diff --git a/CHANGELOG.md b/CHANGELOG.md index 65a657d224..807ea0f3a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * ![Enhancement][badge-enhancement] The `curl` timeout when checking remote links is now configurable with the `linkcheck_timeout` keyword. ([#1057][github-1057], [#1295][github-1295]) +* ![Bugfix][badge-bugfix] Special characters are now properly escaped in admonition titles in LaTeX/PDF builds and do not cause the PDF build to fail anymore. ([#1299][github-1299]) + ## Version `v0.24.9` * ![Bugfix][badge-bugfix] Canonical URLs are now properly prettified (e.g. `/path/` instead of `/path/index.html`) when using `prettyurls=true`. ([#1293][github-1293]) @@ -557,6 +559,7 @@ [github-1292]: https://github.com/JuliaDocs/Documenter.jl/pull/1292 [github-1293]: https://github.com/JuliaDocs/Documenter.jl/pull/1293 [github-1295]: https://github.com/JuliaDocs/Documenter.jl/pull/1295 +[github-1299]: https://github.com/JuliaDocs/Documenter.jl/pull/1299 [documenterlatex]: https://github.com/JuliaDocs/DocumenterLaTeX.jl [documentermarkdown]: https://github.com/JuliaDocs/DocumenterMarkdown.jl diff --git a/src/Writers/LaTeXWriter.jl b/src/Writers/LaTeXWriter.jl index 59f6e9073f..60015c74c5 100644 --- a/src/Writers/LaTeXWriter.jl +++ b/src/Writers/LaTeXWriter.jl @@ -506,7 +506,7 @@ end function latex(io::IO, md::Markdown.Admonition) wrapblock(io, "quote") do wrapinline(io, "textbf") do - _print(io, md.title) + latexinline(io, md.title) end _println(io, "\n") latex(io, md.content) @@ -681,7 +681,6 @@ const _latexescape_chars = Dict{Char, AbstractString}( '\\' => "{\\textbackslash}", '\'' => "{\\textquotesingle}", '"' => "{\\textquotedbl}", - '_' => "{\\_}", ) for ch in "&%\$#_{}" _latexescape_chars[ch] = "\\$ch" diff --git a/test/examples/src.latex_simple/index.md b/test/examples/src.latex_simple/index.md index ef6cd3f464..a03be06c69 100644 --- a/test/examples/src.latex_simple/index.md +++ b/test/examples/src.latex_simple/index.md @@ -14,3 +14,11 @@ julia> 127 % Int8 1 ⊻ 2 1 | 2 ``` + +## Escaping: ~, ^, \, ', ", _, &, %, \, $, #, { and }. + +~, ^, \, ', ", _, &, %, \, $, #, { and }. + +!!! info "~, ^, \, ', ", _, &, %, \, $, #, { and }." + + ~, ^, \, ', ", _, &, %, \, $, #, { and }.