OthersIn TexStudio, how to define macro for a command with text

Information and discussion about other LaTeX editors not listed above
Post Reply
ali8
Posts: 2
Joined: Tue May 13, 2014 6:10 pm

In TexStudio, how to define macro for a command with text

Post by ali8 »

Hi,

I am writing my text in Arabic, but sometimes I have English sentences. Those need to be done like this:

\textenglish{sample text here}

I was able to define new macro for that command, but I want to go a step further, I want that when I select a text, and press the macro shortcut, I want the text to be entered into that command, and NOT overwritten. This actually works with the $..$ environment/command shortcut provided by default in TexStudio.

Any idea?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
mnsao
Posts: 1
Joined: Thu Jul 31, 2014 1:16 pm

Re: In TexStudio, how to define macro for a command with tex

Post by mnsao »

You can use

%< ... %>

in macros, whereas the ... stand for the default input at that place. If you then mark some text and use the macro, the marked text is inserted there instead of the default.
Post Reply