From fd4d90b5caf562a8d951bb4a3b78a1aa74930017 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 16 Sep 2021 20:17:39 +0000 Subject: latexindent (16sep21) git-svn-id: svn://tug.org/texlive/trunk@60522 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/latexindent/README | 2 +- .../doc/support/latexindent/appendices.tex | 46 +++-- .../doc/support/latexindent/cmhlistings.tex | 9 +- .../doc/support/latexindent/latexindent.pdf | Bin 949988 -> 1001116 bytes .../doc/support/latexindent/latexindent.tex | 29 +++- .../support/latexindent/sec-default-user-local.tex | 29 ++-- .../doc/support/latexindent/sec-how-to-use.tex | 77 +++++++++ .../support/latexindent/sec-the-line-switch.tex | 187 +++++++++++++++++++++ .../doc/support/latexindent/sec-the-m-switch.tex | 5 +- .../subsec-combine-text-wrap-para-line-breaks.tex | 16 +- .../latexindent/subsec-remove-para-line-breaks.tex | 9 +- .../latexindent/subsec-text-wrap-summary.tex | 2 +- .../doc/support/latexindent/subsec-text-wrap.tex | 23 ++- .../subsubsec-environments-and-their-arguments.tex | 16 +- .../texmf-dist/doc/support/latexindent/title.tex | 4 +- 15 files changed, 389 insertions(+), 65 deletions(-) create mode 100644 Master/texmf-dist/doc/support/latexindent/sec-the-line-switch.tex (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/support/latexindent/README b/Master/texmf-dist/doc/support/latexindent/README index 04fd1c5b5fc..85200ba048b 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.11, 2021-07-31 + latexindent.pl, version 3.12, 2021-09-16 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 bbeefb5fd13..617abe1bdc4 100644 --- a/Master/texmf-dist/doc/support/latexindent/appendices.tex +++ b/Master/texmf-dist/doc/support/latexindent/appendices.tex @@ -46,14 +46,15 @@ perl latexindent-module-installer.pl then, once you have answered \texttt{Y}, the appropriate modules will be installed onto your distribution. - \subsection{Manually installed modules}\label{sec:manual-module-instal} + \subsection{Manually installing modules}\label{sec:manual-module-instal} Manually installing the modules given in \cref{lst:helloworld} will vary depending on your operating system and \texttt{Perl} distribution. \subsubsection{Linux} - Linux users may be interested in exploring Perlbrew \cite{perlbrew}; an example - installation would be: - \begin{commandshell} + \paragraph{perlbrew} + Linux users may be interested in exploring Perlbrew \cite{perlbrew}; an example + installation would be: + \begin{commandshell} sudo apt-get install perlbrew perlbrew init perlbrew install perl-5.28.1 @@ -65,25 +66,38 @@ cpanm File::HomeDir cpanm Unicode::GCString \end{commandshell} - For other distributions, the Ubuntu/Debian approach may work as follows - \begin{commandshell} + \paragraph{Ubuntu/Debian} + For other distributions, the Ubuntu/Debian approach may work as follows + \begin{commandshell} sudo apt install perl sudo cpan -i App::cpanminus sudo cpanm YAML::Tiny sudo cpanm File::HomeDir sudo cpanm Unicode::GCString \end{commandshell} - or else by running, for example, - \begin{commandshell} + or else by running, for example, + \begin{commandshell} sudo perl -MCPAN -e'install "File::HomeDir"' \end{commandshell} - If you are using Alpine, some \texttt{Perl} modules are not build-compatible with Alpine, - but replacements are available through \texttt{apk}. For example, you might use the - commands given in \cref{lst:alpine-install}; thanks to \cite{jun-sheaf} for providing - these details. + \paragraph{Ubuntu: using the texlive from apt-get} + Ubuntu users that install texlive using \texttt{apt-get} as in the following + \begin{commandshell} +sudo apt install texlive +sudo apt install texlive-latex-recommended +\end{commandshell} + may need the following additional command to work with \texttt{latexindent.pl} + \begin{commandshell} +sudo apt install texlive-extra-utils +\end{commandshell} + + \paragraph{Alpine} + If you are using Alpine, some \texttt{Perl} modules are not build-compatible with Alpine, + but replacements are available through \texttt{apk}. For example, you might use the + commands given in \cref{lst:alpine-install}; thanks to \cite{jun-sheaf} for providing + these details. - \begin{cmhlistings}[style=tcblatex,language=Bash]{\texttt{alpine-install.sh}}{lst:alpine-install} + \begin{cmhlistings}[style=tcblatex,language=Bash]{\texttt{alpine-install.sh}}{lst:alpine-install} # Installing perl apk --no-cache add miniperl perl-utils @@ -107,9 +121,9 @@ cpanm -n YAML::Tiny cpanm -n Unicode::GCString \end{cmhlistings} - Users of NixOS might like to see - \href{https://github.com/cmhughes/latexindent.pl/issues/222}{https://github.com/cmhughes/latexindent.pl/issues/222} - for tips. + Users of NixOS might like to see + \href{https://github.com/cmhughes/latexindent.pl/issues/222}{https://github.com/cmhughes/latexindent.pl/issues/222} + for tips. \subsubsection{Mac} Users of the Macintosh operating system might like to explore the following commands, for example: diff --git a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex index 1f058616d6d..6b8506c3447 100644 --- a/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex +++ b/Master/texmf-dist/doc/support/latexindent/cmhlistings.tex @@ -4,6 +4,13 @@ ^^I:caption: #2^^J ^^I:name: #3^^J } +\newcommand{\cmhlistingsfromfilelines}[4]{ +.. literalinclude:: #1^^J +^^I:class: .#4^^J +^^I:caption: #2^^J +^^I:name: #3^^J +^^I:linenos:^^J +} \newcommand{\cmhlistingsfromfilefour}[6]{ .. literalinclude:: #3^^J ^^I:class: .#6^^J @@ -14,7 +21,7 @@ ^^I:lineno-start: #1^^J } \newcommand{\cmhlabel}[1]{ -.. _#1:^^J +.. \_#1:^^J } \newcommand{\warning}[1]{ .. warning::^^J diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf index dfb37e0b765..12ad2f551c1 100644 Binary files a/Master/texmf-dist/doc/support/latexindent/latexindent.pdf and b/Master/texmf-dist/doc/support/latexindent/latexindent.pdf differ diff --git a/Master/texmf-dist/doc/support/latexindent/latexindent.tex b/Master/texmf-dist/doc/support/latexindent/latexindent.tex index 9379dddcb06..a97d778742c 100644 --- a/Master/texmf-dist/doc/support/latexindent/latexindent.tex +++ b/Master/texmf-dist/doc/support/latexindent/latexindent.tex @@ -27,7 +27,6 @@ \usepackage{multicol} \usepackage{changepage} % adjust width of page \usepackage{fancyhdr} % headers & footers -\usepackage{wrapfig} \usepackage{fontawesome} \usepackage[sc,format=hang,font=small]{caption} % captions \usepackage[backend=bibtex]{biblatex} % bibliography @@ -42,7 +41,7 @@ \usepackage{totalcount} \usepackage{standalone} % setup gitinfo2, as in the manual, details just above begin{document} -\usepackage[mark,grumpy]{gitinfo2} +\usepackage[mark]{gitinfo2} % tikz, tcolorbox libraries \usetikzlibrary{positioning} \usetikzlibrary{decorations.pathmorphing} @@ -163,6 +162,21 @@ sharp corners, colbacktitle=white!75!black }, + tex-TCB/.style={ + listing only, + listing engine=listings, + left=0cm, + boxrule=0pt, + sharp corners, + center title, + colframe=white!40!black, + colback=white, + sharp corners, + colbacktitle=white!75!black, + toprule=1pt, + bottomrule=1pt, + titlerule=1pt, + }, yaml-TCB/.style={ listing only, listing engine=listings, @@ -326,6 +340,11 @@ columns=fullflexible, } +\lstdefinestyle{lineNumbersTeX}{ + numbers=left, + numberstyle=\color{blue}, +} + \lstdefinestyle{fileExtensionPreference}{ style=yaml-LST, firstnumber=44,linerange={44-48}, @@ -767,9 +786,14 @@ {}% {\titlerule*[0.5em]{$\cdot$}\contentspage} +% to explore in the future: +% partial toc customisation +% https://tex.stackexchange.com/questions/66345/how-to-remove-section-indentation-in-partial-toc-using-titletoc + \setcounter{secnumdepth}{6} \setcounter{tocdepth}{4} \makeindex + \begin{document} \renewcommand*{\thefootnote}{\arabic{footnote}} \input{title.tex} @@ -801,6 +825,7 @@ \input{subsec-poly-switches} \stopcontents[the-m-switch] \input{sec-replacements} + \input{sec-the-line-switch} \input{sec-fine-tuning} \input{sec-conclusions-know-limitations} \input{references} diff --git a/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex b/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex index 85738608b9f..b649f54f9cc 100644 --- a/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex +++ b/Master/texmf-dist/doc/support/latexindent/sec-default-user-local.tex @@ -375,7 +375,7 @@ lookForAlignDelims: 0); \item \announce{2020-03-21}{delimiter RegEx feature}{delimiterRegEx} optionally specifies the pattern matching to be used for the alignment delimeter (default: - \lstinline3 '(?