From a446276fde2e4a633907b16a14023894d6df7054 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 23 Mar 2017 21:28:36 +0000 Subject: lwarp (23mar17) git-svn-id: svn://tug.org/texlive/trunk@43584 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 1611 ++++++++++++++++++++++-- Master/texmf-dist/source/latex/lwarp/lwarp.ins | 9 + 2 files changed, 1536 insertions(+), 84 deletions(-) (limited to 'Master/texmf-dist/source') diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 7d75f17ad54..25aeed06563 100644 --- a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx +++ b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx @@ -16,7 +16,7 @@ % \iffalse %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{lwarp} -% [2017/03/15 v0.24 Allows LaTeX to directly produce HTML5 output.] +% [2017/03/22 v0.25 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -56,7 +56,6 @@ \newunicodechar{Ô}{\^{O}} \newunicodechar{ê}{\^{e}} - \usepackage[log-declarations=false]{xparse} \usepackage[lwarpmk]{lwarp-newproject} @@ -178,6 +177,9 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\goesto}{$\Rightarrow$} +\newcommand{\credits}[1]{{\footnotesize(\textit{Based on original code by} \textsc{#1}.)}} + + \newcommand{\userentry}[1]{% \par \smallskip @@ -421,6 +423,22 @@ Limitations when using MathJax include: \end{itemize} } +\newcommand{\limitsntheorem}{% +This conversion is not total. +\watchout[Font control] +Font control is via \acro{CSS}, and the custom \LaTeX\ font settings +are ignored. + +\pkg{ntheorem} has a bug with equation numbering in AMS environments +\watchout[Equation numbering] +when the option \texttt{thref} is used. \pkg{lwarp} does not share +this bug, so equations with \cs{split}, etc, are numbered correctly +with \pkg{lwarp}'s \acro{HTML} output, but not with the print output. +It is recommended to use \pkg{cleveref} instead of \pkg{ntheorem}'s +\texttt{thref} option. +} + + \newcommand{\limitsgraphics}{% \cs{graphicspath} only works for a single directory; \margintag{\cs{graphicspath}} @@ -799,7 +817,7 @@ operating-system path separator used by \pkg{lwarp}. %<*package> % \fi % -% \CheckSum{9001} +% \CheckSum{10279} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -861,6 +879,8 @@ operating-system path separator used by \pkg{lwarp}. % \changes{v0.22}{2017/03/02}{\ 2017/03/02} % \changes{v0.23}{2017/03/02}{\ 2017/03/02} % \changes{v0.24}{2017/03/15}{\ 2017/03/15} +% \changes{v0.25}{2017/03/22}{\ 2016/03/22} +% \changes{v0.25}{2017/03/16}{Docs: Adds credits for patched code.} @@ -987,9 +1007,19 @@ operating-system path separator used by \pkg{lwarp}. % \section{Updates} % \label{sec:updates} % +% The following is intended for those updating existing projects which use +% \pkg{lwarp}, highlighting any special changes which must be made due +% to improvements or modifications in \pkg{lwarp} itself. +% % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} +% \item[v0.25:] \ +% \begin{itemize} +% \item Fix: Allows \pkg{graphicx} and \pkg{graphicsx} before \pkg{lwarp} because +% \XeLaTeX\ and \LuaLaTeX\ use \pkg{xunicode} which uses \pkg{graphics}. +% \item Package support for \pkg{framed}, several theorem packages, and ellipses. +% \end{itemize} % \item[v0.24:] \ % \begin{itemize} % \item \pkg{tikz}'s |babel| library is load automatically as needed. @@ -1228,6 +1258,7 @@ operating-system path separator used by \pkg{lwarp}. % \AmS{} environments are supported. % User-defined macros are available during converson, % due to native \LaTeX{} processing.\\ +% \pkg{theorem}, \pkg{amsthm}, \pkg{ntheorem}: & Supported, with added \acro{CSS} tags. \\ % \midrule % Floats: & Supported, appear where declared. % \pkg{float} is emulated, \pkg{newfloat} is supported, @@ -1267,13 +1298,12 @@ operating-system path separator used by \pkg{lwarp}. % \pkg{enumitem}: & Supported, although spacing is still controlled by \acro{CSS}. \\ % \midrule % Environments: & Standard \LaTeX{} environments are supported. \\ -% \pkg{theorem}: & Supported, with added \acro{CSS} tags. \\ % \pkg{picture} and \pkg{tikz}: & Converted to an \acro{SVG} image. \\ % \env{minipage}: & Supported with some \acro{HTML}5-imposed limitations. % Nested minipages are supported. % Footnotes appear at the bottom of the \acro{HTML} page. \\ % \pkg{fancyvrb}: & Supported except for verbatim footnotes. \\ -% \pkg{mdframed}: & Supported \\ +% \pkg{framed}, \pkg{mdframed}: & Supported \\ % \pkg{multicol}: & Emulated, with \acro{CSS}3. % Converted to up to three columns with an optional heading, % per browser support. Single-column if unsupported.\\ @@ -1317,8 +1347,7 @@ operating-system path separator used by \pkg{lwarp}. % % Supported packages include everything listed in the table of contents, % plus each of the following in \cref{tab:additionalsupported}, -% and certainly others as well. -% Not all have been thoroughly tested. +% and probably others which have not yet been tested. % Many are simply nullfied during \acro{HTML} output. % Others are not affected by the output mode and thus work as-is. % @@ -1333,7 +1362,7 @@ operating-system path separator used by \pkg{lwarp}. % fancyvrb, fileerr, % newtxmath, % siunitx, somedefs, -% theorem, tikz, trace, +% tikz, trace, % varioref, % xspace % \end{table} @@ -3094,6 +3123,10 @@ operating-system path separator used by \pkg{lwarp}. % \margintag{custom MathJax macros} % see page \pageref{ex:mathjaxmacros}. % +% \subsubsection{Ntheorem} +% +% \limitsntheorem +% % % \subsubsection{Graphics} % @@ -3247,14 +3280,38 @@ operating-system path separator used by \pkg{lwarp}. % or \cs{LWR@ProvidesPackagePass}. If |Drop|ped, the original print-version % package is ignored, and only the |lwarp-| version is used. % Use this where the original print version is useless for \acro{HTML}. -% If |Pass|ed, the original package is loaded first, with the supplied options, then -% the |lwarp-| version continues loading as well. Use this when \acro{HTML} +% If |Pass|ed, the original package is loaded first, with the user-supplied options, +% then the |lwarp-| version continues loading as well. +% See \cref{sec:ntheorem} (\nameref{sec:ntheorem}) +% for an example of selectively disabling user options for a package. +% Use this when \acro{HTML} % output only requires some modifications of the original package. % For a case where the original package is usable without changes, there is no % need to create a |lwarp-| version. % % +% \subsection{Testing \protect\pkg{lwarp}} +% +% \changes{v0.25}{2017/03/22}{Docs: Testing \protect\pkg{lwarp}.} +% +% When changes have been made, test the print output before testing the +% \acro{HTML}. The print output compiles faster, and any errors in the printed +% version will be easier to figure out than the \acro{HTML} version. +% +% The package \pkg{lwarp-newproject} must be loaded to set up the configuration +% files, but may be commented out from then on unless the configuration changes. +% A small amount of time is taken each time \pkg{lwarp-newproject} is run. +% +% Remember that the configuration files are only rewritten when compiling the +% printed version of the document, and when \pkg{lwarp-newproject} is enabled. % +% Sometimes it is worth checking the |_html.pdf| file, which is the +% \acro{PDF} containing \acro{HTML} tags. Also, |_html.html| has +% the text conversion of these tags, before the file is split into individual +% \acro{HTML} files. +% +% It is also worth checking the browser's tools for verifying the correctness +% of \acro{HTML} and \acro{CSS} code. % % % \section{Troubleshooting} @@ -3825,20 +3882,45 @@ after lwarp.} % \end{macro} +% \begin{macro}{\LWR@loadnever} \marg{badpackagename} \marg{replacementpkgname} +% +% The first packages is not supported, so tell the user to use the second instead. +% +% \changes{v0.25}{2017/03/16}{Added the ability to prevent conflicting packages.} +% +% \begin{macrocode} +\newcommand*{\LWR@loadnever}[2]{% +\PackageError{lwarp} +{Package #1 does not work with lwarp's HTML conversion. +Please use the #2 package instead} +{Package #1 conflicts with lwarp in some way, but package #2 probably will work instead.} +} +% \end{macrocode} +% \end{macro} + + + + % Packages which should only be loaded after \pkg{lwarp} are tested % here to trip an error of they have already been loaded. % +% \changes{v0.25}{2017/03/16}{Fix: Allows XE\LaTeX\ and +% \LuaLaTeX\ to preload graphics and graphicx.} +% % The following packages must be loaded after \pkg{lwarp}: % \begin{macrocode} \LWR@loadafter{abstract} \LWR@loadafter{afterpage} \LWR@loadafter{algorithmicx} \LWR@loadafter{alltt} +\LWR@loadafter{amsthm} \LWR@loadafter{bookmark} \LWR@loadafter{booktabs} \LWR@loadafter{changepage} \LWR@loadafter{dcolumn} \LWR@loadafter{draftwatermark} +\LWR@loadafter{ellipsis} +\LWR@loadafter{emptypage} \LWR@loadafter{enumerate} \LWR@loadafter{epigraph} \LWR@loadafter{eso-pic} @@ -3849,13 +3931,14 @@ after lwarp.} \LWR@loadafter{float} \LWR@loadafter{ftnright} \LWR@loadafter{geometry} -\LWR@loadafter{graphics} -\LWR@loadafter{graphicx} +% \LWR@loadafter{graphics}% pre-loaded by xunicode +% \LWR@loadafter{graphicx}% pre-loaded by xunicode \LWR@loadafter{hyperref} \LWR@loadafter{indentfirst} \LWR@loadafter{keyfloat} \LWR@loadafter{layout} \LWR@loadafter{letterspace} +\LWR@loadafter{lips} \LWR@loadafter{listings} \LWR@loadafter{longtable} \LWR@loadafter{lscape} @@ -3870,17 +3953,20 @@ after lwarp.} \LWR@loadafter{newtxmath} \LWR@loadafter{nextpage} \LWR@loadafter{nowidow} +\LWR@loadafter{ntheorem} \LWR@loadafter{pagenote} \LWR@loadafter{parskip} \LWR@loadafter{placeins} \LWR@loadafter{ragged2e} \LWR@loadafter{rotating} \LWR@loadafter{setspace} +\LWR@loadafter{showidx} \LWR@loadafter{showkeys} \LWR@loadafter{sidecap} \LWR@loadafter{subfig} \LWR@loadafter{tabularx} \LWR@loadafter{textpos} +\LWR@loadafter{theorem} \LWR@loadafter{threeparttable} \LWR@loadafter{tikz} \LWR@loadafter{titleps} @@ -5348,18 +5434,15 @@ top=1in,bottom=1in,% % \subsection{HTML tags} % \begin{macro}{\LWR@htmltagc} \marg{tag} -% Break ligatures in \acro{HTML} tags. +% Break ligatures and use upright apostrophes in \acro{HTML} tags. % %|\protect| is in case the tag appears in TOC, LOF, LOT. % \begin{macrocode} + \newcommand*{\LWR@htmltagc}[1]{% {% -\LWR@origttfamily% -% \protect\LWR@origtexttt{% -% \protect\LWR@origtextbf{% -\LWR@origtextless#1\LWR@origtextgreater% -% }% -% }% +\protect\LWR@origttfamily% +\protect\LWR@origtextless#1\protect\LWR@origtextgreater% }% } % \end{macrocode} @@ -7359,10 +7442,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % Graphics: % \begin{macrocode} -\let\textcolor\LWR@textcolor -\let\pagecolor\LWR@pagecolor -\let\colorbox\LWR@colorbox -\let\fcolorbox\LWR@fcolorbox \let\rotatebox\LWR@rotatebox \let\scalebox\LWR@scalebox \let\reflectbox\LWR@reflectbox @@ -8873,6 +8952,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \section{Theorems} % +% \changes{v0.25}{2017/03/17}{Basic \LaTeX\ theorems: improved \acro{CSS}.} +% +% % \DescribeMacro{\newtheorem} \marg{text} \oarg{counter} -or- \oarg{oldname} \marg{text} % % A few minor changes are made to supply \acro{HTML} tags. @@ -8891,18 +8973,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\@begintheorem} \marg{name} \marg{number} % \begin{macrocode} \renewcommand{\@begintheorem}[2]{% -\LWR@htmldivclass{theorem} +\BlockClass{theoremcontents} \InlineClass{theoremlabel}{#1\ #2\ } -\LWR@htmldivclass{theoremcontents} } % \end{macrocode} % \end{macro} % \begin{macro}{\@opargbegintheorem} \marg{name} \marg{number} \marg{oparg} % \begin{macrocode} \renewcommand{\@opargbegintheorem}[3]{% -\BlockClass{theorem} -\InlineClass{theoremlabel}{#1\ #2\ (#3)\ } \BlockClass{theoremcontents} +\InlineClass{theoremlabel}{#1\ #2\ (#3)\ } } % \end{macrocode} % \end{macro} @@ -8910,7 +8990,6 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macrocode} \renewcommand*{\@endtheorem}{% \endBlockClass% theoremcontents -\endBlockClass% theorem } % \end{macrocode} % \end{macro} @@ -10876,14 +10955,16 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macro} % % -% \begin{macro}{\LWR@newlabel} \marg{label} +% \begin{macro}{\LWR@newlabel} \marg{label} \oarg{type} % % \cs{label} during \acro{HTML} output when not in math mode, % removing extra spaces around the label, as done by regular \LaTeX\ \cs{label}. % % \pkg{clevereref} later encases this to add its own cross-referencing. +% +% The optional \meta{type} is per the \pkg{ntheorem} package, and is ignored. % \begin{macrocode} -\newcommand*{\LWR@newlabel}[1]{% +\NewDocumentCommand{\LWR@newlabel}{m o}{% \LWR@traceinfo{LWR@newlabel: !#1!}% % \@bsphack% % \end{macrocode} @@ -11296,8 +11377,9 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \DescribeCounter{LWR@thisfloat} -% A sequential counter for all floats. -% This is used to identify the float then reference it from the List of Figures and +% A sequential counter for all floats and theorems. +% This is used to identify the float or theorem +% then reference it from the List of Figures and % List of Tables. % \begin{macrocode} \newcounter{LWR@thisfloat} @@ -11485,18 +11567,24 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\addcontentsline} % Patched to write the autopage and autofloat before each float's entry. -% No changes if writing |.toc|. +% No changes if writing |.toc| +% For a theorem, automatically defines \cs{ext@} as needed, to +% mimic and reuse the float mechanism. +% +% \changes{v0.25}{2017/03/16}{Handles theorems.} +% % \begin{macrocode} \let\LWR@origaddcontentsline\addcontentsline \renewcommand*{\addcontentsline}[3]{% \ifthenelse{\equal{#1}{toc}}{}{% +\ifthenelse{\equal{#1}{thm}}{\csdef{ext@#2}{thm}}{} \addtocontents{\@nameuse{ext@#2}}{% \protect\LWRsetnextfloat% {\arabic{LWR@latestautopage}}% {\arabic{LWR@thisfloat}}% -}% -}% +}% addtocontents +}% not toc \LWR@origaddcontentsline{#1}{#2}{#3}% } % \end{macrocode} @@ -11833,7 +11921,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \begin{macro}{\hypertocfloat} \marg{1: depth} \marg{2: type} -% \marg{3: caption} \marg{4: page} +% \marg{3: ext of parent} \marg{4: caption} \marg{5: page} % % \begin{description} % \item[\#1] is depth @@ -15124,7 +15212,6 @@ display:inline-block;"% - % \clearpage % \section{lwarpmk.conf} @@ -15223,7 +15310,7 @@ homehtmlfilename = "\HomeHTMLFileName"% % \iffalse %<*lwarp-newproject> % \fi - +% % \part{lwarp-newproject.sty} % % \changes{v0.20}{2016/12/20}{\pkg{lwarp-newproject}: Added.} @@ -15466,6 +15553,7 @@ a.tocfigure {margin-left: 0em} a.tocsubfigure {margin-left: 2em} a.toctable {margin-left: 0em} a.tocsubtable {margin-left: 2em} +a.toctheorem {margin-left: 0em} a.toclstlisting {margin-left: 0em} @@ -15838,16 +15926,7 @@ div.onehalfspace { line-height: 1.5 ; } div.doublespace { line-height: 2 ; } -.theorem { - background: #e0e0e0; - padding: 1ex ; - margin: 1em ; - border: 1px solid silver ; -} - -.theoremlabel { font-weight: bold ; } -.theoremcontents { font-style: italic; margin-left: 1em ; } /* Minipage environments, vertically aligned to top, center, bottom: */ @@ -15915,6 +15994,38 @@ div.doublespace { line-height: 2 ; } } +/* framed package */ +.framed { + margin: 3ex 0em 3ex 0em ; + border: 1px solid black; + border-radius: 0px ; + padding: .3ex 1em 0ex 1em ; + display: block ; +} + +.snugframed { + margin: 3ex 0em 3ex 0em ; + border: 1px solid black; + border-radius: 0px ; + display: block ; +} + +.framedleftbar { + margin: 3ex 0em 3ex 0em ; + border-left: 3pt solid black; + border-radius: 0px ; + padding: .3ex .2em .3ex 1em ; + display: block ; +} + +.framedtitle { + margin: 0em ; + padding: 0em ; + font-size: 130% +} + +.framedtitle p { padding: .3em } + dl { @@ -15930,14 +16041,14 @@ dl dt { dl dd p { margin-top: 0em; } -nav.toc, nav.lof, nav.lot, nav.lol { +nav.toc, nav.lof, nav.lot, nav.lol, nav.lothm { font-family: "URW Classico", Optima, "Linux Biolinum O", "DejaVu Sans", "Bitstream Vera Sans", Geneva, Verdana, sans-serif ; margin-bottom: 4ex ; } -nav.toc p, nav.lof p, nav.lot p, nav.lol p { +nav.toc p, nav.lof p, nav.lot p, nav.lol p, nav.lothm p { line-height: 1.2 ; margin-top:.5ex ; margin-bottom:.5ex; @@ -16311,11 +16422,92 @@ div.multicols { -webkit-columns: 3 380px ; -moz-columns: 3 380px ; columns: 3 380px ; } div.multicols p {margin-top: 0ex} + + /* Used to support algorithmicx: */ span.floatright { float: right ; } + +/* Native LaTeX theorems: */ + +.theoremcontents { font-style: italic; margin-top: 3ex ; margin-bottom: 3ex ; } +.theoremlabel { font-style: normal; font-weight: bold ; margin-right: .5em ; } + + +/* theorem, amsthm, and ntheorem packages */ + +span.theoremheader, +span.theoremheaderplain, +span.theoremheaderdefinition, +span.theoremheaderbreak, +span.theoremheadermarginbreak, +span.theoremheaderchangebreak, +span.theoremheaderchange, +span.theoremheadermargin +{ + font-style:normal ; font-weight: bold ; margin-right: 1em ; +} + +span.amsthmnameplain, +span.amsthmnamedefinition, +span.amsthmnumberplain, +span.amsthmnumberdefinition +{ + font-style:normal ; font-weight: bold ; +} + + +span.amsthmnameremark, +span.amsthmnumberremark +{font-style:italic ; font-weight: normal ; } + + +span.amsthmnoteplain, +span.amsthmnotedefinition +{font-style:normal ;} + + +span.theoremheaderremark, +span.theoremheaderproof, +span.amsthmproofname +{font-style:italic ; font-weight: normal ; margin-right: 1em ; } + +span.theoremheadersc +{ + font-style:normal ; + font-variant: small-caps ; + font-weight: normal ; + margin-right: 1em ; +} + +.theoremendmark {float:right} + +div.amsthmbodyplain, div.theorembodyplain, div.theorembodynonumberplain, +div.theorembodybreak, div.theorembodynonumberbreak, +div.theorembodymarginbreak, +div.theorembodychangebreak, +div.theorembodychange, +div.theorembodymargin +{ + font-style:italic; + margin-top: 3ex ; margin-bottom: 3ex ; +} + +div.theorembodydefinition, div.theorembodyremark, div.theorembodyproof, +div.theorembodyplainupright, nonumberplainuprightsc, +div.amsthmbodydefinition, div.amsthmbodyremark, +div.amsthmproof +{ + font-style: normal ; + margin-top: 3ex ; margin-bottom: 3ex ; +} + +span.amsthmnoteremark {} + + + /* For CSS LaTeX and related logos: Based on: @@ -16603,6 +16795,13 @@ div.sidebartitle{ border-radius: 1ex ; } +.framed .minipage , .framedleftbar .minipage { + border: none ; + background: none ; + padding: 0ex ; + margin: 0ex ; +} + figure.figure .minipage, figcaption .minipage { border: none; } div.marginblock div.minipage { border: none; } @@ -17084,7 +17283,7 @@ MathJax.Hub.Config({ -- Print the usage of the lwarpmk command: -printversion = "v0.24" +printversion = "v0.25" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -17546,6 +17745,8 @@ end -- not --version % % \section{Abstract} % +% \credits{Peter Wilson} +% % \DescribePackage{abstract} % \pkg{abstract} is supported and patched by \pkg{lwarp}. % @@ -17757,6 +17958,156 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \clearpage + +% \iffalse +%<*amsthm> +% \fi + +% \part{lwarp-amsthm.sty} + +% \section{AMSthm} +% +% \credits{Publications Technical Group --- American Mathematical Society} +% +% \DescribePackage{amsthm} +% \pkg{amsthm} is patched for use by \pkg{lwarp}. +% +% \changes{v0.25}{2017/03/15}{\pkg{amsthm}: Added.} +% +% \begin{description} +% \item[CSS styling of theorems and proofs:] \ +% \begin{description} +% \item [Theorem:] |div| of class |amsthmbody| +% \item [Theorem Name:] |span| of class |amsthmname| +% \item [Theorem Number:] |span| of class |amsthmnumber| +% \item [Theorem Note:] |span| of class |amsthmnote| +% \item [Proof:] |div| of class |amsthmproof| +% \item [Proof Name:] |span| of class |amsthmproofname| +% \end{description} +% where || is |plain|, |definition|, etc. +% \end{description} +% +% +% \codehtml +% +% \begin{macrocode} +\LWR@ProvidesPackagePass{amsthm} +% \end{macrocode} + +% Storage for the style being used for new theorems: +% \begin{macrocode} +\newcommand{\LWR@newtheoremstyle}{plain} +% \end{macrocode} + +% Patched to remember the style being used for new theorems: +% \begin{macrocode} +\renewcommand{\theoremstyle}[1]{% + \@ifundefined{th@#1}{% + \PackageWarning{amsthm}{Unknown theoremstyle `#1'}% + \thm@style{plain}% + \renewcommand{\LWR@newtheoremstyle}{plain}% new + }{% + \thm@style{#1}% + \renewcommand{\LWR@newtheoremstyle}{#1}% new + }% +} +% \end{macrocode} + +% Patched to remember the style for this theorem type: +% \begin{macrocode} +\def\@xnthm#1#2{% + \csedef{LWR@thmstyle#2}{\LWR@newtheoremstyle}% new + \let\@tempa\relax + \@xp\@ifdefinable\csname #2\endcsname{% + \global\@xp\let\csname end#2\endcsname\@endtheorem + \ifx *#1% unnumbered, need to get one more mandatory arg + \edef\@tempa##1{% + \gdef\@xp\@nx\csname#2\endcsname{% + \@nx\@thm{\@xp\@nx\csname th@\the\thm@style\endcsname}% + {}{##1}}}% + \else % numbered theorem, need to check for optional arg + \def\@tempa{\@oparg{\@ynthm{#2}}[]}% + \fi + \AtBeginEnvironment{#2}{\edef\LWR@thisthmstyle{\csuse{LWR@thmstyle#2}}}% new + }% + \@tempa +} +% \end{macrocode} + +% Patched to enclose with \acro{CSS}: +% \begin{macrocode} +\newcommand{\LWR@haveamsthmname}{ +\renewcommand{\thmname}[1]{\InlineClass{amsthmname\LWR@thisthmstyle}{##1}} +} + +\newcommand{\LWR@haveamsthmnumber}{ +\renewcommand{\thmnumber}[1]{\InlineClass{amsthmnumber\LWR@thisthmstyle}{##1}} +} + +\newcommand{\LWR@haveamsthmnote}{ +\renewcommand{\thmnote}[1]{\InlineClass{amsthmnote\LWR@thisthmstyle}{##1}} +} + +\LWR@haveamsthmname +\LWR@haveamsthmnumber +\LWR@haveamsthmnote +% \end{macrocode} +% +% Patches for \acro{CSS}: +% \begin{macrocode} +\def\@begintheorem#1#2[#3]{% + \BlockClass{amsthmbody\LWR@thisthmstyle}% new + \deferred@thm@head{ + \the\thm@headfont \thm@indent + \@ifempty{#1}{\let\thmname\@gobble}{\LWR@haveamsthmname}% new + \@ifempty{#2}{\let\thmnumber\@gobble}{\LWR@haveamsthmnumber}% new + \@ifempty{#3}{\let\thmnote\@gobble}{\LWR@haveamsthmnote}% new + \thm@swap\swappedhead\thmhead{#1}{#2}{#3}% + \the\thm@headpunct~ + \thmheadnl % possibly a newline. + \hskip\thm@headsep + }% + \ignorespaces} +% \end{macrocode} +% +% Patched for \acro{CSS}: +% \begin{macrocode} +\def\@endtheorem{\endBlockClass\endtrivlist\@endpefalse } +% \end{macrocode} +% +% +% Proof QED symbol: +% \begin{macrocode} +\AtBeginDocument{ +\def\openbox{\text{\HTMLunicode{25A1}}}% UTF-8 white box +\def\blacksquare{\text{\HTMLunicode{220E}}}% UTF-8 end-of-proof +\def\Box{\text{\HTMLunicode{25A1}}}% UTF-8 white box +} +% \end{macrocode} +% +% Patched for \acro{CSS}: +% \begin{macrocode} +\renewenvironment{proof}[1][\proofname]{\par + \BlockClass{amsthmproof}% new + \pushQED{\qed}% + \normalfont \topsep6\p@\@plus6\p@\relax + \trivlist + \item[\hskip\labelsep + \InlineClass{amsthmproofname}{#1\@addpunct{.}}]\ignorespaces% changes +}{% + \InlineClass{theoremendmark}{\popQED}\endtrivlist% + \endBlockClass% new + \@endpefalse +} +% \end{macrocode} + + +% \iffalse +% +% \fi + + % \iffalse %<*bookmark> @@ -17832,6 +18183,34 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \iffalse +%<*ccaption> +% \fi + +% \part{lwarp-ccaption.sty} + +% \section{Ccaption} +% +% \DescribePackage{ccaption} +% \pkg{ccaption} is not used. +% The user is recommended to use \pkg{caption} instead. + +% \changes{v0.25}{2017/03/16}{\pkg{ccaption}: Prevented.} + +% \codehtml +% \begin{macrocode} +\LWR@loadnever{ccaption}{caption} +% \end{macrocode} + + +% \iffalse +% +% \fi + + + +% \clearpage + % \iffalse %<*changepage> % \fi @@ -17896,6 +18275,8 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \clearpage + % \iffalse %<*draftwatermark> % \fi @@ -17934,6 +18315,59 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \iffalse +%<*ellipsis> +% \fi + +% \part{lwarp-ellipsis.sty} + +% \section{Ellipsis} +% \label{sec:ellipsis} +% +% \changes{v0.25}{2017/03/16}{\pkg{ellipsis}: Added.} +% +% \DescribePackage{ellipsis} +% \pkg{ellipsis} is emulated during \acro{HTML} output, and +% the \pkg{ellipsis} package is ignored. + +% \begin{macrocode} +\LWR@ProvidesPackageDrop{ellipsis} + +\newcommand{\ellipsisgap}{0.1em} +% \end{macrocode} + +% \iffalse +% +% \fi + + +% \clearpage + +% \iffalse +%<*emptypage> +% \fi + +% \part{lwarp-emptypage.sty} + +% \section{Emptypage} +% +% \DescribePackage{emptypage} +% \pkg{emptypage} is ignored. +% +% \changes{v0.25}{2017/03/22}{\pkg{emptypage}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-emptypage}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{emptypage} +% \end{macrocode} + +% \iffalse +% +% \fi + + % \clearpage % \iffalse @@ -18173,6 +18607,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \clearpage % \iffalse %<*fancyhdr> @@ -18721,40 +19156,190 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% + % \clearpage % \iffalse -%<*ftnright> +%<*framed> % \fi -% \part{lwarp-ftnright.sty} - -% \section{Ftnright} +% \part{lwarp-framed.sty} % -% \DescribePackage{ftnright} -% \pkg{ftnright} is ignored. +% \section{Framed} % -% \changes{v0.22}{2017/03/01}{\pkg{ftnright}: Added.} +% \credits{Donald Arseneau} +% +% \DescribePackage{framed} +% \pkg{framed} is supported and patched by \pkg{lwarp}. +% +% \changes{v0.25}{2017/03/19}{\pkg{framed}: Added.} % % \codehtml % -% Discard all options for \pkg{lwarp-ftnright}: +% Accept all options for \pkg{lwarp-framed}: % \begin{macrocode} -\LWR@ProvidesPackageDrop{ftnright} +\LWR@ProvidesPackagePass{framed} % \end{macrocode} -% \iffalse -% -% \fi +% \begin{macrocode} +\renewenvironment{framed}{% +\BlockClass{framed}% +} +{\endBlockClass} -% -% \iffalse -%<*geometry> -% \fi +\renewenvironment{oframed}{% +\BlockClass{framed}% +} +{\endBlockClass} -% \part{lwarp-geometry.sty} + +\renewenvironment{shaded}{% +\convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% +\BlockClass{framed}[background: \#\LWR@tempcolor]% +} +{\endBlockClass} + +\renewenvironment{shaded*}{% +\convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% +\BlockClass{framed}[background: \#\LWR@tempcolor]% +} +{\endBlockClass} + + +\renewenvironment{leftbar}{% + \BlockClass{framedleftbar} + \def\FrameCommand{}% + \MakeFramed {} +}% + {\endMakeFramed\endBlockClass} + + +\renewenvironment{snugshade}{% +\convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% +\BlockClass{snugframed}[background: \#\LWR@tempcolor]% +} +{\endBlockClass} + +\renewenvironment{snugshade*}{% +\convertcolorspec{named}{shadecolor}{HTML}\LWR@tempcolor% +\BlockClass{snugframed}[background: \#\LWR@tempcolor]% +} +{\endBlockClass} + +\let\oframed\framed +\let\endoframed\endframed + + +\RenewEnviron{titled-frame}[1]{% +\CustomFBox{#1}{}{0pt}{0pt}{0pt}{0pt}{\BODY} +} +% \end{macrocode} + + + +% \cs{CustomFBox} \marg{toptitle} \marg{bottitle} +% \marg{thicknesstop} \marg{bottom} \marg{left} \marg{right} +% \marg{text contents} +% \begin{macrocode} +\renewcommand{\CustomFBox}[7]{% +\convertcolorspec{named}{TFFrameColor}{HTML}\LWR@tempcolor% +\begin{BlockClass}{framed}[border: 3px solid \#\LWR@tempcolor]% +\ifthenelse{\isempty{#1}}{}{% not empty +\begin{BlockClass}{framedtitle}[background: \#\LWR@tempcolor]% +\textcolor{TFTitleColor}{\textbf{#1}}% +\end{BlockClass} +}% not empty + +#7 + +\ifthenelse{\isempty{#2}}{}{% not empty +\convertcolorspec{named}{TFFrameColor}{HTML}\LWR@tempcolor% +\begin{BlockClass}{framedtitle}[background: \#\LWR@tempcolor]% +\textcolor{TFTitleColor}{\textbf{#2}}% +\end{BlockClass} +}% not empty +\end{BlockClass} +} +% \end{macrocode} + +% \cs{TitleBarFrame} \oarg{marker} \marg{title} \marg{contents} +% \begin{macrocode} +\renewcommand\TitleBarFrame[3][]{ +\CustomFBox + {#2}{}% + \fboxrule\fboxrule\fboxrule\fboxrule + {#3}% +} +% \end{macrocode} + + +% \begin{macrocode} +\renewcommand{\TF@Title}[1]{#1} +% \end{macrocode} + + +% \env{MakeFramed} \marg{settings} +% \begin{macrocode} +\let\MakeFramed\relax +\let\endMakeFramed\relax + +\NewEnviron{MakeFramed}[1]{% +\FrameCommand{\begin{minipage}{\linewidth}\BODY\end{minipage}}% +} +% \end{macrocode} + + +% \cs{fb@put@frame} \marg{frame cmd no split} \marg{frame cmd split} +% \begin{macrocode} +\renewcommand*{\fb@put@frame}[2]{% +\relax% +\@tempboxa% +} +% \end{macrocode} + +% \iffalse +% +% \fi + + + + +% \clearpage + +% \iffalse +%<*ftnright> +% \fi + +% \part{lwarp-ftnright.sty} + +% \section{Ftnright} +% +% \DescribePackage{ftnright} +% \pkg{ftnright} is ignored. +% +% \changes{v0.22}{2017/03/01}{\pkg{ftnright}: Added.} +% +% \codehtml +% +% Discard all options for \pkg{lwarp-ftnright}: +% \begin{macrocode} +\LWR@ProvidesPackageDrop{ftnright} +% \end{macrocode} + +% \iffalse +% +% \fi + + + +% +% \iffalse +%<*geometry> +% \fi + +% \part{lwarp-geometry.sty} % \section{Geometry} % @@ -18800,12 +19385,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \codehtml % \begin{macrocode} -\PackageError{lwarp-graphics} - {The graphics package is not supported by - the lwarp package's HTML conversion. - Please use graphicx instead. \protect\usepackage{graphicx}} - {Graphicx requires a different syntax but is more flexible, - and it is emulated by lwarp.} +\LWR@loadnever{graphics}{graphicx} % \end{macrocode} @@ -19379,6 +19959,48 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \fi +% \clearpage + +% \iffalse +%<*lips> +% \fi + +% \part{lwarp-lips.sty} + +% \section{Lips} +% \label{sec:lips} +% +% \changes{v0.25}{2017/03/16}{\pkg{lips}: Added.} +% +% \DescribePackage{lips} +% \pkg{lips} is emulated during \acro{HTML} output, and +% the \pkg{lips} package is ignored. + +% \begin{macrocode} +% \LWR@ProvidesPackageDrop{lips} +\PackageInfo{lwarp}{Using the lwarp version of package `lips'.}% +\ProvidesPackage{lwarp-lips} + +\NewDocumentCommand{\Lips}{}{\textellipsis} + +\NewDocumentCommand{\BracketedLips}{}{[\textellipsis]} + +\let\lips\Lips +\let\olips\lips + +\DeclareOption*{} +\DeclareOption{mla}{ +\let\lips\BracketedLips +} +\ProcessOptions\relax + +\newcommand \LPNobreakList {} +% \end{macrocode} + +% \iffalse +% +% \fi + % \clearpage @@ -19391,6 +20013,9 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % \section{Listings} % \label{sec:listings} +% +% \credits{Carsten Heinz, Brooks Moses, Jobst Hoffmann} + % % \DescribePackage{listings} % \pkg{listings} is supported with some limitations. @@ -19799,6 +20424,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% +% \clearpage % \iffalse %<*mcaption> @@ -19882,12 +20508,16 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % ^^A \DescribeMacro{\mdfsetup} % To handle CSS and paragraphs, -% patch code at start and end of environment and contents: +% patch code at start and end of environment and contents. +% \cs{LWR@origraggedright} helps avoid hyphenation. +% +% \changes{v0.25}{2017/03/16}{\pkg{mdframed}: Help avoid hyphenation.} +% % \begin{macrocode} \mdfsetup{ -startcode={\LWR@mdframedstart}, +startcode={\LWR@mdframedstart\LWR@origraggedright}, endcode={\LWR@mdframedend}, -startinnercode={\LWR@startpars}, +startinnercode={\LWR@startpars\LWR@origraggedright}, endinnercode={\LWR@stoppars}, } % \end{macrocode} @@ -20619,6 +21249,565 @@ solid +% \clearpage + +% \iffalse +%<*ntheorem> +% \fi + +% \part{lwarp-ntheorem.sty} +% +% \section{Ntheorem} +% +% \label{sec:ntheorem} +% +% \credits{Wolfgang May, Andreas Schedler} +% +% \DescribePackage{ntheorem} +% \pkg{ntheorem} is patched for use by \pkg{lwarp}. +% +% \changes{v0.25}{2017/03/22}{\pkg{ntheorem}: Added.} +% +% \begin{description} +% \item[CSS styling of theorems and proofs:] \ +% \begin{description} +% \item [Theorem:] |div| of class |theorembody| +% \item [Theorem Header:] |span| of class |theoremheader