-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Introduce an f-specification argument in ltcmd #1525
Conversation
Currently this is a draft: there are some clear open questions to answer before it is ready to merge
|
I'd maybe drop the warning on |
Is it possible in the architecture of Cf. the handling of the optional argument in |
As for the argument name, what about an upper case |
88e37f9
to
d55f3ba
Compare
Thinking here is that reading the arg. spec. should be clear: collecting an environment will allow newlines, so should be |
I thought about that - but the pattern we have at the moment is all uppercase specs relate to the matching lowercase in that they take an extra |
Whilst we don't currently do this, it would be possible to do a 'pre-scan' to establish if special settings are needed. The issue I think is that unlike say |
that pattern is strong and easy to understand so I don't think we should break it, thus that would rule |
Maybe a dumb Saturday evening idea, but what about using a special sort of processor? Right now |
I would think this is bound to produce problems forever. Besides, what you do with respect to chars being |
I see the idea, but we have a few things that mean I suspect it's not quite right
However, it does suggest something we could do - see parallel reply. |
I think @Skillmon's approach could work, with a logic for seeking an optional arg:
This could be done by adding an additional specifier (lets say |
Performance is not that bad, it's just |
I don't think we can use a group, and we have to deal with looping for spaces, but yes, I guess you are broadly right about performance. |
Good point about multiple |
One might well argue that both |
Of course you can use a group! You're doing right now for the
Yes, applying
My argumentation is that |
I think I'll implement the suggestion, we can look at it then decide if we need automation - that would mainly sit in a different part of the code so would still require the underlying |
d55f3ba
to
4193145
Compare
79ff942
to
4600c98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typos. Only read the non-code part.
4600c98
to
c152931
Compare
I've made two adjustments here:
The second idea is partly-done. At present, you have to turn this on using a |
We could make life a little easier e.g. by saying that optional args before |
ca0d87c
to
537a86f
Compare
Other than the basic question 'is this the right letter', I think we are good-to-go here now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only a very shallow review. But I'm still not happy about using "f" as I wrote. Otherwise only minor comments
base/ltcmd.dtx
Outdated
% \begin{macro}{\@@_grab_f_obey_spaces:w} | ||
% \begin{macro}{\@@_grab_f_start:n} | ||
% \begin{macro}{\@@_grab_f_first:w} | ||
% \begin{macro}{\@@_grab_f_loop:w} | ||
% \begin{macro}{\@@_grab_f_auxi:w} | ||
% \begin{macro}{\@@_grab_f_auxii:w} | ||
% \begin{macro}{\@@_grab_f_auxiii:N} | ||
% \begin{macro}{\@@_grab_f_auxiv:} | ||
% \begin{macro}{\@@_grab_f_auxv:} | ||
% \begin{macro}{\@@_grab_f_auxvi:N} | ||
% \begin{macro}{\@@_grab_f_auxvii:} | ||
% \begin{macro}{\@@_grab_f_auxviii:} | ||
% \begin{macro}{\@@_grab_f_end:w} | ||
% \begin{macro}{\@@_grab_f_end:n} | ||
% \begin{macro}{\@@_grab_f_end_auxi:w} | ||
% \begin{macro}{\@@_grab_f_end_auxii:w} | ||
% \begin{macro}{\@@_grab_f_end_auxiii:w} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might actually be helpful in the documented version of the envs are put closer to the actual definitions (and small groups perhaps in some cases but not like this big lumb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I favour the approach of 'keep all the aux
functions together'. We can of course change - suggestions on a split?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind much either way, but such long lists might actually create issues at page breaks and, you may end up with the margin note on one page but the actual text way later, but up to you.
31009a3
to
84c6669
Compare
3b6bc66
to
8e1bb89
Compare
|
||
In this release, a new specifier~\texttt{f} is introduced, which collects the | ||
body of an environment in a verbatim-like way. Like the existing | ||
\texttt{v}~specification, each separate line is marked by the special |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically this is only the case for +v
, without the +
line endings throw an error.
\texttt{v} specification, newlines are stored as \cs{obeyedline}. In a similar | ||
fashion to the \texttt{b}~specification, by default \emph{newlines} are trimmed | ||
at both ends of the body. Putting the prefix |!| before \texttt{f} suppresses | ||
space-trimming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
space-trimming. | |
this trimming. |
It's no space-trimming in the literal sense.
I'll continue collecting typos here (because here I conveniently see what was added in this PR). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only some more minor typos.
\texttt{D}~specification argument immediately before an | ||
\texttt{c}~specification. This means that when the optional argument is absent, | ||
the first character of the next line will be read properly. Issues may arise if | ||
\emph{multiple} optional arguments are used before an \texttt{c}~specification, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\emph{multiple} optional arguments are used before an \texttt{c}~specification, | |
\emph{multiple} optional arguments are used before a \texttt{c}~specification, |
and are therefore strongly discouraged. | ||
|
||
For technical reasons, we recommend that spaces are \emph{not} ignored when | ||
searching for an optional argument before an \texttt{c} specification: this can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searching for an optional argument before an \texttt{c} specification: this can | |
searching for an optional argument before a \texttt{c} specification: this can |
% The total number of arguments found during normalization: this is needed | ||
% where special action is needed for the penultimate argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really bad, but "needed ... needed", maybe "necessary/required ... needed" instead.
See latex3/latex3#591.
Internal housekeeping
Status of pull request
Checklist of required changes before merge will be approved
\changes
entries in source includedchanges.txt
updatedltnewsX.tex
(and/orlatexchanges.tex
) updated