Skip to content

Commit

Permalink
Detail interaction of trailing optional args. and \inputlineno
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed May 19, 2023
1 parent 1a3121a commit 9cce659
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/changes.txt
Expand Up @@ -5,6 +5,12 @@ It is provided for convenience only. It therefore makes no claims to
completeness or accuracy and it contains some references to files that
are not part of the distribution.
================================================================================
2023-05-97 Joseph Wright <Joseph.Wright@latex-project.org>

* usrguide.tex (section Creating document commands and environments)
Add details of result of trailing optional arguments on
\inputlineno

2023-05-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org>

* ltxref.dtx
Expand Down
6 changes: 6 additions & 0 deletions base/doc/usrguide.tex
Expand Up @@ -340,6 +340,12 @@ \subsection{Spacing and optional arguments}
\NewDocumentCommand\\{!s !o}{ ... }
\end{verbatim}

Also notable when using optional arguments in the last position is that \TeX{}
will necessarily look ahead for the argument opening token. This means that
the value of |\inputlineno| will be `out by one' if such a trailing optional
argument is \emph{not} present and the command ends a line; it will be one
greater than the line number containing the last mandatory argument.

\subsection{`Embellishments'}
\label{sec:cmd:embellishment}

Expand Down

0 comments on commit 9cce659

Please sign in to comment.