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

footnote environment #4218

Merged
merged 3 commits into from Oct 6, 2020
Merged

footnote environment #4218

merged 3 commits into from Oct 6, 2020

Conversation

jensmaurer
Copy link
Member

@jensmaurer jensmaurer commented Sep 21, 2020

Create a "footnoteenv" environment for footnotes.
This allows to clearly separate them in the LaTeX source, enabling automatic checking for normative words such as "shall" or "may" inside them.

[temp.constr.order] has an example each inside two footnotes that now gets formatted differently.
We should get rid of that for unrelated reasons (bad rendering with the new separate-paragraph examples).

With this compensated, this patch has no visible differences in "appearance" mode except for footnote 12 (different hyphenation) and footnote 256 (slight differences in spacing/kerning, it seems).

@jensmaurer
Copy link
Member Author

... and (drum roll) with a slight patch to detect "shall", "may", "should" also inside footnotes, we now find

lex.tex:672:characters may produce a long external identifier, but \Cpp{} does not <--- "shall", "should", or "may" inside a note
preprocessor.tex:558:a preprocessing token shall not follow a <--- "shall", "should", or "may" inside a note
preprocessor.tex:564:comments may appear anywhere in a source file, <--- "shall", "should", or "may" inside a note
support.tex:2490:expression, may, however, increase the \tcode{size} argument to <--- "shall", "should", or "may" inside a note
templates.tex:9077:may be deduced from an array bound, the resulting value will always be <--- "shall", "should", or "may" inside a note

@jensmaurer jensmaurer added this to the C++23 milestone Sep 23, 2020
@jensmaurer
Copy link
Member Author

jensmaurer commented Sep 23, 2020

@godbyk , I think I need your help here. Please have a look at this pull request and consider the definition of the "footnoteenv" macro in macros.tex. The goal is to have a proper environment for footnotes and not the inline-style \footnote{...} stuff. The proper environment helps our script-based sanity checking of the LaTeX source code.

I essentially got it working with some "lrbox" operations, and it looks as before (except for a hyphenation change that I can only explain by some difference in hyphenation regime in footnotes, but that's not the point here).

In order to make the "footnoteenv" work inside tables inside floats, I need to make sure I employ \global to have the footnote's contents "escape" properly. So far, so good. However, I am unable to achieve this with a named box; it only works with a numbered box. See the line that copies the local \box99 to the \global named box. Of course, using a specific numbered box risks conflicts. For example, \box0 seems to cause such a conflict; all page numbers in the cross-reference are off by the size of the table of contents. My attempts at using a named box have failed with "expected a <box> here" errors. Do you have any ideas?

@jensmaurer
Copy link
Member Author

Rebased due to conflict.

@jensmaurer
Copy link
Member Author

jensmaurer commented Oct 6, 2020

Rebased again. This is now ready for revuew/merge, from my perspective.
Two diff's remain: One hyphenation change (for unknown reasons), one removed space before the footnote number in the running text (a clear improvement)

Comment on lines 292 to 293
% \show \lrbox
% \show \endlrbox
Copy link
Member

Choose a reason for hiding this comment

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

Please remove these comments.

@jensmaurer jensmaurer merged commit be49696 into cplusplus:master Oct 6, 2020
@jensmaurer jensmaurer deleted the fn-env branch October 6, 2020 20:27
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

2 participants