From 50d0760490f7e9df364939f4305c19197d49d17a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 30 Oct 2017 20:40:38 +0000 Subject: lwarp (30oct17) git-svn-id: svn://tug.org/texlive/trunk@45648 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/lwarp/README.txt | 2 +- Master/texmf-dist/doc/latex/lwarp/lwarp.pdf | Bin 1501624 -> 1583065 bytes Master/texmf-dist/scripts/lwarp/lwarpmk.lua | 2 +- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 3199 +++++++++++++++----- Master/texmf-dist/source/latex/lwarp/lwarp.ins | 2 + .../tex/latex/lwarp/lwarp-algorithmicx.sty | 7 + .../texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty | 13 +- .../texmf-dist/tex/latex/lwarp/lwarp-fancybox.sty | 26 +- .../texmf-dist/tex/latex/lwarp/lwarp-floatflt.sty | 31 +- .../texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | 60 +- .../texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty | 32 +- .../texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty | 2 - .../texmf-dist/tex/latex/lwarp/lwarp-moreverb.sty | 14 - .../tex/latex/lwarp/lwarp-morewrites.sty | 26 + .../texmf-dist/tex/latex/lwarp/lwarp-multirow.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-ntheorem.sty | 28 +- .../texmf-dist/tex/latex/lwarp/lwarp-overpic.sty | 42 + .../tex/latex/lwarp/lwarp-realscripts.sty | 6 - .../texmf-dist/tex/latex/lwarp/lwarp-sidenotes.sty | 10 +- .../texmf-dist/tex/latex/lwarp/lwarp-siunitx.sty | 40 + Master/texmf-dist/tex/latex/lwarp/lwarp-soul.sty | 23 +- Master/texmf-dist/tex/latex/lwarp/lwarp-subfig.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-textcomp.sty | 4 + .../texmf-dist/tex/latex/lwarp/lwarp-theorem.sty | 1 + .../texmf-dist/tex/latex/lwarp/lwarp-titleps.sty | 17 + .../texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty | 7 + .../texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty | 6 + .../texmf-dist/tex/latex/lwarp/lwarp-titling.sty | 4 +- .../texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty | 9 + Master/texmf-dist/tex/latex/lwarp/lwarp-ulem.sty | 42 +- Master/texmf-dist/tex/latex/lwarp/lwarp-verse.sty | 1 + .../texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty | 26 +- Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty | 1 - Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 942 ++++-- 34 files changed, 3578 insertions(+), 1054 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-morewrites.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-overpic.sty (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/lwarp/README.txt b/Master/texmf-dist/doc/latex/lwarp/README.txt index d98b7eb6f50..c740bf01bfa 100644 --- a/Master/texmf-dist/doc/latex/lwarp/README.txt +++ b/Master/texmf-dist/doc/latex/lwarp/README.txt @@ -1,5 +1,5 @@ -LaTeX lwarp package v0.41 README.txt +LaTeX lwarp package v0.42 README.txt Files included are: diff --git a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf index ee9b98d5e54..f01233eab15 100644 Binary files a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf and b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf differ diff --git a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua index 7ef5650b5d1..7d0dbb62ac5 100755 --- a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua +++ b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua @@ -4,7 +4,7 @@ -- Print the usage of the lwarpmk command: -printversion = "v0.41" +printversion = "v0.42" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 92616ef0d2a..26c9ba2770f 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/10/07 v0.41 Allows LaTeX to directly produce HTML5 output.] +% [2017/10/30 v0.42 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -74,6 +74,7 @@ \newunicodechar{₦}{\textnaira} \newunicodechar{₱}{\textpeso} \newunicodechar{℞}{\textrecipe} +\newunicodechar{⸘}{\textinterrobangdown} \newunicodechar{‱}{\textpertenthousand} \newunicodechar{฿}{\textbaht} \newunicodechar{℠}{\textservicemark} @@ -89,6 +90,8 @@ \usepackage{titlesec} +% \usepackage[nobottomtitles*]{titlesec} +% \renewcommand{\bottomtitlespace}{.\textheight} \titleformat{\part}[hang] {\LARGE\ttfamily\bfseries}{}{0pt}{}[\marginpar{\hfill{}File\,\thepart}] @@ -116,6 +119,7 @@ \usepackage{array} \usepackage{longtable} \usepackage{booktabs} +\usepackage{threeparttable} \usepackage{multirow} \usepackage{bigdelim} @@ -141,6 +145,7 @@ \setlength{\cftsubsubsecindent}{2.8em} \setlength{\cftsubsubsecnumwidth}{4em} +\usepackage[notbib,notindex,nottoc]{tocbibind} \usepackage{titleps} @@ -241,15 +246,16 @@ Keywords={LaTeX, HTML, conversion}% \newrobustcmd{\acro}[1]{\textsc{\lowercase{#1}}} \newrobustcmd{\element}[1]{\texttt{<#1>}} \newrobustcmd{\attribute}[1]{\texttt{#1}} +\newrobustcmd{\UI}[1]{\textbf{\textsf{#1}}} \newrobustcmd{\TOC}{\acro{TOC}} \newrobustcmd{\LOF}{\acro{LOF}} \newrobustcmd{\LOT}{\acro{LOT}} \newrobustcmd{\HTML}{\acro{HTML}} -\newrobustcmd{\HTMLfive}{\HTML\oldstylenums{5}} +\newrobustcmd{\HTMLfive}{\HTML\textsc{5}} \newrobustcmd{\CSS}{\acro{CSS}} -\newrobustcmd{\CSSthree}{\CSS\oldstylenums{3}} +\newrobustcmd{\CSSthree}{\CSS\textsc{3}} \newrobustcmd{\EPUB}{\acro{EPUB}} \newrobustcmd{\SVG}{\acro{SVG}} \newrobustcmd{\PNG}{\acro{PNG}} @@ -443,7 +449,7 @@ For now, the number list is simply turned off. The glossaries may be placed in a numbered or unnumbered section, given \margintag{placement and \acro{TOC} options} -a \acro{TOC} entry, and placed inline or on their own \HTML page: +a \acro{TOC} entry, and placed inline or on their own \HTML\ page: \begin{description} \item [Numbered section, on its own \HTML\ page:] @@ -574,8 +580,19 @@ if \texttt{FileDepth} allows: } -\newcommand{\limitstext}{\cs{textbf}, etc.\ are supported, -but \cs{bfseries}, etc.\ are not yet supported.} +\newcommand{\limitstext}{% +\cs{textbf}, etc.\ are supported, +\watchout[\cs{bfseries}, etc.] +but \cs{bfseries}, etc.\ are not yet supported. + +\texttt{\&}, \texttt{\textless}, and \texttt{\textgreater} +\watchout[HTML special chars] +have special meanings in \HTML. +If \cs{\&}, \cs{textless}, and \cs{textgreater} are used, the proper result +should occur in \HTML, but there may be \HTML\ parsing problems +if these special characters occur unescaped in program listings +or other verbatim text. +} \newcommand{\limitshspace}{% \DescribeMacro{\hspace}% @@ -703,13 +720,43 @@ by setting \cs{LateximageFontSizeName} to a font size name --- \emph{without the \newcommand{\limitsmath}{% -\limitsntheoremnumbering +\subsubsection{Rendering tradeoffs} Math may be rendered \margintag{Math rendering} as \SVG\ graphics or using the \textsc{MathJax} JavaScript display engine. \index{JavaScript>MathJax} +In its current implementation, +\margintag{SVG files} +rendering math as images creates a new \SVG\ file for each expression. +In text with many references to math variables, +this can result in a large number of files with +duplicate content. +In the future, some method of content-based naming and check-summing +may be used to remove the need for duplicate files. + +Another approach could be +\margintag{SVG inline} +to in-line the \SVG\ files directly into the \HTML. +This may reduce the number of files and potentially speed loading the images, +but slows the display of the rest of the document before the images are loaded. + +Others converters have used \PNG\ files, +\margintag{PNG files} +sometimes pre-scaled for print resolution but displayed +on-screen at a scaled down size. This allows high-quality print output at the expense +of larger files, but \SVG\ files are the preferred approach for scalable graphics. + +Conversion to \MathML\ might be a better approach, +\margintag{MathML} +among other things allowing a more compact representation of math than \SVG\ drawings. +Problems with \MathML\ include limited browser support and some +issues with the fine control of the appearance of the result. +Also see \cref{sec:epub} regarding \EPUB\ output with MathJax. + +\subsubsection{SVG option} + For \SVG\ math, \margintag{SVG math option} math is rendered as usual by \LaTeX{} into the initial \PDF\ file using the @@ -726,33 +773,16 @@ math, allowing copy/paste of the \LaTeX{} math expression into other documents. \limitslateximagefontsize -As currently implemented, -\margintag{SVG files} -each instance of math creates a new \SVG\ file. In text with -many references to math variables, this can result in a large number of files with -duplicate content. In the future, some method of content-based naming and checksumming -may be used to remove the need for duplicate files. +For \SVG\ math, text copy/paste from the \HTML\ \element{alt} tags lists the +\margintag{SVG math copy/paste} +equation number or tag for single equations, along with the \LaTeX\ code +for the math expression. +For \AmS\ environments with multiple numbers in the same environment, +only the first and last is copy/pasted, as a range. +No tags are listed inside a starred \AmS\ environment, although the \cs{tag} +macro will still appear inside the \LaTeX\ math expression. -Another approach would be -\margintag{SVG inline} -to in-line the \SVG\ files directly into the \HTML. -This avoids having a large number of files and potentially speeds loading the images, -but dis-allows the possibility of sharing one file among many instances without -user intervention. - -Others have used \PNG\ files, -\margintag{PNG files} -sometimes pre-scaled for print resolution but displayed -on-screen at a scaled down size. This allows high-quality print output at the expense -of larger files, but \SVG\ files are also larger as well. - -Conversion to \MathML\ might be a better approach, -\margintag{MathML} -among other things -allowing a more compact representation of math than \SVG\ drawings. -Problems with \MathML\ include limited browser support and some -issues with the fine control of the appearance of the result. -Also see \cref{sec:epub} regarding \EPUB\ output with MathJax. +\subsubsection{MathJax option} The popular MathJax alternative (\url{mathjax.org}) may be used to display math. \margintag{MathJax math option} @@ -806,13 +836,35 @@ Limitations when using MathJax include: where it will be rendered as normal text. \watchout[siunitx inside an equation] - \href{https://github.com/mathjax/MathJax-third-party-extensions/tree/master/siunitx} - {\texttt{https://github.com/mathjax/MathJax-third-party-extensions/\\ - \hspace*{2em}tree/master/siunitx}} + \href{https://github.com/burnpanck/MathJax-siunitx} + {\texttt{https://github.com/burnpanck/MathJax-siunitx}} + + Also see \cref{sec:limitssiunitx}. + +\item Other math-related macros and packages are not supported by MathJax, + \watchout[other macros and packages] + including \cs{ensuremath}, \pkg{bigdelim}, \pkg{units}, and \pkg{nicefrac}, + along with occasionally-used macros such as \cs{footnote} and \cs{relax}. \item MathJax does not automatically support custom \LaTeX{} macros, - \margintag{\LaTeX{} macros} - but they may be set up by the user. + \margintag{custom MathJax macros} + \index{MathJax>custom macros} + but they may be created by the user inside a math expression: + \begin{sourcedisplay} + \cs{begin}\{document\}\\ + \textrm{(\dots)} \\ + \cs{begin}\{warpHTML\} \% Only for HTML output, \\ + \cs{ifbool}\{mathjax\} \% and only for MathJax output: \\ + \{ \\ + \hspace*{2em}\% New macros for MathJax are \\ + \hspace*{2em}\% placed inside a math expression: \\ + \hspace*{2em}\cs{(} \\ + \hspace*{4em}\cs{newcommand}\{\cs{expval}\}[1]\{\cs{langle}\#1\cs{rangle}\} \\ + \hspace*{4em}\cs{newcommand}\{\cs{abs}\}[1]\{\cs{lvert}\#1\cs{rvert}\} \\ + \hspace*{2em}\cs{)} \\ + \}\{\} \\ + \cs{end}\{warpHTML\} \\ + \end{sourcedisplay} \end{itemize} } @@ -981,6 +1033,15 @@ Use \CSS\ or \cs{textcolor} where possible. \margintag{\cs{color} and \cs{pagecolor}} } +\newcommand{\limitsoverpic}{% +The macros \cs{overpicfontsize} and \cs{overpicfontskip} are used during +\watchout[scaling] +\HTML\ generation. These are sent to \cs{fontsize} to adjust the font +size for scaling differences between the print and \HTML\ versions of the +document. Renew these macros before using the \env{overpic} and \env{Overpic} +environments. +} + \newcommand{\limitstabular}{% Tabular mostly works as expected, but pay special attention to the following, especially if working with environments, macros inside tabulars, @@ -1242,10 +1303,10 @@ are above or below the delimiter: \begin{sourcedisplay} \hrule\smallskip \cs{begin}\{tabular\}\{lll\} \\ -\textcolor{green}{} \& a \& b \textbackslash\textbackslash \\ +\textcolor{green!50!black}{} \& a \& b \textbackslash\textbackslash \\ \cs{ldelim}\{\textbackslash\{\}\{2\}\{.25in\}[left ] \& c \& d \textbackslash\textbackslash \\ \textcolor{red}{\cs{mrowcell}} \& e \& f \textbackslash\textbackslash \\ -\textcolor{green}{} \& g \& h \textbackslash\textbackslash \\ +\textcolor{green!50!black}{} \& g \& h \textbackslash\textbackslash \\ \cs{end}\{tabular\} \smallskip\hrule \begin{tabular}{lll} @@ -1479,11 +1540,27 @@ Possible solutions include: \end{itemize} } +\newcommand{\limitskeyfloat}{% +If placing a \cs{keyfig}[H] inside a \env{keywrap}, +\watchout[\env{keywrap}] +use an absolute width for +\cs{keyfig}, instead of \texttt{lw}-proportional widths. +(The [H] option forces the use of a minipage, which internally adjusts for +a virtual 6-inch wide minipage, which then corrupts the \texttt{lw} option.) +} + \newcommand{\limitssiunitx}{% -Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdftotext} conversion. +Do not use \cmds{per-mode=fraction}, \watchout[per-mode] +which cannot be seen by the final \cmds{pdftotext} conversion. Some units will require that the expression be placed inside math mode. +\watchout[math mode required] + +\textcolor{red}{NOTE: As of this writing, the \pkg{siunitx} extension +for MathJax is not currently hosted at any public CDN, +thus \pkg{siunitx} is not usable with MathJax unless a local copy +of this extension is created first.} } \newcommand{\limitsnicefrac}{% @@ -1541,14 +1618,14 @@ changes do not affect the \HTML\ output. \newcommand{\limitsnewtxmath}{% The proper load order is: \watchout[loading sequence] -\begin{enumerate} -\item \dots -\item \texttt{\cs{usepackage}\{lwarp\}} -\item \dots -\item \texttt{\cs{usepackage}\{amsthm\}} -\item \texttt{\cs{usepackage}\{newtxmath\}} -\item \dots -\end{enumerate} +\begin{sourcedisplay} +\textrm{\dots} \\ +\cs{usepackage}\{lwarp\} \\ +\textrm{\dots} \\ +\cs{usepackage}\{amsthm\} \\ +\cs{usepackage}\{newtxmath\} \\ +\textrm{\dots} \\ +\end{sourcedisplay} } @@ -1595,7 +1672,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{14314} +% \CheckSum{14824} % % \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 @@ -1678,6 +1755,7 @@ This boolean may be tested by the user for later use. % \changes{v0.39}{2017/09/05}{\ 2017/09/05} % \changes{v0.40}{2017/09/25}{\ 2017/09/25} % \changes{v0.41}{2017/10/07}{\ 2017/10/07} +% \changes{v0.42}{2017/10/30}{\ 2017/10/30} @@ -1700,7 +1778,7 @@ This boolean may be tested by the user for later use. % % {\Huge The \textbf{lwarp} package} % -% {\Large \textup{\LaTeX{} to \HTMLfive}} +% {\Large \textup{\LaTeX{} to HTML}} % % \bigskip % @@ -1787,6 +1865,58 @@ This boolean may be tested by the user for later use. % \end{center} % % \clearpage +% +% \section{Supporting \protect\TeX\ development} +% \changes{v0.42}{2017/10/30}{Docs: Added support page.} +% +% \TeX\ development: +% \begin{itemize}[nosep] +% \item is mostly open-sourced and a volunteer effort; +% \item benefits students, academics, scientists, engineers, and businesses; +% \item helps drive education, public and private research, and commercial activity; +% \item is used in the fields of mathematics, science, engineering, and the humanities; +% \item spans decades of development; +% \item is enduring --- many older packages are still actively used and maintained; +% \item is largely backwards compatible; +% \item is portable across all the major computing platforms; +% \item is usable even on older computers and away from internet access; +% \item requires no yearly subscription fees; +% \item is supported by an active community of knowledgeable volunteers; +% \item and is continuing to maintain relevance with modern improvements. +% \end{itemize} +% +% Please consider helping by joining and/or contributing to the \TeX\ Users Group, +% a United States 501(c)(3) tax-exempt charitable organization. +% Contributions are accepted by credit card, check, or Pay Pal, via the United Way, +% or by USA or European bank transfer. +% Membership in TUG supports the development of \TeX{}Live, the major \TeX\ distribution. +% +% Donations may be directed towards individual projects: +% \begin{description}[nosep] +% \item[TUG Bursary Fund:] Assistance for attending annual TUG meetings. +% \item[CTAN:] The Comprehensive \TeX\ Archive Network --- Central storage for \TeX. +% \item[TeX Development Fund:] Support for specific projects. +% \item[EduTeX:] Teaching and using \TeX\ in schools and universities. +% \item[GUST e-foundry fonts:] Enhanced for math and additional language groups. +% \item[LaTeX Project:] Modernizing the \LaTeX\ core. +% \item[Libre Font Fund:] Fonts, tools (FontForge), and distribution (the Open Font Library). +% \item[LuaTeX:] Combining the pdf\TeX\ engine and the Lua language. +% \item[MetaPost:] Postscript graphics. +% \item[MacTeX:] \TeX\ for Mac. +% \item[PDF Accessibility:] Modern PDF standards. +% \item[Other:] Additional projects may be specified. +% \end{description} +% +% To make a contribution: \hfill +% \href{https://www.tug.org/donate.html}{\texttt{https://www.tug.org/donate.html}} +% +% For users of MiK\TeX: \hfill +% \href{https://miktex.org/donations.html}{\texttt{https://miktex.org/donations.html}} +% +% For country-specific \TeX\ users groups: \hfill +% \href{http://tug.org/usergroups.html}{\texttt{http://tug.org/usergroups.html}} +% +% \clearpage % % % \tableofcontents @@ -1800,8 +1930,6 @@ This boolean may be tested by the user for later use. % % \clearpage % -% \part{lwarp.sty} -% % \section{Updates} % \label{sec:updates} % @@ -1812,6 +1940,42 @@ This boolean may be tested by the user for later use. % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} +% \item[v0.42:] \ +% \begin{itemize} +% \item Improved assitance for word-processor conversions when +% \margintag{word-processor conversion} +% boolean |FormatWP| is set |true|. +% See \cref{sec:wordprocessorconversion}. +% \begin{itemize} +% \item \textcolor{red}{The} \watchout[name change] +% \textcolor{red}{boolean |FormatWordProcessor| has +% been renamed |FormatWP|.} +% \item \textcolor{red}{The} \watchout[name change] +% \textcolor{red}{boolean |HTMLMarkFloats| has +% been renamed |WPMarkFloats|.} +% \item New booleans control whether to place additional +% marks around minipages, at the table of contents, +% at the \acro{LOF} and \acro{LOT}, and whether to +% print math as \LaTeX\ source for copy/paste into the +% LibreOffice Writer TeXMaths extension. +% \item Improved formatting for numerous objects. +% See \cref{sec:wordprocessorconversion}. +% \end{itemize} +% \item Add: \env{tabbing} environment. +% \margintag{\env{tabbing}} +% \item Add: \pkg{overpic} package. See \cref{sec:overpic}. +% \margintag{\pkg{overpic}} +% \item Fix: Text copy/paste of \AmS\ math environment numbers and names. +% \margintag{math} +% \item Improved \cs{ensuremath}. +% \item MathJax with \pkg{siunitx}: Updated script and documentation. +% \item \pkg{textcomp}: Improved \cs{interrobangdown}. +% \margintag{symbols} +% \item \pkg{realscripts}: Fix for subscripts in a \env{lateximage}. +% \item \pkg{morewrites}: Enforces loading before \pkg{lwarp}. +% \margintag{load order} +% \end{itemize} +% \needspace{2\baselineskip} % \item[v0.41:] \ % \begin{itemize} % \item Added tabular vertical rules, subject to some limitations. @@ -2159,9 +2323,11 @@ This boolean may be tested by the user for later use. % \item Boolean |FormatWordProcessor| changes \HTML\ output for easier conversion % by a word processor. Removes headers and nav, prints footnotes per section, % and also forces single-file output and turns off \HTML\ debug comments. +% Name changed to |FormatWP| as of v0.42. % \item Boolean |HTMLMarkFloats| adds text marks around floats only if % |FormatWordProcessor|. These make it easier to identify float boundaries, % which are to be manually converted to word-processor frames. +% Name changed to |WPMarkFloats| as of v0.42. % \item Updated for the new MathJax \acro{CDN} repository. % \item Adds \pkg{tabulary}. % \item Supports the options syntax for \pkg{graphics}. @@ -2344,7 +2510,7 @@ This boolean may be tested by the user for later use. % % Furthermore, \SVG\ images allow math to be presented with % the same precise formatting as in the print version. -% Math is accompanied by ALT tags holding the \LaTeX{} source for the expression, allowing it to be +% Math is accompanied by \element{alt} tags holding the \LaTeX{} source for the expression, allowing it to be % copy/pasted into other documents.\footnote{There seems to be some debate as to whether % \MathML\ is actually an improvement over \LaTeX{} for sharing math. The author has no % particular opinion on the matter, except to say that in this case \LaTeX{} is much easier to implement!} @@ -2472,7 +2638,7 @@ This boolean may be tested by the user for later use. % % \midrule % -% Math: & Supported. Converted to \SVG\ images with \HTML\ \cmds{ALT} tags containing the +% Math: & Supported. Converted to \SVG\ images with \HTML\ \element{alt} tags containing the % \LaTeX{} source for the math expression. % MathJax supported as an alternative. % \AmS{} environments are supported. @@ -2509,11 +2675,10 @@ This boolean may be tested by the user for later use. % References to \PDF\ files are changed to \SVG, other image types % are accepted as well. % \cs{rotatebox} and \cs{scalebox} are supported as well as \HTML\ can handle. -% \pkg{grffile} is supported. \\ -% -% \pkg{rotating}: & Emulated. All objects are displayed unrotated. \\ +% \pkg{rotating} is emulated but all objects are unrotated. +% \pkg{picture} and \pkg{tikz} are converted to an \SVG\ image. +% \pkg{grffile} and \pkg{overpic} are supported. \\ % -% \pkg{picture} and \pkg{tikz}: & Converted to an \SVG\ image. \\ % % \midrule % @@ -4747,13 +4912,11 @@ This boolean may be tested by the user for later use. % % % \subsection{Math} -% \label{sec:limitsmath} % +% \changes{v0.42}{2017/10/30}{Docs: Reorganized math limitations} +% \label{sec:limitsmath} % \limitsmath % -% For an example of using custom \LaTeX\ macros with MathJax, -% \margintag{custom MathJax macros} -% see page \pageref{ex:mathjaxmacros}. % % % \subsubsection{\pkg{ntheorem} package} @@ -4762,6 +4925,7 @@ This boolean may be tested by the user for later use. % % % \subsubsection{\pkg{siunitx} package} +% \label{sec:limitssiunitx} % % \DescribePackage{siunitx} % \limitssiunitx @@ -4800,6 +4964,10 @@ This boolean may be tested by the user for later use. % % \limitsxcolor % +% \subsubsection{\pkg{overpic} package} +% +% \limitsoverpic +% % % \subsection{Tabular} % \label{sec:limitstabular} @@ -4845,6 +5013,11 @@ This boolean may be tested by the user for later use. % \limitsfloatrow % % +% \subsubsection{\pkg{keyfloat} package} +% +% \limitskeyfloat +% +% % \subsection{Miscellaneous} % % @@ -4898,7 +5071,7 @@ This boolean may be tested by the user for later use. % converting \pkg{lwarp} \HTML\ output to \EPUB: % % \DescribeBoolean{FormatEPUB} -% \begin{docsidebar} +% \begin{docsidebar}[\texttt{FormatEPUB}] % \raggedright % Default false. % |FormatEPUB| changes \HTML\ output for easy \EPUB\ conversion @@ -4914,8 +5087,10 @@ This boolean may be tested by the user for later use. % \end{sourcedisplay} % to the project's source preamble after |\usepackage{lwarp}|. % The \EPUB\ version of the document cannot co-exist with the -% regular \HTML\ version, so \userentry{lwarpmk cleanall} then +% regular \HTML\ version, so +% \userentry{lwarpmk cleanall} % \userentry{lwarpmk html} +% \userentry{lwarpmk limages} % to recompile with the |FormatEPUB| boolean turned on. % Several changes are then made to the \HTML\ output: % \begin{itemize} @@ -4955,7 +5130,7 @@ This boolean may be tested by the user for later use. % \begin{UIdisplay} % Match HTML tags with tag name: % \end{UIdisplay} -% to \element{h4}. (Or \element{h3} for document classes with \cs{chapter}s.) +% to ``h4''. (Or ``h3'' for document classes with \cs{chapter}s.) % The \textsf{Detect chapters at} field should then show % \begin{UIdisplay} % //h:h4 \qquad \textrm{---\,or\,---} \qquad //h:h3 @@ -4989,6 +5164,11 @@ This boolean may be tested by the user for later use. % \clearpage % % \section{Word-processor conversion} +% \label{sec:wordprocessorconversion} +% \index{word processor>HTML conversion settings} +% \index{HTML>conversion settings>word processor} +% \index{LibreOffice>import into} +% \index{export>to word processor} % % \pkg{lwarp} may be told to modify its \HTML\ output to make it % easier to import the \HTML\ document into a word processor. @@ -5000,11 +5180,13 @@ This boolean may be tested by the user for later use. % as shown below. % % +% \subsection{Activating word-processor conversion} +% % A special boolean is provided to simplify the process of % converting \pkg{lwarp} \HTML\ output to \EPUB: % -% \DescribeBoolean{FormatWordProcessor} -% \begin{docsidebar} +% \DescribeBoolean{FormatWP} +% \begin{docsidebar}[\texttt{FormatWP}] % \raggedright % Default false. % Changes \HTML\ output for easier conversion @@ -5012,18 +5194,25 @@ This boolean may be tested by the user for later use. % Removes headers and nav, prints footnotes per section, % and also forces single-file output and turns off \HTML\ debug % comments. +% Additionally, honors the booleans |WPMarkFloats|, |WPMarkMinipages|, +% |WPMarkTOC|, and |WPMarkLOFT|. % \end{docsidebar} -% \index{word processor>HTML conversion settings} -% \index{HTML>conversion settings>word processor} % % To help modify \pkg{lwarp} \HTML\ output for easier % import to a word processor, add % \begin{sourcedisplay} -% |\booltrue{FormatWordProcessor}| +% |\booltrue{FormatWP}| % \end{sourcedisplay} % to the project's source preamble after \pkg{lwarp} is loaded. -% Several changes are then made to the \HTML\ output: +% The following changes are then made to the \HTML\ output: +% \margintag{formatting adjustments} % \begin{itemize} +% \item If using a class without chapters, \cs{section} and lower are +% shifted up in level for the \HTML\ heading tags. The \CSS\ has +% not been changed, so the section heading formats will not match the normal +% \HTML\ output, but when imported to LibreOffice Writer the higher +% section headings will import as \UI{Heading~1} for the title, \UI{Heading~2} +% for \cs{section}, etc. % \item Headers, footers, and navigation are removed at file splits. % \item Any accumulated footnotes are printed at the bottom of each file split. % These will have to be manually moved to their proper place in @@ -5036,40 +5225,286 @@ This boolean may be tested by the user for later use. % marking the opening/closing of sections and \element{div}s, % but they are no longer useful when the document has been % imported into a word processor. +% \item An additional \element{div} with an \attribute{id} encapsulates +% each float and minipage, which on import into LibreOffice Writer +% causes a thin frame to appear around the text block for each. +% \item Float captions are given an explicit italic formatting. +% \item Tabular rule borders are made explicit for LibreOffice Writer. +% LibreOffice displays a light border around each cell while editing, +% even those which have no border when printed, +% and \pkg{lwarp} also uses a light border for thin rules, +% so it will be best to judge the results using +% the print preview instead of while editing in LibreOffice. +% \item \cs{includegraphics} and \SVG\ math width and height +% are made explicit for LibreOffice. +% \item \cs{hspace} is approximated by a number of \cs{quad}s, +% and rules are approximated by a number of underscores. +% \item Explicit \HTML\ styles are given to: +% \begin{itemize} +% \item \cs{textsc}, etc. +% \item \cs{underline}, \pkg{soul} and \pkg{ulem} markup. +% \item \env{center}, \env{flushleft}, \env{flushright}. +% \item \cs{marginpar}, \pkg{keyfloat}, \pkg{sidenotes}, \pkg{floatflt}, +% and \pkg{wrapfig}. +% \item \pkg{fancybox} \cs{shadowbox}, etc. +% \item The \LaTeX\ and \TeX\ logos. +% \end{itemize} +% \item Honors several booleans: +% \begin{description} +% \item[\texttt{WPMarkFloats}:] Marks the begin and end of floats. +% \item[\texttt{WPMarkMinipages}:] Marks the begin and end of minipages. +% \item[\texttt{WPMarkTOC}:] Marks the location of the Table of Contents. +% \item[\texttt{WPMarkLOFT}:] Marks the locations of the List of Figures/Tables. +% \item[\texttt{WPMarkMath}:] Prints \LaTeX\ math instead of using images. +% \item[\texttt{WPTitleHeading}:] Adjusts title and section headings. +% \end{description} +% Several of these may be used to add markers to the HTML text +% which help determine where to adjust the word processor document after +% import. + % \end{itemize} % -% An additional boolean may be set to help mark float boundaries: % -% \newcommand{\describeHTMLMarkFloats}{ -% Default true. +% \subsection{Additional modifications} +% +% \newcommand{\describeWPMarkFloats}{ +% Default |false|. % Adds % \begin{sourcedisplay} -% === table begin \\ +% === begin table === \\ % \dots \\ -% === end +% === end === % \end{sourcedisplay} % or % \begin{sourcedisplay} -% === figure begin \\ +% === begin figure === \\ % \dots \\ -% === end +% === end === % \end{sourcedisplay} % around floats while formatting for word processors. % This helps identify boundaries of floats to be manually converted -% to word-processor frames. +% to word-processor frames and captions. % } % -% \DescribeBoolean{HTMLMarkFloats} -% \begin{docsidebar} +% \DescribeBoolean{WPMarkFloats} +% \begin{docsidebar}[\texttt{WPMarkFloats}] % \raggedright -% \describeHTMLMarkFloats +% \describeWPMarkFloats % \end{docsidebar} -% \index{word processor>HTML conversion settings} -% \index{HTML>conversion settings>word processor} % -% When enabled, markers are placed around each float, helping the -% user to identify float boundaries for further conversion to -% word processor frames and captions. +% +% \newcommand{\describeWPMarkMinipages}{ +% Default |false|. +% Adds +% \begin{sourcedisplay} +% === begin minipage === \\ +% \dots \\ +% === end minipage === +% \end{sourcedisplay} +% around minipages while formatting for word processors. +% This helps identify boundaries of minipages to be manually converted +% to word-processor frames. +% } +% +% \DescribeBoolean{WPMarkMinipages} +% \begin{docsidebar}[\texttt{WPMarkMinipages}] +% \raggedright +% \describeWPMarkMinipages +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkTOC}{ +% Default |true|. +% While formatting for word processors, adds +% \begin{sourcedisplay} +% === table of contents === \\ +% \end{sourcedisplay} +% where the Table of Contents would have been. +% This helps identify where to insert the actual \acro{TOC}. +% +% \emph{If set |false|, the actual \acro{TOC} is printed instead.} +% } +% +% \DescribeBoolean{WPMarkTOC} +% \begin{docsidebar}[\texttt{WPMarkTOC}] +% \raggedright +% \describeWPMarkTOC +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkLOFT}{ +% Default |false|. +% While formatting for word processors, adds +% \begin{sourcedisplay} +% === list of figures === \quad \textrm{\textit{and\,/\,or}} \\ +% === list of tables === \\ +% \end{sourcedisplay} +% where each of these lists would have been. +% This helps identify where to insert the actual lists. +% +% \emph{If set |false|, the actual lists are printed instead.} +% } +% +% \DescribeBoolean{WPMarkLOFT} +% \begin{docsidebar}[\texttt{WPMarkLOFT}] +% \raggedright +% \describeWPMarkLOFT +% \end{docsidebar} +% +% +% \newcommand{\describeWPMarkMath}{ +% Default |false|. +% While formatting for word processors, +% prints math as \LaTeX\ code instead of creating \SVG\ images or MathJax. +% This is useful for cut/paste into the LibreOffice Writer TeXMaths extension. +% } +% +% \DescribeBoolean{WPMarkMath} +% \DescribeProgram{TeXMaths} +% \margintag{siunitx} +% \begin{docsidebar}[\texttt{WPMarkMath}] +% \raggedright +% \describeWPMarkMath +% +% When using the \pkg{siunitx} package, enter +% \begin{sourcedisplay} +% \cs{usepackage}\{siunitx\} +% \end{sourcedisplay} +% in the TeXMaths preamble. +% Equation numbering is problematic for \AmS\ math environments. +% \end{docsidebar} +% \index{siunitx>with TeXMaths} +% \index{math>word processor conversion} +% +% +% \newcommand*{\describeWPTitleHeading}{ +% Default |false|. +% While formatting for word processors, +% |true| sets the document title to \element{h1}, which is expected for \HTML\ documents, +% but also causes the lower-level section headings to start at \UI{Heading 2} when +% imported into LibreOffice. +% Set to |false| to cause the title to be plain text, and the section headings +% to begin at \UI{Heading 1}. +% +% See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}. +% } +% +% \DescribeBoolean{WPTitleHeading} +% \margintag{section headings} +% \begin{docsidebar}[\texttt{WPTitleHeading}] +% \raggedright +% \describeWPTitleHeading +% \end{docsidebar} +% \index{section>heading, word processor} +% \index{heading, word processor} +% \index{word processor>section headings} +% \index{LibreOffice>section headings} +% +% \begin{table} +% \centering +% \begin{threeparttable} +% \caption{Section HTML headings for word-processor conversion} +% \label{tab:WPsectionheadings} +% \begin{tabular}{lcccc} +% \toprule +% ~ & \multicolumn{4}{c}{HTML headings\tnote{\textasteriskcentered}} \\ +% \cmidrule{2-5} +% ~ & \multicolumn{2}{c}{With \cs{chapter}} & \multicolumn{2}{c}{Without \cs{chapter}} \\ +% \cmidrule(r){2-3} \cmidrule(l){4-5} +% ~ & \multicolumn{2}{c}{|WPTitleHeading|} & \multicolumn{2}{c}{|WPTitleHeading|} \\ +% Section & |true| & |false| & |true| & |false| \\ +% \midrule +% Title & \element{h1} & plain & \element{h1} & plain \\ +% \cs{part} & \element{h2} & \element{h1} & \element{h2} & \element{h1} \\ +% \cs{chapter} & \element{h3} & \element{h2} & --- & --- \\ +% \cs{section} & \element{h4} & \element{h3} & \element{h3} & \element{h2} \\ +% \cs{subsection} & \element{h5} & \element{h4} & \element{h4} & \element{h3} \\ +% \cs{paragraph} & \element{h6} & \element{h5} & \element{h5} & \element{h4} \\ +% \cs{subparagraph} & span & \element{h6} & \element{h6} & \element{h5} \\ +% \bottomrule +% \end{tabular} +% \begin{tablenotes} +% \footnotesize +% \item[\textasteriskcentered] For default depths when not |FormatWP|, +% see \cref{tab:depthsheadings} on \cpageref{tab:depthsheadings}. +% \end{tablenotes} +% \end{threeparttable} +% \smallskip\hrule +% \end{table} +% +% \subsection{Recommendations} +% \index{word processor>conversion recommendations} +% \index{LibreOffice>conversion recommendations} +% +% For use with LibreOffice Writer, it is recommended to: +% \margintag{TOC, LOF, LOT} +% \begin{enumerate}[nosep] +% \item Set \cs{booltrue}\{FormatWP\}. +% \item Set \cs{booltrue}\{WPMarkTOC\} and \cs{boolfalse}\{WPMarkLOFT\}. +% \item Use \pkg{lwarp} to generate the \HTML\ document. +% \item Copy/paste from the \HTML\ document into an empty LibreOffice Writer document. +% \item Manually insert a LibreOffice \acro{TOC} in the LibreOffice document. +% \item Manually add frames around each float, adding a caption which is cut/pasted from +% each float's simulated caption. +% \item Manually create cross references. +% \end{enumerate} +% This process yields a document with an actual LibreOffice Table of Contents, +% but a simulated List of Figures and List of Tables. +% +% For \pkg{siunitx}, remember to adjust the preamble as mentioned above. +% \margintag{siunitx} +% +% LibreOffice has options in the View menu to turn on/off the display of +% \margintag{LO view border options} +% thin borders around table cells and text objects. +% +% +% \subsection{Limitations} +% +% Floats and captions are not explicitly converted to LibreOffice floats with their +% own captions. Floats are surrounded by a thin frame in the LibreOffice editor, +% and may be marked with |WPMarkFloats|, but are not given a proper LibreOffice +% object frame. +% Captions are given an explicit italic formatting, +% but not a proper LibreOffice paragraph style. +% +% Cross references are not actual LibreOffice linked cross references. +% +% The List of Figures and List of Tables are not linked. +% The pasted pseudo \acro{LOF} and \acro{LOT} match the numbering +% of the \LaTeX\ and \HTML\ versions. +% +% Equation numbering is not automatic, but the equation numbers in \SVG\ math +% will match the \LaTeX\ and \HTML\ output. +% SVG math is recommended when using the \AmS\ environments, which may have +% multiple numbered equations per object. +% +% As of when last checked, LibreOffice ignores the following: +% \begin{itemize} +% \item Minipage alignment. +% \item Tabular cell vertical alignment. +% \item Image rotation and scaling. +% \item Rounded border corners, which are also used by: +% \begin{itemize} +% \item \cs{textcircled} +% \item \pkg{booktabs} trim +% \end{itemize} +% \item \cs{hspace} and rules, also used by \pkg{algorithmic}. +% \item Coloring of text decorations, used by \pkg{soul} and \pkg{ulem}. +% \item Overline text decoration, used by \pkg{romanbar}. +% \end{itemize} +% +% Libreoffice also has limitations with frames and backgrounds: +% \begin{itemize} +% \item Multiple lines in an object are framed individually instead of as a whole. +% \item Nested frames are not handled correctly. +% \item Images inside boxes are not framed correctly. +% \item Spans with background colors and frames are not displayed correctly. +% \end{itemize} +% +% +% +% % % % \clearpage @@ -5219,12 +5654,12 @@ This boolean may be tested by the user for later use. % % Also see: \\ % \Cref{sec:printcommands}: \nameref{sec:printcommands} \\ -% \Cref{sec:successfulcommands}: \nameref{sec:successfulcommands} \\ % \Cref{sec:limitations}: \nameref{sec:limitations} % % \changes{v0.14}{2016/03/26}{Docs: Troubleshooting cross-references.} % \changes{v0.16}{2016/04/08}{Docs: Text not converting.} % \changes{v0.34}{2017/08/08}{Docs: Misplaced alignment character.} +% \changes{v0.42}{2017/10/13}{Docs: Improper \cs{prevdepth}.} % % \begin{description} % @@ -5247,7 +5682,21 @@ This boolean may be tested by the user for later use. % \item Be sure that a print version of the document compiles and % that your document's \LaTeX{} code is correct, before attempting % to generate an \HTML\ version. -% \end{itemize} +% +% \begin{description} +% \item [``Leaders not followed by proper glue'':] This can be caused by +% a missing |l@| or |l@| definition. +% See \pkg{lwarp}'s definitions for examples. +% +% \item [``Improper \cs{prevdepth}'':] Something tried to use +% \cs{ensuremath} where \pkg{lwarp} then tries to create a \env{lateximage}. +% If you can locate what used \cs{ensuremath}, have it temporarily set: +% \begin{sourcedisplay} +% \cs{LetLtxMacro}\cs{@ensuredmath}\cs{LWR@origensuredmath} +% \end{sourcedisplay} +% inside a group first. +% \end{description} +% \end{itemize} % % \item [Missing sections:] ~ % \begin{itemize} @@ -5257,8 +5706,10 @@ This boolean may be tested by the user for later use. % \end{itemize} % % \item [Missing HTML files:] \ +% \begin{itemize} % \item See the warning regarding changes to the \HTML\ settings % at \cref{sec:htmlsettings}. +% \end{itemize} % % \item [Missing / incorrect cross-references:] ~ % \index{cross-references>missing or incorrect} @@ -5300,13 +5751,11 @@ This boolean may be tested by the user for later use. % \item |lwarpmk limages| to refresh the |lateximage| images. % \end{itemize} % -% \item[SVG images:] \limitssvgimages +% \item[SVG images:] \ % -% \item [``Leaders not followed by proper glue'':] This can be caused by -% a missing |l@| or |l@| definition. -% See \pkg{lwarp}'s definitions for examples. +% \limitssvgimages % -% \item [Plain-looking document:] ~ +% \item [Plain-looking document:] \ % \begin{itemize} % \item The document's \CSS\ stylesheet may not be available, or may be % linked incorrectly. Verify any \cs{CSSFilename} statements point to @@ -5386,6 +5835,8 @@ This boolean may be tested by the user for later use. % % % +% \part{lwarp.sty} +% % % \section{Implementation} % @@ -5420,7 +5871,7 @@ This boolean may be tested by the user for later use. % Testing has primarily been done with the Iceweasel/Firefox browser. % % -% \section{Stack depths} +% \section{Section depths and HTML headings} % \label{sec:stackdepths} % \index{HTML>headings} % \index{section>depths}\index{stack depths} @@ -5436,10 +5887,13 @@ This boolean may be tested by the user for later use. % sections and lists of a deeper level to keep the \HTML\ tags nested correctly. % % \begin{table} +% \centering +% \begin{threeparttable} % \caption{Section depths and HTML headings\label{tab:depthsheadings}} % \begin{tabular}{lcl} % \toprule -% Section & \parbox[c]{.35in}{\LaTeX{} depth} & \HTML\ headings \\ +% Section & \parbox[b]{.35in}{\centering\LaTeX\ depth} & +% HTML headings \tnote{\textasteriskcentered} \\ % \midrule % title of the entire website & & \element{h1} \\ % none & -5 & new for this package \\ @@ -5454,6 +5908,15 @@ This boolean may be tested by the user for later use. % listitem & 7 & new for this package, used for list items \\ % \bottomrule % \end{tabular} +% \begin{tablenotes} +% \footnotesize +% \item{\textasteriskcentered} If |FormatWP| is true, +% section headings may be adjusted, depending on |WPTitleHeading|. +% See \cref{tab:WPsectionheadings} on \cpageref{tab:WPsectionheadings}. +% \end{tablenotes} +% \end{threeparttable} +% \smallskip +% \hrule % \end{table} % % Support for the \pkg{memoir} package will require the addition of a |book| @@ -6122,6 +6585,8 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{flushend} \LWR@loadafter{fncychap} \LWR@loadafter{fnpos} +% fontenc must be loaded before lwarp +% fontspec must be loaded before lwarp \LWR@loadafter{ftnright} \LWR@loadafter{fullpage} \LWR@loadafter{fullwidth} @@ -6134,6 +6599,7 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{hyperxmp} \LWR@loadafter{idxlayout} \LWR@loadafter{indentfirst} +% inputenc must be loaded before lwarp \LWR@loadafter{keyfloat} \LWR@loadafter{layout} \LWR@loadafter{letterspace} @@ -6152,17 +6618,21 @@ For a possible alternative, see package(s) #2.} \LWR@loadafter{microtype} \LWR@loadafter{midfloat} \LWR@loadafter{moreverb} +% morewrites must be loaded before lwarp \LWR@loadafter{mparhack} %\LWR@loadafter{multicol}% loaded by ltxdoc \LWR@loadafter{multirow} \LWR@loadafter{nameref} \LWR@loadafter{needspace} +% newclude must be loaded before lwarp \LWR@loadafter{newtxmath} +% newunicodechar must be loaded before lwarp \LWR@loadafter{nextpage} \LWR@loadafter{nonumonpart} \LWR@loadafter{nopageno} \LWR@loadafter{nowidow} \LWR@loadafter{ntheorem} +\LWR@loadafter{overpic} \LWR@loadafter{pagenote} \LWR@loadafter{paralist} \LWR@loadafter{parskip} @@ -6655,7 +7125,7 @@ top=1in,bottom=1in,% % \DescribePackage{environ} % -% Used to encapsulate math environments for re-use in \HTML\ ALT text. +% Used to encapsulate math environments for re-use in \HTML\ \element{alt} text. % % \begin{macrocode} \RequirePackage{environ} @@ -7018,6 +7488,7 @@ top=1in,bottom=1in,% % \section{Debugging messages} +% \codeall % \begin{macrocode} \begin{warpall} % \end{macrocode} @@ -7076,6 +7547,10 @@ top=1in,bottom=1in,% } % \end{macrocode} +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + @@ -7084,6 +7559,12 @@ top=1in,bottom=1in,% % These booleans modify the \HTML\ output in various ways % to improve conversion to \EPUB\ or word processor imports. % +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} +% +% \subsection{User-level controls} % % \DescribeBoolean{FormatEPUB} Default false. % Changes \HTML\ output for easy \EPUB\ conversion @@ -7100,7 +7581,7 @@ top=1in,bottom=1in,% % \end{macrocode} % % -% \DescribeBoolean{FormatWordProcessor} Default false. +% \DescribeBoolean{FormatWP} Default false. % Changes \HTML\ output for easier conversion % by a word processor. % Removes headers and nav, prints footnotes per section, @@ -7109,33 +7590,161 @@ top=1in,bottom=1in,% % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % -% \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatWordProcessor}.} +% \changes{v0.28}{2017/04/09}{Added boolean \texttt{FormatWP}.} % % \begin{macrocode} -\newbool{FormatWordProcessor} -\boolfalse{FormatWordProcessor} +\newbool{FormatWP} +\boolfalse{FormatWP} % \end{macrocode} % % -% \DescribeBoolean{HTMLMarkFloats} -% \describeHTMLMarkFloats +% \DescribeBoolean{WPMarkFloats} +% \describeWPMarkFloats % \footnote{Perhaps some day word processors will have \HTML\ import options -% for identifying \element{div} classes for figures and tables, -% along with the associated captions.} +% for identifying \element{figure} and \element{figcaption} tags +% for figures and tables.} % \index{word processor>HTML conversion settings} % \index{HTML>conversion settings>word processor} % -% \changes{v0.28}{2017/04/09}{Added boolean \texttt{HTMLMarkFloats}} +% \changes{v0.28}{2017/04/09}{Added boolean \protect\texttt{HTMLMarkFloats}, changed +% to \protect\texttt{WPMarkFloats} as of v0.42.} % % \begin{macrocode} -\newbool{HTMLMarkFloats} -\booltrue{HTMLMarkFloats} +\newbool{WPMarkFloats} +\boolfalse{WPMarkFloats} +% \end{macrocode} + +% \DescribeBoolean{WPMarkMinipages} +% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkMinipages}.} +% \describeWPMarkMinipages +% \begin{macrocode} +\newbool{WPMarkMinipages} +\boolfalse{WPMarkMinipages} +% \end{macrocode} + +% \DescribeBoolean{WPMarkTOC} +% \changes{v0.42}{2017/10/18}{Added boolean \protect\texttt{WPMarkTOC}.} +% \describeWPMarkTOC +% \begin{macrocode} +\newbool{WPMarkTOC} +\booltrue{WPMarkTOC} +% \end{macrocode} + + +% \DescribeBoolean{WPMarkLOFT} +% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkLOFT}.} +% \describeWPMarkLOFT +% \begin{macrocode} +\newbool{WPMarkLOFT} +\boolfalse{WPMarkLOFT} +% \end{macrocode} + + +% \DescribeBoolean{WPMarkMath} +% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPMarkMath}.} +% \describeWPMarkMath +% \begin{macrocode} +\newbool{WPMarkMath} +\boolfalse{WPMarkMath} +% \end{macrocode} + + +% \DescribeBoolean{WPTitleHeading} +% \changes{v0.42}{2017/10/19}{Added boolean \protect\texttt{WPTitleHeading}.} +% \describeWPTitleHeading +% \begin{macrocode} +\newbool{WPTitleHeading} +\boolfalse{WPTitleHeading} % \end{macrocode} % \begin{macrocode} \end{warpall} % \end{macrocode} +% +% \subsection{Heading adjustments} +% +% \changes{v0.42}{2017/10/19}{If \protect\texttt{FormatWP}, +% shift section headings.} +% If formatting the \HTML\ for a word processor, adjust heading levels. +% +% If |WPTitleHeading| is true, adjust so that |part| is \UI{Heading~1}. +% +% If |WPTitleHeading| is false, use \element{h1} for the title, +% and set |part| to \UI{Heading~2}. +% +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% \begin{macrocode} +\AtBeginDocument{ +\ifbool{FormatWP}{ +\@ifundefined{chapter}{ +\ifbool{WPTitleHeading}{% part and section starting at h2 +\renewcommand*{\LWR@tagtitle}{h1} +\renewcommand*{\LWR@tagtitleend}{/h1} +\renewcommand*{\LWR@tagpart}{h2} +\renewcommand*{\LWR@tagpartend}{/h2} +\renewcommand*{\LWR@tagsection}{h3} +\renewcommand*{\LWR@tagsectionend}{/h3} +\renewcommand*{\LWR@tagsubsection}{h4} +\renewcommand*{\LWR@tagsubsectionend}{/h4} +\renewcommand*{\LWR@tagsubsubsection}{h5} +\renewcommand*{\LWR@tagsubsubsectionend}{/h5} +\renewcommand*{\LWR@tagparagraph}{h6} +\renewcommand*{\LWR@tagparagraphend}{/h6} +\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"{}} +\renewcommand*{\LWR@tagsubparagraphend}{/span} +}% WPTitleHeading +{% not WPTitleHeading, part and section starting at h1 +\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitleend}{/div} +\renewcommand*{\LWR@tagpart}{h1} +\renewcommand*{\LWR@tagpartend}{/h1} +\renewcommand*{\LWR@tagsection}{h2} +\renewcommand*{\LWR@tagsectionend}{/h2} +\renewcommand*{\LWR@tagsubsection}{h3} +\renewcommand*{\LWR@tagsubsectionend}{/h3} +\renewcommand*{\LWR@tagsubsubsection}{h4} +\renewcommand*{\LWR@tagsubsubsectionend}{/h4} +\renewcommand*{\LWR@tagparagraph}{h5} +\renewcommand*{\LWR@tagparagraphend}{/h5} +\renewcommand*{\LWR@tagsubparagraph}{h6} +\renewcommand*{\LWR@tagsubparagraphend}{/h6} +}% not WPTitleHeading +}% chapter undefined +{% chapter defined +\ifbool{WPTitleHeading}{} +{% not WPTitleHeading, part and chapter starting at h1 +\renewcommand*{\LWR@tagtitle}{div class="title"} +\renewcommand*{\LWR@tagtitleend}{/div} +\renewcommand*{\LWR@tagpart}{h1} +\renewcommand*{\LWR@tagpartend}{/h1} +\renewcommand*{\LWR@tagchapter}{h2} +\renewcommand*{\LWR@tagchapterend}{/h2} +\renewcommand*{\LWR@tagsection}{h3} +\renewcommand*{\LWR@tagsectionend}{/h3} +\renewcommand*{\LWR@tagsubsection}{h4} +\renewcommand*{\LWR@tagsubsectionend}{/h4} +\renewcommand*{\LWR@tagsubsubsection}{h5} +\renewcommand*{\LWR@tagsubsubsectionend}{/h5} +\renewcommand*{\LWR@tagparagraph}{h6} +\renewcommand*{\LWR@tagparagraphend}{/h6} +\renewcommand*{\LWR@tagsubparagraph}{span class="subparagraph"{}} +\renewcommand*{\LWR@tagsubparagraphend}{/span} +}% not WPTitleHeading +}% chapter defined +}{}% FormatWP +}% AtBeginDocument +% \end{macrocode} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + % \section{Remembering original formatting macros} @@ -7179,8 +7788,12 @@ top=1in,bottom=1in,% \let\LWR@origsp\sp \let\LWR@origsb\sb -\let\LWR@origtextsuperscript\textsuperscript -\let\LWR@origtextsubscript\textsubscript +\LetLtxMacro\LWR@origtextsuperscript\textsuperscript +\LetLtxMacro\LWR@orig@textsuperscript\@textsuperscript +\AtBeginDocument{ +\LetLtxMacro\LWR@origtextsubscript\textsubscript +\LetLtxMacro\LWR@orig@textsubscript\@textsubscript +} \LetLtxMacro\LWR@origunderline\underline \let\LWR@origscriptsize\scriptsize @@ -7589,6 +8202,13 @@ span.poemtitle { font-size: 120% ; font-weight: bold; } +pre.tabbing { + font-family: "Linux Libertine Mono O", "Lucida Console", + "Droid Sans Mono", "DejaVu Mono", "Bitstream Vera Mono", + "Liberation Mono", "FreeMono", "Andale Mono", + "Nimbus Mono L", "Courier New", monospace; +} + blockquote { margin-left: 0px ; margin-right: 0px ; @@ -7986,6 +8606,11 @@ div.onehalfspace { line-height: 1.5 ; } div.doublespace { line-height: 2 ; } +/* Word processor format output: */ +div.wpfigure { border: 1px solid red ; margin: .5ex ; padding: .5ex ; } +div.wptable { border: 1px solid blue ; margin: .5ex ; padding: .5ex ; } +div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;} + @@ -9319,8 +9944,9 @@ nav.botnavigation { % the resulting \HTML\ files. % % \changes{v0.28}{2017/04/11}{File \protect\texttt{lwarp\_mathjax.txt}: Updated \protect\acro{CDN} repository.} -% \changes{v0.30}{2017/04/26}{Fix: \protect\texttt{lwarp\_mathjax.txt} only written in print mode.} -% \changes{v0.34}{2017/07/27}{File: \protect\texttt{lwarp\_mathjax.txt} version change.} +% \changes{v0.30}{2017/04/26}{Fix: \protect\texttt{lwarp\_mathjax.txt}: Only written in print mode.} +% \changes{v0.34}{2017/07/27}{File: \protect\texttt{lwarp\_mathjax.txt}: Version change.} +% \changes{v0.42}{2017/10/16}{File: \protect\texttt{lwarp\_mathjax.txt}: Updated \pkg{siunitx} script.} % % % \begin{macrocode} @@ -9387,15 +10013,16 @@ MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () { "https://cdn.mathjax.org/mathjax/contrib"; - + + - + +