diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty | 126 |
1 files changed, 109 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty b/Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty index ef52cc96427..11b7f5f7204 100644 --- a/Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty +++ b/Master/texmf-dist/tex/latex/jmlr/jmlrutils.sty @@ -7,7 +7,7 @@ %% jmlr.dtx (with options: `jmlrutils.sty,package') %% %% jmlr.dtx -%% Copyright 2020 Nicola Talbot +%% Copyright 2022 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -40,15 +40,21 @@ %% Right brace \} Tilde \~} %% First editor: %% Second editor: -\ProvidesPackage{jmlrutils}[2020/09/21 v1.28 (NLCT)] +\ProvidesPackage{jmlrutils}[2022/01/29 v1.29 (NLCT)] \newif\ifjmlrutilsmaths \jmlrutilsmathstrue \DeclareOption{maths}{\jmlrutilsmathstrue} \DeclareOption{nomaths}{\jmlrutilsmathsfalse} +\DeclareOption{math}{\jmlrutilsmathstrue} +\DeclareOption{nomath}{\jmlrutilsmathsfalse} \newif\ifjmlrutilstheorems \jmlrutilstheoremstrue \DeclareOption{theorems}{\jmlrutilstheoremstrue} \DeclareOption{notheorems}{\jmlrutilstheoremsfalse} +\newif\ifjmlrcleveref +\jmlrclevereffalse +\DeclareOption{cleveref}{\jmlrclevereftrue} +\DeclareOption{nocleveref}{\jmlrclevereffalse} \newif\ifjmlrutilssubfloats \jmlrutilssubfloatstrue \DeclareOption{subfloats}{\jmlrutilssubfloatstrue} @@ -58,6 +64,19 @@ \ifjmlrutilsmaths \RequirePackage{amsmath} \fi +\ifjmlrcleveref + \ifdef\jmlrprehyperref + { + \jmlrprehyperref + \@ifundefined{@pre@hyperref}{}{\@pre@hyperref\undef\@pre@hyperref} + \RequirePackage{hyperref} + \let\jmlrprehyperref\relax + \@ifundefined{@post@hyperref}{}{\@post@hyperref\undef\@post@hyperref} + } + {} + \RequirePackage{aliascnt} + \RequirePackage{cleveref} +\fi \@ifundefined{iftablecaptiontop} {\newif\iftablecaptiontop \tablecaptiontoptrue} @@ -158,10 +177,13 @@ #2\label{#1}% } \newcommand{\algocfconts}[3]{% - \@algocf@pre@ruled - #2\label{#1}\kern2pt\hrule height.8pt depth0pt\kern2pt% - #3\@algocf@pre@ruled + \jmlralgorule\par\smallskip + #2\label{#1}% caption and label + \jmlralgorule\par\smallskip + #3% algorithm content + \jmlralgorule } +\newcommand{\jmlralgorule}{\kern2pt\hrule height.8pt depth0pt\kern2pt} \newenvironment{algorithm}[1][htbp]% {% \ifundef{\algocf}% @@ -171,7 +193,7 @@ \begin{algocf}[#1]% \renewcommand\@makecaption[2]{% \hskip\AlCapHSkip - \parbox[t]{\hsize}{\algocf@captiontext{##1}{##2}}% + \parbox[t]{\dimexpr\linewidth-\AlCapHSkip}{\algocf@captiontext{##1}{##2}}% }% }% {% @@ -258,6 +280,7 @@ \newcommand*{\subfigurelabel}[1]{(\emph{#1})} \newsavebox\@subfloatcapbox \newsavebox\@subfloatcontsbox + \newlength\jmlrminsubcaptionwidth \newcommand*{\subfigure}[1][]{% \bgroup \def\@subfigcap{#1}% @@ -277,8 +300,18 @@ \ifdim\@tempdimb>\@tempdima \settowidth\@tempdimb{\subfigurelabel{\thesubfigure}\space}% \addtolength{\@tempdima}{-\@tempdimb}% - \sbox\@subfloatcapbox{\subfigurelabel{\thesubfigure}\space - \parbox[t]{\@tempdima}{\@subfigcap}}% + \ifdim\@tempdima>\jmlrminsubcaptionwidth + \sbox\@subfloatcapbox{\subfigurelabel{\thesubfigure}\space + \parbox[t]{\@tempdima}{\@subfigcap}}% + \else + \sbox\@subfloatcapbox{\subfigurelabel{\thesubfigure}\space + \parbox[t]{\jmlrminsubcaptionwidth}{\@subfigcap}}% + \fi + \else + \ifdim\@tempdimb<\jmlrminsubcaptionwidth + \sbox\@subfloatcapbox{\subfigurelabel{\thesubfigure}\space + \parbox[t]{\jmlrminsubcaptionwidth}{\@subfigcap}}% + \fi \fi \begin{tabular}[#1]{@{}c@{}}% \usebox\@subfloatcontsbox\\\usebox\@subfloatcapbox @@ -349,8 +382,18 @@ \ifdim\@tempdimb>\@tempdima \settowidth\@tempdimb{\subtablelabel{\thesubtable}\space}% \addtolength{\@tempdima}{-\@tempdimb}% - \sbox\@subfloatcapbox{\subtablelabel{\thesubtable}\space - \parbox[t]{\@tempdima}{\@subtabcap}}% + \ifdim\@tempdima>\jmlrminsubcaptionwidth + \sbox\@subfloatcapbox{\subtablelabel{\thesubtable}\space + \parbox[t]{\@tempdima}{\@subtabcap}}% + \else + \sbox\@subfloatcapbox{\subtablelabel{\thesubtable}\space + \parbox[t]{\jmlrminsubcaptionwidth}{\@subtabcap}}% + \fi + \else + \ifdim\@tempdimb<\jmlrminsubcaptionwidth + \sbox\@subfloatcapbox{\subtablelabel{\thesubtable}\space + \parbox[t]{\jmlrminsubcaptionwidth}{\@subtabcap}}% + \fi \fi \begin{tabular}[#1]{@{}c@{}}% \usebox\@subfloatcapbox\\\usebox\@subfloatcontsbox @@ -507,13 +550,62 @@ } \newtheorem{example}{Example} \newtheorem{theorem}{Theorem} - \newtheorem{lemma}[theorem]{Lemma} - \newtheorem{proposition}[theorem]{Proposition} - \newtheorem{remark}[theorem]{Remark} - \newtheorem{corollary}[theorem]{Corollary} - \newtheorem{definition}[theorem]{Definition} - \newtheorem{conjecture}[theorem]{Conjecture} - \newtheorem{axiom}[theorem]{Axiom} + \ifjmlrcleveref + \newaliascnt{lemma}{theorem} + \newtheorem{lemma}[theorem]{Lemma} + \aliascntresetthe{lemma} + \crefname{lemma}{lemma}{lemmas} + \else + \newtheorem{lemma}[theorem]{Lemma} + \fi + \ifjmlrcleveref + \newaliascnt{proposition}{theorem} + \newtheorem{proposition}[proposition]{Proposition} + \aliascntresetthe{proposition} + \crefname{proposition}{proposition}{propositions} + \else + \newtheorem{proposition}[theorem]{Proposition} + \fi + \ifjmlrcleveref + \newaliascnt{remark}{theorem} + \newtheorem{remark}[remark]{Remark} + \aliascntresetthe{remark} + \crefname{remark}{remark}{remarks} + \else + \newtheorem{remark}[theorem]{Remark} + \fi + \ifjmlrcleveref + \newaliascnt{corollary}{theorem} + \newtheorem{corollary}[corollary]{Corollary} + \aliascntresetthe{corollary} + \crefname{corollary}{corollary}{corollaries} + \else + \newtheorem{corollary}[theorem]{Corollary} + \fi + \ifjmlrcleveref + \newaliascnt{definition}{theorem} + \newtheorem{definition}[definition]{Definition} + \aliascntresetthe{definition} + \crefname{definition}{definition}{definitions} + \else + \newtheorem{definition}[theorem]{Definition} + \fi + \ifjmlrcleveref + \newaliascnt{conjecture}{theorem} + \newtheorem{conjecture}[conjecture]{Conjecture} + \aliascntresetthe{conjecture} + \crefname{conjecture}{conjecture}{conjectures} + \else + \newtheorem{conjecture}[theorem]{Conjecture} + \fi + \ifjmlrcleveref + \newaliascnt{axiom}{theorem} + \newtheorem{axiom}[axiom]{axiom} + \aliascntresetthe{axiom} + \crefname{axiom}{axiom}{axioms} + \else + \newtheorem{axiom}[theorem]{Axiom} + \fi \fi \endinput %% |