From 9904bf716a276cc927280cf1e1e7b7d8e661ca75 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 11 Oct 2020 09:26:11 -0700 Subject: Updated templates for pandoc 2.11 --- default.latex | 23 +++++++-- default.opendocument | 2 +- styles.html | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 5 deletions(-) diff --git a/default.latex b/default.latex index d6cca9c..31327c1 100644 --- a/default.latex +++ b/default.latex @@ -368,10 +368,25 @@ $endif$ $if(csl-refs)$ \newlength{\cslhangindent} \setlength{\cslhangindent}{1.5em} -\newenvironment{cslreferences}% - {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}% - \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}% - {\par} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry sp + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi + % set line spacing + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#3\baselineskip} + \fi + }% + {} +\usepackage{calc} % for \widthof, \maxof +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\maxof{\widthof{#1}}{\csllabelwidth}}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth}{#1}} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} $endif$ $if(title)$ diff --git a/default.opendocument b/default.opendocument index e34c8d5..2eff86d 100644 --- a/default.opendocument +++ b/default.opendocument @@ -31,7 +31,7 @@ $include-before$ $endfor$ $if(toc)$ - + $toc-title$ diff --git a/styles.html b/styles.html index ea92c39..3d7ebb5 100644 --- a/styles.html +++ b/styles.html @@ -1,3 +1,111 @@ +$if(document-css)$ +html { + line-height: $if(linestretch)$$linestretch$$else$1.7$endif$; + font-family: $if(mainfont)$$mainfont$$else$Georgia, serif$endif$; + font-size: $if(fontsize)$$fontsize$$else$20px$endif$; + color: $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$; + background-color: $if(backgroundcolor)$$backgroundcolor$$else$#fdfdfd$endif$; +} +body { + margin: 0 auto; + max-width: 40em; + padding-left: $if(margin-left)$$margin-left$$else$50px$endif$; + padding-right: $if(margin-right)$$margin-right$$else$50px$endif$; + padding-top: $if(margin-top)$$margin-top$$else$50px$endif$; + padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$; + hyphens: auto; + word-wrap: break-word; + text-rendering: optimizeLegibility; + font-kerning: normal; +} +@media (max-width: 600px) { + body { + font-size: 0.9em; + padding: 1em; + } +} +@media print { + body { + background-color: transparent; + color: black; + } + p, h2, h3 { + orphans: 3; + widows: 3; + } + h2, h3, h4 { + page-break-after: avoid; + } +} +p { + margin-top: 1.7em; +} +a { + color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$; +} +a:visited { + color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$; +} +img { + max-width: 100%; +} +h1, h2, h3, h4, h5, h6 { + margin-top: 1.7em; +} +ol, ul { + padding-left: 1.7em; + margin-top: 1.7em; +} +li > ol, li > ul { + margin-top: 0; +} +blockquote { + margin: 1.7em 0 1.7em 1.7em; + padding-left: 1em; + border-left: 2px solid #e6e6e6; + font-style: italic; +} +code { + font-family: $if(monofont)$$monofont$$else$Menlo, Monaco, 'Lucida Console', Consolas, monospace$endif$; + background-color: #f0f0f0; + font-size: 85%; + margin: 0; + padding: .2em .4em; +} +pre { + line-height: 1.5em; + padding: 1em; + background-color: #f0f0f0; + overflow: auto; +} +pre code { + padding: 0; + overflow: visible; +} +hr { + background-color: #1a1a1a; + border: none; + height: 1px; + margin-top: 1.7em; +} +table { + border-collapse: collapse; + width: 100%; + overflow-x: auto; + display: block; +} +th, td { + border-bottom: 1px solid lightgray; + padding: 1em 3em 1em 0; +} +header { + margin-bottom: 6em; + text-align: center; +} +nav a:not(:hover) { + text-decoration: none; +} +$endif$ code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} @@ -13,3 +121,27 @@ $endif$ $if(displaymath-css)$ .display.math{display: block; text-align: center; margin: 0.5rem auto;} $endif$ +$if(csl-css)$ +div.csl-bib-body { } +div.csl-entry { + clear: both; +$if(csl-entry-spacing)$ + margin-bottom: $csl-entry-spacing$; +$endif$ +} +.hanging div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} +$endif$ -- cgit v1.2.3