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

\exposid (and similar macros) cause misalignment of columns in code blocks #4381

Open
burblebee opened this issue Nov 18, 2020 · 4 comments · Fixed by #4392
Open

\exposid (and similar macros) cause misalignment of columns in code blocks #4381

burblebee opened this issue Nov 18, 2020 · 4 comments · Fixed by #4392

Comments

@burblebee
Copy link
Contributor

See the \expos comments near the beginning of [range.take.while.sentinel] for an example - they don't line up. The comments start on the same column in ranges.tex (after subtracting out the columns taken up by the use of \exposid), so the should line up. This appears to be similar to what I've seen when \placeholder is used instead of \placeholdernc. Do we need a \exposidnc?

In addition to \exposid, the use of other macros should be checked and possibly fixed as well.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 18, 2020

Yes, looks like we need \exposidnc there.

(For the purpose of column counting, it'd be nice if we could annotate our macros with the number of characters that the macro invocation takes up and the number of output characters it produces, so support mental arithmetic.)

@burblebee
Copy link
Contributor Author

burblebee commented Nov 19, 2020

(For the purpose of column counting, it'd be nice if we could annotate our macros with the number of characters that the macro invocation takes up and the number of output characters it produces, so support mental arithmetic.)

Yes please!!! Unfortunately, \exposid doesn't take up any space when rendered, so still have to do mental arithmetic to align the // \expos that often follow it.

@burblebee
Copy link
Contributor Author

burblebee commented Nov 16, 2022

This issue has not been resolved.

Using either \exposid or \exposidnc on an exposid in a synopsis causes \expos comments to not line up.

\exposidnc is supposed to be like \exposid but without italic correction.
In #3135 Thomas says:
"The non-correcting spacing is most necessary when horizontal fixed-width alignment is required"
suggesting that we should be using \exposidnc when an exposid is followed by a \expos comment, but doing so doesn't appear to make a visible difference.

For example, see the declarations in the private: section of [range.cartesian.iterator] after applying the resolution to LWG3760 from P2703r0 (branch motions-2022-11-lwg-7). You'll see the \expos comments don't line up. Replacing \exposidnc with \exposid in the branch doesn't appear to make a difference.

Since \exposidnc uses \placeholdernc, will #3135 fix this #4381?
Summary of related github issues/prs:

Summary of related commits:

  • d5e8108 [macros] Add "\exposidnc", like \exposid without italic correction (#4392)
  • 475cc82 [macros] Fix spacing of \exposidnc
  • f3ff6aa [lib] Use \placeholder with italic correction before <
  • b743f3b [lib] Use \placeholdernc before (

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 16, 2022

Note that italic correction is only applied (and hence only needs to be removed) before certain characters, but not always. E.g. before a whitespace I believe no correction is inserted, so using the "nc" variants doesn't make a difference there.

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 a pull request may close this issue.

2 participants