Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture newlines as \obeyedline in ltcmd #1304

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

josephwright
Copy link
Member

READ ME FIRST: Please understand that in most cases we will not be able to merge a pull request because there are a lot of internal activities needed when updating the LaTeX2e sources. If you have a code suggestion please discuss it with the team first.

Pull requests in this repository are intended for LaTeX Team members only.

Internal housekeeping

Status of pull request

  • Feedback wanted
  • Under development
  • Ready to merge

Checklist of required changes before merge will be approved

  • Test file(s) added
  • Version and date string updated in changed source files
  • Relevant \changes entries in source included
  • Relevant changes.txt updated
  • Rollback provided (if necessary)?
  • ltnewsX.tex (and/or latexchanges.tex) updated

Copy link
Member

@FrankMittelbach FrankMittelbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only minor stuff in comments

base/doc/usrguide.tex Outdated Show resolved Hide resolved
base/doc/usrguide.tex Outdated Show resolved Hide resolved
base/doc/usrguide.tex Outdated Show resolved Hide resolved
base/ltcmd.dtx Outdated Show resolved Hide resolved
Documentation for verb is extended here.

This is a breaking change - so needs good notice.

The l3doc patch will need to be transferred back to
the full release.
@josephwright josephwright merged commit c107b0d into develop Mar 26, 2024
78 checks passed
@josephwright josephwright deleted the ltcmd-obeyedline branch March 26, 2024 12:25
@car222222
Copy link
Contributor

I shall look again at documentation to check that it explains that the whole of the content, with these line delimiters, is placed in the argument for further processing. Maybe at some stage this needs some examples of how to make use of it for various purposes.

muzimuzhi added a commit to muzimuzhi/latex3 that referenced this pull request Mar 27, 2024
any characters have been made \enquote{special} and are not listed in
\cs{dospecials}, an error will arise (see below).

Characters are grabbed two identical delimiters: in contrast to \cs{verb}, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grabbed "between" two identical delimiters?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe in full:
The characters that are grabbed as the argument are all those between two identical

Copy link
Contributor

@car222222 car222222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of relatively small suggestions.

Plus maybe some deletions, movements and better signposting needed.


When grabbing a \texttt{v}-type argument, \LaTeX{} first uses the kernel
command \cs{dospecials} to turn off the \enquote{special} nature of characters.
It then makes both spaces and tabs \enquote{active}, so they can be given a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better: . . . , so that they . . .

any characters have been made \enquote{special} and are not listed in
\cs{dospecials}, an error will arise (see below).

Characters are grabbed two identical delimiters: in contrast to \cs{verb}, the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe in full:
The characters that are grabbed as the argument are all those between two identical

\cs{dospecials}, an error will arise (see below).

Characters are grabbed two identical delimiters: in contrast to \cs{verb}, the
characters \texttt{\textbackslash}, |{|, |}| and |%| \emph{cannot be used}. If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better: . . . cannot be used as the delimiter character}.

any of the grabbed tokens have \enquote{special} meaning, an error will be
issued.

For the \texttt{+v}-type argument, which allows line breaks in input,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“input” is very misleading here:
. . . line breaks within the argument, . . .

\begin{verbatim}
\renewcommand*\obeyedline{\mbox{}\par}
\end{verbatim}
along with other setting that may be appropriate (e.g., using a monospaced
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this last bit relevant here? Probably needs a new sentence explaining (roughly) that other setup may also be needed since, for example, by default no font change is inserted.

Better to end with something like this:
More information about using these arguments in typesetting is in the following subsection.


\subsection{Typesetting verbatim-like material}

In contrast to \cs{verb}, the \texttt{v}-type argument is only about
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this refer also explicitly to verbatim and v+ ? (Even if v-type implies these.)

The \cs{verb} command also selects a monotype font: this is not intrinsic
to verbatim material, so will need to be set up using for example \cs{ttfamily}.
Similarly, the \texttt{verbatim} environment sets up the meaning of \cs{par}
suitable for breaking lines.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe need to add:
. . . , so this may also need to be set up (see example above) ??

@@ -794,6 +794,59 @@ \subsection{Commands at the start of tabular cells}
\end{tabular}
\end{verbatim}

\subsection{Using the verbatim argument types}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall comment on this subsection and the next.

It is a bit confusing so that working out where useful information appears, and exactly what it applies to (v, and/or v+).

issued.

For the \texttt{+v}-type argument, which allows line breaks in input,
newline characters are converted into \cs{obeyedline} commands. This means that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to explain the normal meaning of “obeyedline” here, thus:
Since \cs{obeyedline} is b default defined as . . . . , this allows . . . to be used directly . . .

In contrast to \cs{verb}, the \texttt{v}-type argument is only about
\emph{grabbing} the argument, not \emph{typesetting} it. As such, features that
users often associate with \enquote{verbatim} are not automatically activated,
e.g., a monospaced font. Material grabbed by the \texttt{v}-type argument does
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. . . e.g., selecting a monospaced . . .

muzimuzhi added a commit to muzimuzhi/latex3 that referenced this pull request Mar 27, 2024
@car222222
Copy link
Contributor

Maybe the large difference (one does typesetting, the other simply prepares/processes the content of an argument) between verb/verbatim and these “v-type” args needs to be presented more definitely upfront; rather than by multiple references throughout.

josephwright pushed a commit to latex3/latex3 that referenced this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants