diff options
| author | TuongNM <[email protected]> | 2025-09-28 15:52:33 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-28 15:52:33 +0200 |
| commit | b62f2505b3370a2a878057389c91416b2eb8a45d (patch) | |
| tree | 373b229051fbe92f7fa98dfa01dde3e8e25dbe57 | |
| parent | 3ffd47af68853662fc613c3ce186e60b60d95d43 (diff) | |
LaTeX writer: Fix strikeouts in beamer title (#11169)
beamer uses pdfstring for the pdfinfo which can't handle soul strikeouts.
Therefore, the title, subtitle and author contents need to be put inside
texorpdfstring to deal with both the pdfinfo as well as the formatting.
Fixes #11168.
| -rw-r--r-- | data/templates/default.beamer | 6 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/data/templates/default.beamer b/data/templates/default.beamer index b2eafaadf..6e2c0ed80 100644 --- a/data/templates/default.beamer +++ b/data/templates/default.beamer @@ -108,12 +108,12 @@ $after-header-includes.latex()$ $hypersetup.latex()$ $if(title)$ -\title$if(shorttitle)$[$shorttitle$]$endif${$title$$if(thanks)$\thanks{$thanks$}$endif$} +\title$if(shorttitle)$[$shorttitle$]$endif${\texorpdfstring{$title$}{$title-meta$}$if(thanks)$\thanks{$thanks$}$endif$} $endif$ $if(subtitle)$ -\subtitle$if(shortsubtitle)$[$shortsubtitle$]$endif${$subtitle$} +\subtitle$if(shortsubtitle)$[$shortsubtitle$]$endif${\texorpdfstring{$subtitle$}{$subtitle-meta$}} $endif$ -\author$if(shortauthor)$[$shortauthor$]$endif${$for(author)$$author$$sep$ \and $endfor$} +\author$if(shortauthor)$[$shortauthor$]$endif${\texorpdfstring{$for(author)$$author$$sep$ \and $endfor$}{$author-meta$}} \date$if(shortdate)$[$shortdate$]$endif${$date$} $if(institute)$ \institute$if(shortinstitute)$[$shortinstitute$]$endif${$for(institute)$$institute$$sep$ \and $endfor$} diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 73dbca459..3fb93545e 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -183,6 +183,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do st <- get titleMeta <- escapeCommas <$> -- see #10501 stringToLaTeX TextString (stringify $ docTitle meta) + subtitleMeta <- stringToLaTeX TextString (stringify $ lookupMetaInlines "subtitle" meta) authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta -- The trailer ID is as hash used to identify the PDF. Taking control of its -- value is important when aiming for reproducible PDF generation. Setting @@ -233,6 +234,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do else 0)) $ defField "body" main $ defField "title-meta" titleMeta $ + defField "subtitle-meta" subtitleMeta $ defField "author-meta" (T.intercalate "; " authorsMeta) $ defField "documentclass" documentClass $ |
