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.
-
"Indentation"->4
- inherited from tex-fmt.
-
"SurroundEquationWithPercent"->False
-
surround equations with percentage symbol;
-
accepts
True
ofFalse
;
Code
% \begin{equation} a+b \end{equation} %
\begin{equation} a+b \end{equation}
-
-
"EquationMarkSpacing"->None
-
adjust spacings before punctuation marks in equation environment;
-
accepts
None
or 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
True
ofFalse
; -
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
True
ofFalse
;
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
,\newenvironment
and\usepackage
. -
To disable parsing of a line, add the magic comment
% LaTeXParser-Skip
at 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}
, whereAutomatic
for non-typed ones.For example, the magic comment
% LaTeXParser-MathJax-Skip
will 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
\newenvironment
has not been implemented.