Created
November 27, 2016 12:24
-
-
Save mratsim/b933af9f1e7be53d1f3cb613a42e0fbc to your computer and use it in GitHub Desktop.
Macros to itemize, enumerate or wrap in function for TexStudio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%Itemize | |
%SCRIPT | |
txt = cursor.selectedText() | |
txt = txt.replace(/^/gm, "\t\\item ") | |
editor.write("\\begin{itemize}\n"+txt+"\n\\end{itemize}\n") | |
cursor.clearSelection() | |
%%Enumerate | |
%SCRIPT | |
txt = cursor.selectedText() | |
txt = txt.replace(/^/gm, "\t\\item ") | |
editor.write("\\begin{enumerate}\n"+txt+"\n\\end{enumerate}\n") | |
cursor.clearSelection() | |
%%Apply Function | |
%SCRIPT | |
txt = cursor.selectedText() | |
editor.write("\\{"+txt+"}") | |
cursor.movePosition(2+txt.length, cursorEnums.Left); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment