diff options
Diffstat (limited to 'support/latexindent/documentation/subsec-text-wrap.tex')
-rw-r--r-- | support/latexindent/documentation/subsec-text-wrap.tex | 107 |
1 files changed, 106 insertions, 1 deletions
diff --git a/support/latexindent/documentation/subsec-text-wrap.tex b/support/latexindent/documentation/subsec-text-wrap.tex index e03eb66395..fddbffd98b 100644 --- a/support/latexindent/documentation/subsec-text-wrap.tex +++ b/support/latexindent/documentation/subsec-text-wrap.tex @@ -30,7 +30,17 @@ \item setting \texttt{columns} to $-1$ will \emph{only} remove line breaks within the text wrap block; \item by default, the text wrapping routine will remove line breaks within text blocks because - \texttt{removeBlockLineBreaks} is set to 1; switch it to 0 if you wish to change this. + \texttt{removeBlockLineBreaks} is set to 1; switch it to 0 if you wish to change this; + \item about trailing comments within text wrap blocks: + \begin{enumerate} + \item trailing comments that do \emph{not} have leading space instruct the text wrap routine to + connect the lines \emph{without} space (see \cref{lst:tw-tc2}); + \item multiple trailing comments will be connected at the end of the text wrap block (see + \cref{lst:tw-tc4}); + \item the number of spaces between the end of the text wrap block and the (possibly combined) + trailing comments is determined by the spaces (if any) at the end of the text wrap block + (see \cref{lst:tw-tc5}). + \end{enumerate} \end{enumerate} We demonstrate this feature using a series of examples. @@ -349,6 +359,101 @@ latexindent.pl -m -l textwrap1A.yaml,tw-be-equation.yaml tw-be-equation.tex Naturally, you should feel encouraged to customise this as you see fit. \end{example} +\subsubsection{Text wrap: trailing comments and spaces} + We explore the behaviour of the text wrap routine in relation to trailing comments using + the following examples. + + \begin{example} + The file in \cref{lst:tw-tc1} contains a trailing comment which \emph{does} have a space + infront of it. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc1.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output given in \cref{lst:tw-tc1-mod1}. + + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc1.tex}{\texttt{tw-tc1.tex}}{lst:tw-tc1} + \cmhlistingsfromfile*{demonstrations/tw-tc1-mod1.tex}{\texttt{tw-tc1-mod1.tex}}{lst:tw-tc1-mod1} + \end{cmhtcbraster} + \end{example} + + \begin{example} + The file in \cref{lst:tw-tc2} contains a trailing comment which does \emph{not} have a + space infront of it. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc2.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output in \cref{lst:tw-tc2-mod1}. + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*{demonstrations/tw-tc2.tex}{\texttt{tw-tc2.tex}}{lst:tw-tc2} + \cmhlistingsfromfile*{demonstrations/tw-tc2-mod1.tex}{\texttt{tw-tc2-mod1.tex}}{lst:tw-tc2-mod1} + \end{cmhtcbraster} + We note that, because there is \emph{not} a space before the trailing comment, that the + lines have been joined \emph{without} a space. + \end{example} + + \begin{example} + The file in \cref{lst:tw-tc3} contains multiple trailing comments. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc3.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output in \cref{lst:tw-tc3-mod1}. + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*{demonstrations/tw-tc3.tex}{\texttt{tw-tc3.tex}}{lst:tw-tc3} + \cmhlistingsfromfile*{demonstrations/tw-tc3-mod1.tex}{\texttt{tw-tc3-mod1.tex}}{lst:tw-tc3-mod1} + \end{cmhtcbraster} + \end{example} + + \begin{example} + The file in \cref{lst:tw-tc4} contains multiple trailing comments. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc4.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output in \cref{lst:tw-tc4-mod1}. + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*{demonstrations/tw-tc4.tex}{\texttt{tw-tc4.tex}}{lst:tw-tc4} + \cmhlistingsfromfile*{demonstrations/tw-tc4-mod1.tex}{\texttt{tw-tc4-mod1.tex}}{lst:tw-tc4-mod1} + \end{cmhtcbraster} + \end{example} + + \begin{example} + The file in \cref{lst:tw-tc5} contains multiple trailing comments. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc5.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output in \cref{lst:tw-tc5-mod1}. + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc5.tex}{\texttt{tw-tc5.tex}}{lst:tw-tc5} + \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc5-mod1.tex}{\texttt{tw-tc5-mod1.tex}}{lst:tw-tc5-mod1} + \end{cmhtcbraster} + The space at the end of the text block has been preserved. + \end{example} + + \begin{example} + The file in \cref{lst:tw-tc6} contains multiple trailing comments. + + Running the command + \begin{commandshell} +latexindent.pl -m tw-tc6.tex -l textwrap1A.yaml -o=+-mod1 +\end{commandshell} + gives the output in \cref{lst:tw-tc6-mod1}. + \begin{cmhtcbraster}[raster column skip=.1\linewidth] + \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc6.tex}{\texttt{tw-tc6.tex}}{lst:tw-tc6} + \cmhlistingsfromfile*[showspaces=true]{demonstrations/tw-tc6-mod1.tex}{\texttt{tw-tc6-mod1.tex}}{lst:tw-tc6-mod1} + \end{cmhtcbraster} + The space at the end of the text block has been preserved. + \end{example} + \subsubsection{Text wrap: huge, tabstop and separator} The \announce{2021-07-23}*{huge:overflow is now default} default value of \texttt{huge} is \texttt{overflow}, which means that words will \emph{not} be broken by the text |