-
-
Notifications
You must be signed in to change notification settings - Fork 92
Code formatting
Press Ctrl+Alt+L to reformat.
To disable formatting on a portion of your tex
file, wrap the code with
% @formatter:off ... % @formatter:on
and enable these comments in the settings by going to Settings › Editor › Code Style › Formatter Control and checking Enable formatter markers in comments.
This can be particularly useful for listings
environments.
Since b0.6.8
When writing inside a group ({…}
or […]
) the formatter will indent all content that is on a new line.

Since b0.6.10
Inside a table environment, like tabular
, the &
s and \\
s are aligned, so it is clear which cells belong to the same column.

When formatting the contents of a table, it ignores all table lines that
-
are split over multiple lines, or
-
contain less
&
than required (for example when using the\multicolumn
command).

When writing pseudocode using the algorithmicx
environment and the algpseudocode
set of commands, they will be formatted properly.
For example,
\begin{algorithm}
\begin{algorithmic}
\State begin
\If {$i\geq maxval$}
\State $i\gets 0$
\Else
\If {$i+k\leq maxval$}
\State $i\gets i+k$
\EndIf
\EndIf
\end{algorithmic}
\caption{Insertion sort}
\label{alg:insertion-sort}
\end{algorithm}
will be reformatted to
\begin{algorithm}
\begin{algorithmic}
\State begin
\If {$i\geq maxval$}
\State $i\gets 0$
\Else
\If {$i+k\leq maxval$}
\State $i\gets i+k$
\EndIf
\EndIf
\end{algorithmic}
\caption{Insertion sort}
\label{alg:insertion-sort}
\end{algorithm}
The following commands are supported.
-
\If{<condition>} <text> (\ElsIf{<condition>} <text>)* (\Else <text>)? \EndIf
-
\For{<condition>} <text> \EndFor
-
\ForAll{<condition>} <text> \EndFor
-
\While{<condition>} <text> \EndWhile
-
\Repeat <text> \Until{<condition>}
-
\Loop <text> \EndLoop
-
\Function{<name>}{<params>} <body> \EndFunction
-
\Procedure{<name>}{<params>} <body> \EndProcedure
Commands defined using \algblock
or \algloop
are currently not recognized by the formatter.
Formatting for algorithms written with algorithm2e
instead of algorithmicx
is also supported.
This documentation has moved to https://hannah-sten.github.io/TeXiFy-IDEA