summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sidenotes
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-02-14 23:26:59 +0000
committerKarl Berry <karl@freefriends.org>2014-02-14 23:26:59 +0000
commita4a0d07a6102faeeec5a28db70104eaa5549ecd1 (patch)
treedc4d506ebd8f25311d0a380300d4b8167c1e2ec4 /Master/texmf-dist/tex/latex/sidenotes
parent85276df4f1ff4a7de8716186b240501de96ff6df (diff)
sidenotes (14feb14)
git-svn-id: svn://tug.org/texlive/trunk@32970 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/sidenotes')
-rw-r--r--Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls20
-rw-r--r--Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty98
2 files changed, 62 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls b/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls
index 750ae562708..b1812381a5e 100644
--- a/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls
+++ b/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesFile{caesar_book.cls}[2013/12/18 v0.93 Caesar book]
+\ProvidesFile{caesar_book.cls}[2014/02/14 v0.96 Caesar book]
% Load the amsmath and the mhchem package before loading microtype
\RequirePackage{amsmath}% better math handling
\RequirePackage[version=3]{mhchem}% chemical formulas
@@ -12,10 +12,16 @@
\RequirePackage{microtype}% microtypography
\@ifpackagelater{microtype}{2011/08/18}% xxx allow LaTeX and earlier microtype
{\renewcommand{\caesar@letterspace}[1]{\textls{#1}}}%
-{\AtEndDocument{\ClassWarningNoLine{caesar_book}{Need newest microtype (beta) for letterspacing.}}}
-% Set page layout geometry -- default is epubli science-book format
-\RequirePackage[paperwidth=170mm, paperheight=240mm, left=42pt, top=40pt, textwidth=280pt, marginparsep=20pt, marginparwidth=100pt, textheight=560pt, footskip=40pt]{geometry}
-% fontsize is 10pt, 13pt for book
+{\AtEndDocument{\ClassWarningNoLine{caesar_book}{Need newest microtype for letterspacing.}}}
+%
+% Set page layout geometry -- default is science-book format
+% this means a (portrait) paper size of 170mm x 240mm
+%
+\RequirePackage{geometry}
+\geometry{paperwidth=170mm, paperheight=240mm, left=42pt, top=40pt, textwidth=280pt, marginparsep=20pt, marginparwidth=100pt, textheight=560pt, footskip=40pt}
+%
+% fontsize is 10pt with a leading (line spacing) of 13pt for book
+%
\renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%
\renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%
% fullwidth environment, text across textwidth+marginparsep+marginparwidth
@@ -44,8 +50,8 @@
\mhchemoptions{textfontcommand=\addfontfeature{Numbers=Lining}} % use lining numbers for chemical formulas
\else% in LaTeX we load fonts differently
\IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}% palatino clone for math
- \IfFileExists{helvet.sty}{\RequirePackage{helvet}}{}% helvetica is sans serif font
- \IfFileExists{beramono.sty}{\RequirePackage{beramono}}{}% beramono is tt font
+ \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{}% helvetica is sans serif font
+ \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}% beramono is tt font
\RequirePackage[T1]{fontenc}% finally load fontenc
\fi
% nice headings and TOC
diff --git a/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty b/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
index a6598e9bb1f..47596038a85 100644
--- a/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
+++ b/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
@@ -13,93 +13,93 @@
%% about the files the work consists of.
%%
\ProvidesPackage{sidenotes}[%
- 2012/04/07 v0.93 rich text in the margin for LaTeX]
-\RequirePackage{marginnote} % puts the stuff in the margin and provides an offset option instead of a float
-\RequirePackage{caption} % handles the figure caption (in the margin)
-\RequirePackage{xifthen} % provide an if command
-\RequirePackage{twoopt} % two optional arguments possible
+ 2014/02/14 v0.96a rich text in the margin for LaTeX]
+\RequirePackage{marginnote} % provides an offset option for the marginals instead of a float
+\RequirePackage{caption} % handles the captions (in the margin)
+\RequirePackage{xparse} % new LaTeX3 syntax to define macros and environments
\RequirePackage[strict]{changepage} % Changepage package for symmetric twoside handling
-\newcounter{sidenote} % make counter
-\newcounter{@sidenotes@buffer}
-\setcounter{sidenote}{1} % init counter
+\newcounter{sidenote} % make a counter
+\setcounter{sidenote}{1} % init the counter
+\ExplSyntaxOn
+\DeclareExpandableDocumentCommand{\IfNoValueOrEmptyTF}{mmm}
+{
+ \IfNoValueTF{#1}
+ {#2} % true
+ {\tl_if_empty:nTF {#1} {#2} {#3}} % false
+}
+\ExplSyntaxOff
\def\@sidenotes@ifnextchar#1#2#3{%
\let\@sidenotes@buffere #1\def\@sidenotes@buffera{#2}%
\def\@sidenotes@bufferb{#3}\futurelet\@sidenotes@bufferc\@sidenotes@ifnextchar@real}%
\def\@sidenotes@ifnextchar@real{%
\ifx\@sidenotes@bufferc \@sidenotes@buffere \let\@sidenotes@bufferd\@sidenotes@buffera%
\else\let\@sidenotes@bufferd\@sidenotes@bufferb\fi\@sidenotes@bufferd}%
-\newcommandtwoopt{\sidenote}[3][][]{%
+\NewDocumentCommand \sidenote { o o +m } {%
\sidenotemark[#1]%
\sidenotetext[#1][#2]{#3}%
\@sidenotes@ifnextchar\sidenote{\kern-0.07em\textsuperscript{,}}%
{\@sidenotes@ifnextchar\sidecite{\kern-0.07em\textsuperscript{,}}{}}%
}
-\newcommand{\sidenotemark}[1][]{%
+\NewDocumentCommand \sidenotemark { o } {%
\nobreak\hspace{0.1pt}\nobreak%
-\ifthenelse{\isempty{#1}}%
-{\textsuperscript{\thesidenote}%
-\refstepcounter{sidenote}}% if no argument is given use sidenote counter%
-{\setcounter{@sidenotes@buffer}{\value{sidenote}}%
-\setcounter{sidenote}{#1}%
-\textsuperscript{\thesidenote}% print out the argument otherwise
-\setcounter{sidenote}{\value{@sidenotes@buffer}}}%
+\IfNoValueOrEmptyTF{#1}%
+{%
+\textsuperscript{\thesidenote}%
+}% if no argument is given use sidenote counter%
+{\textsuperscript{#1}}% print out the argument otherwise
\@sidenotes@ifnextchar\sidenote{\textsuperscript{,}}{}%
\ignorespaces%
}%
-\newcommandtwoopt{\sidenotetext}[3][][]{%
-\ifthenelse{\isempty{#1}}{% sitenotemark given?
-\addtocounter{sidenote}{-1}%
-\ifthenelse{\isempty{#2}}% offset given?
+\NewDocumentCommand \sidenotetext { o o +m } {%
+\IfNoValueOrEmptyTF{#1}{% sitenotemark given?
+\IfNoValueOrEmptyTF{#2}% offset given?
{\marginpar{\textsuperscript{\thesidenote}{} #3}}%
{\marginnote{\textsuperscript{\thesidenote}{} #3}[#2]}%
-\addtocounter{sidenote}{1}}%
-{\ifthenelse{\isempty{#2}}% offset given?
+\refstepcounter{sidenote}}%
+{\IfNoValueOrEmptyTF{#2}% offset given?
{\marginpar{\textsuperscript{#1} #3}}%
{\marginnote{\textsuperscript{#1} #3}[#2]}}%
}%
\DeclareCaptionStyle{sidecaption}{font=footnotesize}
-\newcommand{\sidecaption}{\@ifstar\@sidenotes@sidecaption@starred\@sidenotes@sidecaption@unstarred}
-\newcommandtwoopt{\@sidenotes@sidecaption@unstarred}[3][][]{%
-\captionsetup{style=sidecaption}%
-\ifthenelse{\isempty{#2}}{\marginnote{\caption[#1]{#3}}}{\marginnote{\caption[#1]{#3}}[#2]}}%
-\newcommand{\@sidenotes@sidecaption@starred}[2][]{%
+\NewDocumentCommand \sidecaption {s o o m} {%
\captionsetup{style=sidecaption}%
-\ifthenelse{\isempty{#1}}{\marginnote{\caption*{#2}}}{\marginnote{\caption*{#2}}[#1]}}%
+\IfBooleanTF{#1}%is the macro starred
+{\IfNoValueOrEmptyTF{#2}%
+{\marginnote{\caption*{#4}}}%
+{\marginnote{\caption*{#4}}[#2]}%
+}% yes, starred macro
+{%
+\IfNoValueOrEmptyTF{#2}%
+{\def\@sidenotes@sidecaption@tof{#4}}%
+{\def\@sidenotes@sidecaption@tof{#2}}%
+\IfNoValueOrEmptyTF{#3}%
+{\marginnote{\caption[\@sidenotes@sidecaption@tof]{#4}}}%
+{\marginnote{\caption[\@sidenotes@sidecaption@tof]{#4}}[#3]}%
+}% no, unstarred macro
+}
\newsavebox{\@sidenotes@sidefigurebox}
-\newboolean{@sidenotes@sidefigure@skip}
-\newcommand{\@sidenotes@sidefigure@skiplength}{}
\DeclareCaptionStyle{marginfigure}{font=footnotesize}
-\newenvironment{marginfigure}[1][]%
-{\ifthenelse{\isempty{#1}}% offset?
-{\setboolean{@sidenotes@sidefigure@skip}{false}}%
-{\setboolean{@sidenotes@sidefigure@skip}{true}%
-\renewcommand{\@sidenotes@sidefigure@skiplength}{#1}}%
-\begin{lrbox}{\@sidenotes@sidefigurebox}%
+\NewDocumentEnvironment{marginfigure}{o}
+{\begin{lrbox}{\@sidenotes@sidefigurebox}%
\begin{minipage}{\marginparwidth}%
\captionsetup{type=figure,style=marginfigure}}%
{\end{minipage}%
\end{lrbox}%
-\ifthenelse{\boolean{@sidenotes@sidefigure@skip}}% offset?
-{\marginnote{\usebox{\@sidenotes@sidefigurebox}}[\@sidenotes@sidefigure@skiplength]}% offset
+\IfNoValueOrEmptyTF{#1}% offset?
{\marginpar{\usebox{\@sidenotes@sidefigurebox}}}% no offset
+{\marginnote{\usebox{\@sidenotes@sidefigurebox}}[#1]}% offset
}
\newsavebox{\@sidenotes@margintablebox}
-\newboolean{@sidenotes@margintable@skip}
-\newcommand{\@sidenotes@margintable@skiplength}{}
\DeclareCaptionStyle{margintable}{font=footnotesize}
-\newenvironment{margintable}[1][]%
-{\ifthenelse{\isempty{#1}}%
-{\setboolean{@sidenotes@margintable@skip}{false}}%
-{\setboolean{@sidenotes@margintable@skip}{true}%
-\renewcommand{\@sidenotes@margintable@skiplength}{#1}}%
-\begin{lrbox}{\@sidenotes@margintablebox}%
+\NewDocumentEnvironment{margintable}{o}
+{\begin{lrbox}{\@sidenotes@margintablebox}%
\begin{minipage}{\marginparwidth}%
\captionsetup{type=table,style=margintable}}%
{\end{minipage}%
\end{lrbox}%
-\ifthenelse{\boolean{@sidenotes@margintable@skip}}%
-{\marginnote{\usebox{\@sidenotes@margintablebox}}[\@sidenotes@margintable@skiplength]}%
+\IfNoValueOrEmptyTF{#1}% offset?
{\marginpar{\usebox{\@sidenotes@margintablebox}}} %
+{\marginnote{\usebox{\@sidenotes@margintablebox}}[#1]}%
}%
\AtBeginDocument{%
\newlength{\@sidenotes@extrawidth}