diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/docx/word/styles.xml | 9 | ||||
-rw-r--r-- | data/pandoc.lua | 40 | ||||
-rw-r--r-- | data/templates/default.beamer | 2 | ||||
-rw-r--r-- | data/templates/default.context | 25 | ||||
-rw-r--r-- | data/templates/default.latex | 49 |
5 files changed, 63 insertions, 62 deletions
diff --git a/data/docx/word/styles.xml b/data/docx/word/styles.xml index 5d09a67b0..3596d8bbc 100644 --- a/data/docx/word/styles.xml +++ b/data/docx/word/styles.xml @@ -342,8 +342,9 @@ <w:semiHidden /> <w:unhideWhenUsed /> </w:style> - <w:style w:type="table" w:default="1" w:styleId="TableNormal"> - <w:name w:val="Normal Table" /> + <w:style w:type="table" w:default="1" w:styleId="Table"> + <w:name w:val="Table" /> + <w:basedOn w:val="TableNormal" /> <w:semiHidden /> <w:unhideWhenUsed /> <w:qFormat /> @@ -400,8 +401,8 @@ <w:name w:val="Figure" /> <w:basedOn w:val="Normal" /> </w:style> - <w:style w:type="paragraph" w:customStyle="1" w:styleId="FigureWithCaption"> - <w:name w:val="Figure with Caption" /> + <w:style w:type="paragraph" w:customStyle="1" w:styleId="CaptionedFigure"> + <w:name w:val="Captioned Figure" /> <w:basedOn w:val="Figure" /> <w:pPr> <w:keepNext /> diff --git a/data/pandoc.lua b/data/pandoc.lua index 2a5a945b5..750b41e86 100644 --- a/data/pandoc.lua +++ b/data/pandoc.lua @@ -233,11 +233,11 @@ M.BulletList = M.Block:create_constructor( --- Creates a code block element -- @function CodeBlock -- @tparam string text code string --- @tparam[opt] Attr attributes element attributes +-- @tparam[opt] Attr attr element attributes -- @treturn Block code block element M.CodeBlock = M.Block:create_constructor( "CodeBlock", - function(text, attributes) return {c = {attributes, text}} end, + function(text, attr) return {c = {attr or M.Attr(), text}} end, {{"identifier", "classes", "attributes"}, "text"} ) @@ -254,11 +254,13 @@ M.DefinitionList = M.Block:create_constructor( --- Creates a div element -- @function Div -- @tparam {Block,...} content block content --- @tparam[opt] Attr attributes element attributes +-- @tparam[opt] Attr attr element attributes -- @treturn Block code block element M.Div = M.Block:create_constructor( "Div", - function(content, attributes) return {c = {attributes, content}} end, + function(content, attr) + return {c = {attr or M.Attr(), content}} + end, {{"identifier", "classes", "attributes"}, "content"} ) @@ -266,12 +268,12 @@ M.Div = M.Block:create_constructor( -- @function Header -- @tparam int level header level -- @tparam {Inline,...} content inline content --- @tparam Attr attributes element attributes +-- @tparam[opt] Attr attr element attributes -- @treturn Block header element M.Header = M.Block:create_constructor( "Header", - function(level, content, attributes) - return {c = {level, attributes, content}} + function(level, content, attr) + return {c = {level, attr or M.Attr(), content}} end, {"level", {"identifier", "classes", "attributes"}, "content"} ) @@ -386,11 +388,11 @@ M.Cite = M.Inline:create_constructor( --- Creates a Code inline element -- @function Code -- @tparam string text brief image description --- @tparam[opt] Attr attributes additional attributes +-- @tparam[opt] Attr attr additional attributes -- @treturn Inline code element M.Code = M.Inline:create_constructor( "Code", - function(text, attributes) return {c = {attributes, text}} end, + function(text, attr) return {c = {attr or M.Attr(), text}} end, {{"identifier", "classes", "attributes"}, "text"} ) @@ -409,14 +411,14 @@ M.Emph = M.Inline:create_constructor( -- @tparam {Inline,..} caption text used to describe the image -- @tparam string src path to the image file -- @tparam[opt] string title brief image description --- @tparam[opt] Attr attributes additional attributes +-- @tparam[opt] Attr attr additional attributes -- @treturn Inline image element M.Image = M.Inline:create_constructor( "Image", - function(caption, src, title, attributes) + function(caption, src, title, attr) title = title or "" - attributes = attributes or Attribute.empty - return {c = {attributes, caption, {src, title}}} + attr = attr or M.Attr() + return {c = {attr, caption, {src, title}}} end, {"attributes", "caption", {"src", "title"}} ) @@ -434,14 +436,14 @@ M.LineBreak = M.Inline:create_constructor( -- @tparam {Inline,..} content text for this link -- @tparam string target the link target -- @tparam[opt] string title brief link description --- @tparam[opt] Attr attributes additional attributes +-- @tparam[opt] Attr attr additional attributes -- @treturn Inline image element M.Link = M.Inline:create_constructor( "Link", - function(content, target, title, attributes) + function(content, target, title, attr) title = title or "" - attributes = attributes or Attribute.empty - return {c = {attributes, content, {target, title}}} + attr = attr or M.Attr() + return {c = {attr, content, {target, title}}} end, {"attributes", "content", {"target", "title"}} ) @@ -560,11 +562,11 @@ M.Space = M.Inline:create_constructor( --- Creates a Span inline element -- @function Span -- @tparam {Inline,..} content inline content --- @tparam[opt] Attr attributes additional attributes +-- @tparam[opt] Attr attr additional attributes -- @treturn Inline span element M.Span = M.Inline:create_constructor( "Span", - function(content, attributes) return {c = {attributes, content}} end, + function(content, attr) return {c = {attr or M.Attr(), content}} end, {{"identifier", "classes", "attributes"}, "content"} ) 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} 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$] diff --git a/data/templates/default.latex b/data/templates/default.latex index 899a00aea..156c43985 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} @@ -103,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$} @@ -155,22 +150,13 @@ $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} % 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}} @@ -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 |