aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-09-24 22:25:07 +0200
committerJohn MacFarlane <[email protected]>2025-09-24 22:25:07 +0200
commit95326e21e6502612ddfcadb59714825aead8a70e (patch)
tree60d13b5fa145dd1ef76fd0ae52ac4201f79153b7
parent9024df9348ce38741777296a5845b39539a90acf (diff)
Add `shorthands` variable for LaTeX output.
If true, pandoc will allow language-specific shorthands when loading babel. Closes #11160.
-rw-r--r--MANUAL.txt5
-rw-r--r--data/templates/common.latex4
-rw-r--r--test/command/9472.md4
-rw-r--r--test/writers-lang-and-dir.latex4
4 files changed, 11 insertions, 6 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index af7a573c3..4bff32e2a 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -3056,6 +3056,11 @@ Pandoc uses these variables when [creating a PDF] with a LaTeX engine.
- heightrounded
...
+`shorthands`
+: Enable language-specific shorthands when loading `babel`.
+ (By default, pandoc includes `shorthands=off` when loading
+ `babel`, disabling language-specific shorthands.)
+
`hyperrefoptions`
: option for [`hyperref`] package, e.g. `linktoc=all`;
repeat for multiple options:
diff --git a/data/templates/common.latex b/data/templates/common.latex
index 5f32758ed..46c32823f 100644
--- a/data/templates/common.latex
+++ b/data/templates/common.latex
@@ -183,9 +183,9 @@ $-- Babel language support
$--
$if(lang)$
\ifLuaTeX
-\usepackage[bidi=basic,shorthands=off,$for(babeloptions)$,$babeloptions$$endfor$]{babel}
+\usepackage[bidi=basic$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}
\else
-\usepackage[bidi=default,shorthands=off,$for(babeloptions)$,$babeloptions$$endfor$]{babel}
+\usepackage[bidi=default$if(shorthands)$$else$,shorthands=off$endif$$for(babeloptions)$,$babeloptions$$endfor$]{babel}
\fi
$if(babel-lang)$
$if(mainfont)$
diff --git a/test/command/9472.md b/test/command/9472.md
index dffd103fc..f40e63bc1 100644
--- a/test/command/9472.md
+++ b/test/command/9472.md
@@ -49,9 +49,9 @@ More text in English. ['Zitat auf Deutsch.']{lang=de}
\KOMAoptions{parskip=half}}
\makeatother
\ifLuaTeX
-\usepackage[bidi=basic,shorthands=off,]{babel}
+\usepackage[bidi=basic,shorthands=off]{babel}
\else
-\usepackage[bidi=default,shorthands=off,]{babel}
+\usepackage[bidi=default,shorthands=off]{babel}
\fi
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex
index 842ca98a6..0d6b003bf 100644
--- a/test/writers-lang-and-dir.latex
+++ b/test/writers-lang-and-dir.latex
@@ -43,9 +43,9 @@
\KOMAoptions{parskip=half}}
\makeatother
\ifLuaTeX
-\usepackage[bidi=basic,shorthands=off,]{babel}
+\usepackage[bidi=basic,shorthands=off]{babel}
\else
-\usepackage[bidi=default,shorthands=off,]{babel}
+\usepackage[bidi=default,shorthands=off]{babel}
\fi
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures