Merge pull request #141 from adunning/keywords

ConTeXt/LaTeX/Beamer clean-up
This commit is contained in:
John MacFarlane 2015-11-12 16:00:56 -08:00
commit ef963c3060
3 changed files with 68 additions and 46 deletions

View file

@ -21,7 +21,7 @@ $endif$
\setbeamertemplate{caption label separator}{: }
\setbeamercolor{caption name}{fg=normal text.fg}
$if(fontfamily)$
\usepackage[$fontfamilyoptions$]{$fontfamily$}
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
@ -43,20 +43,20 @@ $endif$
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\newcommand{\euro}{€}
$if(mainfont)$
\setmainfont[$mainfontoptions$]{$mainfont$}
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$sansfontoptions$]{$sansfont$}
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$monofontoptions$$endif$]{$monofont$}
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
$if(mathfont)$
\setmathfont(Digits,Latin,Greek)[$mathfontoptions$]{$mathfont$}
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$if(CJKmainfont)$
\usepackage{xeCJK}
\setCJKmainfont[$CJKoptions$]{$CJKmainfont$}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
% use upquote if available, for straight quotes in verbatim environments
@ -68,8 +68,10 @@ $endif$
}{}
$if(lang)$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$$sep$,$endfor$,main=$babel-lang$]{babel}
\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$}

View file

@ -8,31 +8,38 @@ $endif$
% Enable hyperlinks
\setupinteraction
[state=start,
style=$if(style)$$style$$else$normal$endif$,
color=$if(linkcolor)$$linkcolor$$else$black$endif$,
contrastcolor=$if(linkcolor)$$linkcolor$$else$black$endif$$if(title)$,
title=$title$$endif$$if(subtitle)$,
subtitle=$subtitle$$endif$$if(author)$,
author=$for(author)$$author$$sep$; $endfor$$endif$$if(keywords)$,
keyword=$keywords$$endif$]
$if(title)$
title={$title$},
$endif$
$if(subtitle)$
subtitle={$subtitle$},
$endif$
$if(author)$
author={$for(author)$$author$$sep$; $endfor$},
$endif$
$if(keywords)$
keyword={$for(keywords)$$keywords$$sep$; $endfor$},
$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]
\setuptagging[state=start]
$if(papersize)$
\setuppapersize[$for(papersize)$$papersize$$sep$,
$endfor$]
\setuppapersize[$for(papersize)$$papersize$$sep$,$endfor$]
$endif$
$if(layout)$
\setuplayout[$for(layout)$$layout$$sep$,
$endfor$]
\setuplayout[$for(layout)$$layout$$sep$,$endfor$]
$endif$
$if(pagenumbering)$
\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,
$endfor$]
\setuppagenumbering[$for(pagenumbering)$$pagenumbering$$sep$,$endfor$]
$endif$
\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes] % use microtypography
% use microtypography
\definefontfeature[default][default][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
\definefontfeature[smallcaps][smallcaps][protrusion=quality,expansion=quality,onum=yes,pnum=yes]
\setupalign[hz,hanging]
\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
$if(mainfont)$
@ -48,13 +55,12 @@ $if(mathfont)$
\definefontfamily[mathfont][math][$mathfont$]
$endif$
\setupbodyfont[mainfont$if(fontsize)$,$fontsize$$endif$]
$if(whitespace)$
\setupwhitespace[$whitespace$]
$else$
\setupwhitespace[medium]
\setupwhitespace[$if(whitespace)$$whitespace$$else$medium$endif$]
$if(indenting)$
\setupindenting[$for(indenting)$$indenting$$sep$,$endfor$]
$endif$
$if(interlinespace)$
\setupinterlinespace[$interlinespace$]
\setupinterlinespace[$for(interlinespace)$$interlinespace$$sep$,$endfor$]
$endif$
\setuphead[chapter] [style=\tfd,header=empty]
@ -65,10 +71,10 @@ $endif$
\setuphead[subsubsubsubsection][style=\it]
$if(headertext)$
\setupheadertexts[$headertext$]
\setupheadertexts$for(headertext)$[$headertext$]$endfor$
$endif$
$if(footertext)$
\setupfootertexts[$footertext$]
\setupfootertexts$for(footertext)$[$footertext$]$endfor$
$endif$
$if(number-sections)$
$else$

View file

@ -1,6 +1,6 @@
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
$if(fontfamily)$
\usepackage[$fontfamilyoptions$]{$fontfamily$}
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
@ -26,20 +26,20 @@ $endif$
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\newcommand{\euro}{€}
$if(mainfont)$
\setmainfont[$mainfontoptions$]{$mainfont$}
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont[$sansfontoptions$]{$sansfont$}
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
$endif$
$if(monofont)$
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$monofontoptions$$endif$]{$monofont$}
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
$endif$
$if(mathfont)$
\setmathfont(Digits,Latin,Greek)[$mathfontoptions$]{$mathfont$}
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
$endif$
$if(CJKmainfont)$
\usepackage{xeCJK}
\setCJKmainfont[$CJKoptions$]{$CJKmainfont$}
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
% use upquote if available, for straight quotes in verbatim environments
@ -54,23 +54,35 @@ $if(geometry)$
$endif$
\usepackage{hyperref}
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
\hypersetup{breaklinks=true,
unicode=true,$if(title-meta)$
pdftitle={$title-meta$},$endif$$if(author-meta)$
pdfauthor={$author-meta$},$endif$$if(subtitle)$
pdfsubject={$subtitle$},$endif$$if(keywords)$
pdfkeywords={$keywords$},$endif$
\hypersetup{unicode=true,
$if(title-meta)$
pdftitle={$title-meta$},
$endif$
$if(author-meta)$
pdfauthor={$author-meta$},
$endif$
$if(subtitle)$
pdfsubject={$subtitle$},
$endif$
$if(keywords)$
pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
$endif$
$if(colorlinks)$
colorlinks=true,
citecolor=$if(citecolor)$$citecolor$$else$black$endif$,
urlcolor=$if(urlcolor)$$urlcolor$$else$black$endif$,
linkcolor=$if(linkcolor)$$linkcolor$$else$black$endif$,
pdfborder={0 0 0}$if(hidelinks)$,
hidelinks$endif$}
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
$else$
pdfborder={0 0 0},
$endif$
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
$if(lang)$
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$$sep$,$endfor$,main=$babel-lang$]{babel}
\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$}
@ -196,7 +208,9 @@ $include-before$
$endfor$
$if(toc)$
{
$if(colorlinks)$
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
$endif$
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}