Skip to content
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

Add LaTeX option urlstyle #8429

Merged
merged 4 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions MANUAL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,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`
Expand Down
6 changes: 5 additions & 1 deletion data/templates/default.latex
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ $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
$if(urlstyle)$
\urlstyle{$urlstyle$}
$else$
\urlstyle{same}
$endif$
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
Expand Down
2 changes: 2 additions & 0 deletions man/pandoc.1
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion test/lhs-test.latex
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion test/lhs-test.latex+lhs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion test/writer.latex
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion test/writers-lang-and-dir.latex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down