diff options
author | Karl Berry <karl@freefriends.org> | 2018-06-08 22:10:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-06-08 22:10:31 +0000 |
commit | ed97aa4d4d77a6cb020570b4502db91b233f4fb2 (patch) | |
tree | 6db5db41a0c71dbaed96a2e83095e551d3741984 /Master/texmf-dist/doc/support/latexindent | |
parent | 9b33ad18278c204e27ce93e5f43d292a325df899 (diff) |
latexindent (9jun18)
git-svn-id: svn://tug.org/texlive/trunk@47964 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/latexindent')
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/appendices.tex | 46 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/cmhlistings.tex | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/latexindent.pdf | bin | 690820 -> 690838 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/latexindent.tex | 52 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex | 15 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latexindent/title.tex | 2 |
9 files changed, 61 insertions, 85 deletions
diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README index dfa09652e65..0ffb2810068 100644 --- a/Master/texmf-dist/doc/support/latexindent/README +++ b/Master/texmf-dist/doc/support/latexindent/README @@ -1,5 +1,5 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - latexindent.pl, version 3.4.2, 2018-04-27 + latexindent.pl, version 3.4.3, 2018-06-08 PERL script to indent code within environments, and align delimited environments in .tex files. diff --git a/Master/texmf-dist/doc/support/latexindent/appendices.tex b/Master/texmf-dist/doc/support/latexindent/appendices.tex index ed93148521b..3a54a950389 100644 --- a/Master/texmf-dist/doc/support/latexindent/appendices.tex +++ b/Master/texmf-dist/doc/support/latexindent/appendices.tex @@ -109,7 +109,7 @@ ls /usr/local/bin \end{enumerate} To \emph{remove} the files, run \begin{commandshell} -sudo make uninstall}. +sudo make uninstall \end{commandshell} \subsection{Add to path for Windows} To add \texttt{latexindent.exe} to the path for Windows, follow these steps: @@ -185,34 +185,17 @@ latexindent.pl myfile.tex -outputfile outputfile.tex The fields given in \cref{lst:obsoleteYaml} are \emph{obsolete} from Version 3.0 onwards. - \begin{yaml}[style=yaml-LST,numbers=none]{Obsolete YAML fields from Version 3.0}[colframe=white!25!red,colbacktitle=white!75!red,colback=white!90!red,]{lst:obsoleteYaml} -alwaysLookforSplitBrackets -alwaysLookforSplitBrackets -checkunmatched -checkunmatchedELSE -checkunmatchedbracket -constructIfElseFi -\end{yaml} + \cmhlistingsfromfile{demonstrations/obsolete.yaml}[yaml-obsolete]{Obsolete YAML fields from Version 3.0}{lst:obsoleteYaml} There is a slight difference when specifying indentation after headings; specifically, we now write \texttt{indentAfterThisHeading} instead of \texttt{indent}. See \cref{lst:indentAfterThisHeadingOld,lst:indentAfterThisHeadingNew} \begin{minipage}{.45\textwidth} - \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld} -indentAfterHeadings: - part: - indent: 0 - level: 1 -\end{yaml} + \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingOld.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 2.2}{lst:indentAfterThisHeadingOld} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew} -indentAfterHeadings: - part: - indentAfterThisHeading: 0 - level: 1 -\end{yaml} + \cmhlistingsfromfile{demonstrations/indentAfterThisHeadingNew.yaml}[yaml-TCB]{\texttt{indentAfterThisHeading} in Version 3.0}{lst:indentAfterThisHeadingNew} \end{minipage}% To specify \texttt{noAdditionalIndent} for display-math environments in Version 2.2, you would write YAML @@ -220,26 +203,13 @@ indentAfterHeadings: or, if you're using \texttt{-m} switch, \cref{lst:indentAfterThisHeadingNew2}. \begin{minipage}{.45\textwidth} - \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld} -noAdditionalIndent: - \[: 0 - \]: 0 -\end{yaml} + \cmhlistingsfromfile{demonstrations/noAddtionalIndentOld.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} in Version 2.2}{lst:noAdditionalIndentOld} \end{minipage}% \hfill \begin{minipage}{.45\textwidth} - \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1} -specialBeginEnd: - displayMath: - begin: '\\\[' - end: '\\\]' - lookForThis: 0 -\end{yaml} - - \begin{yaml}[style=yaml-LST,numbers=none]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew2} -noAdditionalIndent: - displayMath: 1 -\end{yaml} + \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew1} + + \cmhlistingsfromfile{demonstrations/noAddtionalIndentNew1.yaml}[yaml-TCB]{\texttt{noAdditionalIndent} for \texttt{displayMath} in Version 3.0}{lst:indentAfterThisHeadingNew2} \end{minipage}% \mbox{}\hfill \begin{minipage}{.25\textwidth} diff --git a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex index b056bd23f79..85aff0881cd 100644 --- a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex +++ b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex @@ -1,10 +1,12 @@ -\newcommand{\cmhlistingsfromfile}[3]{ +\newcommand{\cmhlistingsfromfile}[4]{ .. literalinclude:: #1^^J +^^I:class: .#4^^J ^^I:caption: #2^^J ^^I:name: #3^^J } -\newcommand{\cmhlistingsfromfilefour}[5]{ +\newcommand{\cmhlistingsfromfilefour}[6]{ .. literalinclude:: #3^^J +^^I:class: .#6^^J ^^I:caption: #4^^J ^^I:name: #5^^J ^^I:lines: #1-#2^^J diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf Binary files differindex 9cc5c3332f9..be0c9f8d6fa 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf +++ b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.tex b/Master/texmf-dist/doc/support/latexindent/latexindent.tex index 3462790e824..eb089d0418f 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent.tex +++ b/Master/texmf-dist/doc/support/latexindent/latexindent.tex @@ -175,6 +175,20 @@ enhanced, overlay={\node[anchor=north east,outer sep=2pt,draw=cmhgold,very thick,double,fill=harvestgold,font =\small] at ([yshift=-3mm]frame.north east) {\texttt{-m}}; } }, + yaml-obsolete/.style={ + listing only, + listing engine=listings, + left=0cm, + boxrule=0pt, + %leftrule=3pt, + sharp corners, + center title, + toprule=2pt, + titlerule=2pt, + colframe=white!25!red, + colbacktitle=white!75!red, + colback=white!90!red, + }, new-to-this-version/.style={ enhanced, overlay app={\node at ([yshift=0mm,xshift=0mm]frame.north east) {\stardemo[scale=1.2]}; }, @@ -332,115 +346,115 @@ \lstdefinestyle{indentAfterItems}{ style=yaml-LST, - firstnumber=183,linerange={183-187}, + firstnumber=182,linerange={182-186}, numbers=left, } \lstdefinestyle{itemNames}{ style=yaml-LST, - firstnumber=193,linerange={193-195}, + firstnumber=192,linerange={192-194}, numbers=left, } \lstdefinestyle{specialBeginEnd}{ style=yaml-LST, - firstnumber=199,linerange={199-212}, + firstnumber=198,linerange={198-211}, numbers=left, } \lstdefinestyle{indentAfterHeadings}{ style=yaml-LST, - firstnumber=222,linerange={222-231}, + firstnumber=221,linerange={221-230}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobalEnv}{ style=yaml-LST, - firstnumber=280,linerange={280-281}, + firstnumber=279,linerange={279-280}, numbers=left, } \lstdefinestyle{noAdditionalIndentGlobal}{ style=yaml-LST, - firstnumber=280,linerange={280-292}, + firstnumber=279,linerange={279-291}, numbers=left, } \lstdefinestyle{indentRulesGlobalEnv}{ style=yaml-LST, - firstnumber=296,linerange={296-297}, + firstnumber=295,linerange={295-296}, numbers=left, } \lstdefinestyle{indentRulesGlobal}{ style=yaml-LST, - firstnumber=296,linerange={296-308}, + firstnumber=295,linerange={295-307}, numbers=left, } \lstdefinestyle{commandCodeBlocks}{ style=yaml-LST, - firstnumber=311,linerange={311-325}, + firstnumber=310,linerange={310-324}, numbers=left, } \lstdefinestyle{modifylinebreaks}{ style=yaml-LST, - firstnumber=395,linerange={395-397}, + firstnumber=394,linerange={394-396}, numbers=left, } \lstdefinestyle{textWrapOptions}{ style=yaml-LST, - firstnumber=398,linerange={398-399}, + firstnumber=397,linerange={397-398}, numbers=left, } \lstdefinestyle{textWrapOptionsAll}{ style=yaml-LST, - firstnumber=398,linerange={398-400}, + firstnumber=397,linerange={397-399}, numbers=left, } \lstdefinestyle{removeParagraphLineBreaks}{ style=yaml-LST, - firstnumber=423,linerange={423-435}, + firstnumber=422,linerange={422-434}, numbers=left, } \lstdefinestyle{paragraphsStopAt}{ style=yaml-LST, - firstnumber=436,linerange={436-444}, + firstnumber=435,linerange={435-443}, numbers=left, } \lstdefinestyle{oneSentencePerLine}{ style=yaml-LST, - firstnumber=401,linerange={401-422}, + firstnumber=400,linerange={400-421}, numbers=left, } \lstdefinestyle{sentencesFollow}{ style=yaml-LST, - firstnumber=404,linerange={404-412}, + firstnumber=403,linerange={403-411}, numbers=left, } \lstdefinestyle{sentencesBeginWith}{ style=yaml-LST, - firstnumber=413,linerange={413-416}, + firstnumber=412,linerange={412-415}, numbers=left, } \lstdefinestyle{sentencesEndWith}{ style=yaml-LST, - firstnumber=417,linerange={417-422}, + firstnumber=416,linerange={416-421}, numbers=left, } \lstdefinestyle{modifylinebreaksEnv}{ style=yaml-LST, - firstnumber=445,linerange={445-454}, + firstnumber=444,linerange={444-453}, numbers=left, } diff --git a/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex b/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex index 77e85e16af8..165cccf4724 100644 --- a/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex +++ b/Master/texmf-dist/doc/support/latexindent/sec-how-to-use.tex @@ -339,19 +339,8 @@ latexindent.pl You can use the rule in any of the ways described in \cref{lst:arara} (or combinations thereof). In fact, \texttt{arara} allows yet greater flexibility -- you can use \texttt{yes/no}, \texttt{true/false}, or \texttt{on/off} to toggle the various options. - \begin{cmhlistings}[style=demo,escapeinside={(*@}{@*)}]{\texttt{arara} sample usage}{lst:arara} -%(*@@*) arara: indent -%(*@@*) arara: indent: {overwrite: yes} -%(*@@*) arara: indent: {output: myfile.tex} -%(*@@*) arara: indent: {silent: yes} -%(*@@*) arara: indent: {trace: yes} -%(*@@*) arara: indent: {localSettings: yes} -%(*@@*) arara: indent: {onlyDefault: on} -%(*@@*) arara: indent: { cruft: /home/cmhughes/Desktop } -\documentclass{article} -... -\end{cmhlistings} - %(*@@*) arara: indent: { modifylinebreaks: yes } + + \cmhlistingsfromfile{demonstrations/arara-demo.tex}{\texttt{arara} sample usage}{lst:arara} Hopefully the use of these rules is fairly self-explanatory, but for completeness \cref{tab:orbsandswitches} shows the relationship between \texttt{arara} directive arguments and the diff --git a/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex b/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex index 2b10438eb09..caed7644c67 100644 --- a/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex +++ b/Master/texmf-dist/doc/support/latexindent/sec-the-m-switch.tex @@ -356,10 +356,11 @@ latexindent.pl url -m -l=manipulate-sentences.yaml it to \texttt{0}, and you can experiment with the \texttt{other} field. The \texttt{basicFullStop} routine should probably be avoided in most situations, as it does not accomodate the specifications - above. For example, using the YAML in \cref{lst:alt-full-stop1-yaml} gives the output from the following command in \cref{lst:url-mod2}. + above. For example, using the following command \begin{commandshell} latexindent.pl url -m -l=alt-full-stop1.yaml \end{commandshell} + and the YAML in \cref{lst:alt-full-stop1-yaml} gives the output in \cref{lst:url-mod2}. \begin{adjustwidth}{-3.5cm}{-1.5cm} \begin{minipage}{.6\linewidth} @@ -1031,17 +1032,17 @@ latexindent.pl -m env-mlb7.tex -l env-mlb13.yaml,env-mlb14.yaml,UnpreserveBlankL \toprule Code block & Sample & \multicolumn{2}{c}{Poly-switch mapping} \\ \midrule - environment & \verb!before words!$\BeginStartsOnOwnLine$ & $\BeginStartsOnOwnLine$ & BeginStartsOnOwnLine \\ - & \verb!\begin{myenv}!$\BodyStartsOnOwnLine$ & $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ - & \verb!body of myenv!$\EndStartsOnOwnLine$ & $\EndStartsOnOwnLine$ & EndStartsOnOwnLine \\ - & \verb!\end{myenv}!$\EndFinishesWithLineBreak$ & $\EndFinishesWithLineBreak$ & EndFinishesWithLineBreak \\ - & \verb!after words! & & \\ + environment & \verb!before words!$\BeginStartsOnOwnLine$ & $\BeginStartsOnOwnLine$ & BeginStartsOnOwnLine \\ + & \verb!\begin{myenv}!$\BodyStartsOnOwnLine$ & $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ + & \verb!body of myenv!$\EndStartsOnOwnLine$ & $\EndStartsOnOwnLine$ & EndStartsOnOwnLine \\ + & \verb!\end{myenv}!$\EndFinishesWithLineBreak$ & $\EndFinishesWithLineBreak$ & EndFinishesWithLineBreak \\ + & \verb!after words! & & \\ \cmidrule{2-4} - ifelsefi & \verb!before words!$\BeginStartsOnOwnLine$ & $\BeginStartsOnOwnLine$ & IfStartsOnOwnLine \\ - & \verb!\if...!$\BodyStartsOnOwnLine$ & $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ - & \verb!body of if/or statement!$\OrStartsOnOwnLine$ & $\OrStartsOnOwnLine$ & OrStartsOnOwnLine % + ifelsefi & \verb!before words!$\BeginStartsOnOwnLine$ & $\BeginStartsOnOwnLine$ & IfStartsOnOwnLine \\ + & \verb!\if...!$\BodyStartsOnOwnLine$ & $\BodyStartsOnOwnLine$ & BodyStartsOnOwnLine \\ + & \verb!body of if/or statement!$\OrStartsOnOwnLine$ & $\OrStartsOnOwnLine$ & OrStartsOnOwnLine % \announce*{2018-04-27}{new ifElseFi code block polyswitches} \\ - & \verb!\or!$\OrFinishesWithLineBreak$ & $\OrFinishesWithLineBreak$ & OrFinishesWithLineBreak \\ + & \verb!\or!$\OrFinishesWithLineBreak$ & $\OrFinishesWithLineBreak$ & OrFinishesWithLineBreak \\ & \verb!body of if/or statement!$\ElseStartsOnOwnLine$ & $\ElseStartsOnOwnLine$ & ElseStartsOnOwnLine \\ & \verb!\else!$\ElseFinishesWithLineBreak$ & $\ElseFinishesWithLineBreak$ & ElseFinishesWithLineBreak \\ & \verb!body of else statement!$\EndStartsOnOwnLine$ & $\EndStartsOnOwnLine$ & FiStartsOnOwnLine \\ diff --git a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex index 32292cfbfc5..2f4412faffd 100644 --- a/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex +++ b/Master/texmf-dist/doc/support/latexindent/subsec-commands-and-their-options.tex @@ -201,7 +201,7 @@ latexindent.pl for-each.tex -l foreach.yaml There are some special command names% \announce*{2018-04-27}*{commandNameSpecial} that do not fit within the names recognized by \texttt{latexindent.pl}, the first one of which is \lstinline!\@ifnextchar[!. From the perspective of \texttt{latexindent.pl}, the whole of the - text \lstinline!\@ifnextchar[! is is a command, because it is + text \lstinline!\@ifnextchar[! is a command, because it is immediately followed by sets of mandatory arguments. However, without the \texttt{commandNameSpecial} field, \texttt{latexindent.pl} would not be able to label it as such, because the \lstinline![! is, necessarily, not matched by a closing \lstinline!]!. diff --git a/Master/texmf-dist/doc/support/latexindent/title.tex b/Master/texmf-dist/doc/support/latexindent/title.tex index fec997546f6..1e0596c4df6 100644 --- a/Master/texmf-dist/doc/support/latexindent/title.tex +++ b/Master/texmf-dist/doc/support/latexindent/title.tex @@ -8,7 +8,7 @@ sharp corners, enhanced, overlay={\node[anchor=north east,outer sep=2pt] at ([xshift=3cm,yshift=4mm]frame.north east) {\includegraphics[width=3cm]{logo}}; }] - \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4.2 + \centering\ttfamily\bfseries latexindent.pl\\[1cm] Version 3.4.3 \end{tcolorbox} } \author{Chris Hughes \thanks{and contributors! |