From 03e478ee2cdf3a5c6dd4cbf2a6bc16ce175e1cac Mon Sep 17 00:00:00 2001 From: Amar Al-Zubaidi <92645199+amarakon@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:39:14 -0500 Subject: Add LaTeX variable `urlstyle` (#8429) This is set to `same` by default, so users should not experience any change. --- MANUAL.txt | 3 +++ data/templates/default.latex | 2 +- man/pandoc.1 | 2 ++ test/lhs-test.latex | 2 +- test/lhs-test.latex+lhs | 2 +- test/writer.latex | 2 +- test/writers-lang-and-dir.latex | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 7a55cb29b..eb1a50d72 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -2913,6 +2913,9 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine. `links-as-notes` : causes links to be printed as footnotes +`urlstyle` +: style for URLs (e.g., tt, same) + #### Front matter `lof`, `lot` diff --git a/data/templates/default.latex b/data/templates/default.latex index 1e76be34b..f7362eb18 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -384,7 +384,7 @@ $if(csquotes)$ $endif$ \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{same} % disable monospaced font for URLs +\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$} $if(links-as-notes)$ % Make links footnotes instead of hotlinks: \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} diff --git a/man/pandoc.1 b/man/pandoc.1 index ec70a04a1..e71dffaaa 100644 --- a/man/pandoc.1 +++ b/man/pandoc.1 @@ -3011,6 +3011,8 @@ and links in table of contents, respectively: uses options allowed by .TP \f[V]links-as-notes\f[R] causes links to be printed as footnotes +\f[V]urlstyle\f[R] +style for URLs (e.g., tt, same) .SS Front matter .TP \f[V]lof\f[R], \f[V]lot\f[R] diff --git a/test/lhs-test.latex b/test/lhs-test.latex index d496399b4..499842ac3 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -83,7 +83,7 @@ \fi \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{same} % disable monospaced font for URLs +\urlstyle{same} \hypersetup{ hidelinks, pdfcreator={LaTeX via pandoc}} diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index e12f253f3..51c70fe1e 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -50,7 +50,7 @@ \fi \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{same} % disable monospaced font for URLs +\urlstyle{same} \hypersetup{ hidelinks, pdfcreator={LaTeX via pandoc}} diff --git a/test/writer.latex b/test/writer.latex index 3d0cf9851..b286d3da9 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -60,7 +60,7 @@ \fi \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{same} % disable monospaced font for URLs +\urlstyle{same} \VerbatimFootnotes % allow verbatim text in footnotes \hypersetup{ pdftitle={Pandoc Test Suite}, diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index 0966a8312..fe474f165 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -66,7 +66,7 @@ \fi \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available -\urlstyle{same} % disable monospaced font for URLs +\urlstyle{same} \hypersetup{ pdflang={en}, hidelinks, -- cgit v1.2.3