summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sidenotes
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-12-18 22:01:25 +0000
committerKarl Berry <karl@freefriends.org>2013-12-18 22:01:25 +0000
commit6b143eea98b60a128b535e6b84043e76b4798569 (patch)
tree91dc539527d7d75ab09d02d9f232238296c6b002 /Master/texmf-dist/tex/latex/sidenotes
parent51dd85fd0039ad102b4c0551cefc94c2dc7b46c0 (diff)
sidenotes (18dec13)
git-svn-id: svn://tug.org/texlive/trunk@32439 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.cls132
-rw-r--r--Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty19
2 files changed, 144 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls b/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls
new file mode 100644
index 00000000000..750ae562708
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/sidenotes/caesar_book.cls
@@ -0,0 +1,132 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{caesar_book.cls}[2013/12/18 v0.93 Caesar book]
+% Load the amsmath and the mhchem package before loading microtype
+\RequirePackage{amsmath}% better math handling
+\RequirePackage[version=3]{mhchem}% chemical formulas
+\LoadClassWithOptions{book}% this is derived from the book class
+\RequirePackage{sidenotes}% put annotations, tables and figures in the margin
+\captionsetup{font=footnotesize, skip=4pt}
+\RequirePackage[maxfloats=45]{morefloats}% a lot of marginals need more float 'memory'
+\RequirePackage{marginfix}% automatically adjust the side-floats nicely
+\newcommand{\caesar@letterspace}[1]{#1}% allow LuaLaTeX, LaTeX letterspacing
+\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
+\renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%
+\renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%
+% fullwidth environment, text across textwidth+marginparsep+marginparwidth
+\newlength{\overhang}
+\setlength{\overhang}{\marginparwidth}
+\addtolength{\overhang}{\marginparsep}
+%
+\newenvironment{fullwidth}
+ {\ifthenelse{\boolean{@twoside}}%
+ {\begin{adjustwidth*}{}{-\overhang}}%
+ {\begin{adjustwidth}{}{-\overhang}}%
+ }%
+ {\ifthenelse{\boolean{@twoside}}%
+ {\end{adjustwidth*}}%
+ {\end{adjustwidth}}%
+ }
+% set up the fonts
+\RequirePackage{ifluatex}
+\ifluatex% in LuaLateX we use fontspec
+ \RequirePackage{fontspec}%
+ \RequirePackage[vargreek-shape=TeX]{unicode-math}%
+ \setmathfont{Asana-Math.otf}% asana math works well with palatino
+ \setmainfont[Ligatures=TeX, Numbers=OldStyle]{Tex Gyre Pagella}% free Palatino clone
+ \setmonofont{Tex Gyre Cursor}% works okay with palatino
+ \setsansfont{Tex Gyre Heros}% work okay with palatino
+ \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
+ \RequirePackage[T1]{fontenc}% finally load fontenc
+\fi
+% nice headings and TOC
+\RequirePackage{titlesec,titletoc}% load the helper package
+\setcounter{secnumdepth}{-1}% no numbering at all
+\titleformat{\chapter}[display]{\relax\itshape\huge}{}{0pt}{\huge\rmfamily\itshape}[]% chapter format
+\titleformat{\section}[hang]{\normalfont\Large\itshape}{}{1em}{}[]% section format
+\titleformat{\subsection}[hang]{\normalfont\large\itshape}{}{1em}{}[]% subsection format
+\titleformat{\paragraph}[runin]{\normalfont\itshape}{}{1em}{}[]% paragraph format
+\renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\em #1}% italic description instead of bold)
+\setcounter{tocdepth}{0}% The Table of Contents, only chapters
+\titlecontents{chapter}%
+ [0em] % distance from left margin
+ {\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry)
+ {\hspace*{0em}\contentslabel{2em}} % before w/label (label = ``2'')
+ {\hspace*{0em}} % before w/o label
+ {\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
+ [\end{fullwidth}] % after
+%set up header, footer and page numbering
+\RequirePackage{fancyhdr}% helper package
+\renewcommand{\headrulewidth}{0pt}% The running heads and feet do not have rules
+\renewcommand{\footrulewidth}{0pt}
+\fancyhf{}% set up the page numbering
+{\fancyfoot[LE,RO]{\thepage}}
+\fancypagestyle{plain}{%
+ \fancyhf{}
+}
+\renewcommand{\frontmatter}{\pagestyle{empty}}% the frontmatter is empty
+\renewcommand{\mainmatter}{\cleardoublepage\pagestyle{fancy}}% mainmatter with page numbering
+\RequirePackage{ragged2e} % \RaggedRight works better than \raggedright
+\newcommand{\marginparstyle}{\footnotesize\RaggedRight} % initialize style with start value
+\long\def\@ympar#1{% redefine margin par to avoid too many macros in the document
+ \@savemarbox\@marbox{\marginparstyle#1}% marginparstyle is a prefix to the marginpar text now
+ \global\setbox\@currbox\copy\@marbox % the rest of the definition is taken from original LaTeX
+ \@xympar}
+\renewcommand*{\marginfont}{\marginparstyle}
+% setup itemize and enumerate
+\RequirePackage{enumitem}
+\setlist[itemize]{leftmargin=*}
+%\renewcommand{\labelitemi}{}
+% compatibility with T-L
+%
+% titlepage
+\newcommand{\publisher}[1]{\gdef\caesar@publisher{#1}}
+\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
+\RequirePackage{color} % the title is too black, define gray
+\definecolor{darkgray}{rgb}{0.25,0.25,0.25}
+\newcommand{\maketitlepage}{% the title page is generated here
+ % first count the number of lines in the title
+ \setbox0\vbox{\noindent\fontsize{30}{38}\selectfont\caesar@letterspace{\MakeTextUppercase{\@title}}\par
+ \count@\z@
+ \loop
+ \unskip\unpenalty\unskip\unpenalty\unskip
+ \setbox0\lastbox
+ \ifvoid0
+ \xdef\caesar@numlines{\the\count@}%
+ \else
+ \advance\count@\@ne
+ \repeat}
+ % now adjust the vertical spaces accordingly
+ \edef\caesar@titlespace{\the\dimexpr 210pt - 15pt * \caesar@numlines \relax}% calculate the necessary space
+ \cleardoublepage%
+ \begingroup%
+ {%
+ \sffamily%
+ \begin{fullwidth}%
+ \vspace*{0em}% one line extra space
+ \LARGE\caesar@letterspace{\MakeTextUppercase{\@author}}\par
+ \vfill%
+ \noindent\fontsize{30}{38}\selectfont\textcolor{darkgray}{\caesar@letterspace{\MakeTextUppercase{\@title}}}\par
+ \vfill%
+ \vspace{\caesar@titlespace}%
+ \Large\noindent\caesar@letterspace{\MakeTextUppercase{\caesar@publisher}}\par
+ \end{fullwidth}%
+ }%
+ \endgroup%
+ \thispagestyle{empty}%
+ \clearpage%
+}
+\newcommand\newthought[1]{%
+ \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
+ \noindent\textsc{#1}%
+}%
+\newcommandtwoopt{\sidecite}[3][][]{\sidenote{\fullcite[#1][#2]{#3}}}
diff --git a/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty b/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
index f0cbb66dc4e..a6598e9bb1f 100644
--- a/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
+++ b/Master/texmf-dist/tex/latex/sidenotes/sidenotes.sty
@@ -13,7 +13,7 @@
%% about the files the work consists of.
%%
\ProvidesPackage{sidenotes}[%
- 2012/11/09 v0.92 rich text in the margin for LaTeX]
+ 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
@@ -22,12 +22,17 @@
\newcounter{sidenote} % make counter
\newcounter{@sidenotes@buffer}
\setcounter{sidenote}{1} % init counter
-
+\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][][]{%
\sidenotemark[#1]%
\sidenotetext[#1][#2]{#3}%
-\@ifnextchar\sidenote{\kern-0.07em\textsuperscript{,}}%
-{\@ifnextchar\sidecite{\kern-0.07em\textsuperscript{,}}{ }}%
+\@sidenotes@ifnextchar\sidenote{\kern-0.07em\textsuperscript{,}}%
+{\@sidenotes@ifnextchar\sidecite{\kern-0.07em\textsuperscript{,}}{}}%
}
\newcommand{\sidenotemark}[1][]{%
\nobreak\hspace{0.1pt}\nobreak%
@@ -38,7 +43,7 @@
\setcounter{sidenote}{#1}%
\textsuperscript{\thesidenote}% print out the argument otherwise
\setcounter{sidenote}{\value{@sidenotes@buffer}}}%
-\@ifnextchar\sidenote{\textsuperscript{,}}{}%
+\@sidenotes@ifnextchar\sidenote{\textsuperscript{,}}{}%
\ignorespaces%
}%
\newcommandtwoopt{\sidenotetext}[3][][]{%
@@ -49,8 +54,8 @@
{\marginnote{\textsuperscript{\thesidenote}{} #3}[#2]}%
\addtocounter{sidenote}{1}}%
{\ifthenelse{\isempty{#2}}% offset given?
-{\marginpar{\textsuperscript{#1} #3}}
-{\marginnote{\textsuperscript{#1} #3}[#2]}}
+{\marginpar{\textsuperscript{#1} #3}}%
+{\marginnote{\textsuperscript{#1} #3}[#2]}}%
}%
\DeclareCaptionStyle{sidecaption}{font=footnotesize}
\newcommand{\sidecaption}{\@ifstar\@sidenotes@sidecaption@starred\@sidenotes@sidecaption@unstarred}