From 95326e21e6502612ddfcadb59714825aead8a70e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Sep 2025 22:25:07 +0200 Subject: Add `shorthands` variable for LaTeX output. If true, pandoc will allow language-specific shorthands when loading babel. Closes #11160. --- MANUAL.txt | 5 +++++ data/templates/common.latex | 4 ++-- test/command/9472.md | 4 ++-- test/writers-lang-and-dir.latex | 4 ++-- 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 -- cgit v1.2.3