diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 305 |
1 files changed, 160 insertions, 145 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index ce165a885a4..124f1e70a7d 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty @@ -17,7 +17,7 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{lwarp} - [2017/08/19 v0.37 Allows LaTeX to directly produce HTML5 output.] + [2017/08/27 v0.38 Allows LaTeX to directly produce HTML5 output.] @@ -201,6 +201,8 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{algorithmicx} \LWR@loadafter{alltt} \LWR@loadafter{amsthm} +\LWR@loadafter{appendix} +\LWR@loadafter{arabicfront} \LWR@loadafter{array} \LWR@loadafter{balance} \LWR@loadafter{bookmark} @@ -209,6 +211,8 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{boxedminipage2e} \LWR@loadafter{ccaption} \LWR@loadafter{changepage} +\LWR@loadafter{chappg} +\LWR@loadafter{color} \LWR@loadafter{crop} \LWR@loadafter{cutwin} \LWR@loadafter{dcolumn} @@ -226,15 +230,18 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{fancyhdr} \LWR@loadafter{fancyvrb} \LWR@loadafter{figcaps} +\LWR@loadafter{fix2col} \LWR@loadafter{float} \LWR@loadafter{floatflt} \LWR@loadafter{floatpag} \LWR@loadafter{floatrow} \LWR@loadafter{flushend} +\LWR@loadafter{fncychap} \LWR@loadafter{ftnright} \LWR@loadafter{fullpage} \LWR@loadafter{geometry} \LWR@loadafter{glossaries} +\LWR@loadafter{grffile} \LWR@loadafter{hyperref} \LWR@loadafter{hyperxmp} \LWR@loadafter{idxlayout} @@ -253,6 +260,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{marginnote} \LWR@loadafter{mcaption} \LWR@loadafter{mdframed} +\LWR@loadafter{metalogo} \LWR@loadafter{microtype} \LWR@loadafter{moreverb} \LWR@loadafter{mparhack} @@ -261,6 +269,8 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{needspace} \LWR@loadafter{newtxmath} \LWR@loadafter{nextpage} +\LWR@loadafter{nonumonpart} +\LWR@loadafter{nopageno} \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} \LWR@loadafter{pagenote} @@ -271,6 +281,10 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{placeins} \LWR@loadafter{prelim2e} \LWR@loadafter{ragged2e} +\LWR@loadafter{realscripts} +\LWR@loadafter{relsize} +\LWR@loadafter{romanbar} +\LWR@loadafter{romanbarpagenumber} \LWR@loadafter{rotating} \LWR@loadafter{rotfloat} \LWR@loadafter{savetrees} @@ -280,6 +294,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{showkeys} \LWR@loadafter{sidecap} \LWR@loadafter{sidenotes} +\LWR@loadafter{siunitx} \LWR@loadafter{soul} \LWR@loadafter{subfig} \LWR@loadafter{tabularx} @@ -291,6 +306,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{titleps} \LWR@loadafter{titlesec} \LWR@loadafter{titletoc} +\LWR@loadafter{tocbibind} \LWR@loadafter{tocloft} \LWR@loadafter{transparent} \LWR@loadafter{trivfloat} @@ -302,6 +318,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{wrapfig} \LWR@loadafter{xcolor} \LWR@loadafter{xfrac} +\LWR@loadafter{xltxtra} \LWR@loadafter{xmpincl} @@ -680,81 +697,13 @@ top=1in,bottom=1in,% \end{warpHTML} \begin{warpHTML} -\AtBeginDocument{% in case textcomp was not loaded - \@ifpackageloaded{textcomp} { -\let\LWR@origtextdegree\textdegree -\let\LWR@origtextcelsius\textcelsius -\let\LWR@origtextohm\textohm -\let\LWR@origtextmu\textmu -\LetLtxMacro\LWR@origcapitalcedilla\capitalcedilla -\LetLtxMacro\LWR@origcapitalogonek\capitalogonek -\LetLtxMacro\LWR@origcapitalgrave\capitalgrave -\LetLtxMacro\LWR@origcapitalacute\capitalacute -\LetLtxMacro\LWR@origcapitalcircumflex\capitalcircumflex -\LetLtxMacro\LWR@origcapitaltilde\capitaltilde -\LetLtxMacro\LWR@origcapitaldieresis\capitaldieresis -\LetLtxMacro\LWR@origcapitalhungarumlaut\capitalhungarumlaut -\LetLtxMacro\LWR@origcapitalring\capitalring -\LetLtxMacro\LWR@origcapitalcaron\capitalcaron -\LetLtxMacro\LWR@origcapitalbreve\capitalbreve -\LetLtxMacro\LWR@origcapitalmacron\capitalmacron -\LetLtxMacro\LWR@origcapitaldotaccent\capitaldotaccent -\LetLtxMacro\LWR@origtextcircled\textcircled -\ifPDFTeX -\renewcommand*{\textdegree}{\HTMLentity{deg}} -\renewcommand*{\textcelsius}{\HTMLentity{deg}\,C} -\renewcommand*{\textohm}{\HTMLunicode{2126}} -\renewcommand*{\textmu}{\HTMLunicode{00B5}} -\else -\renewcommand*{\textdegree}{°} -\renewcommand*{\textcelsius}{°C} -\renewcommand*{\textohm}{Ω} -\renewcommand*{\textmu}{μ} -\fi -\renewcommand*{\capitalcedilla}[1]{#1\HTMLunicode{0327}} -\renewcommand*{\capitalogonek}[1]{#1\HTMLunicode{0328}} -\renewcommand*{\capitalgrave}[1]{#1\HTMLunicode{0300}} -\renewcommand*{\capitalacute}[1]{#1\HTMLunicode{0301}} -\renewcommand*{\capitalcircumflex}[1]{#1\HTMLunicode{0302}} -\renewcommand*{\capitaltilde}[1]{#1\HTMLunicode{0303}} -\renewcommand*{\capitaldieresis}[1]{#1\HTMLunicode{0308}} -\renewcommand*{\capitalhungarumlaut}[1]{#1\HTMLunicode{30B}} -\renewcommand*{\capitalring}[1]{#1\HTMLunicode{30A}} -\renewcommand*{\capitalcaron}[1]{#1\HTMLunicode{30C}} -\renewcommand*{\capitalbreve}[1]{#1\HTMLunicode{306}} -\renewcommand*{\capitalmacron}[1]{#1\HTMLunicode{304}} -\renewcommand*{\capitaldotaccent}[1]{#1\HTMLunicode{307}} -\renewcommand*{\textcircled}[1]{% -\InlineClass[border: 1px solid \LWR@currenttextcolor]{textcircled}{#1}% -} -\newcommand*{\LWR@restoreorigtextcomp}{% -\let\textdegree\LWR@origtextdegree% -\let\textcelsius\LWR@origtextcelsius% -\let\textohm\LWR@origtextohm% -\let\textmu\LWR@origtextmu% -\LetLtxMacro\capitalcedilla\LWR@origcapitalcedilla% -\LetLtxMacro\capitalogonek\LWR@origcapitalogonek% -\LetLtxMacro\capitalgrave\LWR@origcapitalgrave% -\LetLtxMacro\capitalacute\LWR@origcapitalacute% -\LetLtxMacro\capitalcircumflex\LWR@origcapitalcircumflex% -\LetLtxMacro\capitaltilde\LWR@origcapitaltilde% -\LetLtxMacro\capitaldieresis\LWR@origcapitaldieresis% -\LetLtxMacro\capitalhungarumlaut\LWR@origcapitalhungarumlaut% -\LetLtxMacro\capitalring\LWR@origcapitalring% -\LetLtxMacro\capitalcaron\LWR@origcapitalcaron% -\LetLtxMacro\capitalbreve\LWR@origcapitalbreve% -\LetLtxMacro\capitalmacron\LWR@origcapitalmacron% -\LetLtxMacro\capitaldotaccent\LWR@origcapitaldotaccent% -\LetLtxMacro\textcircled\LWR@origtextcircled% -} -}% textcomp loaded -{% textcomp not loaded -\newcommand*{\LWR@restoreorigtextcomp}{}% -}% textcomp not loaded - -}% AtBeginDocument +\LWR@origRequirePackage{lwarp-textcomp} +} +{ +\providecommand*{\LWR@restoreorigtextcomp}{}% +} \end{warpHTML} @@ -800,26 +749,6 @@ top=1in,bottom=1in,% -\begin{warpHTML} - -\AtBeginDocument{% in case textcomp was not loaded - -\@ifpackageloaded{siunitx} -{ -\DeclareSIUnit\bohr{\textit{a}\textsubscript{0}} -\DeclareSIUnit\clight{\textit{c}\textsubscript{0}} -\DeclareSIUnit\elementarycharge{\textit{e}} -\DeclareSIUnit\electronmass{\textit{m}\textsubscript{e}} -\DeclareSIUnit\hartree{\textit{E}\textsubscript{h}} -}% siunitx loaded -{}% siunitx not loaded - -}% AtBeginDocument - -\end{warpHTML} - - - \begin{warpprint} \typeout{lwarp: generating configuration files} \end{warpprint} @@ -944,7 +873,7 @@ body { p {margin: 1.5ex 0em 1.5ex 0em ;} /* Holds a section number to add space between it and the name */ -span.sectionnumber { margin-right: .6em } +span.sectionnumber { margin-right: 0em } /* Inserted in front of index lines */ span.indexitem {margin-left: 0em} @@ -984,6 +913,28 @@ span.textsf { span.textcircled { border: 1px solid black ; border-radius: 1ex ; } +/* For realscripts */ +.supsubscript { + display: inline-block; + text-align:left ; +} + +.supsubscript sup, +.supsubscript sub { + position: relative; + display: block; + font-size: .5em; + line-height: 1; +} + +.supsubscript sup { + top: .5em; +} + +.supsubscript sub { + top: .5em; +} + span.attribution { margin-left: 1em ; font-size: 80% ; font-variant: small-caps; } @@ -1842,9 +1793,12 @@ div.sidetoccontents { nav.sidetoc p {line-height:1.2 ; margin: 1ex .5em 1ex .5em ; text-indent: 0 ; } + nav.sidetoc p a {color:black ; font-size: .7em ;} + div.sidetoctitle {font-size: 1.2em; font-weight:bold; text-align:center; border-bottom: 1px solid silver ; } + nav.sidetoc a:hover {text-decoration: underline ; } section.textbody { margin: 0ex 1em 0ex 1em ;} @@ -2621,7 +2575,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- -- Print the usage of the lwarpmk command: -printversion = "v0.37" +printversion = "v0.38" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -2630,10 +2584,12 @@ end function printusage () print ( [[ -lwarpmk print [project]: Compile a print version. +lwarpmk print [project]: Compile the print version if necessary. +lwarpmk print1 [project]: Forced single compile of the print version. lwarpmk printindex [project]: Process the index for the print version. lwarpmk printglossary [project]: Process the glossary for the print version. -lwarpmk html [project]: Compile an HTML version. +lwarpmk html [project]: Compile the HTML version if necessary. +lwarpmk html1 [project]: Forced single compile of the HTML version. lwarpmk htmlindex [project]: Process the index for the html version. lwarpmk htmlglossary [project]: Process the glossary for the html version. lwarpmk again [project]: Touch the source code to trigger recompiles. @@ -2937,7 +2893,7 @@ end if (arg[1] == "--version") then print ( "lwarpmk: " .. printversion ) -else -- not -- version +else -- not --version -- print intro: @@ -2968,6 +2924,12 @@ else -- not latexmk end end -- not latexmk +elseif arg[1] == "print1" then + loadconf () + verifyfileexists (sourcename .. ".tex") ; + onetime("") + print ("lwarpmk: Done.") ; + -- lwarp printindex: -- Compile the index then touch the source -- to trigger a recompile of the document: @@ -3028,6 +2990,13 @@ else -- not latexmk end end -- not latexmk +elseif arg[1] == "html1" then + loadconf () + verifyfileexists ( sourcename .. ".tex" ) ; + onetime("_html") + pdftohtml () + print ("lwarpmk: Done.") + elseif arg[1] == "pdftohtml" then loadconf () pdftohtml () @@ -3384,16 +3353,21 @@ end -- not --version \end{warpHTML} + \begin{warpHTML} \newcommand{\LWR@forcenewpage}{% \LWR@stoppars\LWR@orignewpage\LWR@startpars% } - \renewcommand*{\pagestyle}[1]{} \renewcommand*{\thispagestyle}[1]{} +\renewcommand*{\markboth}[2]{} +\renewcommand*{\markright}[1]{} +\renewcommand*{\raggedbottom}{} +\renewcommand*{\flushbottom}{} +\renewcommand*{\sloppy}{} +\renewcommand*{\fussy}{} \renewcommand*{\pagenumbering}[1]{} - \end{warpHTML} @@ -4144,6 +4118,24 @@ end -- not --version \begin{warpHTML} +\newbool{LWR@forcinghtmlpage} +\boolfalse{LWR@forcinghtmlpage} + +\newcommand*{\ForceHTMLPage}{% +\global\booltrue{LWR@forcinghtmlpage}% +} +\newbool{LWR@forcinghtmltoc} +\boolfalse{LWR@forcinghtmltoc} + +\newcommand*{\ForceHTMLTOC}{% +\global\booltrue{LWR@forcinghtmltoc}% +} +\end{warpHTML} +\begin{warpprint} +\newcommand*{\ForceHTMLPage}{} +\newcommand*{\ForceHTMLTOC}{} +\end{warpprint} +\begin{warpHTML} \newbool{LWR@mainmatter} \DeclareDocumentCommand{\mainmatter}{}{% \booltrue{LWR@mainmatter}% @@ -4172,36 +4164,46 @@ end -- not --version } \newcounter{LWR@prevFileDepth} \setcounter{LWR@prevFileDepth}{\LWR@depthsubparagraph} +\def\@seccntformat#1{\csname the#1\endcsname\protect\quad} \DeclareDocumentCommand{\LWR@section}{m m m m}{% -\LWR@traceinfo{LWR@section}% +\LWR@traceinfo{LWR@section |#2| |#3|}% +\LWR@traceinfo{LWR@section: not an empty section}% \LWR@stoppars% \global\boolfalse{LWR@minipagethispar}% \LWR@traceinfo{LWR@section: testing whether to start a new HTML file}% -\IfBooleanTF{#1}{% starred - \LWR@orignewpage% - -}{% not starred - \ifthenelse{% - \cnttest{\csuse{LWR@depth#4}}{<=}{\value{FileDepth}}% - \AND% - \(% +\IfBooleanTF{#1}{\LWR@traceinfo{LWR@section: starred}}{}% +\ifbool{LWR@forcinghtmlpage}{\LWR@traceinfo{LWR@section: forcinghtmlpage}}{}% +\ifthenelse{% + \(% + \(\NOT\equal{#1}{\BooleanTrue}\)\OR% + \(\cnttest{\csuse{LWR@depth#4}}{=}{\LWR@depthpart}\)\OR% + \(\boolean{LWR@forcinghtmlpage}\)% + \)% + \AND% + \cnttest{\csuse{LWR@depth#4}}{<=}{\value{FileDepth}}% + \AND% + \(% \NOT\boolean{CombineHigherDepths}\OR% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{LWR@prevFileDepth}}% - \)% - }% - {% new file - \LWR@traceinfo{LWR@section: new HTML file}% - \IfNoValueTF{#2}% - {\LWR@newhtmlfile{#3}}% - {\LWR@newhtmlfile{#2}}% - }% new file - {% not new file - \LWR@orignewpage% - - }% not new file -}% not starred + \)% + \AND% + \NOT\equal{#3}{}% phantomsection +}% +{% new file + \LWR@traceinfo{LWR@section: new HTML file}% + \IfNoValueTF{#2}% + {\LWR@newhtmlfile{#3}}% + {\LWR@newhtmlfile{#2}}% +}% new file +{% not new file + \LWR@traceinfo{LWR@section: not a new HTML file}% + \LWR@orignewpage% + +}% not new file +\IfValueTF{#3}{% \LWR@traceinfo{LWR@section: about to LWR@setlatestname}% \IfValueTF{#2}{\LWR@setlatestname{#2}}{\LWR@setlatestname{#3}}% +}{}% \ifbool{HTMLDebugComments}{% \LWR@htmlcomment{Opening #4 ``#3''{}}% @@ -4214,7 +4216,11 @@ end -- not --version {}% \LWR@createautosec{\csuse{LWR@tag#4}}% \IfBooleanTF{#1}% -{}% starred +{% +\ifbool{LWR@forcinghtmltoc}% +{\addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}}% +{}% +}% starred {% not starred \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}% @@ -4227,17 +4233,19 @@ end -- not --version \refstepcounter{#4}% \LWR@traceinfo{LWR@section: about to addcontentsline}% \addcontentsline{toc}{#4}% - {\protect\LWR@sectionnumber{\csuse{the#4}}% - \IfValueTF{#2}{ #2}{ #3}}% + {% + \protect\numberline{\csuse{the#4}}% + {\ignorespaces\IfValueTF{#2}{#2}{#3}\protect\relax}% + }% \LWR@traceinfo{LWR@section: finished addcontentsline}% }% end of if main matter {% not main matter \LWR@traceinfo{LWR@section: no main matter}% - \addcontentsline{toc}{#4}{\IfValueTF{#2}{ #2}{ #3}}% + \addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}% }% end of not main matter }% end of secnumdepth {% - \addcontentsline{toc}{#4}{\IfValueTF{#2}{ #2}{ #3}}% + \addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}% }% \ifbool{LWR@mainmatter}% {% @@ -4252,7 +4260,7 @@ end -- not --version \ifthenelse{% \cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}% }% - {\protect\LWR@sectionnumber{\csuse{the#4}}~}% + {\protect\LWR@sectionnumber{\@seccntformat{#4}}}% {}% \LWR@traceinfo{LWR@section: finished print section number}% }{}% @@ -4265,18 +4273,24 @@ end -- not --version }% {\LWR@startpars}% {}% -\IfBooleanTF{#1}% -{}% +\ifthenelse{% + \NOT\equal{#1}{\BooleanTrue}\OR% + \cnttest{\csuse{LWR@depth#4}}{=}{\LWR@depthpart}% +}% {% not starred \setcounter{LWR@prevFileDepth}{\csuse{LWR@depth#4}}% }% not starred +{}% +\ifstrempty{#3}% +{}% +{% +\global\boolfalse{LWR@forcinghtmlpage}% +\global\boolfalse{LWR@forcinghtmltoc}% +}% \LWR@traceinfo{LWR@section: done}% } -\@ifundefined{chapter} -{} -{% \DeclareDocumentCommand{\part}{s o m}{% \LWR@epubprintpendingfootnotes% \LWR@stoppars% @@ -4285,7 +4299,6 @@ end -- not --version \LWR@section{#1}{#2}{#3}{part}% } -} \@ifundefined{chapter} {} @@ -4297,9 +4310,7 @@ end -- not --version \LWR@startnewdepth{\LWR@depthchapter}{\LWR@printclosechapter}% -\LWR@traceinfo{chapter: about to LWR@section}% \LWR@section{#1}{#2}{#3}{chapter}% -\LWR@traceinfo{chapter: done}% } } @@ -6280,7 +6291,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \renewcommand*{\numberline}[1]{% -\LWR@sectionnumber{#1}% +\LWR@sectionnumber{#1}\quad% } \NewDocumentCommand{\hypertoc}{m m +m m}{% @@ -6341,20 +6352,20 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \newcounter{LWR@autoglossary} \setcounter{LWR@autoglossary}{0} -\@ifundefined{chapter} - {\newcommand*{\LWR@indexsection}{\section{\indexname}}} - {\newcommand*{\LWR@indexsection}{\chapter{\indexname}}} - \let\LWR@origprintindex\printindex \renewcommand*{\printindex} { -\LWR@indexsection \LWR@startpars \LWR@origprintindex } +\@ifundefined{chapter} +{\newcommand*{\LWR@indexsection}[1]{\section*{#1}}} +{\newcommand*{\LWR@indexsection}[1]{\chapter*{#1}}} + \renewenvironment*{theindex}{% +\LWR@indexsection{\indexname}% \let\item\LWR@indexitem% \let\subitem\LWR@indexsubitem% \let\subsubitem\LWR@indexsubsubitem% @@ -6499,7 +6510,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% } }{}% not eq > 0 } - +\newcommand*{\LWR@restoreorigrelsize}{} \newcommand*{\LWR@restoreorigformatting}{% \LWR@traceinfo{LWR@restoreorigformatting}% \LetLtxMacro{\hspace}{\LWR@orighspace}% @@ -6562,6 +6573,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@restoremoreorigxcolor% \LWR@restoreorigtextcomp% \LWR@restoreorigaccents% +\LWR@restoreorigrelsize% \LWR@FBcancel% } @@ -8068,7 +8080,9 @@ width:\rndprintlength{\LWR@tempwidth}% \begin{warpHTML} -\newcommand*{\phantomsection}{\section*{}} +\newcommand*{\phantomsection}{% +\section*{}% +} \end{warpHTML} @@ -8131,6 +8145,7 @@ width:\rndprintlength{\LWR@tempwidth}% \end{warpHTML} + \endinput %% %% End of file `lwarp.sty'. |