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

In Latex sources, do columns start counting at 0 or 1? #3131

Closed
burblebee opened this issue Aug 5, 2019 · 5 comments · Fixed by #3270
Closed

In Latex sources, do columns start counting at 0 or 1? #3131

burblebee opened this issue Aug 5, 2019 · 5 comments · Fixed by #3270
Assignees

Comments

@burblebee
Copy link
Contributor

burblebee commented Aug 5, 2019

Our coding style guidelines say that the starting columns for comments in examples should be multiples of 4, but starting from where? If we start counting at 1, the examples' comments in [diff.cpp17.dcl.dcl] start on column 25, suggesting that at least those comments start counting from 0, while other comments (including the ones I've edits) assume we start counting at 1. Which is correct? Example from compatibility.tex:

  void f() {}           // ill-formed; previously well-formed
0         1         2
0123456780912345678091234 does the above comment start on column 24?
1234567809123456780912345 or on column 25?

FWIW, the comments in the guideline's own Latex example text start on column 48 when counting from 1, suggesting that whoever wrote the guidelines was thinking they should start at 1:
\begin{note} %% own lines if possible

The guidelines should be fixed to specify, and the examples fixed to adhere to them.

@JohelEGP
Copy link
Contributor

JohelEGP commented Aug 5, 2019

The example is correct. The first/zeroth column is a multiple of 4.

@tkoeppe
Copy link
Contributor

tkoeppe commented Aug 5, 2019

Maybe a better way to say this is that "the number of spaces preceding a comment should be a multiple of four".

@JohelEGP
Copy link
Contributor

JohelEGP commented Aug 6, 2019

Most comments aren't preceded by spaces only. We also can't say just characters, as that'd be ambiguous between source characters (LaTeX) and rendered characters (using \placeholder requires readjusting). What actually matters is that the number of characters preceding a rendered comment is a multiple of four.

@tkoeppe
Copy link
Contributor

tkoeppe commented Aug 6, 2019

Yes, sorry, that's what I meant. (And indeed, if you have macros in the source, you need to know how many characters they expand to, which is something I try to document as part of the macro in cases that come up a lot, like \commentellip.)

@jensmaurer jensmaurer added the decision-required A decision of the editorial group (or the Project Editor) is required. label Sep 10, 2019
@jensmaurer
Copy link
Member

Editorial teleconference: @tkoeppe's is the right rule.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Sep 30, 2019
@jensmaurer jensmaurer self-assigned this Oct 3, 2019
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.

4 participants