-
Notifications
You must be signed in to change notification settings - Fork 31
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
Compile error when emphasis is used both inside and outside of inline note in same paragraph #447
Comments
Hi and sorry to hear about your trouble. Which version of the Markdown package are you using and what happens when the document "doesn't compile"? If you could attach your |
Sure, here is the log file: |
According to the log, you use the latest released version v3.6.0 (2024-05-27) of the Markdown package with XeLaTeX from TeX Live 2024 and the error is as follows:
I tried compiling the document in the same conditions and I successfully reproduced your issue. Enabling the
The issue is that the second inline note is not correctly recognized as an inline note and the character
\markdownRendererDocumentBegin
\markdownRendererSectionBegin
\markdownRendererHeadingOne{MWE emphasis in footnotes with markdown}\markdownRendererInterblockSeparator
{}Example 1\markdownRendererNote{Example \markdownRendererEmphasis{starred}.}.\markdownRendererParagraphSeparator
{}Example 2 with \markdownRendererEmphasis{more} starred^[Example \markdownRendererEmphasis{starred}.].
\markdownRendererSectionEnd \markdownRendererDocumentEnd @lostenderman Would you mind looking at why this fails? It seems to do with how we process emphasis; if I replace |
Maybe the bug isn't related only to the way emphasis it's parsed, in fact from more tests I saw that the same bug shows up with bold too and actually any combination of bold/emphasis inside AND outside a footnote does NOT compile: \documentclass{article}
\usepackage[hybrid, inlineNotes=true]{markdown}
\begin{document}
\begin{markdown}
# MWE emphasis in footnotes with markdown
Combinations of emphasis/bold inside OR outside footnote compile correctly:
1. Example *emphasis* bold outside footnote^[Example emphasis bold inside footnote.].
1. Example emphasis bold outside footnote^[Example *emphasis* bold inside footnote.].
1. Example emphasis **bold** outside footnote^[Example emphasis bold inside footnote.].
1. Example emphasis bold outside footnote^[Example emphasis **bold** inside footnote.].
% Any combination of emphasis/bold inside AND outside footnote does NOT compile
%1. Example *emphasis* bold outside footnote^[Example *emphasis* bold inside footnote.].
%1. Example emphasis **bold** outside footnote^[Example emphasis **bold** inside footnote.].
%1. Example *emphasis* bold outside footnote^[Example emphasis **bold** inside footnote.].
%1. Example emphasis **bold** outside footnote^[Example *emphasis* bold inside footnote.].
\end{markdown}
\end{document} N.B. Mixed markdown/latex combinations of emphasis/bold inside and outside footnote compiles correctly. |
Thanks for sharing the additional examples. The issue seems related to the interplay between (strong) emphasis and inline footnotes. Namely, the code that parses (strong) emphasis seems to misparse the inline footnote as regular text while looking around for other possible candidates for emphasis within the same paragraph. |
An additional detail, the issue shows up only if emphasis/bold comes before a footnote containing other emphasis/bold. |
@nopria: The issue has been fixed by @lostenderman in #450, see also your example document and its output after #450: \documentclass{article}
\usepackage[hybrid, inlineNotes]{markdown}
\begin{document}
\begin{markdown}
# MWE emphasis in footnotes with markdown
Combinations of emphasis/bold inside OR outside footnote compile correctly:
1. Example *emphasis* bold outside footnote^[Example emphasis bold inside footnote.].
1. Example emphasis bold outside footnote^[Example *emphasis* bold inside footnote.].
1. Example emphasis **bold** outside footnote^[Example emphasis bold inside footnote.].
1. Example emphasis bold outside footnote^[Example emphasis **bold** inside footnote.].
Any combinations of emphasis/bold inside AND outside footnote also compile correctly since #450:
1. Example *emphasis* bold outside footnote^[Example *emphasis* bold inside footnote.].
1. Example emphasis **bold** outside footnote^[Example emphasis **bold** inside footnote.].
1. Example *emphasis* bold outside footnote^[Example emphasis **bold** inside footnote.].
1. Example emphasis **bold** outside footnote^[Example *emphasis* bold inside footnote.].
\end{markdown}
\end{document} I also added a regression test, so that any similar issues are caught by our automated tests in the future. The fix will be part of Markdown 3.7.0, to be released later this month. If you'd like to use the fix earlier, take the following steps:
Note that leaving the file Even after Markdown 3.7.0, using an old file |
I released the new version yesterday. In the end, it was not a minor release 3.7.0 but just a bugfix release 3.6.1, since no new features were added since I was busy preparing a TUG 2024 article about the Markdown package. If you have a TeX Live install that is not locked by your operating system to prevent updates, you should be able to update the Markdown package using the command |
The following MWE doesn't compile "Example 2" line.
If you comment such line it compiles regularly.
This issue was not present in some prevoius version (don't know the exact number but I know I was using option
inlineFootnotes=true
instead ofinlineNotes=true
as required by current version).The text was updated successfully, but these errors were encountered: