summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty169
1 files changed, 117 insertions, 52 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty
index 20c2e566fda..fb45e2de613 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-patch-memoir.sty
@@ -41,14 +41,28 @@
\RequirePackage{lwarp-parskip}
\RequirePackage{lwarp-setspace}% req'd
\RequirePackage{lwarp-showidx}
-\RequirePackage{lwarp-subcaption}% req'd for \subfloat
\makeindex
\RequirePackage{lwarp-titling}% req'd
\RequirePackage{lwarp-tocloft}% req'd
\RequirePackage{lwarp-verse}% req'd
-\LetLtxMacro\LWR@orig@label\@mem@old@label
+\let\LWR@orig@label\@mem@old@label
+\let\@mem@old@label\LWR@new@label
+\AtBeginDocument{
+ \renewcommand*{\sf@@memsub@label}[1]{%
+ \@bsphack
+ \sf@@memsub@label@hook{#1}%
+ \@memoldlabel{#1}%
+ \LWR@label@createtag{sub@#1}%
+ \protected@write\@auxout{}{%
+ \string\newlabel{sub@#1}%
+ {{\@nameuse{@@thesub\@captype}}%
+ {\thepage}}}%
+ \LWR@write@lwarplabel{sub@#1}%
+ \@esphack
+ }
+}
\setstocksize{190in}{20in}
\setlrmarginsandblock{2in}{2in}{*}
@@ -406,10 +420,9 @@
\renewcommand*{\makeheadposition}[5]{}
\renewcommand{\makepsmarks}[2]{}
\renewcommand*{\makeheadfootstrut}[3]{}
-
-\renewcommand{\createplainmark}[3]{}
+\renewcommand{\createmark}[5]{\csdef{#1mark}[1]{}}
+\renewcommand{\createplainmark}[3]{\csdef{#1mark}{}}
\renewcommand{\memUChead}[1]{}
-\renewcommand{\createmark}[5]{}
\renewcommand*{\clearplainmark}[1]{}
\renewcommand*{\clearmark}[1]{}
\renewcommand{\addtopsmarks}[3]{}
@@ -636,10 +649,32 @@
\renewcommand{\settocpreprocessor}[2]{}
\DeclareRobustCommand{\cftpagenumbersoff}[1]{}
\DeclareRobustCommand{\cftpagenumberson}[1]{}
+\AtBeginDocument{
+\def\@xfloat #1[#2]{%
+ \LWR@floatbegin{#1}[#2]
+ \normalsize
+ \@nameuse{#1adjustment}%
+ \LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment%
+}
+\def\@xdblfloat #1[#2]{%
+ \LWR@floatbegin{#1}[#2]
+ \normalsize
+ \@nameuse{#1adjustment}%
+ \LWR@futurenonspacelet\LWR@mynexttoken\LWR@floatalignment%
+}
+}
\RenewDocumentCommand{\newfloat}{o m m m}{%
- \IfValueTF{#1}%
- {\DeclareFloatingEnvironment[fileext=#3,within=#1,name={#4}]{#2}}%
- {\DeclareFloatingEnvironment[fileext=#3,name={#4}]{#2}}%
+ \def\LWR@tempone{#4}%
+ \def\LWR@temptwo{\@nameuse{#2name}}%
+ \ifdefequal{\LWR@tempone}{\LWR@temptwo}{% recursive name, already defined
+ \IfValueTF{#1}%
+ {\DeclareFloatingEnvironment[fileext=#3,within=#1]{#2}}%
+ {\DeclareFloatingEnvironment[fileext=#3]{#2}}%
+ }{% not recursive name
+ \IfValueTF{#1}%
+ {\DeclareFloatingEnvironment[fileext=#3,within=#1,name={#4}]{#2}}%
+ {\DeclareFloatingEnvironment[fileext=#3,name={#4}]{#2}}%
+ }%
\cslet{listof#2s}\relax%
\cslet{listof#2es}\relax%
}
@@ -667,7 +702,7 @@
\NewDocumentEnvironment{KFLTmemoir@marginfloat}{O{-1.2ex} m}
{% start
\LWR@BlockClassWP{float:right; width:2in; margin:10pt}{}{marginblock}%
- \captionsetup{type=#2}%
+ \renewcommand*{\@captype}{#2}%
}
{%
\endLWR@BlockClassWP%
@@ -696,14 +731,13 @@
\renewcommand{\flegfigure}{\figurename}
\renewcommand{\flegtoctable}{}
\renewcommand{\flegtocfigure}{}
-\renewcommand{\subcaption}[2][]{%
- \ifblank{#1}{\subfloat[#2]{}}{\subfloat[#1][#2]{}}%
+\renewcommand{\@makesubfloatcaption}[2]{%
+ \minipagefullwidth
+ \begin{minipage}{\linewidth}%
+ #1 \ignorespaces #2 \unskip%
+ \end{minipage}
}
-\renewcommand{\contsubcaption}{\ContinuedFloat\subcaption}
-
-\LetLtxMacro\subcaptionref\subref
-
\renewcommand*{\tightsubcaptions}{}
\renewcommand*{\loosesubcaptions}{}
@@ -727,11 +761,12 @@
\renewcommand*{\sidecapmargin}[1]{}
\scapmargleftfalse
\renewcommand*{\setsidecappos}[1]{}
-
\RenewDocumentEnvironment{sidecontcaption}{m o}
{}
{%
- \ContinuedFloat%
+ \ifdef{\ContinuedFloat}%
+ {\ContinuedFloat}%
+ {\addtocounter{\@captype}{-1}}%
\caption{#1}%
\IfValueT{#2}{\label[\@captype]{#2}}%
}
@@ -769,7 +804,7 @@
\renewcommand*{\verbfootnote}[2][]{%
\PackageError{lwarp,memoir}%
- {Verbatim footnotes are not yet supported by lwarp.}%
+ {Verbatim footnotes are not yet supported by lwarp}%
{This may be improved some day.}%
}
@@ -781,7 +816,7 @@
\renewcommand*{\newfootnoteseries}[1]{%
\PackageError{lwarp,memoir}%
- {Memoir footnote series are not yet supported by lwarp.}%
+ {Memoir footnote series are not yet supported by lwarp}%
{This may be improved some day.}%
}
@@ -825,16 +860,32 @@
\renewcommand*{\sidefootmarkstyle}[1]{}
\renewcommand*{\sidefoottextfont}{}
\renewcommand*{\sidefootform}{}
-
\renewcommand*{\continuousnotenums}{\pncontopttrue}% from pagenote
\renewcommand*{\notepageref}{}
\renewcommand*{\prenotetext}{}
\renewcommand*{\postnotetext}{}
-\renewcommand*{\idtextinnotes}[1]{}
-\renewcommand*{\printpageinnotes}[1]{}
-\renewcommand*{\printpageinnoteshyperref}[1]{}
+\LetLtxMacro\printpageinnoteshyperref\printpageinnotes
\renewcommand*{\foottopagenote}{}
\renewcommand*{\pagetofootnote}{}
+\xpatchcmd{\m@m@wrpnote}
+ {\string\startnoteentry{\thepagenote}}
+ {\string\startnoteentry{{\thepagenote}{\arabic{pagenote}}}}
+ {}
+ {\LWR@patcherror{memoir}{m@m@wrpnote}}
+
+\renewcommand\startnoteentrystart[4]{%
+ \prenoteinnotes%
+ \noteidinnotes{\@firstoftwo#1}{#2}%
+ \@ifmtarg{#2}{%
+ \def\@currentlabel{\@firstoftwo#1}% lwarp
+ \def\cref@currentlabel{% lwarp
+ [pagenote][\@secondoftwo#1][]\@firstoftwo#1% lwarp
+ }% lwarp
+ }{}%
+ \pagenoteanchor{#4}%
+ \pageinnotes{#3}%
+ \prenotetext%
+}
\renewcommand*{\epigraphposition}[1]{}
\renewcommand*{\epigraphtextposition}[1]{}
\renewcommand*{\epigraphsourceposition}[1]{}
@@ -866,10 +917,6 @@
\renewcommand*{\PoemTitlefont}{}
\renewenvironment{qframe}{\framed}{\endframed}
\renewenvironment{qshade}{\shaded}{\endshaded}
-\renewcommand*{\commentsoff}[1]{\includecomment{#1}}
-\renewcommand*{\commentson}[1]{\excludecomment{#1}}
-\LetLtxMacro\renewcomment\commentson
-
\renewcommand*{\setverbatimfont}[1]{}
\renewcommand*{\tabson}[1]{}
\renewcommand*{\tabsoff}{}
@@ -1087,32 +1134,50 @@
\endgroup%
}
-\RenewDocumentCommand{\subtop}{O{} O{} m}{%
- \subfloat[#1][#2]{#3}%
-}
-
-\RenewDocumentCommand{\subbottom}{O{} O{} m}{%
- \subfloat[#1][#2]{#3}%
-}
-\renewcommand{\contsubtop}{%
- \ContinuedFloat
- \subtop%
-}
-
-\renewcommand{\contsubbottom}{%
- \ContinuedFloat
- \subbottom%
+\renewcommand{\@memsubbody}{%
+ \bgroup
+ \let\label=\memsub@label
+ \ifdonemaincaption\else
+ \advance\csname c@\@captype\endcsname\@ne
+ \fi
+ % \refstepcounter{sub\@captype}\@contkeep%
+ \@ifnextchar [%
+ {\@memsubfig}%
+ {\@memsubfig[\@empty]}}
+
+\renewcommand{\@memcontsubbody}{%
+ \bgroup
+ \let\label=\memsub@label
+ \@contset
+ % \refstepcounter{sub\@captype}\@contkeep%
+ \@ifnextchar [%
+ {\@memsubfig}%
+ {\@memsubfig[\@empty]}}
+
+\long\def\@memsubfloat#1[#2][#3]#4{%
+ \bgroup%
+ \mem@step@subcounter%
+ \LWR@stoppars%
+ \minipagefullwidth% lwarp
+ \begin{minipage}{\linewidth}% lwarp
+ \bgroup
+ \if@contbotsub
+ #4% \box\@tempboxa
+ \egroup
+ \ifx \@empty#3\relax \else
+ \@memsubcaption{#1}{#2}{#3}%
+ \fi
+ \else
+ \ifx \@empty#3\relax \else
+ \@memsubcaption{#1}{#2}{#3}%
+ \fi\egroup
+ #4% \box\@tempboxa
+ \fi
+ \end{minipage}% lwarp
+ \LWR@startpars% lwarp
+ \egroup
+\egroup
}
-\renewcommand{\subconcluded}{}
-
-\let\contsubtable\contsubtop
-\let\contsubfigure\contsubbottom
-\newcommand{\newfloatentry}[4][\@empty]{TODO: newfloatentry}
-\newcommand{\newfloatlist}[5][\@empty]{TODO: newfloatlist}
-\newcommand{\newfloatenv}[4][\@empty]{TODO: newfloatenv}
-\DeclareRobustCommand{\newfloatpagesoff}[1]{}
-\DeclareRobustCommand{\newfloatpageson}[1]{}
-\newcommand{\setnewfloatindents}[3]{}
\newlistof{tableofcontents}{toc}{\contentsname}
\newlistof{listoffigures}{lof}{\listfigurename}
\newlistof{listoftables}{lot}{\listtablename}