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

[intro.abstract] Move \indextext under \pnum #2088

Merged
merged 1 commit into from Jun 8, 2018

Conversation

languagelawyer
Copy link
Contributor

Currently index entries point to the end of the previous paragraph, see pic. image

@BitonicEelis
Copy link

BitonicEelis commented May 28, 2018

This issue probably only affects the HTML version generated by cxxdraft-htmlgen, so in fairness this should probably be considered a cxxdraft-htmlgen deficiency. Having said that, fixing it by changing the LaTeX means less work for cxxdraft-htmlgen, so I'm all for it. :P

@languagelawyer
Copy link
Contributor Author

this should probably be considered a cxxdraft-htmlgen deficiency

Completely disagree. \indextext refers to the "current location". And until the next paragraph starts, the current location is the last defined paragraph.

@BitonicEelis
Copy link

As far as LaTeX is concerned, the index entry is just a location you can jump to. With an index entry right before a pnum, the jump location coincides with the start of the paragraph, so that if you jump to the index entry, you correctly arrive at the start of the paragraph. As far as I know this is ordinary LaTeX behavior. On what do you base your "the current location is the last defined paragraph" interpretation?

@languagelawyer
Copy link
Contributor Author

languagelawyer commented May 28, 2018

As far as LaTeX is concerned, the index entry is just a location you can jump to.

Yep. And the location where the index entry was defined — was the end of the paragraph. Not the beginning.

With an index entry right before a pnum, the jump location coincides with the start of the paragraph

How an index entry should coincide with the start of a paragraph which haven't even started yet?

As far as I know this is ordinary LaTeX behavior.

Have you ever used "ordinary" LaTeX? For example, article documentclass? Where do you put \label if you want to refer to a section or to a figure caption? Before or after \section/\caption?

Anyway, just read https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines#source-code-formatting

@BitonicEelis
Copy link

BitonicEelis commented May 28, 2018

I'm not sure why you think there is trouble in having a (zero-width) location coincide with the start of the thing that follows it. In the string "ABC", the location between B and C coincides with the start of C. No?

As for \label, that's a different command. It doesn't tell us anything about index entries.

Anyway, I'm happy to see that the guidelines recommend putting the index entry after the pnum. I suspect it's just for human source readability since LaTeX doesn't care, but it's great for cxxdraft-htmlgen! :)

@Eelis
Copy link
Contributor

Eelis commented May 28, 2018

A closely related question that the style guidelines do not address, is whether \indextext entries for list items should be placed after the \item as well. For eel.is/c++draft I currently use a patch that moves some such index entries that currently occur before \item, for much the same reason as described in the description of this pull request. So if the style guidelines were updated to say that index entries for list items are also to be placed after the \item command, then that would be great for me.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 8, 2018

I wouldn't mind such a style rule, though I'm not sure if anyone would spend significant effort on modifying existing uses.

@jwakely
Copy link
Member

jwakely commented Jun 8, 2018

And until the next paragraph starts, the current location is the last defined paragraph.

The next paragraph starts after the blank line, not at the \pnum.

@languagelawyer
Copy link
Contributor Author

languagelawyer commented Jun 8, 2018

I wouldn't mind such a style rule

I think this is not a style rule, because it affects which paragraph an index entry points to.
And the rule already exists https://github.com/cplusplus/draft/wiki/Specification-Style-Guidelines#source-code-formatting

The next paragraph starts after the blank line, not at the \pnum.

No. The blank line ends the current paragraph:
image
(D. Knuth "The TeXbook", Chapter 8: The Characters You Type)
and puts TeX back into vertical mode:
image
(D. Knuth "The TeXbook", Chapter 25: Summary of Horizontal Mode)
The next paragraph starts only when some commands appear in vertical mode:
image
(D. Knuth "The TeXbook", Chapter 24: Summary of Vertical Mode)

The \pnum, printing the paragraph number (AFAIK numbers are <otherchar>), starts a new paragraph.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 8, 2018

I wouldn't mind such a style rule

I think this is not a style rule, because it affects which paragraph an index entry points to.

Yes, you're right. I think what I meant was that I'd only have such a rule apply to when the index entry is in fact meant to appertain to the following paragraph.

And the rule already exists

Wonderful!

@tkoeppe tkoeppe merged commit b821b01 into cplusplus:master Jun 8, 2018
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