diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex | 65 |
1 files changed, 53 insertions, 12 deletions
diff --git a/Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex b/Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex index 25c5c099e27..a93daee46db 100644 --- a/Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex +++ b/Master/texmf-dist/doc/latex/pseudo/doc/pseudo.tex @@ -46,6 +46,9 @@ listingsutf8, documentation]{tcolorbox} \usepackage{pseudo} + +\usepackage{noindentafter} + \usepackage{url} \usepackage{amsopn} % For \newmcodes@ example @@ -287,19 +290,16 @@ \ior_map_inline:Nn \g_tmpa_ior { - \tl_gput_right:Nn \g_tmpa_tl { ##1 } + % Just using the first paragraph + \regex_match:nnTF { ##1 } { \c{par} } { + \ior_map_break: + } { + \tl_gput_right:Nn \g_tmpa_tl { ##1 } + } } \regex_replace_all:nnN - { \# .* \n } - { } \g_tmpa_tl - - \regex_replace_all:nnN - { \n } - { XYZZY } \g_tmpa_tl - - \regex_replace_all:nnN {\*\* ( \w+ ) \*\*} { \c{pkg} \cB{ \1 \cE} } \g_tmpa_tl @@ -444,7 +444,7 @@ environment starts a new paragraph. The left margin (how much the pseudocode is indented wrt.\ the surrounding text) is set by the \refk{left-margin} key (initially \code{0pt}).\footnote{If \refe{pseudo} occurs in a box such as \code{fbox}, or a \pkg[https://ctan.org/pkg/pgf]{tikz} node, this spacing is -dropped.} +dropped. See also the \refk{compact} key for overriding this behavior.} \medskip\noindent There are also some styling commands for special elements of the pseudocode: @@ -1088,8 +1088,8 @@ alphabetical order), you'll find definitions of a couple of counters here \pkg[https://ctan.org/pkg/standalone]{standalone} to produce individual pseudocode images, this compactness will \emph{not} be triggered automatically. In such cases, you can override the behavior using the - \refk{compact} trigger, manually specifying whether you want the - pseudocode to be compact or not. + \refk{compact} key, manually specifying whether you want the pseudocode to + be compact or not. \end{docKey} \begin{docCommand}{ct}{\marg{text}} @@ -1995,9 +1995,49 @@ See also \refk{indent-level}. \section{But how do I\,\dots} + Some functionality is not built in, but is still fairly easy to achieve. Some streamlining may be added in future versions. +\subsection{\dots\,prevent paragraph indentation after \code{pseudo}?} + +If you want to keep the pseudocode as part of a surrounding paragraph, you +could have it not start its own, i.e., not have an empty line before it. This +will reduce the amount of spacing as well; if you'd rather have that reduced, +you could simply drop the empty line \emph{after} the environment: + +\begin{texexp}[listing only] +Text before + +\begin{pseudo} + pseudocode +\end{pseudo} +% +Text after +\end{texexp} + +\noindent +The effect would then be the following: + +\begin{pseudo} + pseudocode +\end{pseudo} +% +No indentation here, and normal spacing. If, however, you wish to suppress +indentation after \emph{all} instances of \refe{pseudo}, you could use the +\pkg[https://ctan.org/pkg/noindentafter]{noindentafter} package, as follows: + +\medskip + +\begin{texexp}[listing only] +\usepackage{noindentafter} +\NoIndentAfterEnv{pseudo} +\end{texexp} + +\noindent +If you wish to override this, and indent a given paragraph after all, you can +simply use the \cs{indent} command. + \subsection{\dots\,get log-like functions?} There's no built-in command for math-roman function names, as used in $\log$ @@ -3515,6 +3555,7 @@ the line: \mode_if_vertical:F { \unskip \par + \group_insert_after:N \@endparenv } \addvspace{ \l_tmpa_skip } |