-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
latex parsing: final item label in theorem environment applied to theorem rather than item #8872
Labels
Comments
T/P/Readers/LaTeX/Math.hs theoremEnvironment. We currently do something fairly primitive. When we encounter a label, we modify sLastLabel in state. We then check this after parsing a theorem environment. |
ibayashi-hikaru
added a commit
to ibayashi-hikaru/pandoc
that referenced
this issue
Nov 17, 2023
In the current implementation , theorem labels in `theoremEnvironment` are determined by the `LastLabel` in the current state. This approach works well when the `\label{label_name}` is placed at the end of the theorem body (, which is a standard place to put a label.) However, when a label is placed at the beginning of the theorem (another common practice) and additional labels follow in the theorem body, `theoremEnvironment` incorrectly picks the last label (e.g., `\label{item2}` in jgm#8872). This patch addresses the issue by extracting the label extraction independently of the `LastLabel` state.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pandoc version 3.1.2 on macOS 12.6, "pandoc test.tex -o test.md"
Input:
Output:
Expected output:
That is to say, the final item label is applied to the enclosing block rather than to the item.
I wasn't able to find related issues in github or pandoc-discuss. I would be happy to try to understand this issue better. Would Text/Pandoc/Readers/LaTeX.hs be the place to look?
The text was updated successfully, but these errors were encountered: