From 5dc3c1fc74df34166b4e2247c0a7ac2ad6fb7eff Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 20 Aug 2017 22:12:58 +0000 Subject: lwarp (20aug17) git-svn-id: svn://tug.org/texlive/trunk@45082 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 716 +++++++++++++++++++------ 1 file changed, 554 insertions(+), 162 deletions(-) (limited to 'Master/texmf-dist/source/latex/lwarp') diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index 577293502a1..9d0e35838c4 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/08/17 v0.36 Allows LaTeX to directly produce HTML5 output.] +% [2017/08/19 v0.37 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -356,6 +356,17 @@ and a \cs{fill} is converted to a \cs{qquad}. \cs{kern} and \cs{hskip} are treated as a single normal space. } +\newcommand{\limitstextcomp}{% +Many \pkg{textcomp} symbols are not supported by many fonts. +\watchout[Missing symbols] +Try using more complete fonts in the \CSS, but expect to see gaps in coverage. +} + +\newcommand{\limitsaccents}{% +Native \LaTeX\ accents such as \cs{"} will work, but many more kinds of +accents are available when using Unicode-aware \XeLaTeX\ and \LuaLaTeX. +} + \newcommand{\limitsreferences}{% \cs{nameref} refers to the most recently-used section where the \cs{label} was defined. If no section has been defined before the \cs{label}, @@ -906,6 +917,11 @@ may be defined as: \pkg{fancybox}'s \cs{VerbBox} may be used inside \cs{fbox}. \margintag{framed \cs{VerbBox}} + +\env{LVerbatim}, \cs{LVerbatimInput}, and \cs{LUseVerbatim} indent with horizontal +\margintag{indented alignment} +space which may not line up exactly with what \texttt{pdftotext} detects. +Some lines may be off slightly in their left edge. } \newcommand{\limitsmdframed}{% @@ -1010,7 +1026,7 @@ Possible solutions include: Do not use \cmds{per-mode=fraction}, which cannot be seen by the final \cmds{pdftotext} conversion. \watchout[per-mode] -Place the \cs{SI} expression inside math mode for anything which requires math mode units. +Some units will require that the expression be placed inside math mode. } \newcommand{\limitsnicefrac}{% @@ -1144,7 +1160,7 @@ This boolean may be tested by the user for later use. %<*package> % \fi % -% \CheckSum{12815} +% \CheckSum{13116} % % \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 @@ -1220,8 +1236,9 @@ This boolean may be tested by the user for later use. % \changes{v0.34}{2017/07/25}{File: \texttt{README.txt}: updated.} % \changes{v0.34}{2017/07/25}{Docs: Horizontal space limitations.} % \changes{v0.35}{2017/08/08}{\ 2017/08/08} -% \changes{v0.36}{2017/08/17}{\ 2017/08/17} % \changes{v0.36}{2017/08/15}{Source: Improved formatting.} +% \changes{v0.36}{2017/08/17}{\ 2017/08/17} +% \changes{v0.37}{2017/08/19}{\ 2017/08/19} @@ -1356,6 +1373,22 @@ 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.37:] \ +% \begin{itemize} +% \item \cs{include} now maintains independent |.aux| files +% \margintag{\cs{include} for \HTML} +% for \HTML\ versions. +% \item \pkg{comment}, used by \pkg{lwarp}, now maintains +% \margintag{\texttt{latexmk}} +% independent cut files for print and \HTML\ versions, helping |latexmk| to +% better know whether to recompile. +% \item Improved support for \LaTeX\ accents, +% \margintag{accents and symbols} +% \pkg{textcomp}, \pkg{siunitx} symbols. +% \item Improved \pkg{babel-french} handling for +% \margintag{\pkg{babel-french}} +% load order and \textasciitilde\ tilde. +% \end{itemize} % \item[v0.36:] \ % \begin{itemize} % \item Recorganized the documentation section regarding special cases and limitations. @@ -1366,7 +1399,7 @@ This boolean may be tested by the user for later use. % \item \cs{makebox} and \cs{framebox} now use width and position. % \item \cs{fcolorbox} and related now work inside a \env{lateximage}. % \item \pkg{babel-french}: Improvements for French variants, load order, -% \margintag{babel-french} +% \margintag{\pkg{babel-french}} % footnotes, ellipses. % \item Improved footnote numbering. % \margintag{footnotes} @@ -1374,7 +1407,7 @@ This boolean may be tested by the user for later use. % the numbering of the print version. % Also fixed a regression with MathJax. % \item Improved \pkg{siunitx} units. -% \margintag{siunitx} +% \margintag{\pkg{siunitx}} % \item Fix for filenames while using MathJax. % \item Fix for \cs{rule} when \pkg{xcolor} is not loaded. % \item Added \pkg{transparent}, \pkg{upref}. @@ -1418,11 +1451,11 @@ This boolean may be tested by the user for later use. % \cs{fbox} and minipages now often work in \SVG\ math and \env{lateximage}s. % MathJax supports \cs{fbox}, but not \cs{fboxBlock} nor \env{fminipage}. % \item Improved compatibility between \env{lateximage} and -% \margintag{lateximage, \SVG\ math, tabular} +% \margintag{\env{lateximage}, \SVG\ math, \env{tabular}} % \env{minipage}, \cs{parbox}, \cs{makebox}, \cs{fbox}, \cs{framebox}, % \cs{raisebox}, \cs{scalebox}, \cs{reflectbox}, \env{tabular}, \pkg{booktabs}. % \item Improved font control for \env{lateximage}es and \SVG\ math. -% \item Added the \env{eqnarray} environments.\margintag{eqnarray} +% \item Added the \env{eqnarray} environments.\margintag{\env{eqnarray}} % \item \pkg{fancyvrb} is no longer required (preloaded), % \margintag{verbatim packages} % but is still supported. @@ -1437,7 +1470,7 @@ This boolean may be tested by the user for later use. % \item Added \pkg{rotfloat}, \pkg{marginfit}, % and several minor packages; see the change log. % \item Adds fixed-width \HTML\ spaces around punctuation -% \margintag{babel-french} +% \margintag{\pkg{babel-french}} % when using \pkg{babel-french}. % \LuaTeX\ does not yet use the extra punctuation spacing. % \end{itemize} @@ -3825,6 +3858,16 @@ This boolean may be tested by the user for later use. % of the macros \cs{centering}, \cs{raggedright}, \cs{raggedleft}. % % +% \subsubsection{Accents} +% +% \limitsaccents +% +% +% \subsubsection{Textcomp} +% +% \limitstextcomp +% +% % \subsubsection{Superscripts and other non-math uses of math mode} % % Use \cs{textsuperscript\{x\}} instead of |$^{x}$| @@ -4780,15 +4823,8 @@ This boolean may be tested by the user for later use. % \end{macrocode} % % -% \DescribePackage{comment} -% Provides conditional code blocks. % -% \begin{macrocode} -\RequirePackage{comment} -\excludecomment{testing} -% \end{macrocode} - - +% % \DescribePackage{letltxmacro} % Used to redefine \cs{textbf} and friends. % @@ -4888,42 +4924,16 @@ This boolean may be tested by the user for later use. % \end{macrocode} % % -% -% -% \begin{macro}{\warpprintonly} \marg{contents} -% -% Only process the contents if producing printed output. -% \changes{v0.19}{2016/06/06}{Replaces \cs{rowprintedonly}.} +% The default is print output, +% \margintag{defaults} +% and \SVG\ math if the user chose \HTML\ output. % \begin{macrocode} -\newcommand{\warpprintonly}[1]{\ifbool{warpingprint}{#1}{}} +\booltrue{warpingprint}% +\boolfalse{warpingHTML}% +\boolfalse{mathjax}% % \end{macrocode} -% \end{macro} -% % -% \begin{macro}{\warpHTMLonly} \marg{contents} % -% Only process the contents if producing \HTML\ output. -% \changes{v0.19}{2016/06/06}{Added.} -% \begin{macrocode} -\newcommand{\warpHTMLonly}[1]{\ifbool{warpingHTML}{#1}{}} -% \end{macrocode} -% \end{macro} - - - - -% \begin{environment}{warpall} -% Anything in the |warpall| environment will be generated for print or \HTML\ outputs. -% \begin{macrocode} -\includecomment{warpall} -% \end{macrocode} -% \end{environment} - - - - -% \begin{environment}{warpprint} -% Anything in the |warpprint| environment will be generated for print output only. % % \DescribeOption{warpprint} % If the |warpprint| option is given, boolean |warpingprint| is true and boolean |warpingHTML| is false, @@ -4933,13 +4943,10 @@ This boolean may be tested by the user for later use. % \begin{macrocode} \DeclareVoidOption{warpprint}{% \PackageInfo{lwarp}{Using option 'warpprint'} -\includecomment{warpprint}% -\excludecomment{warpHTML}% \booltrue{warpingprint}% \boolfalse{warpingHTML}% } % \end{macrocode} -% \end{environment} % \begin{environment}{warpHTML} % Anything in the |warpHTML| environment will be generated for \HTML\ output only. @@ -4950,9 +4957,7 @@ This boolean may be tested by the user for later use. % % \begin{macrocode} \DeclareVoidOption{warpHTML}{% -\PackageInfo{lwarp}{Using option 'warpHTML'} -\excludecomment{warpprint}% -\includecomment{warpHTML}% +\PackageInfo{lwarp}{Using option 'warpHTML'}% \booltrue{warpingHTML}% \boolfalse{warpingprint}% } @@ -5040,9 +5045,12 @@ This boolean may be tested by the user for later use. % % If |lwarpmk| option, creates a local copy of |lwarpmk.lua|: % \begin{macrocode} +\newbool{LWR@creatinglwarpmk} +\boolfalse{LWR@creatinglwarpmk} + \DeclareVoidOption{lwarpmk}{ \PackageInfo{lwarp}{Using option 'lwarpmk'} -\includecomment{LWR@createlwarpmk} +\booltrue{LWR@creatinglwarpmk} } % \end{macrocode} @@ -5101,26 +5109,6 @@ This boolean may be tested by the user for later use. % \end{macrocode} - -% The default is print output, -% \margintag{defaults} -% and \SVG\ math if the user chose \HTML\ output. -% \begin{macrocode} -\includecomment{warpprint}% -\excludecomment{warpHTML}% -\booltrue{warpingprint}% -\boolfalse{warpingHTML}% -\boolfalse{mathjax}% -% \end{macrocode} - - - -% Optionally generate a local copy of |lwarpmk|. Default to no: -% \begin{macrocode} -\excludecomment{LWR@createlwarpmk} -% \end{macrocode} - - % Execute the package options, with the defaults which have been set just above: % \margintag{Execute options} % \begin{macrocode} @@ -5128,8 +5116,6 @@ This boolean may be tested by the user for later use. % \end{macrocode} - - % Assign the \cs{BaseJobname} if the user hasn't provided one: % \begin{macrocode} \providecommand*{\BaseJobname}{\LWR@BaseJobname} @@ -5147,10 +5133,107 @@ This boolean may be tested by the user for later use. \csedef{HTMLFilename}{\LWR@HTMLFilename} % \end{macrocode} % +% +% +% \subsection{Conditional compilation} +% +% +% +% \begin{macro}{\warpprintonly} \marg{contents} +% +% Only process the contents if producing printed output. +% \changes{v0.19}{2016/06/06}{Replaces \cs{rowprintedonly}.} +% \begin{macrocode} +\newcommand{\warpprintonly}[1]{\ifbool{warpingprint}{#1}{}} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\warpHTMLonly} \marg{contents} +% +% Only process the contents if producing \HTML\ output. +% \changes{v0.19}{2016/06/06}{Added.} +% \begin{macrocode} +\newcommand{\warpHTMLonly}[1]{\ifbool{warpingHTML}{#1}{}} +% \end{macrocode} +% \end{macro} +% +% +% \DescribePackage{comment} Provides conditional code blocks. +% +% \begin{macrocode} +\RequirePackage{comment} +% \end{macrocode} + + +% Use |comment_print.cut| for print mode, and +% |comment_html.cut| for \HTML\ mode. +% This helps |latexmk| to more reliably know whether to recompile. +% +% \changes{v0.37}{2017/08/19}{\pkg{comment}: Maintains independent +% cutfiles for print, \protect\HTML.} +% +% \begin{macrocode} +\ifbool{warpingHTML}{ +\def\DefaultCutFileName{\def\CommentCutFile{comment_html.cut}} +}{} + +\ifbool{warpingprint}{ +\def\DefaultCutFileName{\def\CommentCutFile{comment_print.cut}} +}{} +% \end{macrocode} + + +% \begin{macrocode} +\excludecomment{testing} +% \end{macrocode} + + +% \begin{environment}{warpall} +% Anything in the |warpall| environment will be generated for print or \HTML\ outputs. +% \begin{macrocode} +\includecomment{warpall} +% \end{macrocode} +% \end{environment} +% \begin{environment}{warpprint} +% \begin{environment}{warpHTML} +% Anything in the |warpprint| environment will be generated for print output only. +% +% For \HTML\ output: +% \begin{macrocode} +\ifbool{warpingHTML}{% +\includecomment{warpHTML} +} +{\excludecomment{warpHTML}}% +% \end{macrocode} + +% \begin{macrocode} +\ifbool{warpingprint} +{\includecomment{warpprint}} +{\excludecomment{warpprint}} +% \end{macrocode} + +% \end{environment} +% \end{environment} + + +% Optionally generate a local copy of |lwarpmk|. +% Default to no. +% \begin{macrocode} +\ifbool{LWR@creatinglwarpmk} +{\includecomment{LWR@createlwarpmk}} +{\excludecomment{LWR@createlwarpmk}} +% \end{macrocode} +% +% +% +% +% +% % \section{Misplaced packages} @@ -5840,12 +5923,6 @@ top=1in,bottom=1in,% % \end{macrocode} - - - - - - % \begin{macrocode} \end{warpHTML} % \end{macrocode} @@ -6009,6 +6086,114 @@ top=1in,bottom=1in,% +% \section{File handles} + +% Defines file handles for writes. + +% \changes{v0.37}{2017/08/19}{File handles reorganized.} + +% \codeall +% \begin{macrocode} +\begin{warpall} +% \end{macrocode} + +% \begin{macro}{\LWR@quickfile} +% For quick temporary use only. +% This is reused in several places. +% \begin{macrocode} +\newwrite\LWR@quickfile% +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpall} +% \end{macrocode} + + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\LWR@lateximagesfile} +% For |lateximages.txt|. +% \begin{macrocode} +\newwrite\LWR@lateximagesfile +% \end{macrocode} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + +% \section{Include a file} +% +% During \HTML\ output, |\include{}| causes the following to occur: +% +% \begin{enumerate} +% \item \pkg{lwarp} creates |_html_inc.tex| whose contents are: +% \begin{sourcedisplay} +% \cs{input} \textless{}filename\textgreater.tex +% \end{sourcedisplay} +% \item |_html_inc.tex| is then \cs{include}d instead of |.tex|. +% \item |_html_inc.aux| is automatically generated and used by \LaTeX. +% \end{enumerate} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macro}{\include} \marg{filename} +% +% \changes{v0.37}{2017/08/19}{Maintains independent \protect\texttt{.aux} files for \protect\HTML.} +% +% \begin{macro}{\@include} \marg{filename} Modified to load |_html_inc| files. +% \begin{macrocode} +\def\@include#1 {% +\immediate\openout\LWR@quickfile #1_html_inc.tex% new +\immediate\write\LWR@quickfile{\string\input{#1.tex}}% new +\immediate\closeout\LWR@quickfile% new +\LWR@origclearpage% \changed +\if@filesw + \immediate\write\@mainaux{\string\@input{#1_html_inc.aux}}% changed +\fi +\@tempswatrue +\if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do + {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% +\fi +\if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #1_html_inc.aux % changed + \immediate\write\@partaux{\relax}% + \fi + \@input@{#1_html_inc.tex}% changed + \LWR@origclearpage% changed + \@writeckpt{#1}% + \if@filesw + \immediate\closeout\@partaux + \fi +\else + \deadcycles\z@ + \@nameuse{cp@#1}% +\fi +\let\@auxout\@mainaux% +} +% \end{macrocode} +% \end{macro} +% \end{macro} + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + % \section{Copying a file} % \codehtml @@ -6021,20 +6206,21 @@ top=1in,bottom=1in,% % Used to copy the |.toc| file to |.sidetoc| to re-print the \TOC\ in % the side\TOC\ navigation pane. % \begin{macrocode} +\newwrite\LWR@copyoutfile % open the file to write to +\newread\LWR@copyinfile % open the file to read from + \newcommand*{\LWR@copyfile}[2]{% -\newwrite\copyfile % open the file to write to -\immediate\openout\copyfile=#2 -\newread\file % open the file to read from -\openin\file=#1 +\immediate\openout\LWR@copyoutfile=#2 +\openin\LWR@copyinfile=#1 \begingroup\endlinechar=-1 \makeatletter -\loop\unless\ifeof\file - \read\file to\fileline % Read one line and store it into \fileline -% \fileline\par % print the content into the pdf +\loop\unless\ifeof\LWR@copyinfile + \read\LWR@copyinfile to\LWR@fileline % Read one line and store it into \LWR@fileline +% \LWR@fileline\par % print the content into the pdf % print the content: - \immediate\write\copyfile{\unexpanded\expandafter{\fileline}}% + \immediate\write\LWR@copyoutfile{\unexpanded\expandafter{\LWR@fileline}}% \repeat -\closeout\copyfile +\closeout\LWR@copyoutfile \endgroup } % \end{macrocode} @@ -6255,31 +6441,48 @@ top=1in,bottom=1in,% -% \section{Textcomp and SIunitx} - -% Mimic the \pkg{textcomp} package if it not loaded, -% then create \HTML\ versions. - -% \changes{v0.36}{2017/08/17}{\pkg{siunitx}: Improved symbol support.} - +% \section{Textcomp} +% +% \limitstextcomp +% +% \changes{v0.37}{2017/08/18}{\pkg{textcomp}: Improved support.} +% % \codehtml % \begin{macrocode} \begin{warpHTML} % \end{macrocode} - +% +% Modifications for \pkg{textcomp} are done \cs{AtBeginDocument} since +% \pkg{textcomp} may have been loaded before \pkg{lwarp}. % \begin{macrocode} \AtBeginDocument{% in case textcomp was not loaded -\providecommand*{\textdegree}{DEG} -\providecommand*{\textcelsius}{DEGC} -\providecommand*{\textohm}{OHM} -\providecommand*{\textmu}{MU} - +\@ifpackageloaded{textcomp} +{ +% \end{macrocode} +% The following are restored for print when inside a \env{lateximage}: +% \begin{macrocode} \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 +% \end{macrocode} +% For \HTML, use \HTML\ entities or direct Unicode, depending on the engine: +% \begin{macrocode} \ifPDFTeX \renewcommand*{\textdegree}{\HTMLentity{deg}} \renewcommand*{\textcelsius}{\HTMLentity{deg}\,C} @@ -6291,6 +6494,169 @@ top=1in,bottom=1in,% \renewcommand*{\textohm}{Ω} \renewcommand*{\textmu}{μ} \fi +% \end{macrocode} +% For \HTML, Unicode diacritical marks are used: +% \begin{macrocode} +\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}} +% \end{macrocode} +% \cs{textcircled} becomes a span with a rounded border: +% \begin{macrocode} +\renewcommand*{\textcircled}[1]{% +\InlineClass[border: 1px solid \LWR@currenttextcolor]{textcircled}{#1}% +} +% \end{macrocode} +% +% \begin{macro}{\LWR@restoreorigtextcomp} +% Called from \cs{restoreoriginalformatting} when a \env{lateximage} is begun. +% \begin{macrocode} +\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% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +}% textcomp loaded +{% textcomp not loaded +% \end{macrocode} +% A null version for use when \pkg{textcomp} was not loaded: +% \begin{macrocode} +\newcommand*{\LWR@restoreorigtextcomp}{}% +}% textcomp not loaded + +}% AtBeginDocument + +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + +% \section{Accents} +% +% \limitsaccents +% +% \changes{v0.37}{2017/08/18}{\protect\LaTeX\ accents: Added.} +% +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} +% +% +% Without \cs{AtBeginDocument}, \cs{t} was being re-defined somewhere. +% \begin{macrocode} +\AtBeginDocument{ +% \end{macrocode} +% The following are restored for print when inside a \env{lateximage}. +% +% For Unicode engines, only \cs{t} needs to be redefined: +% \begin{macrocode} +\LetLtxMacro{\LWR@origt}{\t} +% \end{macrocode} +% For pdf\LaTeX, additional work is required: +% \begin{macrocode} +\ifPDFTeX +\LetLtxMacro{\LWR@origequalaccent}{\=} +\LetLtxMacro{\LWR@origdotaccent}{\.} +\LetLtxMacro{\LWR@origu}{\u} +\LetLtxMacro{\LWR@origv}{\v} +\LetLtxMacro{\LWR@origc}{\c} +\LetLtxMacro{\LWR@origd}{\d} +\LetLtxMacro{\LWR@origb}{\b} +% \end{macrocode} +% The \HTML\ redefinitions follow. +% +% For pdf\LaTeX, Unicode diacritical marks are used: +% \begin{macrocode} +\renewcommand*{\=}[1]{#1\HTMLunicode{0305}} +\renewcommand*{\.}[1]{#1\HTMLunicode{0307}} +\renewcommand*{\u}[1]{#1\HTMLunicode{0306}} +\renewcommand*{\v}[1]{#1\HTMLunicode{030C}} +\renewcommand*{\c}[1]{#1\HTMLunicode{0327}} +\renewcommand*{\d}[1]{#1\HTMLunicode{0323}} +\renewcommand*{\b}[1]{#1\HTMLunicode{0331}} +\fi +% \end{macrocode} +% For all engines, a Unicode diacritical tie is used: +% \begin{macrocode} +\def\LWR@t#1#2{#1\HTMLunicode{0361}#2} +\renewcommand*{\t}[1]{\LWR@t#1} +% \end{macrocode} +% +% \begin{macro}{\LWR@restoreorigaccents} +% Called from \cs{restoreoriginalformatting} when a \env{lateximage} is begun. +% \begin{macrocode} +\ifPDFTeX +\newcommand*{\LWR@restoreorigaccents}{% +\LetLtxMacro{\=}{\LWR@origequalaccent}% +\LetLtxMacro{\.}{\LWR@origdotaccent}% +\LetLtxMacro{\u}{\LWR@origu}% +\LetLtxMacro{\v}{\LWR@origu}% +\LetLtxMacro{\t}{\LWR@origt}% +\LetLtxMacro{\c}{\LWR@origc}% +\LetLtxMacro{\d}{\LWR@origd}% +\LetLtxMacro{\b}{\LWR@origb}% +} +\else% XeLaTeX, LuaLaTeX: +\newcommand*{\LWR@restoreorigaccents}{% +\LetLtxMacro{\t}{\LWR@origt}% +} +\fi +}% AtBeginDocument +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macrocode} +\end{warpHTML} +% \end{macrocode} + + + + +% \section{SIunitx} + +% \changes{v0.36}{2017/08/17}{\pkg{siunitx}: Improved symbol support.} +% \changes{v0.37}{2017/08/17}{\pkg{siunitx}: Improved symbol support.} + +% \codehtml +% \begin{macrocode} +\begin{warpHTML} +% \end{macrocode} + +% \begin{macrocode} +\AtBeginDocument{% in case textcomp was not loaded \@ifpackageloaded{siunitx} { @@ -6299,9 +6665,8 @@ top=1in,bottom=1in,% \DeclareSIUnit\elementarycharge{\textit{e}} \DeclareSIUnit\electronmass{\textit{m}\textsubscript{e}} \DeclareSIUnit\hartree{\textit{E}\textsubscript{h}} -\DeclareSIUnit\planckbar{\HTMLunicode{210F}} }% siunitx loaded -{} +{}% siunitx not loaded }% AtBeginDocument @@ -6338,16 +6703,15 @@ top=1in,bottom=1in,% % Only write |\jobname_html.tex| if generating the print version. % \begin{macrocode} \begin{warpprint} -\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} -\immediate\openout\LWR@file=\jobname_html.tex -\immediate\write\LWR@file{% +\immediate\openout\LWR@quickfile=\jobname_html.tex +\immediate\write\LWR@quickfile{% \detokenize{\PassOptionsToPackage}% {warpHTML,BaseJobname=\jobname}{lwarp}% } -\immediate\write\LWR@file{% +\immediate\write\LWR@quickfile{% \detokenize{\input}\string{\jobname.tex\string }% } -\immediate\closeout\LWR@file +\immediate\closeout\LWR@quickfile \end{warpprint} % \end{macrocode} @@ -6378,31 +6742,31 @@ top=1in,bottom=1in,% % \codeprint % \begin{macrocode} \begin{warpprint} -\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} -\immediate\openout\LWR@file=lwarpmk.conf +\ifcsdef{LWR@quickfile}{}{\newwrite{\LWR@quickfile}} +\immediate\openout\LWR@quickfile=lwarpmk.conf \ifbool{usingOSWindows}{ -\immediate\write\LWR@file{opsystem = "Windows"} +\immediate\write\LWR@quickfile{opsystem = "Windows"} }{ -\immediate\write\LWR@file{opsystem = "Unix"} +\immediate\write\LWR@quickfile{opsystem = "Unix"} } \ifPDFTeX -\immediate\write\LWR@file{latexname = "pdflatex"} +\immediate\write\LWR@quickfile{latexname = "pdflatex"} \fi \ifXeTeX -\immediate\write\LWR@file{latexname = "xelatex"} +\immediate\write\LWR@quickfile{latexname = "xelatex"} \fi \ifLuaTeX -\immediate\write\LWR@file{latexname = "lualatex"} +\immediate\write\LWR@quickfile{latexname = "lualatex"} \fi -\immediate\write\LWR@file{sourcename = "\jobname"} -\immediate\write\LWR@file{% +\immediate\write\LWR@quickfile{sourcename = "\jobname"} +\immediate\write\LWR@quickfile{% homehtmlfilename = "\HomeHTMLFilename"% } -\immediate\write\LWR@file{htmlfilename = "\HTMLFilename"} -\immediate\write\LWR@file{latexmk = "\ifbool{LWR@latexmk}{true}{false}"} -\immediate\write\LWR@file{language = "\LWR@IndexLanguage"} -\immediate\write\LWR@file{xdyfile = "\LWR@xdyFilename"} -\immediate\closeout\LWR@file +\immediate\write\LWR@quickfile{htmlfilename = "\HTMLFilename"} +\immediate\write\LWR@quickfile{latexmk = "\ifbool{LWR@latexmk}{true}{false}"} +\immediate\write\LWR@quickfile{language = "\LWR@IndexLanguage"} +\immediate\write\LWR@quickfile{xdyfile = "\LWR@xdyFilename"} +\immediate\closeout\LWR@quickfile \end{warpprint} % \end{macrocode} @@ -6416,31 +6780,31 @@ homehtmlfilename = "\HomeHTMLFilename"% % % \begin{macrocode} \begin{warpprint} -\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} -\immediate\openout\LWR@file=\jobname.lwarpmkconf +\ifcsdef{LWR@quickfile}{}{\newwrite{\LWR@quickfile}} +\immediate\openout\LWR@quickfile=\jobname.lwarpmkconf \ifbool{usingOSWindows}{ -\immediate\write\LWR@file{opsystem = "Windows"} +\immediate\write\LWR@quickfile{opsystem = "Windows"} }{ -\immediate\write\LWR@file{opsystem = "Unix"} +\immediate\write\LWR@quickfile{opsystem = "Unix"} } \ifPDFTeX -\immediate\write\LWR@file{latexname = "pdflatex"} +\immediate\write\LWR@quickfile{latexname = "pdflatex"} \fi \ifXeTeX -\immediate\write\LWR@file{latexname = "xelatex"} +\immediate\write\LWR@quickfile{latexname = "xelatex"} \fi \ifLuaTeX -\immediate\write\LWR@file{latexname = "lualatex"} +\immediate\write\LWR@quickfile{latexname = "lualatex"} \fi -\immediate\write\LWR@file{sourcename = "\jobname"} -\immediate\write\LWR@file{% +\immediate\write\LWR@quickfile{sourcename = "\jobname"} +\immediate\write\LWR@quickfile{% homehtmlfilename = "\HomeHTMLFilename"% } -\immediate\write\LWR@file{htmlfilename = "\HTMLFilename"} -\immediate\write\LWR@file{latexmk = "\ifbool{LWR@latexmk}{true}{false}"} -\immediate\write\LWR@file{language = "\LWR@IndexLanguage"} -\immediate\write\LWR@file{xdyfile = "\LWR@xdyFilename"} -\immediate\closeout\LWR@file +\immediate\write\LWR@quickfile{htmlfilename = "\HTMLFilename"} +\immediate\write\LWR@quickfile{latexmk = "\ifbool{LWR@latexmk}{true}{false}"} +\immediate\write\LWR@quickfile{language = "\LWR@IndexLanguage"} +\immediate\write\LWR@quickfile{xdyfile = "\LWR@xdyFilename"} +\immediate\closeout\LWR@quickfile \end{warpprint} % \end{macrocode} @@ -6554,6 +6918,8 @@ span.textsf { Geneva, Verdana, sans-serif ; } +span.textcircled { border: 1px solid black ; border-radius: 1ex ; } + span.attribution { margin-left: 1em ; font-size: 80% ; font-variant: small-caps; } @@ -8377,6 +8743,7 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX- % \changes{v0.30}{2017/04/28}{\protect\texttt{lwarpmk}: Add: \protect\texttt{xdyfile} configuration option.} % \changes{v0.32}{2017/06/08}{\protect\texttt{lwarpmk}: Fix: \protect\texttt{io.lines()} changed to \protect\texttt{file:lines()} % due to \protect\texttt{luatex} changes.} +% \changes{v0.37}{2017/08/19}{\protect\texttt{lwarpmk}: Removes additional \HTML\ \protect\texttt{aux} files.} % % \begin{macrocode} \begin{filecontents*}{lwarpmk.lua} @@ -8386,7 +8753,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.36" +printversion = "v0.37" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -8407,7 +8774,7 @@ lwarpmk pdftohtml [project]: For use with latexmk or a Makefile: Convert project_html.pdf to project_html.html and individual HTML files. -lwarpmk clean [project]: Remove project.aux, .toc, .lof/t, .idx, .ind, .log, .gl* +lwarpmk clean [project]: Remove project.aux, .toc, .lof/t, .idx, .ind, .log, *_html_inc.*, .gl* lwarpmk cleanall [project]: Remove auxiliary files and also project.pdf, *.html lwarpmk -h: Print this help message. lwarpmk --help: Print this help message. @@ -8643,7 +9010,8 @@ function removeaux () sourcename ..".idx " .. sourcename .. "_html.idx " .. sourcename ..".ind " .. sourcename .. "_html.ind " .. sourcename ..".log " .. sourcename .. "_html.log " .. - sourcename ..".gl* " .. sourcename .. "_html.gl* " + sourcename ..".gl* " .. sourcename .. "_html.gl* " .. + "*_html_inc.*" ) end @@ -8867,7 +9235,7 @@ print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.") print ("lwarpmk: Done.") -- lwarpmk clean: --- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, .gl* +-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, *_html_inc.*, .gl* elseif arg[1] == "clean" then loadconf () @@ -8875,7 +9243,7 @@ removeaux () print ("lwarpmk: Done.") -- lwarpmk cleanall --- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, .gl* +-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, *_html_inc.*, .gl* -- and also project.pdf, *.html elseif arg[1] == "cleanall" then @@ -9567,6 +9935,7 @@ end -- not --version % \changes{v0.34}{2017/08/03}{\pkg{babel-french}: Adds fixed-width HTML spaces to punctuation.} % \changes{v0.36}{2017/08/15}{\pkg{babel-french}: Adjustements for French variants, % load order, footnotes, ellipses.} +% \changes{v0.37}{2017/08/19}{\pkg{babel-french}: Adjustment for load order.} % % Adjust \pkg{babel-french} for \HTML\ spaces. % So far, this only works for |pdflatex| and |xelatex|. @@ -9613,6 +9982,7 @@ end -- not --version \LWR@origampersand{}nbsp;% ~ \endgroup% } + \renewcommand*{~}{\HTMLentity{nbsp}}% was overwritten by babel-french \ifFBunicode \else \DeclareTextSymbol{\FBtextellipsis}{LY1}{133} @@ -11853,7 +12223,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % % For the |lateximages| record file: % \begin{macrocode} -\immediate\openout\LWR@file=lateximages.txt +\immediate\openout\LWR@lateximagesfile=lateximages.txt % \end{macrocode} % % Removes space after the caption in the \HTML: @@ -12063,7 +12433,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \end{macrocode} % For \env{lateximage} commands: % \begin{macrocode} -\immediate\closeout\LWR@file +\immediate\closeout\LWR@lateximagesfile } % \end{macrocode} % \end{macro} @@ -17057,10 +17427,6 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \let\sb\LWR@origsb% \let\textsuperscript\LWR@origtextsuperscript% \let\textsubscript\LWR@origtextsubscript% -\let\textdegree\LWR@origtextdegree% -\let\textcelsius\LWR@origtextcelsius% -\let\textohm\LWR@origtextohm% -\let\textmu\LWR@origtextmu% \let~\LWR@origtilde% \let\enskip\LWR@origenskip% \let\quad\LWR@origquad% @@ -17090,6 +17456,10 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LetLtxMacro{\parbox}{\LWR@origparbox}% \LWR@restoreorigxcolor% \LWR@restoremoreorigxcolor% +% +\LWR@restoreorigtextcomp% +\LWR@restoreorigaccents% +% \LWR@FBcancel% } % \end{macrocode} @@ -17763,11 +18133,6 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \setcounter{LWR@lateximagedepth}{0} % \end{macrocode} -% Declare the |\LWR@file| for writing -% to generate file |lateximages.txt|: -% \begin{macrocode} -\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} -% \end{macrocode} % A few utility macros to write special characters: % \begin{macrocode} \edef\LWR@hashmark{\string#} % for use in \write @@ -17944,7 +18309,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % Write instructions to the |lateximages.txt| file: % \begin{macrocode} \LWR@traceinfo{lateximage: about to write to lateximages.txt}% - \immediate\write\LWR@file{|\theLWR@LIpage|\theLWR@externalfilecnt|}% + \immediate\write\LWR@lateximagesfile{|\theLWR@LIpage|\theLWR@externalfilecnt|}% % \end{macrocode} % Place an open comment tag at the bottom of page; footnotes will be above this tag. % This will hide any traces of the lateximage \PDF\ page which were picked up by @@ -19919,8 +20284,6 @@ width:\rndprintlength{\LWR@tempwidth}% \LetLtxMacro{\em}{\LWR@nullem}% \LetLtxMacro{\normalfont}{\LWR@nullnormalfont}% \renewcommand*{\HTMLunicode}[1]{}% -% \renewcommand*{\HTMLunicode}[1]{} -% \renewcommand*{\HTMLentity}[1]{##1} \renewcommand*{\HTMLentity}[1]{}% % \end{macrocode} % Ampersand becomes ``and'', which is a short word and is then removed from the filename. @@ -21385,9 +21748,37 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% % % % -% % \clearpage % +% +% \iffalse +%<*color> +% \fi +% +% \part{lwarp-color.sty} +% +% \section{Color} +% +% \DescribePackage{color} +% \pkg{color} is superceded by \pkg{xcolor}, and +% \pkg{lwarp} requires several of the features of \pkg{xcolor}. +% +% \changes{v0.37}{2017/08/18}{\pkg{color}: Prevented.} +% +% \codehtml +% \begin{macrocode} +\LWR@loadnever{color}{xcolor} +% \end{macrocode} +% +% \iffalse +% +% \fi +% +% +% +% +% +% % \iffalse %<*crop> % \fi @@ -22121,6 +22512,7 @@ span style="width:\rndprintlength{\ALG@thistlm}; display:inline-block;"% \renewcommand*{\LUseVerbatim}[1]{% \LWR@atbeginverbatim{LVerbatim}%\unskip\LWR@origvspace*{-\baselineskip}%% +\noindent% \LWRFB@LUseVerbatim{#1}% \LWR@afterendverbatim% } -- cgit v1.2.3