Yurie/LaTeXTool
LaTeX tools.
Formatter
-
LaTeXFormat[opts_][file_]- format the LaTeX file.The file will be formatted firstly by tex-fmt and then successively by the steps controlled by the following options.
-
"SurroundEquationWithPercent"->False-
surround equations with percentage symbol;
-
accepts
TrueofFalse;
Code
% \begin{equation} a+b \end{equation} %\begin{equation} a+b \end{equation} -
-
"EquationMarkSpacing"->None-
adjust spacings before punctuation marks in equation environment;
-
accepts
Noneor one of the followings:Code
{"\\;","\\,","\\:","\\>","\\ "} -
skip equations surrounded by the magic comments
Code
% LaTeXFormat-EMS-Off ... % LaTeXFormat-EMS-On
Code
\begin{equation} a+b \, . \end{equation} % LaTeXFormat-EMS-Off \begin{equation} a+b. \end{equation} % LaTeXFormat-EMS-On\begin{equation} a+b. \end{equation} % LaTeXFormat-EMS-Off \begin{equation} a+b. \end{equation} % LaTeXFormat-EMS-On -
-
-
MarkdownFormat[opts_][file_]- format the Markdown file.The file will be formatted firstly by AutoCorrect and then successively by the steps controlled by the following options.
-
"SurroundInlineEquationWithBlank"->True-
surround inline equations with blank;
-
accepts
TrueofFalse; -
skip inline equations surrounded by the magic comments
Code
<!-- MarkdownFormat-IEB-Off --> ... <!-- MarkdownFormat-IEB-Off -->
Code
测试,$a$ 测试测试,$a$测试 -
-
"SurroundEquationWithEmptyLine"->True-
surround equations with empty line;
-
accepts
TrueofFalse;
Code
测试 \begin{equation} a+b \end{equation} 测试测试 \begin{equation} a+b \end{equation} 测试 -
-
"EquationMarkSpacing"->None- similar to the one in
LaTeXFormat.
- similar to the one in
-
Parser
-
LaTeXParser[opts_][file_]- a simple parser of LaTeX.-
Parse
\newcommand,\newenvironmentand\usepackage. -
To disable parsing of a line, add the magic comment
% LaTeXParser-Skipat the end of that line. To disable parsing of a block, use the magic comments:Code
% LaTeXParser-Off ... % LaTeXParser-On -
The option
"SkipType"allows typed magic comments and acceptsAutomatic|_String|{__String}, whereAutomaticfor non-typed ones.For example, the magic comment
% LaTeXParser-MathJax-Skipwill be triggered by setting the option as"SkipType"->"MathJax".
-
Other tools
-
MathJaxJSOverwrite[macro_][file_]- overwrite the macros in JSON files used by MathJax.-
The matching is hinted by the magic comments:
Code
// MathJaxJSOverwrite-Macro-Begin macros: { ... }, // MathJaxJSOverwrite-Macro-End
-
To-do
- The parser of
\newenvironmenthas not been implemented.