diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-11 20:24:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-11 20:24:29 +0000 |
commit | e5ce0cde7b90ac10f3f1e87757282a7086e2645f (patch) | |
tree | 13a72c4d52a6bf1fcdf2177799fde412516d8a08 /Master/texmf-dist/tex/latex/phfnote | |
parent | 191b3e8d3780e596eeccd450cefa620fb5e73c08 (diff) |
phfnote (11oct21)
git-svn-id: svn://tug.org/texlive/trunk@60733 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/phfnote')
-rw-r--r-- | Master/texmf-dist/tex/latex/phfnote/phfnote.sty | 998 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/phfnote/phfnotepreset-xpkgdoc.def | 251 |
2 files changed, 853 insertions, 396 deletions
diff --git a/Master/texmf-dist/tex/latex/phfnote/phfnote.sty b/Master/texmf-dist/tex/latex/phfnote/phfnote.sty index 7c2590f1b9d..f445b7d1ff3 100644 --- a/Master/texmf-dist/tex/latex/phfnote/phfnote.sty +++ b/Master/texmf-dist/tex/latex/phfnote/phfnote.sty @@ -8,7 +8,7 @@ %% %% This is a generated file. %% -%% Copyright (C) 2016 by Philippe Faist <philippe.faist@bluewin.ch> +%% Copyright (C) 2016 by Philippe Faist, philippe.faist@bluewin.ch %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3 of this license @@ -22,33 +22,29 @@ %% \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{phfnote} - [2016/08/15 v1.0 phfnote package] + [2021/10/08 v4.0 phfnote package] \RequirePackage{xkeyval} \RequirePackage{kvoptions} \RequirePackage{etoolbox} +\RequirePackage{xparse} \def\phfnote@internal@execattribs#1#2#3{% \@for\next:=#3\do{% \ifcsname #1\next\endcsname% \csname #1\next\endcsname% \else% - \PackageWarning{phfnote}{Unknown #2: '\next'. Ignoring.} + \PackageError{phfnote}{Unknown #2: '\next'. Ignoring.}{The given #2 '\next' + is invalid. Consult the package documentation for information about + valid attributes.} \fi } } -\newcommand{\notetitlefont}{\sffamily\bfseries} -\newcommand{\notetitleauthorfont}{} -\newcommand{\notetitledatefont}{\footnotesize} +\newcommand{\notetitlefont}[1]{\sffamily\bfseries #1} +\newcommand{\notetitleauthorfont}[1]{#1} +\newcommand{\notetitledatefont}[1]{\footnotesize #1} \newcommand{\notetitlebelowspace}{4mm} \newcommand{\notetitletopspace}{-1.2cm} \newcommand{\notetitlehrule}{\hrule} \long\def\notetitle@title#1{\long\gdef\@title{#1}} -\def\phfnote@title@checksetspace#1{% - \ifdefined\singlespace\else% - \PackageError{phfnote}{Note title style `#1' requires the - `setspace' package to be loaded! Please load it, or use a - pkgset which loads it automatically}% - \fi% -} \def\phfnote@setupthanksmpfootnote{% \def\thempfootnote{\arabic{mpfootnote}}% \let\footnoterule\relax% @@ -64,14 +60,22 @@ }% \def\thanksmark[##1]{\phfnote@mympfootnotemark{##1}}% } -\def\phfnote@finalizempfootnotes{% - \global\setbox\@mpfootins=\vbox{% - \parskip=0pt\parindent=0pt\parshape 1 0.04\textwidth 0.96\textwidth\relax% - \noindent\leavevmode% - \reset@font\footnotesize% - \phfnote@fmt@titlefootnotes% - \phfnote@mpfootmaterial}% +\def\phfnote@finalizempfootnotes#1{% + \if\relax\detokenize\expandafter{\phfnote@mpfootmaterial}\relax + \else + \global\skip\@mpfootins=#1\relax + \global\setbox\@mpfootins=\vbox{% + \parskip=\z@\relax + \parindent=\z@\relax + \phfnote@mpfootnotes@fontparsetup + \noindent\leavevmode% + \reset@font\footnotesize% + \phfnote@fmt@titlefootnotes% + \phfnote@mpfootmaterial}% + \fi } +\def\phfnote@mpfootnotes@fontparsetup{% + \parshape 1 0.04\textwidth 0.96\textwidth\relax} \def\phfnote@fmt@titlefootnotes{} \def\phfnote@mympfootnotemark#1{\@textsuperscript{\normalfont#1}} \def\phfnote@mpfootnoteglue{\hskip 1.2em plus 2em minus 0.5em\relax} @@ -87,11 +91,122 @@ \protected@xdef\@thanks{\@thanks\protect\footnotetext[#1]{#2}}% \fi% } +\newcommand\notetitleinnervsep{1.15ex} +\def\notetitlewidth{\textwidth} +\def\notetitleparskip{1.4ex}% parskip for multiple pars in main title +\def\notetitlefontparsetup{\raggedright\setstretch{1.05}\Large} +\def\notetitleaftertitleskip{% + \ifnotetitle@default@ismultipar + \vspace{\parskip}% + %\gdef\phfnote@tmp@nextskip{\z@}% + \gdef\phfnote@tmp@nextskip{0.5\dimexpr\notetitleinnervsep\relax}% + \else + \gdef\phfnote@tmp@nextskip{\notetitleinnervsep}% + \fi +} +\def\notetitleauthorfontparsetup{% + \notetitledonextvskip[2]% + \parshape 1 0.04\textwidth 0.96\textwidth\relax + \strut +} +\def\notetitledatefontparsetup{% + \notetitledonextvskip + \parshape 1 0.04\textwidth 0.96\textwidth\relax + \strut +} +\newcommand\notetitledonextvskip[1][]{% + \vspace{#1\dimexpr\phfnote@tmp@nextskip\relax}% + \gdef\phfnote@tmp@nextskip{\notetitleinnervsep}% +} +\newcommand\notetitlemakecontents{ + \notetitlemakecontentstop + {\par + \let\phfnote@old@par\par + \notetitle@titledefault@preparetitle + \expandafter\notetitlefontparsetup\expandafter{% + \expandafter\notetitlefont\expandafter{\@title}}% + \phfnote@old@par + \notetitleaftertitleskip + }% + \if\relax\detokenize\expandafter{\@author}\relax\else + \expandafter\notetitleauthorfontparsetup\expandafter{% + \expandafter\notetitleauthorfont\expandafter{\@author}}\par + \fi + \if\relax\detokenize\expandafter{\@date}\relax\else + \expandafter\notetitledatefontparsetup\expandafter{% + \expandafter\notetitledatefont\expandafter{\@date}}\par + \fi + \notetitlemakecontentsbottom +} +\def\notetitlemakecontentstop{} +\def\notetitlemakecontentsbottom{} +\def\notetitlebeginrender{\begin{minipage}{\notetitlewidth}} +\def\notetitleendrender{\end{minipage}} +\newcommand\notetitleusemainbox[1]{% + \par + \box#1% + \vspace*{\notetitleinnervsep}% + \notetitlehrule\relax +} +\newsavebox\notetitle@default@mainbox +\newif\ifnotetitle@default@usesavebox +\notetitle@default@usesaveboxtrue +\newif\ifnotetitleusempfootnotes +\notetitleusempfootnotestrue +\def\notetitle@default@setup{% + \notetitle@default@ismultiparfalse + \gdef\phfnote@tmp@nextskip{\z@}% + \par\raggedright} \newcommand{\notetitle@style@default}{% + \begingroup + \parskip=\z@\relax + \parindent=\z@\relax + \providecommand\singlespace{}% + \notetitle@default@setup + \ifnotetitleusempfootnotes + \phfnote@setupthanksmpfootnote + \fi + \vspace*{\notetitletopspace}% + \def\x{}% + \ifnotetitle@default@usesavebox + \def\x{\setbox\notetitle@default@mainbox=\hbox\bgroup} + \fi + \x\notetitlebeginrender + \begingroup + \singlespace% + \notetitlemakecontents\par + \ifnotetitleusempfootnotes + \expandafter\ifstrequal\expandafter{\@mpfn}{mpfootnote}{}{% + \PackageError{phfnote}{phfnote title: can only have + 'usempfootnotes' in a minipage}{Make sure you open a + \string\begin{minipage} in the definition of + \string\notetitlebeginrender \space and correspondingly close + it with \string\end{minipage} in \string\notetitleendrender}% + } + \global\let\@thanks\@empty + \phfnote@finalizempfootnotes{\phfnote@tmp@nextskip}% + \fi + \endgroup + \notetitleendrender + \def\x{}% + \ifnotetitle@default@usesavebox + \def\x{\egroup + \notetitleusemainbox{\notetitle@default@mainbox}}% + \fi + \x + \par + \endgroup + \vskip\notetitlebelowspace\relax% don't change this, abstract needs to \removelastskip +} +\newif\ifnotetitle@default@ismultipar +\newcommand\notetitle@titledefault@preparetitle{% + \def\par{\phfnote@old@par\global\notetitle@default@ismultipartrue}% + \leavevmode\parskip=\notetitleparskip\relax} +\csdef{notetitle@style@defaultv1}{% \begingroup\par\raggedright% \phfnote@setupthanksmpfootnote% \vspace*{\notetitletopspace}% - \phfnote@title@checksetspace{default}% + \phfnote@title@checksetspace{defaultv1}% \begin{minipage}{\textwidth}% \begin{singlespace}% \parskip=0pt\parindent=0pt\relax% @@ -113,7 +228,7 @@ \vskip 2mm\relax% \fi \global\let\@thanks\@empty% - \phfnote@finalizempfootnotes% + \csname phfnote@finalizempfootnotes@v1\endcsname% \end{singlespace}% \end{minipage}\par% \vspace*{2mm}% @@ -122,19 +237,187 @@ \endgroup% \vskip\notetitlebelowspace\relax% don't change this, abstract needs to \removelastskip } -\newcommand{\notetitle@style@small}{% +\csdef{phfnote@finalizempfootnotes@v1}{% + \global\setbox\@mpfootins=\vbox{% + \parskip=0pt\parindent=0pt\parshape 1 0.04\textwidth 0.96\textwidth\relax% + \noindent\leavevmode% + \reset@font\footnotesize% + \phfnote@fmt@titlefootnotes% + \phfnote@mpfootmaterial}% +} +\def\phfnote@title@checksetspace#1{% + \ifdefined\singlespace\else% + \PackageError{phfnote}{Note title style `#1' requires the + `setspace' package to be loaded! Please load it, or use a + pkgset which loads it automatically}{}% + \fi% +} +\let\notetitle@style@pretty\notetitle@style@default +\cslet{notetitle@style@pretty2}\notetitle@style@default +\def\notetitle@stylesetup@pretty{% + \RequirePackage{xcolor} + \long\def\notetitlefont##1{\bfseries ##1} + \def\notetitlefontparsetup{% + \color{notetitleprettytextcolor}\centering} + \def\notetitleauthorfontparsetup{% + \notetitledonextvskip[2]% + \color{notetitleprettytextcolor}\centering} + \def\notetitledatefontparsetup{% + \notetitledonextvskip + \color{notetitleprettytextcolor}\centering} + \def\phfnote@mpfootnotes@fontparsetup{\color{notetitleprettytextcolor}} + % + \def\notetitlewidth{\dimexpr\textwidth + -\notetitleprettylsiderulewidth + -\notetitleprettyrsiderulewidth + -\notetitleprettylsidespacewidth + -\notetitleprettyrsidespacewidth\relax} + \let\notetitleusemainbox\notetitle@pretty@usemainbox + % + \def\notetitleprettylsiderulewidth{10pt} + \def\notetitleprettylsidespacewidth{10pt} + \def\notetitleprettyrsiderulewidth{10pt} + \def\notetitleprettyrsidespacewidth{10pt} + \def\notetitleprettytopspace{10pt} + \def\notetitleprettybottomspace{10pt} + \def\notetitleprettytophrulewidth{0pt} + \def\notetitleprettybottomhrulewidth{0pt} + % + \definecolor{notetitleprettylsiderulecolor}{RGB}{0,68,126} + \colorlet{notetitleprettyrsiderulecolor}{notetitleprettylsiderulecolor} + \colorlet{notetitleprettytophrulecolor}{notetitleprettylsiderulecolor} + \colorlet{notetitleprettybottomhrulecolor}{notetitleprettylsiderulecolor} + \definecolor{notetitleprettytextcolor}{RGB}{25,25,38} + \colorlet{notetitleprettybgcolor}{white} +} +\newlength\notetitle@pretty@tmplenht +\newlength\notetitle@pretty@tmplendp +\def\notetitle@pretty@usemainbox#1{% + \parskip=\z@\relax + \parindent=\z@\relax + \notetitle@pretty@tmplenht=\ht#1\relax% + \notetitle@pretty@tmplendp=\dp#1\relax% + \edef\tmp@dorule##1##2{% + {\noexpand\color{notetitlepretty##1siderulecolor}% + \noexpand\rule{##2}{% + \dimexpr \notetitleprettytopspace+ + \notetitleprettybottomspace+ + \notetitleprettytophrulewidth+ + \notetitleprettybottomhrulewidth+ + \notetitle@pretty@tmplendp+ + \notetitle@pretty@tmplenht\relax}}}% + \fboxsep=0pt% for \colorbox + \par\hbox to \textwidth{% + \hskip 0pt plus 0.1fil minus 0.1fil\relax% + \tmp@dorule{l}{\notetitleprettylsiderulewidth}% + \colorbox{notetitleprettybgcolor}{% + \vbox{% + {\color{notetitleprettytophrulecolor}% + \hrule height \notetitleprettytophrulewidth\relax}% + \hbox{% + \hskip \notetitleprettylsidespacewidth\relax + % \fbox% DEBUG + {\vbox{\vskip \notetitleprettytopspace\relax + \box#1% + \vskip \notetitleprettybottomspace\relax}}% + \hskip \notetitleprettyrsidespacewidth\relax + }% + {\color{notetitleprettybottomhrulecolor}% + \hrule height \notetitleprettybottomhrulewidth\relax}% + }}% + \tmp@dorule{r}{\notetitleprettyrsiderulewidth}% + \hskip 0pt plus 0.1fil minus 0.1fil\relax}% + \par% +} +\csdef{notetitle@stylesetup@pretty2}{% + \notetitle@stylesetup@pretty + % + \definecolor{notetitleprettylsiderulecolor}{RGB}{0,68,126} + \colorlet{notetitleprettyrsiderulecolor}{notetitleprettylsiderulecolor} + \colorlet{notetitleprettytophrulecolor}{notetitleprettylsiderulecolor} + \colorlet{notetitleprettybottomhrulecolor}{notetitleprettylsiderulecolor} + \colorlet{notetitleprettytextcolor}{notetitleprettylsiderulecolor!50!black} + \colorlet{notetitleprettybgcolor}{white!95!notetitleprettytextcolor} + % + \def\notetitleprettytophrulewidth{.4pt} + \def\notetitleprettybottomhrulewidth{.4pt} +} +\let\notetitle@style@small\notetitle@style@default +\newcommand\notetitle@stylesetup@small{% + \notetitleusempfootnotesfalse + % + \def\notetitlemakecontents{% + {\expandafter\notetitlefont\expandafter{\@title}}% + \hfill\makebox{\fontsize{9pt}{10pt}\selectfont + \notetitle@small@renderauthordate}% + } + %\notetitle@default@usesaveboxfalse + %\def\notetitlebeginrender{\par} + %\def\notetitleendrender{% + % \vspace*{\notetitleinnervsep}\notetitlehrule\relax\vspace*{\notetitleinnervsep}} + \def\notetitleusemainbox##1{% + \par\box##1% + \vspace*{\notetitleinnervsep}\notetitlehrule\relax\vspace*{\notetitleinnervsep}} + \def\notetitle@small@renderauthordate{% + \expandafter\notblank\expandafter{\@author}{% + \expandafter\notblank\expandafter{\@date}{% both not blank + {\expandafter\notetitleauthorfont\expandafter{\@author}}% + \notetitlesmallauthordatesep + {\emph{\expandafter\notetitledatefont\expandafter{\@date}}}% + }{% only author + {\expandafter\notetitleauthorfont\expandafter{\@author}}% + }% + }{% only date + {\emph{\expandafter\notetitledatefont\expandafter{\@date}}}% + }} + % + \def\notetitleinnervsep{1mm} + \def\notetitlesmallauthordatesep{\hspace*{2mm}--\hspace*{2mm}} +} +\csdef{notetitle@style@smallv1}{% \begingroup\par\raggedright% \let\footnote\thanks% \vspace*{\notetitletopspace}% - {\notetitlefont \@title}% - \hfill\makebox{\fontsize{9pt}{10pt}\selectfont {\notetitleauthorfont \@author}% - \hspace*{2mm}--\hspace*{2mm}{\emph{\notetitledatefont \@date}}}% + {\expandafter\notetitlefont\expandafter{\@title}}% + \hfill\makebox{\fontsize{9pt}{10pt}\selectfont + {\expandafter\notetitleauthorfont\expandafter{\@author}}% + \hspace*{2mm}--\hspace*{2mm}{\emph{\expandafter\notetitledatefont\expandafter{\@date}}}}% \vspace*{1mm}\notetitlehrule\relax\vspace*{1mm}% \par% \endgroup% \vskip\notetitlebelowspace\relax% don't change this, abstract needs to \removelastskip } -\newcommand{\notetitle@style@article}{% +\let\notetitle@style@article\notetitle@style@default +\newcommand{\notetitle@stylesetup@article}{ + %\def\notetitletopspace{-3em} + \def\notetitlebottomspace{2.5em} + \def\notetitleinnervsep{1.5em} + \def\notetitlefont{} + \def\notetitlefontparsetup{% + \LARGE\centering} + \long\def\notetitleauthorfontparsetup##1{% + \notetitledonextvskip% + {\large\centering + \lineskip .5em\relax% + \begin{tabular}[t]{c}% + ##1% + \end{tabular}\par}} + \long\def\notetitleauthorfont##1{\large ##1} + \def\notetitledatefontparsetup{% + \notetitledonextvskip + \centering} + \def\phfnote@mpfootnotes@fontparsetup{} + \def\notetitleusemainbox##1{% + \par + \box##1% + } + \appto\notetitle@default@setup{% + %\def\singlespace{}% + } + % + \notetitleusempfootnotesfalse +} +\csdef{notetitle@style@articlev1}{% \vspace*{-3em}% \begingroup \centering @@ -154,21 +437,27 @@ \vskip 2.5em\relax% } \def\phfnote@do@notetitle#1{ - \if\relax\detokenize\expandafter{#1}\relax - \else - \ifcsname notetitle@style@#1\endcsname - \def\phfnote@tmp@titsty{#1}% + \ifstrequal{#1}{false}{}{% + \if\relax\detokenize\expandafter{#1}\relax \else - \PackageError{phfnote}{Unknown title style: '#1'.}{Unknown title - style: '#1'. Please consult the package documentation for available - styles.} - \def\phfnote@tmp@titsty{default}% + \ifcsname notetitle@style@#1\endcsname + \def\phfnote@tmp@titsty{#1}% + \else + \PackageError{phfnote}{Unknown title style: '#1'.}{Unknown title + style: '#1'. Please consult the package documentation for available + styles.} + \def\phfnote@tmp@titsty{default}% + \fi + \let\title\notetitle@title + \let\thanks\notetitle@thanks + \let\thanksmark\notetitle@thanksmark + \def\@author{}% + \ifcsname notetitle@stylesetup@\phfnote@tmp@titsty\endcsname + \csname notetitle@stylesetup@\phfnote@tmp@titsty\endcsname + \fi + \def\@maketitle{\csname notetitle@style@\phfnote@tmp@titsty\endcsname}% \fi - \let\title\notetitle@title - \let\thanks\notetitle@thanks - \let\thanksmark\notetitle@thanksmark - \def\@maketitle{\csname notetitle@style@\phfnote@tmp@titsty\endcsname} - \fi + }% } \let\notedefaultabstract\abstract \let\endnotedefaultabstract\endabstract @@ -227,10 +516,12 @@ \def\noteabstract@attr@it{% \g@addto@macro\noteabstracttextfont{\itshape}% } -\def\phfnote@do@noteabstract#1{ - \let\abstract\noteabstract - \let\endabstract\endnoteabstract - \phfnote@internal@execattribs{noteabstract@attr@}{abstract attribute}{#1} +\def\phfnote@do@noteabstract#1{% + \ifstrequal{#1}{false}{}{% + \let\abstract\noteabstract + \let\endabstract\endnoteabstract + \phfnote@internal@execattribs{noteabstract@attr@}{abstract attribute}{#1} + }% } \def\phfnote@pagegeomstyle@default{ \if@twocolumn @@ -280,6 +571,20 @@ \else % fix the margins a bit to make text wider \ifcase\@ptsize% mods for 10 pt + \PassOptionsToPackage{hmargin=1in,vmargin=1in}{geometry}% + \or% mods for 11 pt + \PassOptionsToPackage{hmargin=1in,vmargin=1in}{geometry}% + \or% mods for 12 pt + \PassOptionsToPackage{hmargin=0.75in,vmargin=1in}{geometry}% + \fi% + \fi +} +\csdef{phfnote@pagegeomstyle@xwidev1}{ + \if@twocolumn + \PassOptionsToPackage{hmargin=0.5in,vmargin=0.5in,includeheadfoot}{geometry}% + \else + % fix the margins a bit to make text wider + \ifcase\@ptsize% mods for 10 pt \PassOptionsToPackage{hmargin=1in,vmargin=1.25in}{geometry}% \or% mods for 11 pt \PassOptionsToPackage{hmargin=1in,vmargin=1.25in}{geometry}% @@ -302,45 +607,50 @@ \fi% \fi } -\newcommand{\phfnote@do@pagegeomdefs}[1]{ - \ifcsname phfnote@pagegeomstyle@#1\endcsname - \csname phfnote@pagegeomstyle@#1\endcsname - \else - \PackageWarning{phfnote}{Unknown page geometry style: `#1'!} - \fi - - \RequirePackage{geometry}% -} -\def\phfnote@do@spacing{ - \@ifpackageloaded{setspace}{ - \def\phfnote@dostretch##1{% - \setstretch{##1}\phfnote@docaptionstretch{##1}} - }{ - \def\phfnote@dostretch##1{% - \renewcommand\baselinestretch{##1}\phfnote@docaptionstretch{##1}} - } - \@ifpackageloaded{caption}{ - \def\phfnote@docaptionstretch##1{\captionsetup{font={stretch=##1}}} - }{ - \def\phfnote@docaptionstretch##1{\PackageWarning{phfnote}{Can't - set line spacing for captions, because the package `caption' - is not loaded. Please load it before `phfnote', or use an - appropriate (e.g. `rich') pkgset which loads this package - automatically .}} - } - \if@twocolumn - \phfnote@dostretch{1.0} % leave default - \emergencystretch=3em\relax - \else - \ifcase\@ptsize% 10pt - \phfnote@dostretch{1.1} - \or% 11pt - \phfnote@dostretch{1.0} % 1.05? better 1.0... - \or% 12pt - \phfnote@dostretch{1.0} % 1.03? not really noticeable... +\newcommand{\phfnote@do@pagegeom}[1]{ + \ifstrequal{#1}{false}{}{% + \message{phfnote: Setting page geometry style #1}% + \ifcsname phfnote@pagegeomstyle@#1\endcsname + \csname phfnote@pagegeomstyle@#1\endcsname + \else + \PackageWarning{phfnote}{Unknown page geometry style: `#1'!}% \fi - \emergencystretch=6em\relax - \fi + % + \RequirePackage{geometry}% + }% +} +\def\phfnote@do@spacingdefs#1{ + \ifstrequal{#1}{false}{}{% + \@ifpackageloaded{setspace}{ + \def\phfnote@dostretch##1{% + \setstretch{##1}\phfnote@docaptionstretch{##1}} + }{ + \def\phfnote@dostretch##1{% + \renewcommand\baselinestretch{##1}\phfnote@docaptionstretch{##1}} + } + \@ifpackageloaded{caption}{ + \def\phfnote@docaptionstretch##1{\captionsetup{font={stretch=##1}}} + }{ + \def\phfnote@docaptionstretch##1{\PackageWarning{phfnote}{Can't + set line spacing for captions, because the package `caption' + is not loaded. Please load it before `phfnote', or use an + appropriate pkgset (e.g. `rich') which loads this package + automatically.}} + } + \if@twocolumn + \phfnote@dostretch{1.0} % leave default + \emergencystretch=3em\relax + \else + \ifcase\@ptsize% 10pt + \phfnote@dostretch{1.1} + \or% 11pt + \phfnote@dostretch{1.0} % 1.05? better 1.0... + \or% 12pt + \phfnote@dostretch{1.0} % 1.03? not really noticeable... + \fi + \emergencystretch=6em\relax + \fi + } } \def\phfnote@par@original{% } @@ -357,11 +667,13 @@ \parskip=0.8em plus 0.2em minus 0.1em\relax } \def\phfnote@do@par#1{% - \ifcsname phfnote@par@#1\endcsname - \csname phfnote@par@#1\endcsname - \else - \PackageWarning{phfnote}{Bad paragraph setting: #1. Leaving original} - \fi + \ifstrequal{#1}{false}{}{% + \ifcsname phfnote@par@#1\endcsname + \csname phfnote@par@#1\endcsname + \else + \PackageWarning{phfnote}{Bad paragraph setting: #1. Leaving original} + \fi + } } \newcommand{\notesectionallfont}{% \fontfamily{\notesectionallfontfamily}\fontseries{bx}\selectfont} @@ -433,7 +745,9 @@ } } \def\phfnote@do@secfmt#1{% - \phfnote@internal@execattribs{phfnote@do@secfmt@}{section formatting preset}{#1} + \ifstrequal{#1}{false}{}{% + \phfnote@internal@execattribs{phfnote@do@secfmt@}{section formatting preset}{#1}% + } } \def\phfnote@do@pkgset@none{ } @@ -449,6 +763,11 @@ } +\def\phfnote@internal@setifxeorlua#1#2{% + \ifXeTeX\let#1#2\fi + \ifLuaTeX\let#1#2\fi +} + \def\phfnote@do@pkgset@rich{ \phfnote@do@pkgset@minimal @@ -456,18 +775,28 @@ \RequirePackage{setspace} \RequirePackage{caption} - \RequirePackage{microtype} - \PassOptionsToPackage{shortlabels}{enumitem} \RequirePackage{enumitem} \RequirePackage{graphicx} - \PassOptionsToPackage{T1}{fontenc} - \RequirePackage{fontenc} + \def\phfnote@tmp@requireinputencfontenc{ + \@ifpackageloaded{fontenc}{}{ + \PassOptionsToPackage{T1}{fontenc} + \RequirePackage{fontenc} + } + \@ifpackageloaded{inputenc}{}{ + \PassOptionsToPackage{utf8}{inputenc} + \RequirePackage{inputenc} + } + } + \IfFileExists{iftex.sty}{ + \RequirePackage{iftex} + \phfnote@internal@setifxeorlua\phfnote@tmp@requireinputencfontenc\relax + }{} + \phfnote@tmp@requireinputencfontenc - \PassOptionsToPackage{utf8}{inputenc} - \RequirePackage{inputenc} + \RequirePackage{microtype} } \def\phfnote@do@pkgset@extended{ @@ -489,31 +818,84 @@ \def\phfnote@do@pkgset#1{ \phfnote@internal@execattribs{phfnote@do@pkgset@}{package set}{#1} } -\newcommand{\phfnote@do@pdfhyperrefdefs}{% - \phfnote@requirecolorpackage% - \definecolor{docnotelinkcolor}{rgb}{0,0,0.4}% - \RequirePackage{url}% - \DeclareUrlCommand\phfnote@format@url{}% - \PassOptionsToPackage{bookmarks=true,backref=false}{hyperref}% - \RequirePackage{hyperref}% - % - \hypersetup{unicode=true,% - bookmarksnumbered=false,bookmarksopen=false,bookmarksopenlevel=1,% - breaklinks=true,pdfborder={0 0 0},colorlinks=true}% - \hypersetup{% - anchorcolor=docnotelinkcolor,citecolor=docnotelinkcolor,% - filecolor=docnotelinkcolor,linkcolor=docnotelinkcolor,% - menucolor=docnotelinkcolor,runcolor=docnotelinkcolor,% - urlcolor=docnotelinkcolor}% - \let\email\phfnote@email% - \urlstyle{notesf}% +\def\phfnote@hyperrefdefs@val@options{% + bookmarksnumbered=false,bookmarksopen=false,bookmarksopenlevel=1,% + breaklinks=true,pdfborder={0 0 0},colorlinks=true,% + anchorcolor=docnotelinkcolor,citecolor=docnotelinkcolor,% + filecolor=docnotelinkcolor,linkcolor=docnotelinkcolor,% + menucolor=docnotelinkcolor,runcolor=docnotelinkcolor,% + urlcolor=docnotelinkcolor% +}% +\def\phfnote@hyperrefdefs@deferredhypersetup#1{% + \AtBeginDocument{% + \@ifpackageloaded{hyperref}{% + \hypersetup{#1}% + }{% + \PackageWarning{phfnote}{\MessageBreak\MessageBreak + *** package `hyperref` was not loaded ***\MessageBreak + Since you specified `hyperrefdefs=defer`, I was expecting you would call + `\string\usepackage{hyperref}` at some point later in your preamble, but + it does not appear you did so. Your document might look weird.}% + }% + }% +} +\providecommand\phfnote@hyperrefdefs@dopkgoptions{% + \PassOptionsToPackage{unicode=true}{hyperref} +} +\def\phfnote@hyperrefdefs@loadhyperref{% + \phfnote@hyperrefdefs@dopkgoptions + \RequirePackage{hyperref}} +\def\phfnote@hyperrefdefs@provideemail{\let\email\phfnote@email} +\def\phfnote@eqref#1{% + \hyperref[{#1}]{\textup{\tagform@{\ref*{#1}}}}% +} +\def\phfnote@hyperrefdefs@redefeqref{% + \let\eqref\phfnote@eqref +} +\def\phfnote@hyperrefdefs@afterhook{} +\def\phfnote@do@hyperrefdefs@attr@true{}% for explicit value "hyperrefdefs=true" +\def\phfnote@do@hyperrefdefs@attr@defer{ + \def\phfnote@hyperrefdefs@loadhyperref{% + \phfnote@hyperrefdefs@dopkgoptions + \let\hypersetup\phfnote@hyperrefdefs@deferredhypersetup} +} +\def\phfnote@do@hyperrefdefs@attr@clearoptions{ + \def\phfnote@hyperrefdefs@val@options{} +} +\def\phfnote@do@hyperrefdefs@attr@noemail{ + \def\phfnote@hyperrefdefs@provideemail{} +} +\def\phfnote@do@hyperrefdefs@attr@noeqref{ + \def\phfnote@hyperrefdefs@redefeqref{} +} +\def\phfnote@do@hyperrefdefs@attr@noload{ + \def\phfnote@hyperrefdefs@loadhyperref{} + \def\phfnote@hyperrefdefs@redefeqref{} + \let\hypersetup\@gobble +} +\def\phfnote@do@hyperrefdefs#1{% + \ifstrequal{#1}{false}{}{% + \phfnote@requirecolorpackage% + \definecolor{docnotelinkcolor}{rgb}{0,0,0.4}% + \RequirePackage{url}% + \DeclareUrlCommand\phfnote@format@url{}% + \let\phfnoteEmail\phfnote@email + \phfnote@internal@execattribs{phfnote@do@hyperrefdefs@attr@}{% + phfnote hyperref-related option}{#1}% + \phfnote@hyperrefdefs@loadhyperref + \expandafter\hypersetup\expandafter{\phfnote@hyperrefdefs@val@options} + \phfnote@hyperrefdefs@provideemail + \phfnote@hyperrefdefs@redefeqref + \urlstyle{notesf} + \phfnote@hyperrefdefs@afterhook + } } \newcommand{\phfnotePdfLinkColor}[1]{% \@ifpackageloaded{xcolor}{% \colorlet{docnotelinkcolor}{#1}% }{% else: - \PackageWarning{phfnote}{\protect\phfnotePdfLinkColor may only be - used if the package xcolor is loaded.}% + \PackageError{phfnote}{\protect\phfnotePdfLinkColor may only be + used if the package xcolor is loaded.}{}% }% } \def\phfnote@sanitize@url{% @@ -527,7 +909,6 @@ % \catcode`\^^M10% newline = space \relax% }% -\providecommand\phfnote@format@url{\texttt} \def\phfnote@email{\begingroup\phfnote@sanitize@url\phfnote@impl@email@}% \def\phfnote@impl@email@#1{\endgroup\href{mailto:#1}{\phfnote@format@url{#1}}}% \def\phfnote@requirecolorpackage{% @@ -539,13 +920,19 @@ }% }% } -\def\phfnote@do@fontdefs{ - - \PassOptionsToPackage{T1}{fontenc} - \RequirePackage{fontenc} - - \renewcommand\sfdefault{cmbr} - +\def\phfnote@do@fontdefs#1{ + \ifstrequal{#1}{false}{}{% + \let\phfnote@tmp@do\@firstofone + \IfFileExists{iftex.sty}{% + \RequirePackage{iftex}% + \phfnote@internal@setifxeorlua\phfnote@tmp@do\@gobble + }{} + \phfnote@tmp@do{ + \PassOptionsToPackage{T1}{fontenc} + \RequirePackage{fontenc} + \renewcommand\sfdefault{cmbr} + } + } } \newcommand{\phfnote@bibstyle}{naturemagdoi} \newcommand{\phfnote@bibfont}{\fontsize{9}{11}\selectfont} @@ -558,24 +945,30 @@ \phfnoteHackSectionStarWithTOC% \catcode`\&=12\relax% normal char \providecommand\eprint[2][]{\href{http://arxiv.org/abs/##2}{arXiv:##2}} + \providecommand\doibase{\phfnote@doibasefix} \phfnote@old@bibliography{#1}% \endgroup% } +\def\phfnote@doibasefix#110.{https://doi.org/10.} \newcommand{\phfnote@bibliographystyle}[1]{% \renewcommand{\phfnote@bibstyle}{#1}% } -\def\phfnote@do@bibliographydefs{% - \let\bibliographystyle\phfnote@bibliographystyle% - \let\bibliography\phfnote@bibliography% +\def\phfnote@do@bibliographydefs#1{% + \ifstrequal{#1}{false}{}{% + \let\bibliographystyle\phfnote@bibliographystyle% + \let\bibliography\phfnote@bibliography% + } } -\def\phfnote@do@footnotedefs{ - \let\phfnote@orig@makefnmark\@makefnmark -%% \def\@makefnmark{\hbox{\@textsuperscript{% -%% \normalfont\tiny\fontseries{sb}\selectfont\@thefnmark}}} - \def\@makefnmark{\hbox{\@textsuperscript{% - \normalfont\tiny\bfseries\@thefnmark}}} -%% \def\@makefnmark{\hbox{\@textsuperscript{% -%% \normalfont\scriptsize\bfseries\@thefnmark}}}% too large +\def\phfnote@do@footnotedefs#1{ + \ifstrequal{#1}{false}{}{% + \let\phfnote@orig@makefnmark\@makefnmark +%% \def\@makefnmark{\hbox{\@textsuperscript{% +%% \normalfont\tiny\fontseries{sb}\selectfont\@thefnmark}}} + \def\@makefnmark{\hbox{\@textsuperscript{% + \normalfont\tiny\bfseries\@thefnmark}}} +%% \def\@makefnmark{\hbox{\@textsuperscript{% +%% \normalfont\scriptsize\bfseries\@thefnmark}}}% too large + } } \newcommand\notesmaller[1][\notesmallerfrac]{% \fontsize{#1\dimexpr\f@size pt\relax}{#1\dimexpr\f@baselineskip pt\relax}% @@ -657,7 +1050,7 @@ \csname phfnote@restoredefs@#1\endcsname% \else% \PackageError{phfnote}{\string\phfnoteRestoreDefs: no such - definitions stored (#1)} + definitions stored (#1)}{} \fi% } \def\phfverb#1{% @@ -673,36 +1066,56 @@ prefix=phfnote@opt@ } \DeclareStringOption[default]{title} +\DeclareVoidOption{notitle}{\def\phfnote@opt@title{false}} \DeclareStringOption[]{abstract} +\DeclareVoidOption{noabstract}{\def\phfnote@opt@abstract{false}} \DeclareStringOption[rich]{pkgset} +\DeclareStringOption[default]{pagegeom} +\DeclareVoidOption{nopagegeom}{\def\phfnote@opt@pagegeom{false}} \DeclareBoolOption[true]{pagegeomdefs} \DeclareComplementaryOption{nopagegeomdefs}{pagegeomdefs} -\DeclareStringOption[default]{pagegeom} \DeclareStringOption[section]{secfmt} +\DeclareVoidOption{nosecfmt}{\def\phfnote@opt@secfmt{false}} \DeclareStringOption[skip]{par} -\DeclareBoolOption[true]{spacingdefs} -\DeclareComplementaryOption{nospacingdefs}{spacingdefs} -\DeclareBoolOption[true]{fontdefs} -\DeclareComplementaryOption{nofontdefs}{fontdefs} -\DeclareBoolOption[true]{footnotedefs} -\DeclareComplementaryOption{nofootnotedefs}{footnotedefs} -\DeclareBoolOption[true]{hyperrefdefs} -\DeclareComplementaryOption{nohyperrefdefs}{hyperrefdefs} -\DeclareBoolOption[true]{bibliographydefs} -\DeclareComplementaryOption{nobibliographydefs}{bibliographydefs} -\define@key{phfnote}{preset}{% - \ifcsname phfnote@preset@#1\endcsname% - \csname phfnote@preset@#1\endcsname% - \else% - \PackageError{phfnote}{Unknown preset: `#1'!}{You specified the - option 'preset=...' with an invalid value. Please look up the - package documentation corresponding to your version of phfnote - for possible values.} +\DeclareVoidOption{nopar}{\def\phfnote@opt@par{false}} +\DeclareStringOption[true]{spacingdefs}[true] +\DeclareVoidOption{nospacingdefs}{\def\phfnote@opt@spacingdefs{false}} +\DeclareStringOption[true]{fontdefs}[true] +\DeclareVoidOption{nofontdefs}{\def\phfnote@opt@fontdefs{false}} +\DeclareStringOption[true]{footnotedefs}[true] +\DeclareVoidOption{nofootnotedefs}{\def\phfnote@opt@footnotedefs{false}} +\DeclareStringOption[]{hyperrefdefs}[] +\DeclareVoidOption{nohyperrefdefs}{\def\phfnote@opt@hyperrefdefs{false}} +\DeclareStringOption[true]{bibliographydefs}[true] +\DeclareVoidOption{nobibliographydefs}{\def\phfnote@opt@bibliographydefs{false}} +\def\phfnote@loadpreset#1{% + \IfFileExists{phfnotepreset-#1.def}{% + \input{phfnotepreset-#1.def}% + }{% + \ifcsname phfnote@preset@#1\endcsname% + \csname phfnote@preset@#1\endcsname% + \else% + \PackageError{phfnote}{Unknown preset: `#1'!}{You specified the + option 'preset=...' with an invalid value. Please look up the + package documentation corresponding to your version of phfnote + for possible values. Additionally, no file named `phfnotepreset-#1.def' + was found.}% \fi% + }% +} +\define@key{phfnote}{preset}{% + \phfnote@loadpreset{#1}% } \DeclareDefaultOption{% \@unknownoptionerror } +\def\phfnote@ifpkgoptfalsesetfalse#1#2{% + \edef\x{% + \expandafter\noexpand\csname ifphfnote@opt@#1\endcsname\noexpand\else + \noexpand\PackageWarning{phfnote}{Option #1 is obsolete. Please use "#2=false'' instead.}% + \noexpand\csgdef{phfnote@opt@#2}{false}\noexpand\fi}% + \x +} \def\phfnote@hook@atendload{} \def\phfnote@preset@article{ \def\phfnote@opt@title{article} @@ -712,7 +1125,7 @@ \newcommand\phfnote@presetcommon@xnote[1][noteitsf]{ \def\phfnote@opt@title{default} \def\phfnote@opt@par{skip} - \phfnote@opt@pagegeomdefstrue + %\phfnote@opt@pagegeomdefstrue \def\phfnote@opt@pagegeom{wide} \setlength{\footnotesep}{5pt} \g@addto@macro\phfnote@hook@atendload{ @@ -723,29 +1136,29 @@ } \def\phfnote@preset@sfnote{ \phfnote@presetcommon@xnote - \phfnote@opt@footnotedefstrue - \phfnote@opt@fontdefstrue + \def\phfnote@opt@footnotedefs{true} + \def\phfnote@opt@fontdefs{true} \renewcommand\familydefault{\sfdefault} \renewcommand{\notesectionallfontfamily}{\sfdefault} } \def\phfnote@preset@sfssnote{ - \phfnote@preset@sfnote - \phfnote@opt@fontdefsfalse + \phfnote@loadpreset{sfnote}% + \def\phfnote@opt@fontdefs{false} \PassOptionsToPackage{T1}{fontenc} \RequirePackage{fontenc} \renewcommand\sfdefault{cmss} } \def\phfnote@preset@opensansnote{ - \phfnote@preset@sfnote - \phfnote@opt@fontdefsfalse + \phfnote@loadpreset{sfnote}% + \def\phfnote@opt@fontdefs{false} \PassOptionsToPackage{T1}{fontenc} \RequirePackage{fontenc} - \PassOptionsToPackage{default,osfigures,scale=0.9}{opensans} + \PassOptionsToPackage{default,scale=0.9}{opensans} \RequirePackage{opensans} } \def\phfnote@preset@utopianote{ \phfnote@presetcommon@xnote[noteit] - \phfnote@opt@fontdefsfalse + \def\phfnote@opt@fontdefs{false} \PassOptionsToPackage{T1}{fontenc} \RequirePackage{fontenc} \RequirePackage{fourier} @@ -755,8 +1168,8 @@ } \def\phfnote@preset@mnmynote{ \phfnote@presetcommon@xnote[noteit] - \phfnote@opt@footnotedefsfalse - \phfnote@opt@fontdefsfalse + \def\phfnote@opt@footnotedefs{false} + \def\phfnote@opt@fontdefs{false} \PassOptionsToPackage{T1}{fontenc} \RequirePackage{fontenc} \renewcommand{\notesectionallfontfamily}{\sfdefault} @@ -770,7 +1183,7 @@ } \def\phfnote@preset@pkgdoc{ \phfnote@presetcommon@xnote[noteit] - \phfnote@opt@fontdefsfalse + \def\phfnote@opt@fontdefs{false} \phfnote@pkgdoc@setupfont \def\phfnote@opt@secfmt{section,paragraph,itpar,blockpar,larger,secsquares,secnummargin} \def\phfnote@opt@pagegeom{bigmargin} @@ -785,243 +1198,36 @@ \IfFileExists{opensans.sty}{}{\PackageError{phfnote}{Font OpenSans is not available (need `opensans' package)}{Please install the opensans package, which provides the OpenSans font.}} - \def\opensans@scale{s*[0.85]} - \renewcommand{\sfdefault}{fosj} + \PassOptionsToPackage{scale=0.85,defaultsans}{opensans} + \RequirePackage{opensans} } \providecommand\phfnote@pkgdoc@setupmainfont{\RequirePackage{fourier}} -\def\phfnote@preset@xpkgdoc{ - \phfnote@preset@pkgdoc - \RequirePackage{verbdef} - \ifdefined\PrintChanges - \phfnoteHackSectionStarWithTOCInCommand\PrintChanges - \fi - \ifdefined\PrintIndex - \phfnoteHackSectionStarWithTOCInCommand\PrintIndex - \fi - \def\PrintChangesAndIndexSpacing{\vspace{3cm plus 2cm minus 2cm}} - \def\PrintChangesAndIndex{\PrintChangesAndIndexSpacing\PrintChanges - \PrintChangesAndIndexSpacing\PrintIndex} - \ifdefined\c@IndexColumns - \setcounter{IndexColumns}{2} - \fi - \let\phfnote@xpkgdoc@old@theglossary\theglossary - \let\phfnote@xpkgdoc@old@endtheglossary\endtheglossary - \renewenvironment{theglossary}{% - \glossary@prologue% - \GlossaryParms \let\item\@idxitem \ignorespaces} - {} - \phfnote@opt@hyperrefdefsfalse - \g@addto@macro\phfnote@hook@atendload{ - \definecolor{docnotelinkcolor}{rgb}{0,0,0.4}% - \RequirePackage{url}% - \DeclareUrlCommand\phfnote@format@url{}% - \RequirePackage{hypdoc} - % - \hypersetup{bookmarks=true,backref=false,unicode=true,% - bookmarksnumbered=false,bookmarksopen=false,bookmarksopenlevel=1,% - breaklinks=true,pdfborder={0 0 0},colorlinks=true}% - \hypersetup{% - anchorcolor=docnotelinkcolor,citecolor=docnotelinkcolor,% - filecolor=docnotelinkcolor,linkcolor=docnotelinkcolor,% - menucolor=docnotelinkcolor,runcolor=docnotelinkcolor,% - urlcolor=docnotelinkcolor}% - \let\email\phfnote@email% - \urlstyle{noteit} - } - \def\pkgname##1{% - \pkgnamefmt{##1}% - \index{##1=\pkgnamefmt{##1}|hyperpage}% - \index{packages:>##1=\pkgnamefmt{##1}|hyperpage}% - } - \robustify\pkgname - \def\pkgnamefmt##1{\textsf{##1}} - \robustify\pkgnamefmt - \newcounter{phfnotechanged} - \newcommand*\changed[4][]{% - \if\relax\detokenize{##1}\relax% - \changedtextfmt{##2}{##3}{##4}% - \changes{##2}{##3}{##4}% - \else% - \protected@edef\phfnotechanged@tmpa{{##2}{##3}{##4}}% - \immediate\write\@auxout{\string\phfnote@changed@set% - {##1}{\expandonce\phfnotechanged@tmpa}}% - \par\hspace*{0pt}\refstepcounter{phfnotechanged}\label{phfnotechanged:##1}% - \begingroup\let\phfnote@changedreftext@par\relax - \changedreftext{##1}% - \endgroup - \changes{##2}{##3}{\hyperref[phfnotechanged:##1]{##4}}% - \fi - } - \def\phfnote@changed@set##1{% - \expandafter\gdef\csname phfnote@changed@lbl@##1\endcsname% - } - \def\phfnote@changedreftext@par{\par} - \newcommand*\changedreftext[1]{% - \phfnote@changedreftext@par% - \ifcsname phfnote@changed@lbl@##1\endcsname - \hyperref[phfnotechanged:##1]{% - \expandafter\expandafter\expandafter\changedtextfmt% - \csname phfnote@changed@lbl@##1\endcsname - } - \else - \hyperref[phfnotechanged:##1]{% - \changedtextfmt{???}{???}{[\textbf{missing ref}]}% - }% - \fi - \par - } - \newcommand*\changedtextfmt[3]{% - \textit{Changed in {##1\kern 0.3ex\relax[##2]}:} ##3. - } - \RequirePackage{enumitem} - \newlist{pkgoptions}{description}{1} - \setlist[pkgoptions]{font=\pkgoptionfmt[{\vspace*{5pt}}],style=nextline} - \apptocmd\pkgoptions{\let\pkgoptions@old@item\item% - \def\item{\@ifnextchar[\pkgoptions@item@\pkgoptions@item@@}%] - \def\pkgoptions@item@[##1]{\pkgoptions@old@item[{{##1}}]}% - \def\pkgoptions@item@@{\PackageWarning{phfnote}{{pkgoptions}: you must - specify label to \string\item as \string\item[label].}% - \pkgoptions@old@item}% - }{}{\PackageWarning{phfnote}{preset xpkgdoc: Failed to patch command - \string\pkgoptions}} - \def\pkgoptionscombineitem{\leavevmode\vspace{\dimexpr-\baselineskip-\parskip-\itemsep\relax}} - \def\metatruefalsearg{\meta{\phfverb{true} $\mid$ \phfverb{false}}} - \newcommand\pkgoptionfmt[2][]{% - \begingroup\let\meta\pkgoptfmt@meta\fbox{\normalfont\ttfamily ##2}\endgroup% - \expandafter\phfnote@pkgdoc@index\expandafter{\@firstofone ##2}% - ##1} - \let\pkgopt@save@meta\meta - \def\pkgoptfmt@meta##1{\begingroup\normalfont\itshape\pkgopt@save@meta{##1}\endgroup} - \def\phfnote@pkgdoc@index##1{% - \begingroup\lccode`\= = `\,\relax% - \def\x{\lowercase{\def\@tmpa{##1}}}% - \x% - \let\meta\@gobble% - \let\marg\@gobble% - \let\oarg\@gobble% - \let\parg\@gobble% - \let\pkgoptattrib\@firstofone% - \let\pkgoptattribnodots\@firstofone% - \let\pkgoptattribempty\@empty% - \def\handleitemindex####1{% - \edef\@tmpc{####1}% - \if\relax\detokenize\expandafter{\@tmpc}\relax\else% - \edef\@tmpb{{\expandonce\@tmpc=\string\verb!*+\expandonce\@tmpc+ (\pkgoptname)|hyperpage}}% - \expandafter\index\@tmpb% - \edef\@tmpb{{\packageoptionsname:>\expandonce\@tmpc=\string\verb!*+\expandonce\@tmpc+|hyperpage}}% - \expandafter\index\@tmpb% - \fi% - }% - \def\@tmpc{\forcsvlist{\handleitemindex}}% - \expandafter\@tmpc\expandafter{\@tmpa}% - \endgroup% - } - \def\pkgoptname{pkg. opt.} - \def\packageoptionsname{package options} - \def\cmdoptions{\begingroup\setcmdnotpkgoptions - \pkgoptions} - \def\endcmdoptions{\endpkgoptions\endgroup} - \newcommand\cmdoptionfmt[2][]{\begingroup\setcmdnotpkgoptions - \pkgoptionfmt[{##1}]{##2}\endgroup} - \def\cmdoptname{cmd. opt.} - \def\commandoptionsname{command options} - \def\setcmdnotpkgoptions{\let\pkgoptname\cmdoptname - \let\packageoptionsname\commandoptionsname - \let\fbox\cmdoptionsfbox} - \def\cmdoptionsfbox##1{\ensuremath{\underline{{\text{##1}}}}} - \def\pkgoptattrib##1{\{##1,...\}} - \def\pkgoptattribnodots##1{\{##1\}} - \def\pkgoptattribempty{\{\}} - \phfnoteSaveDefs{verbatimstuff}{% - verbatim,@verbatim,@xverbatim,@sxverbatim,endverbatim} - \usepackage{tcolorbox} - \newtcolorbox{pkgnote}{ - colback=blue!5!white, - colframe=blue!5!white, - coltitle=blue!50!black, - toptitle=1.5ex, - fonttitle=\bfseries, - title={NOTE} - } - \newtcolorbox{pkgwarning}{ - colback=red!5!white, - colframe=red!5!white, - coltitle=red!50!black, - toptitle=1.5ex, - fonttitle=\bfseries, - title={WARNING} - } - \newtcolorbox{pkgtip}{ - colback=green!5!white, - colframe=green!5!white, - coltitle=green!50!black, - toptitle=1.5ex, - fonttitle=\bfseries, - title={TIP} - } - \phfnoteRestoreDefs{verbatimstuff} - \def\phfqitltxPkgTitle##1{The \pkgname{##1} package\thanks{\itshape - This document corresponds to \pkgname{##1}~\fileversion, dated \filedate. It - is part of the - \href{https://github.com/phfaist/phfqitltx/}{\pkgname{phfqitltx}} package - suite, see \url{https://github.com/phfaist/phfqitltx}.}} - \def\pkgfmtdate##1{% - \edef\pkgfmtdate@thedate{##1}% - \expandafter\pkgfmtdate@next\pkgfmtdate@thedate\@nil% - } - \def\pkgfmtdate@next##1/##2/##3\@nil{% YYYY/MM/DD - \ifcase ##2 \or January\or February\or March\or April\or May% - \or June\or July\or August\or September\or October\or November\or December\fi\space ##3,% - \space ##1} - \robustify\pkgfmtdate@next -} \def\phfnote@preset@reset{ \def\phfnote@opt@pkgset{none} - \def\phfnote@opt@title{} - \phfnote@opt@pagegeomdefsfalse - \phfnote@opt@spacingdefsfalse - \def\phfnote@opt@par{original} - \def\phfnote@opt@abstract{original} - \phfnote@opt@hyperrefdefsfalse - \phfnote@opt@fontdefsfalse - \def\phfnote@opt@secfmt{} - \phfnote@opt@bibliographydefsfalse - \phfnote@opt@footnotedefsfalse + \def\phfnote@opt@title{false} + \def\phfnote@opt@pagegeom{false} + \def\phfnote@opt@spacingdefs{false} + \def\phfnote@opt@par{false} + \def\phfnote@opt@abstract{false} + \def\phfnote@opt@hyperrefdefs{false} + \def\phfnote@opt@fontdefs{false} + \def\phfnote@opt@secfmt{false} + \def\phfnote@opt@bibliographydefs{false} + \def\phfnote@opt@footnotedefs{false} } \ProcessKeyvalOptions* -\phfnote@do@pkgset{\phfnote@opt@pkgset} - -\phfnote@do@notetitle{\phfnote@opt@title} - -\phfnote@do@noteabstract{\phfnote@opt@abstract} - -\phfnote@do@secfmt{\phfnote@opt@secfmt} - -\ifphfnote@opt@pagegeomdefs - \phfnote@do@pagegeomdefs{\phfnote@opt@pagegeom} -\fi - -\ifphfnote@opt@spacingdefs - \phfnote@do@spacing -\fi - -\phfnote@do@par{\phfnote@opt@par} - -\ifphfnote@opt@hyperrefdefs - \phfnote@do@pdfhyperrefdefs -\fi - -\ifphfnote@opt@fontdefs - \phfnote@do@fontdefs -\fi - -\ifphfnote@opt@bibliographydefs - \phfnote@do@bibliographydefs -\fi - -\ifphfnote@opt@footnotedefs - \phfnote@do@footnotedefs -\fi +\expandafter\phfnote@do@pkgset\expandafter{\phfnote@opt@pkgset} +\expandafter\phfnote@do@notetitle\expandafter{\phfnote@opt@title} +\expandafter\phfnote@do@noteabstract\expandafter{\phfnote@opt@abstract} +\expandafter\phfnote@do@secfmt\expandafter{\phfnote@opt@secfmt} +\phfnote@ifpkgoptfalsesetfalse{pagegeomdefs}{pagegeom} +\expandafter\phfnote@do@pagegeom\expandafter{\phfnote@opt@pagegeom} +\expandafter\phfnote@do@spacingdefs\expandafter{\phfnote@opt@spacingdefs} +\expandafter\phfnote@do@par\expandafter{\phfnote@opt@par} +\expandafter\phfnote@do@hyperrefdefs\expandafter{\phfnote@opt@hyperrefdefs} +\expandafter\phfnote@do@fontdefs\expandafter{\phfnote@opt@fontdefs} +\expandafter\phfnote@do@bibliographydefs\expandafter{\phfnote@opt@bibliographydefs} +\expandafter\phfnote@do@footnotedefs\expandafter{\phfnote@opt@footnotedefs} \phfnote@hook@atendload \endinput %% diff --git a/Master/texmf-dist/tex/latex/phfnote/phfnotepreset-xpkgdoc.def b/Master/texmf-dist/tex/latex/phfnote/phfnotepreset-xpkgdoc.def new file mode 100644 index 00000000000..a8cd97ef761 --- /dev/null +++ b/Master/texmf-dist/tex/latex/phfnote/phfnotepreset-xpkgdoc.def @@ -0,0 +1,251 @@ +%% +%% This is file `phfnotepreset-xpkgdoc.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% phfnote.dtx (with options: `phfnotepreset,phfnotepreset-xpkgdoc') +%% +%% This is a generated file. +%% +%% Copyright (C) 2016 by Philippe Faist, philippe.faist@bluewin.ch +%% +%% This file may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License, either version 1.3 of this license +%% or (at your option) any later version. The latest version of this +%% license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of LaTeX version +%% 2005/12/01 or later. +%% +%This preset file for phfnote is used when you call `\usepackage[preset=<PRESET NAME>]{phfnote}' +\phfnote@loadpreset{pkgdoc} +\RequirePackage{verbdef} +\ifdefined\PrintChanges + \phfnoteHackSectionStarWithTOCInCommand\PrintChanges +\fi +\ifdefined\PrintIndex + \phfnoteHackSectionStarWithTOCInCommand\PrintIndex +\fi +\def\PrintChangesAndIndexSpacing{\vspace{3cm plus 2cm minus 2cm}} +\def\PrintChangesAndIndex{\PrintChangesAndIndexSpacing\PrintChanges + \PrintChangesAndIndexSpacing\PrintIndex} +\ifdefined\c@IndexColumns + \setcounter{IndexColumns}{2} +\fi +\let\phfnote@xpkgdoc@old@theglossary\theglossary +\let\phfnote@xpkgdoc@old@endtheglossary\endtheglossary +\renewenvironment{theglossary}{% + \glossary@prologue% + \GlossaryParms \let\item\@idxitem \ignorespaces} +{} +\def\phf@fillwithdiscretionaries#1#2#3{% + \def\phf@fillwithdescretionaries@a{#1}% + \def\phf@fillwithdescretionaries@b{#2}% + \edef\x{#3}% + \expandafter \phf@fillwithdiscretionaries@ \x \@nil +} +\def\phf@fillwithdiscretionaries@#1#2\@nil{% + \if\relax\detokenize{#1}\relax\else + #1% + \if\relax\detokenize{#2}\relax\else + \discretionary{\phf@fillwithdescretionaries@a}{% + \phf@fillwithdescretionaries@b}{}% + \phf@fillwithdiscretionaries@#2\@nil + \fi + \fi +} +\definecolor{phfxpkgdocmacronamehyphencolor}{rgb}{0.6,0.6,0.7} +\def\phf@xpkgdoc@macrobreakhyphen{% + \hbox{\textcolor{phfxpkgdocmacronamehyphencolor}{-}}} +\def\ScaleHorizontallyAndHyphenateAnywhere#1#2{% {hscale-factor}{text} + \scalebox{#1}[1.0]{% + \parbox{% compute inverse of #1 ... + \dimexpr \marginparwidth*65536 / + \number\dimexpr #1\p@ \relax \relax + }{\raggedleft\phf@fillwithdiscretionaries{% + \phf@xpkgdoc@macrobreakhyphen}{}{#2}\hfill}% + }% +} +\def\phf@xpkgdoc@marginmacronamecompressfactor{0.85} +\def\phf@xpkgdoc@macrofont{\small\bfseries}% \footnotesize ? +\def\PrintMarginLabelContents#1{% + \strut\MacroFont\phf@xpkgdoc@macrofont + \ScaleHorizontallyAndHyphenateAnywhere{% + \phf@xpkgdoc@marginmacronamecompressfactor}{#1}% + \par +} +\def\PrintMarginLabel#1{\marginpar{\PrintMarginLabelContents{#1}}} +\def\PrintDescribeMacro#1{\PrintMarginLabelContents{\string#1}} +\let\PrintMacroName\PrintDescribeMacro +\let\PrintDescribeEnv\PrintMarginLabelContents +\let\PrintEnvName\PrintMarginLabelContents +\def\phfnote@opt@hyperrefdefs{defer} +\g@addto@macro\phfnote@hook@atendload{ + \RequirePackage{hypdoc} + \urlstyle{noteit} +} +\def\pkgname#1{% + \pkgnamefmt{#1}% + \index{#1=\pkgnamefmt{#1}|hyperpage}% + \index{packages:>#1=\pkgnamefmt{#1}|hyperpage}% +} +\robustify\pkgname +\def\pkgnamefmt#1{\textsf{#1}} +\robustify\pkgnamefmt +\newcounter{phfnotechanged} +\newcommand*\changed[4][]{% + \if\relax\detokenize{#1}\relax% + \changedtextfmt{#2}{#3}{#4}% + \changes{#2}{#3}{#4}% + \else% + \protected@edef\phfnotechanged@tmpa{{#2}{#3}{#4}}% + \immediate\write\@auxout{\string\phfnote@changed@set% + {#1}{\expandonce\phfnotechanged@tmpa}}% + \par\hspace*{0pt}\refstepcounter{phfnotechanged}\label{phfnotechanged:#1}% + \begingroup\let\phfnote@changedreftext@par\relax + \changedreftext[\@secondoftwo]{#1}% + \endgroup + \changes{#2}{#3}{\hyperref[phfnotechanged:#1]{#4}}% + \fi +} +\def\phfnote@changed@set#1{% + \expandafter\gdef\csname phfnote@changed@lbl@#1\endcsname% +} +\def\phfnote@changedreftext@par{\par} +\newcommand*\changedreftext[2][\phfnote@changedrefto]{% + \phfnote@changedreftext@par% + \ifcsname phfnote@changed@lbl@#2\endcsname + #1{#2}{% + \expandafter\expandafter\expandafter\changedtextfmt% + \csname phfnote@changed@lbl@#2\endcsname + } + \else + \hyperref[phfnotechanged:#2]{% + \changedtextfmt{???}{???}{[\textbf{missing ref}]}% + }% + \fi + \par +} +\def\phfnote@changedrefto#1{\hyperref[phfnotechanged:#1]} +\newcommand*\changedtextfmt[3]{% + \textit{Changed in {#1\kern 0.3ex\relax[#2]}:} #3. +} +\RequirePackage{enumitem} +\newlist{pkgoptions}{description}{1} +\setlist[pkgoptions]{font=\pkgoptionfmt@many[{\vspace*{5pt}}],style=nextline} +\def\pkgoptions@item{\@ifnextchar[\pkgoptions@item@\pkgoptions@item@@}%] +\def\pkgoptions@item@[#1]{\pkgoptions@old@item[{{#1}}]}% +\def\pkgoptions@item@@{\PackageWarning{phfnote}{{pkgoptions}: you must + specify label to \string\item as \string\item[label].}% + \pkgoptions@old@item}% +\apptocmd\pkgoptions{% + \let\pkgoptions@old@item\item + \let\item\pkgoptions@item +}{}{\PackageWarning{phfnote}{preset xpkgdoc: Failed to patch command + \string\pkgoptions}} +\def\metatruefalsearg{\meta{\phfverb{true} $\mid$ \phfverb{false}}} +\newcommand\pkgoptionfmt[2][]{% + \begingroup\let\meta\pkgoptfmt@meta\pkgopt@fbox{\normalfont\ttfamily #2}\endgroup% + \expandafter\phfnote@pkgdoc@index\expandafter{\@firstofone #2}% + #1} +\newcommand\pkgoptionfmt@many[2][]{% + \def\pkgoptionfmt@tmp@addcomma{} + \def\do##1{\pkgoptionfmt@tmp@addcomma\pkgoptionfmt{\vphantom{#2}##1}% + \def\pkgoptionfmt@tmp@addcomma{\hskip0.25em\relax,\hskip0.8em\relax}}% + \expandafter\docsvlist\expandafter{\@firstofone #2}% + #1} +\let\pkgopt@save@meta\meta +\def\pkgopt@fbox{\fbox} +\def\pkgoptfmt@meta#1{\begingroup\normalfont\itshape\pkgopt@save@meta{#1}\endgroup} +\def\phfnote@pkgdoc@index#1{% + \begingroup\lccode`\= = `\,\relax% + \def\x{\lowercase{\def\@tmpa{#1}}}% + \x% + \let\meta\@gobble% + \let\marg\@gobble% + \let\oarg\@gobble% + \let\parg\@gobble% + \let\vphantom\@gobble% + \let\hphantom\@gobble% + \let\pkgoptattrib\@firstofone% + \let\pkgoptattribnodots\@firstofone% + \let\pkgoptattribempty\@empty% + \def\handleitemindex##1{% + \edef\@tmpc{##1}% + \if\relax\detokenize\expandafter{\@tmpc}\relax\else% + \edef\@tmpb{{\expandonce\@tmpc=\string\verb!*+\expandonce\@tmpc+ (\pkgoptname)|hyperpage}}% + \expandafter\index\@tmpb% + \edef\@tmpb{{\packageoptionsname:>\expandonce\@tmpc=\string\verb!*+\expandonce\@tmpc+|hyperpage}}% + \expandafter\index\@tmpb% + \fi% + }% + \def\@tmpc{\forcsvlist{\handleitemindex}}% + \expandafter\@tmpc\expandafter{\@tmpa}% + \endgroup% +} +\def\pkgoptname{pkg. opt.} +\def\packageoptionsname{package options} +\def\cmdoptions{\begingroup\setcmdnotpkgoptions + \pkgoptions} +\def\endcmdoptions{\endpkgoptions\endgroup} +\newcommand\cmdoptionfmt[2][]{\begingroup\setcmdnotpkgoptions + \pkgoptionfmt[{#1}]{#2}\endgroup} +\def\cmdoptname{cmd. opt.} +\def\commandoptionsname{command options} +\def\setcmdnotpkgoptions{\let\pkgoptname\cmdoptname + \let\packageoptionsname\commandoptionsname + \let\pkgopt@fbox\cmdoptionsfbox} +\def\cmdoptionsfbox#1{\ensuremath{\underline{{\text{#1}}}}} +\def\pkgoptattrib#1{\{#1,...\}} +\def\pkgoptattribnodots#1{\{#1\}} +\def\pkgoptattribempty{\{\}} +\phfnoteSaveDefs{verbatimstuff}{% + verbatim,@verbatim,@xverbatim,@sxverbatim,endverbatim} +\usepackage{tcolorbox} +\newtcolorbox{pkgnote}{ + colback=blue!5!white, + colframe=blue!5!white, + coltitle=blue!50!black, + toptitle=1.5ex, + fonttitle=\bfseries, + title={NOTE} +} +\newtcolorbox{pkgwarning}{ + colback=red!5!white, + colframe=red!5!white, + coltitle=red!50!black, + toptitle=1.5ex, + fonttitle=\bfseries, + title={WARNING} +} +\newtcolorbox{pkgtip}{ + colback=green!5!white, + colframe=green!5!white, + coltitle=green!50!black, + toptitle=1.5ex, + fonttitle=\bfseries, + title={TIP} +} +\phfnoteRestoreDefs{verbatimstuff} +\appto\endverbatim{\vspace{-\baselineskip}} +\def\phfqitltxPkgTitle#1{The \pkgname{#1} package\thanks{\itshape + This document corresponds to \pkgname{#1}~\fileversion, dated \filedate. It + is part of the + \href{https://github.com/phfaist/phfqitltx/}{\pkgname{phfqitltx}} package + suite, see \url{https://github.com/phfaist/phfqitltx}.}} +\def\pkgfmtdate#1{% + \edef\pkgfmtdate@thedate{#1}% + \expandafter\pkgfmtdate@next\pkgfmtdate@thedate\@nil% +} +\def\pkgfmtdate@next#1/#2/#3\@nil{% YYYY/MM/DD + \ifcase #2 \or January\or February\or March\or April\or May% + \or June\or July\or August\or September\or October% + \or November\or December\fi\space #3,% + \space #1} +\robustify\pkgfmtdate@next +\endinput +%% +%% End of file `phfnotepreset-xpkgdoc.def'. |