Open psads-git opened 11 months ago
This isn't a quarto bug; it's a limitation of the latex format. The following happens with Pandoc directly:
$ cat pandoc-title-test.qmd
---
title: "Untitled"
---
# some [underlined text]{.underline} {-}
$ pandoc -f markdown -t pdf pandoc-title-test.qmd -o out.pdf
Error producing PDF.
! Use of \SOUL@n doesn't match its definition.
\SOUL@ulunderline #1->{\setbox \z@ \hbox {#1}
\SOUL@dimen =\wd \z@ \SOUL@dime...
l.69 ...e{toc}{section}{some \ul{underlined text}}
The issue, I believe, is that the LaTeX template from Pandoc doesn't allow decorated text in the table of contents.
Ideally, we'd figure out the difference between decorated and undecorated text, and we would emit an error message or warning. Unfortunately, that's very hard to do in general. I've made this an enhancement issue, and I'll leave it open; perhaps someone can come up with a clever idea here.
Thanks, Carlos, for your answer.
Is there some workaround users can resort to?
Is there some workaround users can resort to?
The workaround is crude: don't use adorned text in headings.
Thanks, Carlos. I have successfully used LaTeX instead of markdown to create the unnumbered underlined section.
I have successfully used LaTeX instead of markdown to create the unnumbered underlined section.
Can you share what you used ? I am curious...
The issue happens because of this in the LaTeX file
\addcontentsline{toc}{section}{some \ul{underlined text}}
Using \ul
inside \addcontentsline
seems not permitted.
\addcontentsline
is added when a secion is .unnumbered
but listed. If you use
# some [underlined text]{.underline} {.unnumbered .unlisted}
you won't have the issue.
The LaTeX is written by Pandoc. So if you have a LaTeX workaround, you could report in Pandoc's repo so that they do not create not working LaTeX code maybe. 🤷
Thanks, Christophe. Actually, I do not use any underlining inside the table of contents entry (that is maybe why it works):
\subsubsection*{Some \ul{underlined text}}
\addcontentsline{toc}{subsubsection}{Some underlined text}
I do not use any underlining inside the table of contents entry (that is maybe why it works)
Yes exactly. This is the underlying problem - as Pandoc is not stripping the \ul
itself when creating the tex line.
Consider the following
quarto
document:It gives the following error:
If one removes
{-}
the error does not show up.I am using
quarto 1.4.376
version.