I have an active string that when I type
\[ it enters
\[ * \] *
I obviously have problems when I want to type
I was wondering if there is a way that I can change the active string to take care of this problem.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.Sign up to join this community
I think another solution would consist in using this macro (which I name
d-math.edt in the explanations that follow):
BeginGroup; InsLine; GoToBeginningOfLine; Indent; Ins("\[ \]%"); PreviousBullet; EndGroup;
The macro shortcut is defined through this addition to the
Shortcuts menu in `MainMenu.ini:
ITEM="\[ \]" MACRO="Exe('%b\Local\macros\d-math.edt')" SHORTCUT="32954::Alt+$" REQ_DOCUMENT=1
Of course, the choice of the shortcut is based on what's most convenient and meaningful for your keyboard layout (mine is good for an azerty layout). As you can see I've put the macro file in %b\Local\macros, but you can adapt that according to your habits – somewhere in %b, though.
Added: if you want to use the
active string way, you just have to add to your caracterisation of
\[ as an active string in
This is how I solved this problem. This code works in WinEdt9.
Go to the menu item Options -> Options Interface
There you will find a long list of items. Down this list is
Delimeters, Active strings, Abbreviations
Open this item.
Click on Active Strings. The long file with active strings will appear in the right pane. This is an editable file in which you can add your own active strings.
Find the following string
STRING="\[" ENABLED=1 MODE_FILTER="TeX|DTX;INS;STY;AUX" MACRO="[Ins('\]');CharLeft(2);]" DBL_CLICK_ENABLED=1 DBL_CLICK_MODE_FILTER="TeX" DBL_CLICK_MACRO="[MatchDelimiter(1,1,1);]"
Right before the string copied above add the following new string. You can just copy and paste the code below.
STRING="\\[" ENABLED=1 MODE_FILTER="TeX|DTX;INS;STY;AUX" MACRO="[Ins(']');CharLeft(1);]"
The next step is essential. After any modifications of ActiveStrings.ini , instead of saving the file, you have to click "Load Current Script" which is the left-most icon immediately below the title "Options Interface"