From e7f2258c8999561012479841687858870c8e3216 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Thu, 22 Oct 2015 13:35:13 -0400 Subject: Always use $for$ to allow multiple options in LaTeX/ConTeXt/Beamer. Also makes minor improvements to spacing. Adds indenting option to ConTeXt and multiple header/footer texts. --- default.context | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'default.context') diff --git a/default.context b/default.context index d4e8d29f0..519311256 100644 --- a/default.context +++ b/default.context @@ -8,31 +8,38 @@ $endif$ % Enable hyperlinks \setupinteraction [state=start, +$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=$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$] + contrastcolor=$if(linkcolor)$$linkcolor$$else$black$endif$] % 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$ -- cgit v1.2.3 From 3ed48ae68f628b787e4ba98a34e6c51834378bc9 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Mon, 9 Nov 2015 11:10:47 -0500 Subject: Make LaTeX/ConTeXt link colour optional. Prevents a conflict when base text is not black. This makes the `hidelinks` option redundant. --- default.context | 4 ++-- default.latex | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'default.context') diff --git a/default.context b/default.context index 519311256..cba3f28b7 100644 --- a/default.context +++ b/default.context @@ -21,8 +21,8 @@ $if(keywords)$ keyword={$for(keywords)$$keywords$$sep$; $endfor$}, $endif$ style=$if(style)$$style$$else$normal$endif$, - color=$if(linkcolor)$$linkcolor$$else$black$endif$, - contrastcolor=$if(linkcolor)$$linkcolor$$else$black$endif$] + color=$linkcolor$, + contrastcolor=$linkcolor$] % make chapter, section bookmarks visible when opening document \placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section] \setupinteractionscreen[option=bookmark] diff --git a/default.latex b/default.latex index 305ae9dee..33277c053 100644 --- a/default.latex +++ b/default.latex @@ -54,8 +54,7 @@ $if(geometry)$ $endif$ \usepackage{hyperref} \PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref -\hypersetup{breaklinks=true, - unicode=true, +\hypersetup{unicode=true, $if(title-meta)$ pdftitle={$title-meta$}, $endif$ @@ -68,12 +67,15 @@ $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 @@ -206,7 +208,9 @@ $include-before$ $endfor$ $if(toc)$ { +$if(colorlinks)$ \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$} +$endif$ \setcounter{tocdepth}{$toc-depth$} \tableofcontents } -- cgit v1.2.3 From 2823096cb47eb8639b43677081bb593b22f1e3ab Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Mon, 9 Nov 2015 11:35:47 -0500 Subject: Rename ConTeXt `style` to `linkstyle`. Not necessary to write `normal` to prevent links from rendering as bold. --- default.context | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'default.context') diff --git a/default.context b/default.context index cba3f28b7..45323839b 100644 --- a/default.context +++ b/default.context @@ -20,7 +20,7 @@ $endif$ $if(keywords)$ keyword={$for(keywords)$$keywords$$sep$; $endfor$}, $endif$ - style=$if(style)$$style$$else$normal$endif$, + style=$linkstyle$, color=$linkcolor$, contrastcolor=$linkcolor$] % make chapter, section bookmarks visible when opening document -- cgit v1.2.3 From e0bd757310c6dfc73dcba747c78115c1016fa90e Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Mon, 9 Nov 2015 11:37:43 -0500 Subject: Provide separate `linkcontrastcolor` in ConTeXt. --- default.context | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'default.context') diff --git a/default.context b/default.context index 45323839b..c5ad2113f 100644 --- a/default.context +++ b/default.context @@ -22,7 +22,7 @@ $if(keywords)$ $endif$ style=$linkstyle$, color=$linkcolor$, - contrastcolor=$linkcolor$] + contrastcolor=$linkcontrastcolor$] % make chapter, section bookmarks visible when opening document \placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section] \setupinteractionscreen[option=bookmark] -- cgit v1.2.3