From 2f3d62cb8612139ee1695aee962007be86cc636e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 6 May 2017 14:58:32 +0200 Subject: ConTeXt template: improved font handling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit simplefonts is now obsolete in ConTeXt. This patch comes from Pablo Rodríguez via jgm/pandoc-templates#247. --- data/templates/default.context | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'data/templates') diff --git a/data/templates/default.context b/data/templates/default.context index 4a3457934..e17d85b36 100644 --- a/data/templates/default.context +++ b/data/templates/default.context @@ -23,6 +23,7 @@ $endif$ style=$linkstyle$, color=$linkcolor$, contrastcolor=$linkcontrastcolor$] + % make chapter, section bookmarks visible when opening document \placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section] \setupinteractionscreen[option=bookmark] @@ -37,26 +38,22 @@ $endif$ $if(pagenumbering)$ \setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$] $endif$ + % use microtypography \definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes] \definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes] \setupalign[hz,hanging] \setupitaliccorrection[global, always] + \setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted -\usemodule[simplefonts$if(fontsize)$,$fontsize$$endif$] -\setmainfontfallback[DejaVu Serif][range={greekandcoptic, greekextended}, force=yes, rscale=auto] -$if(mainfont)$ -\setmainfont[$mainfont$] -$endif$ -$if(sansfont)$ -\setsansfont[$sansfont$][rscale=auto] -$endif$ -$if(monofont)$ -\setmonofont[$monofont$][features=none, rscale=auto] -$endif$ -$if(mathfont)$ -\setmathfont[$mathfont$][rscale=auto] -$endif$ + +\definefallbackfamily[mainface][rm][DejaVu Serif][preset=range:greek, force=yes] +\definefontfamily[mainface][rm][$if(mainfont)$$mainfont$$else$Latin Modern Roman$endif$] +\definefontfamily[mainface][mm][$if(mathfont)$$mathfont$$else$Latin Modern Math$endif$] +\definefontfamily[mainface][ss][$if(sansfont)$$sansfont$$else$Latin Modern Sans$endif$] +\definefontfamily[mainface][tt][$if(monofont)$$monofont$$else$Latin Modern Typewriter$endif$][features=none] +\setupbodyfont[mainface$if(fontsize)$,$fontsize$$endif$] + \setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$] $if(indenting)$ \setupindenting[$for(indenting)$$indenting$$sep$,$endfor$] -- cgit v1.2.3 From 5048be51129bd195bcbe5e1d469fb895c9d4c5f8 Mon Sep 17 00:00:00 2001 From: Václav Haisman Date: Mon, 8 May 2017 12:07:01 +0200 Subject: Fix links inside captions in LaTeX output with links-as-notes. Declare our redefined `\href` robust. Fixes #3651. (#3652) --- data/templates/default.latex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/templates') diff --git a/data/templates/default.latex b/data/templates/default.latex index 899a00aea..de55d69db 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -155,7 +155,7 @@ $if(graphics)$ $endif$ $if(links-as-notes)$ % Make links footnotes instead of hotlinks: -\renewcommand{\href}[2]{#2\footnote{\url{#1}}} +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} $endif$ $if(strikeout)$ \usepackage[normalem]{ulem} -- cgit v1.2.3 From 7bdf38ef2eb39e552a0825436dc8bdfa5507e245 Mon Sep 17 00:00:00 2001 From: Václav Haisman Date: Tue, 9 May 2017 22:09:10 +0200 Subject: LaTeX: Load `parskip` before `hyperref`. (#3654) * LaTeX: Load `parskip` before `hyperref`. According to `hyperref` package's `README.pdf`, page 22, `hyperref` package should be loaded after `parskip` package. * Adjust tests for previous change. --- data/templates/default.latex | 18 +++++++++--------- test/lhs-test.latex | 12 ++++++------ test/lhs-test.latex+lhs | 12 ++++++------ test/writer.latex | 12 ++++++------ test/writers-lang-and-dir.latex | 12 ++++++------ 5 files changed, 33 insertions(+), 33 deletions(-) (limited to 'data/templates') diff --git a/data/templates/default.latex b/data/templates/default.latex index de55d69db..7630d34f4 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -69,6 +69,15 @@ $endif$ \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} +$if(indent)$ +$else$ +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} +$endif$ \PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref $if(verbatim-in-note)$ \usepackage{fancyvrb} @@ -162,15 +171,6 @@ $if(strikeout)$ % avoid problems with \sout in headers with hyperref: \pdfstringdefDisableCommands{\renewcommand{\sout}{}} $endif$ -$if(indent)$ -$else$ -\IfFileExists{parskip.sty}{% -\usepackage{parskip} -}{% else -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -} -$endif$ \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/test/lhs-test.latex b/test/lhs-test.latex index 3ca8f97c8..027ad3a0e 100644 --- a/test/lhs-test.latex +++ b/test/lhs-test.latex @@ -17,6 +17,12 @@ \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} \PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref \usepackage[unicode=true]{hyperref} \hypersetup{ @@ -61,12 +67,6 @@ \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}} \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}} \newcommand{\NormalTok}[1]{#1} -\IfFileExists{parskip.sty}{% -\usepackage{parskip} -}{% else -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/test/lhs-test.latex+lhs b/test/lhs-test.latex+lhs index b0a58ac78..4aac4c7bb 100644 --- a/test/lhs-test.latex+lhs +++ b/test/lhs-test.latex+lhs @@ -17,6 +17,12 @@ \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} \PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref \usepackage[unicode=true]{hyperref} \hypersetup{ @@ -26,12 +32,6 @@ \usepackage{listings} \newcommand{\passthrough}[1]{#1} \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{} -\IfFileExists{parskip.sty}{% -\usepackage{parskip} -}{% else -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/test/writer.latex b/test/writer.latex index f88621a28..ab5e5e724 100644 --- a/test/writer.latex +++ b/test/writer.latex @@ -17,6 +17,12 @@ \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} \PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref \usepackage{fancyvrb} \usepackage[unicode=true]{hyperref} @@ -39,12 +45,6 @@ \usepackage[normalem]{ulem} % avoid problems with \sout in headers with hyperref: \pdfstringdefDisableCommands{\renewcommand{\sout}{}} -\IfFileExists{parskip.sty}{% -\usepackage{parskip} -}{% else -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index cba3dd96b..c5c363312 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -17,6 +17,12 @@ \usepackage[]{microtype} \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts }{} +\IfFileExists{parskip.sty}{% +\usepackage{parskip} +}{% else +\setlength{\parindent}{0pt} +\setlength{\parskip}{6pt plus 2pt minus 1pt} +} \PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref \usepackage[unicode=true]{hyperref} \hypersetup{ @@ -43,12 +49,6 @@ \setotherlanguage[]{spanish} \setotherlanguage[]{french} \fi -\IfFileExists{parskip.sty}{% -\usepackage{parskip} -}{% else -\setlength{\parindent}{0pt} -\setlength{\parskip}{6pt plus 2pt minus 1pt} -} \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} -- cgit v1.2.3 From b45e47735c4f7f2a0e4493d156a43e603615f398 Mon Sep 17 00:00:00 2001 From: lwolfsonkin Date: Thu, 18 May 2017 16:42:18 -0400 Subject: modified template.latex to fix XeLaTex being used with tables (#3661) - reordered `lang` variable handling to immediately before `bidi` --- data/templates/default.latex | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'data/templates') diff --git a/data/templates/default.latex b/data/templates/default.latex index 7630d34f4..156c43985 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -112,20 +112,6 @@ $endif$ $if(geometry)$ \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ -$if(lang)$ -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} -$if(babel-newcommands)$ - $babel-newcommands$ -$endif$ -\else - \usepackage{polyglossia} - \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} -$endfor$ -\fi -$endif$ $if(natbib)$ \usepackage{natbib} \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$} @@ -191,6 +177,21 @@ $else$ \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} \fi $endif$ +$if(lang)$ +\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex + \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +$if(babel-newcommands)$ + $babel-newcommands$ +$endif$ +\else + % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic) + \usepackage{polyglossia} + \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$} +$for(polyglossia-otherlangs)$ + \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} +$endfor$ +\fi +$endif$ $if(dir)$ \ifxetex % load bidi as late as possible as it modifies e.g. graphicx -- cgit v1.2.3 From 4bae307616de5688983b55cbec1819c2e2864c6e Mon Sep 17 00:00:00 2001 From: Václav Haisman Date: Mon, 5 Jun 2017 15:52:36 +0200 Subject: Added aspectratio variable to beamer template (#3723). * Transplant jgm/pandoc-templates#236 to Pandoc repository. * Document `aspectratio` in user manual. * Enumerate possible values for `aspectratio`. --- MANUAL.txt | 5 +++++ data/templates/default.beamer | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'data/templates') diff --git a/MANUAL.txt b/MANUAL.txt index 2cd35d14d..df08e4b40 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -1339,6 +1339,11 @@ including all [reveal.js configuration options]. : color for internal links, citation links, external links, and links in table of contents: uses any of the [predefined LaTeX colors] (for beamer only). +`aspectratio` +: aspect ratio of slides (for beamer only, `1610` for 16:10, `169` for 16:9, + `149` for 14:9, `141` for 1.41:1, `54` for 5:4, `43` for 4:3 which is the + default, and `32` for 3:2). + [reveal.js configuration options]: https://github.com/hakimel/reveal.js#configuration Variables for LaTeX diff --git a/data/templates/default.beamer b/data/templates/default.beamer index fb02cb058..c9d30b657 100644 --- a/data/templates/default.beamer +++ b/data/templates/default.beamer @@ -1,4 +1,4 @@ -\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(handout)$handout,$endif$$if(colorlinks)$dvipsnames,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$} +\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(handout)$handout,$endif$$if(colorlinks)$dvipsnames,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$$if(aspectratio)$aspectratio=$aspectratio$,$endif$]{$documentclass$} \setbeamertemplate{caption}[numbered] \setbeamertemplate{caption label separator}{: } \setbeamercolor{caption name}{fg=normal text.fg} -- cgit v1.2.3