From 4de9edb8e82d14a0bd8f1e8b77e9019944c1440e Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Wed, 3 Feb 2021 16:54:11 +0000 Subject: LaTeX template: Update to iftex package (#7073) Load the iftex package directly rather than via the ifxetex and ifluatex compatibility wrappers, which have been merged into a single package that is part of the LaTeX core. The capitalization of the commands has been changed for compatibility with older versions of TeX Live that have the version of iftex by the Persian TeX Group. This had been removed in for compatibility with BasicTeX, but that is no longer an issue. --- test/lhs-test.latex+lhs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/lhs-test.latex+lhs') diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index 4bc674f4a..f9149ba02 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -6,8 +6,8 @@ ]{article} \usepackage{amsmath,amssymb} \usepackage{lmodern} -\usepackage{ifxetex,ifluatex} -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex +\usepackage{iftex} +\ifPDFTeX \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{textcomp} % provide euro and other symbols @@ -48,7 +48,7 @@ \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} \setcounter{secnumdepth}{-\maxdimen} % remove section numbering -\ifluatex +\ifLuaTeX \usepackage{selnolig} % disable illegal ligatures \fi -- cgit v1.2.3 From 24d7cd539ba70aa94480976a7957420c020cb19a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Feb 2021 15:48:40 -0800 Subject: LaTeX template: disable `` ?` `` and `` !` `` ligatures. These are often triggered by accident in languagegs that use ` `` ` for end quote (e.g. German). See jgm/citeproc#54. --- data/templates/default.latex | 1 + test/lhs-test.latex | 1 + test/lhs-test.latex+lhs | 1 + test/writer.latex | 1 + test/writers-lang-and-dir.latex | 1 + 5 files changed, 5 insertions(+) (limited to 'test/lhs-test.latex+lhs') diff --git a/data/templates/default.latex b/data/templates/default.latex index c98f53bb6..efc905741 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -181,6 +181,7 @@ $endif$ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts + \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} $if(indent)$ $else$ diff --git a/test/lhs-test.latex b/test/lhs-test.latex index fdc344335..8c91c88a2 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -21,6 +21,7 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts + \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index f9149ba02..0062a8f2d 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -21,6 +21,7 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts + \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/writer.latex b/test/writer.latex index abf772df4..a1cefc333 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -21,6 +21,7 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts + \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index d91f77325..2c6bc0001 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -22,6 +22,7 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts + \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class -- cgit v1.2.3 From 005344fb18c9e3bc3c2601ab3b6a7d567c46f398 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Feb 2021 17:03:11 -0800 Subject: Revert "LaTeX template: disable `` ?` `` and `` !` `` ligatures." This reverts commit 24d7cd539ba70aa94480976a7957420c020cb19a. --- data/templates/default.latex | 1 - test/lhs-test.latex | 1 - test/lhs-test.latex+lhs | 1 - test/writer.latex | 1 - test/writers-lang-and-dir.latex | 1 - 5 files changed, 5 deletions(-) (limited to 'test/lhs-test.latex+lhs') diff --git a/data/templates/default.latex b/data/templates/default.latex index efc905741..c98f53bb6 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -181,7 +181,6 @@ $endif$ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts - \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} $if(indent)$ $else$ diff --git a/test/lhs-test.latex b/test/lhs-test.latex index 8c91c88a2..fdc344335 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -21,7 +21,6 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts - \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index 0062a8f2d..f9149ba02 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -21,7 +21,6 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts - \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/writer.latex b/test/writer.latex index a1cefc333..abf772df4 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -21,7 +21,6 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts - \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index 2c6bc0001..d91f77325 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -22,7 +22,6 @@ \IfFileExists{microtype.sty}{% use microtype if available \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts - \DisableLigatures[?,!]{encoding=T1} % disable ?` and !` ligatures }{} \makeatletter \@ifundefined{KOMAClassName}{% if non-KOMA class -- cgit v1.2.3 From cc088687b4013c2b8b744eb337ed04fc63f315f2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 16 May 2021 14:35:13 -0700 Subject: LaTeX template: move title, author, date up to top of preamble. This allows header-includes to use them, and puts them in a position where you can see them immediately. Closes #7295. --- data/templates/default.latex | 58 ++++++++++++++++++++--------------------- test/lhs-test.latex | 6 ++--- test/lhs-test.latex+lhs | 6 ++--- test/writer.latex | 8 +++--- test/writers-lang-and-dir.latex | 6 ++--- 5 files changed, 42 insertions(+), 42 deletions(-) (limited to 'test/lhs-test.latex+lhs') diff --git a/data/templates/default.latex b/data/templates/default.latex index 04784b971..61402c605 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -36,6 +36,35 @@ $for(classoption)$ $classoption$$sep$, $endfor$ ]{$documentclass$} +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +$endif$ +$if(subtitle)$ +$if(beamer)$ +$else$ +\usepackage{etoolbox} +\makeatletter +\providecommand{\subtitle}[1]{% add subtitle to \maketitle + \apptocmd{\@title}{\par {\large #1 \par}}{}{} +} +\makeatother +$endif$ +\subtitle{$subtitle$} +$endif$ +\author{$for(author)$$author$$sep$ \and $endfor$} +\date{$date$} +$if(beamer)$ +$if(institute)$ +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +$if(titlegraphic)$ +\titlegraphic{\includegraphics{$titlegraphic$}} +$endif$ +$if(logo)$ +\logo{\includegraphics{$logo$}} +$endif$ +$endif$ + $if(beamer)$ $if(background-image)$ \usebackgroundtemplate{% @@ -423,35 +452,6 @@ $if(csquotes)$ \usepackage{csquotes} $endif$ -$if(title)$ -\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} -$endif$ -$if(subtitle)$ -$if(beamer)$ -$else$ -\usepackage{etoolbox} -\makeatletter -\providecommand{\subtitle}[1]{% add subtitle to \maketitle - \apptocmd{\@title}{\par {\large #1 \par}}{}{} -} -\makeatother -$endif$ -\subtitle{$subtitle$} -$endif$ -\author{$for(author)$$author$$sep$ \and $endfor$} -\date{$date$} -$if(beamer)$ -$if(institute)$ -\institute{$for(institute)$$institute$$sep$ \and $endfor$} -$endif$ -$if(titlegraphic)$ -\titlegraphic{\includegraphics{$titlegraphic$}} -$endif$ -$if(logo)$ -\logo{\includegraphics{$logo$}} -$endif$ -$endif$ - \begin{document} $if(has-frontmatter)$ \frontmatter diff --git a/test/lhs-test.latex b/test/lhs-test.latex index fdc344335..20bc6ae19 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -4,6 +4,9 @@ % \documentclass[ ]{article} +\author{} +\date{} + \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -85,9 +88,6 @@ \usepackage{selnolig} % disable illegal ligatures \fi -\author{} -\date{} - \begin{document} \hypertarget{lhs-test}{% diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index f9149ba02..327dac4ef 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -4,6 +4,9 @@ % \documentclass[ ]{article} +\author{} +\date{} + \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -52,9 +55,6 @@ \usepackage{selnolig} % disable illegal ligatures \fi -\author{} -\date{} - \begin{document} \hypertarget{lhs-test}{% diff --git a/test/writer.latex b/test/writer.latex index abf772df4..468c271bc 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -4,6 +4,10 @@ % \documentclass[ ]{article} +\title{Pandoc Test Suite} +\author{John MacFarlane \and Anonymous} +\date{July 17, 2006} + \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -67,10 +71,6 @@ \usepackage{selnolig} % disable illegal ligatures \fi -\title{Pandoc Test Suite} -\author{John MacFarlane \and Anonymous} -\date{July 17, 2006} - \begin{document} \maketitle diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index d91f77325..e06fe05ed 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -5,6 +5,9 @@ \documentclass[ english, ]{article} +\author{} +\date{} + \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -84,9 +87,6 @@ \newenvironment{LTR}{\beginL}{\endL} \fi -\author{} -\date{} - \begin{document} \hypertarget{empty-divs-and-spans}{% -- cgit v1.2.3 From 972db3cdcac19bca0dd4e0957514a48bbf1feacb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Jul 2021 15:21:43 -0700 Subject: Revert "LaTeX template: move title, author, date up to top of preamble." This reverts commit cc088687b4013c2b8b744eb337ed04fc63f315f2 and PR #7295. This fixes issues people had when using LaTeX commands defined later in the preamble (or in some cases UTF-8 text) in the title or author fields. Closes #7422. --- data/templates/default.latex | 58 ++++++++++++++++++++--------------------- test/lhs-test.latex | 6 ++--- test/lhs-test.latex+lhs | 6 ++--- test/writer.latex | 8 +++--- test/writers-lang-and-dir.latex | 6 ++--- 5 files changed, 42 insertions(+), 42 deletions(-) (limited to 'test/lhs-test.latex+lhs') diff --git a/data/templates/default.latex b/data/templates/default.latex index 60f9972c2..d06701675 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -36,35 +36,6 @@ $for(classoption)$ $classoption$$sep$, $endfor$ ]{$documentclass$} -$if(title)$ -\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} -$endif$ -$if(subtitle)$ -$if(beamer)$ -$else$ -\usepackage{etoolbox} -\makeatletter -\providecommand{\subtitle}[1]{% add subtitle to \maketitle - \apptocmd{\@title}{\par {\large #1 \par}}{}{} -} -\makeatother -$endif$ -\subtitle{$subtitle$} -$endif$ -\author{$for(author)$$author$$sep$ \and $endfor$} -\date{$date$} -$if(beamer)$ -$if(institute)$ -\institute{$for(institute)$$institute$$sep$ \and $endfor$} -$endif$ -$if(titlegraphic)$ -\titlegraphic{\includegraphics{$titlegraphic$}} -$endif$ -$if(logo)$ -\logo{\includegraphics{$logo$}} -$endif$ -$endif$ - $if(beamer)$ $if(background-image)$ \usebackgroundtemplate{% @@ -452,6 +423,35 @@ $if(csquotes)$ \usepackage{csquotes} $endif$ +$if(title)$ +\title{$title$$if(thanks)$\thanks{$thanks$}$endif$} +$endif$ +$if(subtitle)$ +$if(beamer)$ +$else$ +\usepackage{etoolbox} +\makeatletter +\providecommand{\subtitle}[1]{% add subtitle to \maketitle + \apptocmd{\@title}{\par {\large #1 \par}}{}{} +} +\makeatother +$endif$ +\subtitle{$subtitle$} +$endif$ +\author{$for(author)$$author$$sep$ \and $endfor$} +\date{$date$} +$if(beamer)$ +$if(institute)$ +\institute{$for(institute)$$institute$$sep$ \and $endfor$} +$endif$ +$if(titlegraphic)$ +\titlegraphic{\includegraphics{$titlegraphic$}} +$endif$ +$if(logo)$ +\logo{\includegraphics{$logo$}} +$endif$ +$endif$ + \begin{document} $if(has-frontmatter)$ \frontmatter diff --git a/test/lhs-test.latex b/test/lhs-test.latex index 20bc6ae19..fdc344335 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -4,9 +4,6 @@ % \documentclass[ ]{article} -\author{} -\date{} - \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -88,6 +85,9 @@ \usepackage{selnolig} % disable illegal ligatures \fi +\author{} +\date{} + \begin{document} \hypertarget{lhs-test}{% diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index 327dac4ef..f9149ba02 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -4,9 +4,6 @@ % \documentclass[ ]{article} -\author{} -\date{} - \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -55,6 +52,9 @@ \usepackage{selnolig} % disable illegal ligatures \fi +\author{} +\date{} + \begin{document} \hypertarget{lhs-test}{% diff --git a/test/writer.latex b/test/writer.latex index 468c271bc..abf772df4 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -4,10 +4,6 @@ % \documentclass[ ]{article} -\title{Pandoc Test Suite} -\author{John MacFarlane \and Anonymous} -\date{July 17, 2006} - \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -71,6 +67,10 @@ \usepackage{selnolig} % disable illegal ligatures \fi +\title{Pandoc Test Suite} +\author{John MacFarlane \and Anonymous} +\date{July 17, 2006} + \begin{document} \maketitle diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index e06fe05ed..d91f77325 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -5,9 +5,6 @@ \documentclass[ english, ]{article} -\author{} -\date{} - \usepackage{amsmath,amssymb} \usepackage{lmodern} \usepackage{iftex} @@ -87,6 +84,9 @@ \newenvironment{LTR}{\beginL}{\endL} \fi +\author{} +\date{} + \begin{document} \hypertarget{empty-divs-and-spans}{% -- cgit v1.2.3