From a312d5264ce16bf7014edb5c0da256772ef5e33b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 23 Feb 2017 22:00:27 +0000 Subject: lwarp (22feb17) git-svn-id: svn://tug.org/texlive/trunk@43317 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/lwarp/README.txt | 18 +- Master/texmf-dist/doc/latex/lwarp/lwarp.pdf | Bin 1262513 -> 1278940 bytes .../texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt | 77 ++ Master/texmf-dist/scripts/lwarp/lwarpmk.lua | 78 +- Master/texmf-dist/source/latex/lwarp/lwarp.dtx | 845 +++++++++++++++------ Master/texmf-dist/source/latex/lwarp/lwarp.ins | 5 + .../texmf-dist/tex/latex/lwarp/lwarp-afterpage.sty | 3 + .../tex/latex/lwarp/lwarp-algorithmicx.sty | 3 + Master/texmf-dist/tex/latex/lwarp/lwarp-alltt.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-bookmark.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-booktabs.sty | 3 + .../tex/latex/lwarp/lwarp-draftwatermark.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-epigraph.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-eso-pic.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-everypage.sty | 3 + .../tex/latex/lwarp/lwarp-extramarks.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-fancyhdr.sty | 3 + Master/texmf-dist/tex/latex/lwarp/lwarp-float.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-floatrow.sty | 5 +- .../texmf-dist/tex/latex/lwarp/lwarp-fontenc.sty | 106 +++ .../texmf-dist/tex/latex/lwarp/lwarp-fontspec.sty | 106 +++ .../texmf-dist/tex/latex/lwarp/lwarp-geometry.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-graphics.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-graphicx.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-inputenc.sty | 106 +++ .../texmf-dist/tex/latex/lwarp/lwarp-keyfloat.sty | 3 + .../tex/latex/lwarp/lwarp-letterspace.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-listings.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-longtable.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-ltcaption.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-mdframed.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-microtype.sty | 43 +- .../texmf-dist/tex/latex/lwarp/lwarp-multicol.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-multirow.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-needspace.sty | 3 + .../tex/latex/lwarp/lwarp-newproject.sty | 81 +- .../tex/latex/lwarp/lwarp-newunicodechar.sty | 106 +++ .../texmf-dist/tex/latex/lwarp/lwarp-nowidow.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-pagenote.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-placeins.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-ragged2e.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-rotating.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-setspace.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-textpos.sty | 3 + .../tex/latex/lwarp/lwarp-threeparttable.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-titleps.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-titlesec.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-titletoc.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-titling.sty | 122 +++ .../texmf-dist/tex/latex/lwarp/lwarp-tocloft.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-trivfloat.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-wallpaper.sty | 3 + .../texmf-dist/tex/latex/lwarp/lwarp-wrapfig.sty | 3 + Master/texmf-dist/tex/latex/lwarp/lwarp-xcolor.sty | 3 + Master/texmf-dist/tex/latex/lwarp/lwarp-xfrac.sty | 3 + Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 137 +++- 57 files changed, 1643 insertions(+), 318 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-fontenc.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-fontspec.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-inputenc.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-newunicodechar.sty create mode 100644 Master/texmf-dist/tex/latex/lwarp/lwarp-titling.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 e1fe2cc950a..7b7b21bb892 100644 --- a/Master/texmf-dist/doc/latex/lwarp/README.txt +++ b/Master/texmf-dist/doc/latex/lwarp/README.txt @@ -1,9 +1,10 @@ -LaTeX lwarp package v0.20 README.txt +LaTeX lwarp package v0.21 README.txt Files included are: lwarp.pdf: The documentation. +lwarp_tutorial.txt: More documentation. A sample tutorial. lwarpmk.lua: A utility program which compiles print or HTML versions. lwarp.dtx: The documented source code. lwarp.ins: The documentaiton driver. @@ -14,16 +15,19 @@ lwarp-newproject.sty: Locally generates configuration files per project. lwarp-*.sty: Numerous compatibility files for other packages. -The documentation includes a file listing "tutorial.tex" which may be -copy/pasted from the documentation into an editor. - - -NOTE: +NOTE FOR TEX DISTRIBUTION MAINTAINERS: For a TeX distribution, an executable called "lwarpmk" should -be created which is a copy of or which calls the "lwarpmk.lua" script. +be created in each bin directory, which is a link to or which +calls the "lwarpmk.lua" script found in the scripts directory. See the installation instructions in the documentation. +The documentation includes a file listing "tutorial.tex" which may be +copied/pasted from the documentation into an editor, or it may +be copied from the file lwarp_tutorial.tex, which is found in the +documentation directory. + + License: This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 diff --git a/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf b/Master/texmf-dist/doc/latex/lwarp/lwarp.pdf index 7438ec468dc..a07837eea40 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/doc/latex/lwarp/lwarp_tutorial.txt b/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt new file mode 100644 index 00000000000..89da7124729 --- /dev/null +++ b/Master/texmf-dist/doc/latex/lwarp/lwarp_tutorial.txt @@ -0,0 +1,77 @@ + +% Save this as tutorial.tex for the lwarp package tutorial. + +\documentclass{book} + +\usepackage{iftex} + +% --- LOAD FONT SELECTION AND ENCODING BEFORE LOADING LWARP --- +\ifPDFTeX +\usepackage{lmodern} % pdflatex +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\else +\usepackage{fontspec} % XeLaTeX or LuaLaTeX +\fi + +% --- HTML FILENAME AND LATEXMK SETTINGS --- +% \newcommand{\HomeHTMLFilename}{index} % Filename of the homepage. +% \newcommand{\HTMLFileName}{node-} % Filename prefix of other pages. +% \newcommand{\UseLatexmk}{true}% Uncomment to use latexmk + +% --- LWARP IS LOADED NEXT --- +\usepackage{lwarp-newproject} % Possibly with the [lwarpmk] option. +\usepackage{lwarp} +% \boolfalse{FileSectionNames} % If false, numbers the files. + +% --- OTHER PACKAGES ARE LOADED AFTER LWARP --- +\usepackage{makeidx} \makeindex +\usepackage{xcolor} + +\usepackage{hyperref,cleveref} % LOAD THESE LAST! + +% --- LATEX AND HTML CUSTOMIZATION --- +\title{The Lwarp Tutorial} +\author{Some Author} +\setcounter{tocdepth}{2} % Include subsections in the TOC. +\setcounter{secnumdepth}{2} % Number down to subsections. +\setcounter{FileDepth}{1} % Split HTML files at sections +\booltrue{CombineHigherDepths} % Combine parts/chapters/sections +\setcounter{SideTOCDepth}{1} % Include subsections in the sideTOC +\SetFirstPageTop{Name and \fbox{HOMEPAGE LOGO}} +\SetPageTop{\fbox{LOGO}} +\SetPageBottom{Contact Information and Copyright} +\NewCSS{lwarp_sagebrush.css} + +\begin{document} +\maketitle % (or a titlepage environment) + +% --- An abstract may be placed here. --- + +\tableofcontents \listoffigures % --- MUST BE BEFORE THE FIRST SECTION. + +\chapter{First chapter} + +\section{A section} + +This is some text which is indexed.\index{Some text.} + +\subsection{A subsection} + +See \cref{fig:withtext}. + +\begin{figure}\begin{center} +\fbox{\textcolor{blue!50!green}{Text in a figure.}} +\caption{A figure with text\label{fig:withtext}} +\end{center}\end{figure} + +\section{Some math} + +Inline math: $r = r_0 + vt - \frac{1}{2}at^2$ +\begin{equation} +a^2 + b^2 = c^2 +\end{equation} + +\printindex + +\end{document} diff --git a/Master/texmf-dist/scripts/lwarp/lwarpmk.lua b/Master/texmf-dist/scripts/lwarp/lwarpmk.lua index cbb8e175ffd..94ae36a62f2 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.20" +printversion = "v0.21" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -140,18 +140,26 @@ end -- file exists -- Select some operating-system commands: if opsystem=="Unix" then -- For Unix / Linux / Mac OS: rmname = "rm" -touchname = "touch" -chmodcmd = "chmod u+x lateximages.sh" -lateximagesname = "./lateximages.sh" +mvname = "mv" +touchnamepre = "touch" +touchnamepost = "" +dirslash = "/" +opquote= "\'" elseif opsystem=="Windows" then -- For Windows rmname = "DEL" -touchname = "TOUCH" -chmodcmd = "" -lateximagesname = "lateximages.cmd" +mvname = "MOVE" +touchnamepre = "COPY /b" +touchnamepost = "+,," +dirslash = "\\" +opquote= "\"" else print ( "lwarpmk: Select Unix or Windows for opsystem" ) end --- for Windows end -- loadconf +function refreshdate () +os.execute(touchnamepre .. " " .. sourcename .. ".tex " .. touchnamepost) +end + -- Scan the LaTeX log file for the phrase "Rerun to get", -- indicating that the file should be compiled again. -- Return true if found. @@ -221,6 +229,43 @@ function removeaux () ) end +-- Create lateximages based on lateximages.txt: +function createlateximages () +print ("lwarpmk: Creating lateximages.") +io.input("lateximages.txt") +-- Create the lateximages directory, ignore error if alreadt exists +err = os.execute("mkdir lateximages") +-- Scan lateximages.txt +for line in io.lines() do +-- lwimgpage is the page number in the PDF which has the image +-- lwimgnum is the sequential lateximage number to assign for the image +i,j,lwimgpage,lwimgnum = string.find (line,"|(.*)|(.*)|") +-- For each entry: +if ( (i~=nil) ) then +-- Separate out the image into its own single-page pdf: +err = os.execute( +"pdfseparate -f " .. lwimgpage .. " -l " .. + lwimgpage .. " " .. sourcename .."_html.pdf lateximagetemp-%d.pdf") +-- Crop the image: +err = os.execute( +"pdfcrop --hires lateximagetemp-" .. lwimgpage ..".pdf lateximage-" .. lwimgnum ..".pdf") +if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +-- Convert the image to svg: +err = os.execute( +"pdftocairo -svg lateximage-" .. lwimgnum ..".pdf lateximage-" .. lwimgnum ..".svg") +if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +-- Move the result into lateximages/: +err = os.execute( +mvname .. " lateximage-" .. lwimgnum ..".svg lateximages" .. dirslash ) +if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +-- Remove the temporary files: +err = os.execute( +rmname .. " lateximage-" .. lwimgnum ..".pdf lateximagetemp-" .. lwimgpage ..".pdf") +if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end +end +end -- do +end -- function + -- lwarpmk --version : if (arg[1] == "--version") then @@ -266,7 +311,7 @@ loadconf () print ("lwarpmk: Processing the index.") os.execute("texindy -M lwarp_html.xdy " .. sourcename .. ".idx") print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.") -os.execute(touchname .. " " .. sourcename .. ".tex") +refreshdate () print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.") print ("lwarpmk: Done.") @@ -278,8 +323,9 @@ if ( uselatexmk == "true" ) then -- The recorder option is required to detect changes in .tex -- while we are loading _html.tex. err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder " - .. "-e '$makeindex = q/texindy -M lwarp_html.xdy/' " - .. "-pdflatex=\"" .. latexname .." %O %S\" " + .. "-e " + .. opquote .. "$makeindex = q/texindy -M lwarp_html.xdy/" .. opquote + .. " -pdflatex=\"" .. latexname .." %O %S\" " .. sourcename .."_html.tex" ) ; if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end pdftohtml () @@ -316,22 +362,20 @@ loadconf () print ("lwarpmk: Processing the index.") os.execute("texindy -M lwarp_html.xdy " .. sourcename .. "_html.idx") print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.") -os.execute(touchname .. " " .. sourcename .. ".tex") +refreshdate () print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.") print ("lwarpmk: Done.") -- lwarpmk limages: --- Make the lateximages command file executable, --- execute it to create the images, +-- Scan the lateximages.txt file to create lateximages, -- then touch the source to trigger a recompile. elseif arg[1] == "limages" then loadconf () print ("lwarpmk: Processing images.") -os.execute(chmodcmd) -os.execute(lateximagesname) +createlateximages () print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.") -os.execute(touchname .. " " .. sourcename .. ".tex") ; +refreshdate () print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.") print ("lwarpmk: Done.") @@ -341,7 +385,7 @@ print ("lwarpmk: Done.") elseif arg[1] == "again" then loadconf () print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.") -os.execute(touchname .. " " .. sourcename .. ".tex") ; +refreshdate () print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.") print ("lwarpmk: Done.") diff --git a/Master/texmf-dist/source/latex/lwarp/lwarp.dtx b/Master/texmf-dist/source/latex/lwarp/lwarp.dtx index dce07329532..e2656f8a077 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/02/09 v0.20 Allows LaTeX to directly produce HTML5 output.] +% [2017/02/23 v0.21 Allows LaTeX to directly produce HTML5 output.] % %<*driver> \documentclass{ltxdoc} @@ -56,13 +56,15 @@ \newunicodechar{Ô}{\^{O}} \newunicodechar{ê}{\^{e}} -\usepackage{microtype} -\usepackage[all,defaultlines=2]{nowidow} -\usepackage{needspace} +\usepackage[log-declarations=false]{xparse} +\usepackage[lwarpmk]{lwarp-newproject} +\usepackage{lwarp} + + +\usepackage{needspace} -\usepackage[log-declarations=false]{xparse} \usepackage[svgnames]{xcolor} \definecolor{myurlcolor}{rgb}{0,0,.7} @@ -124,8 +126,11 @@ \newcommand{\ItemDescribeBoolean}[1]{\item[\texttt{#1}:]\DescribeBoolean{#1}} -\usepackage[lwarpmk]{lwarp-newproject} -\usepackage{lwarp} + + +\usepackage{microtype} + +\usepackage[all,defaultlines=2]{nowidow} @@ -155,6 +160,7 @@ Keywords={LaTeX, HTML, conversion}% \newcommand{\env}[1]{\texttt{#1}} \newcommand{\pkg}[1]{\textsf{#1}} \newcommand{\acro}[1]{\textsc{\lowercase{#1}}} +\newcommand{\tag}[1]{\texttt{<#1>}} @@ -533,14 +539,14 @@ unless you place a \cs{newline} between them. \margintag{placement} A line of text with an inline minipage -\margintag{inline} +\watchout[inline] or parbox will have the minipage or parbox placed onto its own line, because a paragraph is a block element and cannot be made \texttt{inline-block}. -There is limited support for minipages inside an \acro{HTML} |span|. +There is limited support for minipages inside an \acro{HTML} \tag{span}. \margintag{in a span} -An \acro{HTML} |div| cannot appear inside a |span|. -While in a |span|, minipages and parboxes are ignored. +An \acro{HTML} \tag{div} cannot appear inside a \tag{span}. +While in a \tag{span}, minipages and parboxes are ignored. Use \cs{newline} or \cs{par} for an \acro{HTML} break. When using \cs{linewidth}, \cs{textwidth}, and \cs{textheight}, @@ -568,8 +574,7 @@ title and subtitle background colors and borders and thickness, border radius, and shadow. CSS classes are created for \pkg{mdframed} environments and frame titles. -Only load \pkg{mdframed} in a \env{warpprint} environment. -\pkg{lwarp} pre-loads \pkg{mdframed} in HTML with \texttt{framemethod=none}. +When used, \pkg{lwarp} loads \pkg{mdframed} in HTML with \texttt{framemethod=none}. \watchout[loading] For title font, use\\ @@ -708,10 +713,7 @@ If \textsc{MS-Windows} is not correctly detected, use the command \cs{warpOSwindows} in the document \DescribeMacro{\warpOSwindows} preamble after \pkg{lwarp} is loaded. This modifies the -creation of the \\ \hspace*{2em}\texttt{lateximages.sh} or \texttt{lateximages.cmd} \\ -batch file, which is an operating-system-specific shell script used to take -individual pages of the \LaTeX{} \acro{PDF} output and -convert and store them in individual \acro{SVG} files. +operating-system path separator used by \pkg{lwarp}. } @@ -739,7 +741,7 @@ convert and store them in individual \acro{SVG} files. %<*package> % \fi % -% \CheckSum{8260} +% \CheckSum{8282} % % \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 @@ -797,6 +799,7 @@ convert and store them in individual \acro{SVG} files. % \changes{v0.20}{2016/12/17}{Parallel versions of aux files for print/HTML.} % \changes{v0.20}{2017/01/03}{Moved sidebar and example code to test suite.} % \changes{v0.20}{2017/01/25}{\pkg{caption} and \pkg{subcaption} supported.} +% \changes{v0.21}{2017/02/23}{\ 2017/02/23} @@ -843,12 +846,12 @@ convert and store them in individual \acro{SVG} files. % % \begin{abstract} % \noindent -% The \pkg{lwarp} package causes \LaTeX\ to directly produce \htmlfive\ output, +% The \pkg{lwarp} package allows \LaTeX\ to directly produce \htmlfive\ output, % using external utility programs only for the final conversion of text and images. % Math may be represented by \acro{SVG} files or MathJax. % % Documents may be produced by \LaTeX, \LuaLaTeX, or \XeLaTeX. -% A TexLua script removes the need for system utilities such as |make| and |gawk|, +% A |texlua| script removes the need for system utilities such as |make| and |gawk|, % and also supports |xindy| and |latexmk|. Configuration is automatic at the % first manual compile. % @@ -864,24 +867,38 @@ convert and store them in individual \acro{SVG} files. % of the package. % % -% \vfill +% \bigskip % % \begin{center} % \textcolor{blue}{To update existing projects, see \cref{sec:updates}, % \nameref{sec:updates}.} +% \end{center} % -% \vfill +% \bigskip % -% \begin{minipage}{\linewidth} -% \raggedright +% \noindent % \textcolor{red!30!black}{\bfseries % Note that this is still a ``beta'' version of \pkg{lwarp}, % and some things may change in response to user feedback and % further project development. % } -% \end{minipage} % -% \end{center} +% \bigskip +% +% \footnotesize +% \begin{description} +% \item[License:] \ +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% \end{description} +% +% % \end{abstract} % % \vspace*{\fill} @@ -912,6 +929,21 @@ convert and store them in individual \acro{SVG} files. % For a detailed list of changes, see the Change History on page \pageref{sec:changehistory}. % % \begin{description} +% \item[v0.21:] \ +% \begin{itemize} +% \item Documentation for installing on Windows has been updated and improved. +% \item For Windows compatibility, the |lateximages| shell script +% has been replaced with a |lateximages.txt| file, which is parsed +% by |lwarpmk| to generate lateximages. +% This does not require any changes in the user's code. +% \item Windows |lwarpmk again| now functions. +% \item For improved error handling, \pkg{lwarp} now verifies the +% order in which packages are loaded, and signals an error for misplaced packages. +% \pkg{inputenc}, \pkg{fontenc}, \pkg{newunicode}, and \pkg{fontspec} +% must be loaded before \pkg{lwarp}, and the other packages which +% \pkg{lwarp} knows about must be loaded after. +% \item \pkg{lwarp} no longer requires a \cs{title} be assigned. +% \end{itemize} % \item[v0.20:] \ % \begin{itemize} % \item The |makefile| and related infrastructure @@ -1253,6 +1285,19 @@ convert and store them in individual \acro{SVG} files. % a good choice. For new projects with a large number of documents, it may be worth % investigating the alternatives before decided which path to take. % +% \subsection{Internet class} +% +% \changes{v0.21}{2017/02/15}{Docs: Added \protect\texttt{internet} class.} +% +% The closest to \pkg{lwarp} in design principle is the +% \DescribeClass{internet} +% \verb+internet+ class by Andrew Stacey +% (\url{https://github.com/loopspace/latex-to-internet}), +% an interesting project which directly produces several versions +% of markdown, and also \acro{HTML}\ and \acro{EPUB}. +% +% +% % \subsection{TeX4ht} % % \url{http://tug.org/tex4ht/}\DescribeProgram{TeX4ht} @@ -1266,21 +1311,29 @@ convert and store them in individual \acro{SVG} files. % % \subsection{Translators} % -% These systems use external programs to translate a subset of \LaTeX{} syntax into \acro{HTML}: +% \changes{v0.21}{2017/02/14}{Docs: Added TeX2page, GladTeX.} +% +% These systems use external programs to translate a subset of \LaTeX{} syntax into \acro{HTML}. +% Search for each on CTAN (\url{http:\\ctan.org}). % \begin{description} % \item [H\textsuperscript{E}v\textsuperscript{E}a:] \url{http://hevea.inria.fr/} -% \DescribeProgram{Hevea} +% \DescribeProgram{Hevea} {\footnotesize(not on CTAN)} % \item [T\textsubscript{T}H:] \url{http://hutchinson.belmont.ma.us/tth/} % \DescribeProgram{TtH} % \item [GELLMU:] \url{http://www.albany.edu/~hammond/gellmu/} % \DescribeProgram{GELLMU} -% \item [LaTeXML:] \url{http://dlmf.nist.gov/LaTeXML/} +% \item [\LaTeX{}ML:] \url{http://dlmf.nist.gov/LaTeXML/} % \DescribeProgram{LaTeXML} -% \item [Plastex:] \url{https://github.com/tiarno/plastex} +% \item [PlasTeX:] \url{https://github.com/tiarno/plastex} % \DescribeProgram{Plastex} -% \item [LaTeX2html:] \url{http://www.latex2html.org/} \\ +% \item [\LaTeX2HTML:] \url{http://www.latex2html.org/} +% \DescribeProgram{LaTeX2HTML} \\ % and \url{http://ctan.org/pkg/latex2html}. -% \DescribeProgram{LaTeX2html} +% \item [\TeX2page:] \url{http://ds26gte.github.io/tex2page/index.html} \DescribeProgram{TeX2page} +% \end{description} +% Finally, Glad\TeX\ may used to directly insert \LaTeX\ math into \acro{HTML}: +% \begin{description} +% \item [Glad\TeX:] \url{http://humenda.github.io/GladTeX/} \DescribeProgram{GladTeX} % \end{description} % % \subsection{AsciiDoc} @@ -1384,10 +1437,8 @@ convert and store them in individual \acro{SVG} files. % \index{utility>programs} % \index{programs>utility} % -% \vfill -% -% \begin{minipage}{\linewidth} -% \captionof{table}{Required software programs\label{tab:utility}} +% \begin{table} +% \caption{Required software programs\label{tab:utility}} % \hrule % \begin{description} % @@ -1428,10 +1479,16 @@ convert and store them in individual \acro{SVG} files. % % \end{description} % -% \item[Extra packages provided with your operating sytem:] \ +% \item[Poppler PDF utilities:] \ +% +% These might be provided by your operating-system package manager. % % From Poppler: \url{poppler.freedesktop.org}. % +% For Windows, also see: \\ +% \url{https://sourceforge.net/projects/poppler-win32/} \quad and: \\ +% \url{http://blog.alivate.com.au/poppler-windows/} +% % \begin{description} % % \item[pdftotext:] Used to convert \acro{PDF} to text. @@ -1445,6 +1502,13 @@ convert and store them in individual \acro{SVG} files. % % \end{description} % +% \item[Perl:] \ +% +% This may be provided by your operating-system package manager, and is +% required for some of the Poppler \acro{PDF} utilities. +% +% \url{perl.org}, \url{strawberryperl.com} +% % \item[Automatically downloaded from the internet as required:] \ % \begin{description} % @@ -1457,7 +1521,7 @@ convert and store them in individual \acro{SVG} files. % \end{description} % % \hrule -% \end{minipage} +% \end{table} % % \subsection{Installing the \protect\pkg{lwarp} package} % @@ -1468,8 +1532,9 @@ convert and store them in individual \acro{SVG} files. % \raggedright % % \item [Pre-installed:] Try entering into a command line: -% \userentry{lwarpmk} \\ -% If the |lwarpmk| help message appears, then \pkg{lwarp} is already installed. +% \userentry{kpsewhich lwarp.sty} +% +% If a path to |lwarp.sty| is shown, then \pkg{lwarp} is already installed. % % \item [\TeX\ Live:]If using a \TeX\ Live distribution, % try installing via |tlmgr|: @@ -1499,6 +1564,9 @@ convert and store them in individual \acro{SVG} files. % \item Renew the cache: % \userentry{mktexlsr} \quad —\,or\,— % \userentry{texhash} +% +% Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)| +% and click on the button called \textsf{Refresh FNDB}. % \end{enumerate} % % \item[CTAN \texttt{.dtx} and \texttt{.ins} files:] Another form of \TeX\ package @@ -1521,6 +1589,10 @@ convert and store them in individual \acro{SVG} files. % \item Renew the cache: % \userentry{mktexlsr} \quad —\,or\,— % \userentry{texhash} +% +% Or, for Windows MiK\TeX, start the program called |MiKTeX Settings (Admin)| +% and click on the button called \textsf{Refresh FNDB}. +% % \item See \cref{sec:locallwarpmk} to generate your local copy of |lwarpmk|. % \item Once the local version of |lwarpmk.lua| is installed, it may be made % available system-wide as per \cref{sec:installlwarpmk}. @@ -1538,23 +1610,33 @@ convert and store them in individual \acro{SVG} files. % \subsection{Installing the \protect\texttt{lwarpmk} utility} % \label{sec:installlwarpmk} % +% \changes{v0.21}{2017/02/22}{Docs: Installing on Windows.} +% % {\small -% (Note: It is possible to use a local copy of |lwarpmk| instead of -% installing it system-wide. +% (Note: If |lwarpmk| is not already installed, +% it is easiest to use a local copy instead of installing it system-wide. % See \cref{sec:locallwarpmk}.) % } % % After the \pkg{lwarp} package is installed, % you may need to setup the |lwarpmk| utility: % \begin{enumerate} -% \item At a command line, try executing |lwarpmk|. If the help message +% \item At a command line, try executing |lwarpmk|. If the |lwarpmk| help message % appears, then |lwarpmk| is already set up. +% If not, it is easiest to generate and use a local copy. +% See \cref{sec:locallwarpmk}. +% +% Otherwise, continue with the following: +% % \item Locate the file |lwarpmk.lua|, which should be in the |scripts| directory -% of the TDS tree. On a \TeX\ Live system you may use \userentry{kpsewhich lwarpmk.lua} +% of the TDS tree. On a \TeX\ Live or MiK\TeX\ system you may use +% \userentry{kpsewhich lwarpmk.lua} +% +% (If the file is not found, you may also generate a local copy and use it instead. +% See \cref{sec:locallwarpmk}.) +% % \item Create |lwarpmk|: % \begin{description} -% \item [The easy way:] Copy |lwarpmk.lua| to wherever |pdflatex| is located. -% For Unix, rename |lwarpmk.lua| to |lwarpmk| and make it executable. % \item [Unix:] Create a symbolic link and make it executable: % \begin{enumerate} % \item Locate the \TeX\ Live binaries: @@ -1577,14 +1659,20 @@ convert and store them in individual \acro{SVG} files. % \item Locate the \TeX\ Live binaries as shown above for Unix. % \item In the binaries directory, make a \emph{copy} of |runscript.exe| % and call it |lwarpmk.exe| +% This will call the copy of |lwarpmk.lua| +% which is in the |scripts| directory of the distribution. % \end{enumerate} -% \item [Windows MiK\TeX:] Copy |lwarpmk.lua| to a folder in the executable |PATH|: +% \item [Windows MiK\TeX:] Create a new |lwarpmk.bat| file: % \begin{enumerate} % \item Locate the binaries. These will be in a directory such as: \\ -% \hspace*{2em}|C:\Program Files\MiKTeX 2.9\miktex\bin| \\ +% \hspace*{2em}|C:\Program Files\MiKTeX 2.9\miktex\bin\x64| \\ % In this directory you will find programs -% such as |pdflatex| and |makeindex|. -% \item Copy |lwarpmk.lua| to this directory. +% such as |pdflatex.exe| and |makeindex.exe|. +% \item Create a new file named |lwarpmk.bat| containing: \\ +% \hspace*{1em} +% |texlua "C:\Program Files\MiKTeX 2.9\scripts\lwarp\lwarp.texlua" %*| \\ +% This will call the copy of |lwarpmk.lua| +% which is in the |scripts| directory of the distribution. % \end{enumerate} % \end{description} % \end{enumerate} @@ -1603,37 +1691,88 @@ convert and store them in individual \acro{SVG} files. % \item[Unix:] \ % \begin{enumerate} % \item Make |lwarpmk.lua| executable: \userentry{chmod 0755 lwarpmk.lua} -% \item Compile documents with \\ -% \hspace*{2em} |./lwarpmk.lua html| \\ -% \hspace*{2em} |./lwarpmk.lua print| \quad etc. +% \item Compile documents with +% \userentry{./lwarpmk.lua html} +% \userentry{./lwarpmk.lua print} \quad etc. % \item It may be useful to rename or link to a version without the |.lua| suffix. % \end{enumerate} % \item[Windows:] \ % -% Compile documents with \\ -% \hspace*{2em} |lwarpmk html| \\ -% \hspace*{2em} |lwarpmk print| \quad etc. +% Compile documents with either of the following, depending +% on which command shell is being used: +% \userentry{texlua lwarpmk.lua html} +% \userentry{texlua lwarpmk.lua print} \quad etc. +% +% Or: +% +% \userentry{lwarpmk html} +% \userentry{lwarpmk print} \quad etc. % \end{description} % \end{enumerate} % % % \subsection{Installing additional utilities} % -% The \TeX\ utilities |latexmk| and |pdfcrop| may require +% The \TeX\ utilities |latexmk| and |pdfcrop| may be provided by % the installation of additional \TeX-relatex operating-system packages. % -% The tools from the \textsc{Poppler} project should be provided by your +% The tools from the \textsc{Poppler} project may also be provided by your % operating system's package-installation tools. +% For Windows, see \cref{tab:utility} on \cpageref{tab:utility}. +% +% Perl may require installation as well. See \cref{tab:utility}. % -% To test for the existence of the additional utilities, try: +% \begin{description} +% \item [To test for the existence of the additional utilities:] +% Enter the following in a command line: % \userentry{luatex --version} % \userentry{xindy --version} % \userentry{latexmk --version} +% \userentry{perl --version} % \userentry{pdfcrop --version} % \userentry{pdftotext -v} % \userentry{pdfseparate --version} % \userentry{pdftocairo -v} +% \end{description} % +% Any utilities installed by hand must be added to the |PATH|. +% +% \DescribeProgram[requirement]{pdftotext}\index{Poppler} +% \DescribeProgram[requirement]{pdfseparate} +% \DescribeProgram[requirement]{pdftocairo} +% \begin{description} +% \item [To add the Poppler utilities to a Windows machine:] \ +% \begin{enumerate} +% \item Download and extract the Poppler utilities |pdftotext|, |pdfseparate|, +% and |pdftocairo| to a directory, such as |Poppler|. +% \item In the Start window, type "Path" to search for results +% related to Path. Or, open the control panel and search for "Path". +% \item Choose "Edit the system environment variables" in the control panel. +% \item Choose the "Environment Variables" button. +% \item Choose the "Path" variable, then the "Edit" button. +% \item Choose the "New" button to make an additional entry. +% \item Enter the |bin| directory of the Poppler utilities, such as: \\ +% \hspace*{2em}|C:\Users\\Desktop\Poppler\poppler-0.5_x86\poppler-0.5\bin| +% +% Be sure to include |\bin|. +% \item Click "Ok" when done. +% \end{enumerate} +% \end{description} +% +% \DescribeProgram[requirement]{perl}\index{Perl} +% \begin{description} +% \item [To add Perl to a Windows machine:] \ +% \begin{enumerate} +% \item Download and install a version of Perl, such as Straweberry Perl, +% to a directory without a space in its name, such as |C:\Strawberry|. +% \item Edit the Path as seen above for the Poppler utilities. +% \item Enter the |bin| directory of the Perl utility, such as: \\ +% \hspace*{2em}|C:\Strawberry\perl\bin| +% +% Be sure to include |\bin|. +% \item Click "Ok" when done. +% \end{enumerate} +% \end{description} % % % @@ -1647,13 +1786,39 @@ convert and store them in individual \acro{SVG} files. % % \subsection{Starting a new project} % +% \changes{v0.21}{2017/02/23}{File \texttt{lwarp\_tutorial.txt} added.} +% % \begin{enumerate} % % \item Create a new project directory called |tutorial|. % % \item Inside the |tutorial| directory, -% create a new file called |tutorial.tex|, as seen in \cref{fig:tutorial}. -% This may be copied/pasted from this documentation directly into your own editor. +% \DescribeFile{tutorial.tex} +% create a new file called |tutorial.tex|. +% This may be done several ways: +% \begin{description} +% \item [Copy from the documentation PDF:] \ +% +% A listing is in \cref{fig:tutorial}, +% which may be copied/pasted from the figure directly into your own editor, +% depending on the quality of the \acro{PDF} viewer and editor, or: +% +% \item [Copy from the \pkg{lwarp} documentation directory:] \ +% +% Another copy may be found by entering into a command line: +% \DescribeFile{lwarp_tutorial.txt} +% \userentry{texdoc -l lwarp\_tutorial.txt} +% \watchout[Note: |.txt| suffix!] +% +% This should be in the |doc/latex/lwarp/| directory along +% with this \acro{PDF} documentation. +% Copy |lwarp_tutorial.txt| directly into your |tutorial| directory, +% renamed as |tutorial.tex|. +% \end{description} +% +% \emph{When using Windows, use an editor other than Notepad, +% \watchout[Bad Formatting!] +% since Notepad does not accept the end-of-line from a Unix text file.} % % \item Compile the project: \userentry{pdflatex tutorial.tex} % \quad (several times) @@ -1687,11 +1852,16 @@ convert and store them in individual \acro{SVG} files. % \textcolor{red}{Note: There are two pages!} % \end{center} % -% \begin{verbatim} -% \documentclass{book} +% \small % +% \begin{Verbatim}[gobble=2] +% +% % Save this as tutorial.tex for the lwarp package tutorial. +% +% \documentclass{book} +% % \usepackage{iftex} -% +% % % --- LOAD FONT SELECTION AND ENCODING BEFORE LOADING LWARP --- % \ifPDFTeX % \usepackage{lmodern} % pdflatex @@ -1705,16 +1875,16 @@ convert and store them in individual \acro{SVG} files. % % \newcommand{\HomeHTMLFilename}{index} % Filename of the homepage. % % \newcommand{\HTMLFileName}{node-} % Filename prefix of other pages. % % \newcommand{\UseLatexmk}{true}% Uncomment to use latexmk -% +% % % --- LWARP IS LOADED NEXT --- % \usepackage{lwarp-newproject} % Possibly with the [lwarpmk] option. % \usepackage{lwarp} % % \boolfalse{FileSectionNames} % If false, numbers the files. -% +% % % --- OTHER PACKAGES ARE LOADED AFTER LWARP --- -% \usepackage{makeidx} \makeindex +% \usepackage{makeidx} \makeindex % \usepackage{xcolor} -% +% % \usepackage{hyperref,cleveref} % LOAD THESE LAST! % % % --- LATEX AND HTML CUSTOMIZATION --- @@ -1729,32 +1899,40 @@ convert and store them in individual \acro{SVG} files. % \SetPageTop{\fbox{LOGO}} % \SetPageBottom{Contact Information and Copyright} % \NewCSS{lwarp_sagebrush.css} -% +% % \begin{document} % \maketitle % (or a titlepage environment) +% % % --- An abstract may be placed here. --- +% % \tableofcontents \listoffigures % --- MUST BE BEFORE THE FIRST SECTION. -% +% % \chapter{First chapter} +% % \section{A section} +% % This is some text which is indexed.\index{Some text.} % % \subsection{A subsection} +% % See \cref{fig:withtext}. +% % \begin{figure}\begin{center} % \fbox{\textcolor{blue!50!green}{Text in a figure.}} % \caption{A figure with text\label{fig:withtext}} % \end{center}\end{figure} % % \section{Some math} +% % Inline math: $r = r_0 + vt - \frac{1}{2}at^2$ % \begin{equation} % a^2 + b^2 = c^2 % \end{equation} % % \printindex +% % \end{document} -% \end{verbatim} +% \end{Verbatim} % \endgroup % % @@ -2862,9 +3040,9 @@ convert and store them in individual \acro{SVG} files. % \limitscaption % % -% \subsubsection{\pkg{subfig} package} +% ^^A \subsubsection{\pkg{subfig} package} % -% \limitssubfig +% ^^A \limitssubfig % % % \subsubsection{\pkg{floatrow} package} @@ -2873,35 +3051,36 @@ convert and store them in individual \acro{SVG} files. % % % \subsubsection{\pkg{siunitx} package} -% \DescribePackage{siunitx} % +% \DescribePackage{siunitx} % \limitssiunitx % % % \subsubsection{\pkg{newclude} package} -% \DescribePackage{newclude} +% % \changes{v0.14}{2016/03/29}{Docs: Newclude limitations.} % +% \DescribePackage{newclude} % \limitsnewclude % % % \subsubsection{\pkg{newtxmath} package} -% \DescribePackage{newtxmath} % +% \DescribePackage{newtxmath} % \limitsnewtxmath % % % \subsubsection{\pkg{babel} package} -% \DescribePackage{babel} % +% \DescribePackage{babel} % \limitsbabelone % % \limitsbabeltwo % % % \subsubsection{\pkg{enumitem} package} -% \DescribePackage{enumitem} % +% \DescribePackage{enumitem} % \limitsenumitem % % @@ -3257,8 +3436,11 @@ convert and store them in individual \acro{SVG} files. % If using |pdflatex|, convert a minimal set of Unicode characters. % Additional characters may be defined by the user, as needed. % -% If using and of |pdflatex|, |xelatex|, or |lualatex|, \cs{texttimes} is -% declared for a common multiply symbol. +% A commonly-used multiply symbol is declared to be \cs{texttimes}. +% +% The first arguments of \cs{newunicodechar} below are text ligatures in +% the source code, even though they are not printed in the following +% listing. % \begin{macrocode} \RequirePackage{newunicodechar} @@ -3266,7 +3448,7 @@ convert and store them in individual \acro{SVG} files. \newunicodechar{⨯}{\texttimes} \ifPDFTeX -\newunicodechar{ff}{ff} +\newunicodechar{ff}{ff}% the first arguments are ligatures \newunicodechar{fi}{fi} \newunicodechar{fl}{fl} \newunicodechar{ffi}{ffi} @@ -3274,7 +3456,7 @@ convert and store them in individual \acro{SVG} files. \newunicodechar{—}{---} \newunicodechar{–}{--} % \end{macrocode} -% In verbatim text in PDFTex, preserve upright quotes. +% In PDF\TeX, preserve upright quotes in verbatim text: % \begin{macrocode} \RequirePackage{upquote} \else @@ -3479,6 +3661,110 @@ convert and store them in individual \acro{SVG} files. +% \section{Misplaced packages} +% +% \changes{v0.21}{2017/02/22}{Add: Errors for misplaced packages.} + + +% Several packages should only be loaded before \pkg{lwarp}, and +% others should only be loaded after. +% +% Packages which should only be loaded before \pkg{lwarp} have their own \\ +% \hspace*{2em}|lwarp-.sty| \\ +% which will trigger an error if they are loaded after +% \pkg{lwarp}. +% Examples include \pkg{fontspec}, \pkg{inputenc}, \pkg{fontenc}, +% and \pkg{newunicodechar}. +% +% + +% \begin{macro}{\LWR@noloadbefore} \marg{packagename} \quad +% Error if loaded before \pkg{lwarp}. +% +% \begin{macrocode} +\newcommand*{\LWR@noloadbefore}[1]{% +\@ifpackageloaded{#1} +{ +\PackageError{lwarp} +{Package #1, or one which uses #1, must be loaded after lwarp} +{Move \detokenize{\usepackage}{#1} after \detokenize{\usepackage}{lwarp}. +Package #1 may also be loaded by something else, which must also be moved +after lwarp.} +} +{} +} +% \end{macrocode} +% \end{macro} + + +% \begin{macro}{\LWR@noloadafter} \marg{packagename} \quad +% Error if loaded after \pkg{lwarp}. +% +% \begin{macrocode} +\newcommand*{\LWR@noloadafter}[1]{% +\PackageError{lwarp} +{Package #1 must be loaded before lwarp} +{Move \detokenize{\usepackage}{#1} before \detokenize{\usepackage}{lwarp}.} +} +% \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. +% +% The following packages must be loaded after \pkg{lwarp}: +% \begin{macrocode} +\LWR@noloadbefore{afterpage} +\LWR@noloadbefore{algorithmicx} +\LWR@noloadbefore{alltt} +\LWR@noloadbefore{bookmark} +\LWR@noloadbefore{booktabs} +\LWR@noloadbefore{draftwatermark} +\LWR@noloadbefore{epigraph} +\LWR@noloadbefore{eso-pic} +\LWR@noloadbefore{everypage} +\LWR@noloadbefore{extramarks} +\LWR@noloadbefore{fancyhdr} +\LWR@noloadbefore{floatrow} +\LWR@noloadbefore{float} +\LWR@noloadbefore{geometry} +\LWR@noloadbefore{graphics} +\LWR@noloadbefore{graphicx} +\LWR@noloadbefore{hyperref} +\LWR@noloadbefore{keyfloat} +\LWR@noloadbefore{letterspace} +\LWR@noloadbefore{listings} +\LWR@noloadbefore{longtable} +\LWR@noloadbefore{ltcaption} +\LWR@noloadbefore{mdframed} +\LWR@noloadbefore{microtype} +%\LWR@noloadbefore{multicol}% loaded by ltxdoc +\LWR@noloadbefore{multirow} +\LWR@noloadbefore{needspace} +\LWR@noloadbefore{nowidow} +\LWR@noloadbefore{pagenote} +\LWR@noloadbefore{placeins} +\LWR@noloadbefore{ragged2e} +\LWR@noloadbefore{rotating} +\LWR@noloadbefore{setspace} +\LWR@noloadbefore{textpos} +\LWR@noloadbefore{threeparttable} +\LWR@noloadbefore{titleps} +\LWR@noloadbefore{titlesec} +\LWR@noloadbefore{titletoc} +\LWR@noloadbefore{tocloft} +\LWR@noloadbefore{trivfloat} +\LWR@noloadbefore{wallpaper} +\LWR@noloadbefore{wrapfig} +\LWR@noloadbefore{xcolor} +\LWR@noloadbefore{xfrac} +% \end{macrocode} + + + + + % \section{Required packages} % \label{sec:requiredpackages} % \index{packages>required} @@ -3604,12 +3890,12 @@ convert and store them in individual \acro{SVG} files. % ^^A % \end{macrocode} % ^^A +% \pdflatexonly +% % \DescribePackage{microtype} % \changes{v0.18}{2016/05/18}{Microtype disabled during HTML generation} % -% \pdflatexonly -% % Older browsers don't % \index{ligatures} % display ligatures. @@ -4304,35 +4590,9 @@ top=1in,bottom=1in,% % \end{macrocode} % \end{macro} -% \begin{macro}{\OSmkdir} -% The make-directory command. -% \begin{macrocode} -\newcommand*{\OSmkdir}{mkdir } % trailing space is required -% \end{macrocode} -% \end{macro} -% \begin{macro}{\OSrm} -% The remove-file command. -% \begin{macrocode} -\newcommand*{\OSrm}{rm } -% \end{macrocode} -% \end{macro} - -% \begin{macro}{\OSmv} -% The move-file command. -% \begin{macrocode} -\newcommand*{\OSmv}{mv } -% \end{macrocode} -% \end{macro} -% \begin{macro}{\OSShellPath} -% Path to the command-line shell. -% \begin{macrocode} -\newcommand*{\OSShellPath}{/bin/sh} -% \end{macrocode} -% \end{macro} - % \subsection{MS-Windows} @@ -4350,9 +4610,6 @@ top=1in,bottom=1in,% { \booltrue{usingOSwindows} \renewcommand*{\OSPathSymbol}{\@backslashchar} -\renewcommand*{\OSmkdir}{MD } -\renewcommand*{\OSrm}{DEL } -\renewcommand*{\OSmv}{MOVE } } % \end{macrocode} % Test for windows during compile. The user may also specify @@ -5985,9 +6242,14 @@ top=1in,bottom=1in,% % \end{macrocode} % \begin{macro}{\marginpar} \oarg{left} \marg{right} +% +% \changes{v0.21}{2017/02/11}{Fixed source listing.} +% +% \begin{macrocode} \renewcommand{\marginpar}[2][]{% \LWR@htmlspanclass{marginpar}{#2}% } +% \end{macrocode} % \end{macro} % @@ -6176,6 +6438,7 @@ top=1in,bottom=1in,% % \begin{macro}{\LWR@newhtmlfile} \marg{section name} % \changes{v0.18}{2016/04/23}{Sidetoc after title, improving responsive design.} +% \changes{v0.21}{2017/02/22}{Skip title if not given.} % % Finishes the current \acro{HTML} page with footnotes, footer, navigation, % then starts a new \acro{HTML} page with an \acro{HTML} comment telling where to @@ -6235,7 +6498,6 @@ top=1in,bottom=1in,% } % \end{macrocode} - % At the top of the starting file: % \begin{macrocode} \LWR@stoppars @@ -6250,7 +6512,7 @@ top=1in,bottom=1in,% \LWR@htmlelementend{header} -\LWR@printthetitle +\ifcsvoid{thetitle}{}{\LWR@printthetitle} \LWR@sidetoc @@ -6731,10 +6993,13 @@ top=1in,bottom=1in,% % \end{macrocode} % \end{macro} + % \begin{macro}{\LWR@filestart} \marg{title\_suffix} + % Creates the opening \acro{HTML} tags. % \changes{v0.19}{2016/05/25}{lwarp\_mathjax.txt loaded.} % \changes{v0.20}{2016/06/27}{Adds meta description.} +% \changes{v0.21}{2017/02/22}{Skip title if not given.} % % \begin{macrocode} \newcommand*{\LWR@filestart}[1]{ @@ -6801,13 +7066,15 @@ content="width=device-width, initial-scale=1.0" /}% % \begin{macrocode} \LWR@htmltag{!{-}{-}[if lt IE 9]}\LWR@orignewline \LWR@htmltag{% -script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"{}} +script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"{}}% \LWR@htmltag{/script}\LWR@orignewline \LWR@htmltag{![endif]{-}{-}}\LWR@orignewline % \end{macrocode} % The page's title: % \begin{macrocode} -\LWR@htmltag{title}\thetitle#1\LWR@htmltag{/title}\LWR@orignewline +\ifcsvoid{thetitle}{}{% +\LWR@htmltag{title}\thetitle#1\LWR@htmltag{/title}\LWR@orignewline% +}% % \end{macrocode} % The page's stylesheet: % \begin{macrocode} @@ -6860,6 +7127,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\LWR@LwarpStart} % \changes{v0.19}{2016/06/01}{Enabled \textbackslash\textbackslash{} equal to \cs{newline}.} +% \changes{v0.21}{2017/02/22}{Changed \texttt{lateximages} to a \texttt{.txt} file.} % Executed at the beginning of the entire document. % \begin{macrocode} \newcommand*{\LWR@LwarpStart} @@ -6895,22 +7163,9 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \setlength{\parskip}{2ex} % \end{macrocode} % -% For the |lateximages| command file: -% +% For the |lateximages| record file: % \begin{macrocode} -\ifbool{usingOSwindows} -{% Windows: -\immediate\openout\LWR@file=lateximages.cmd -} -{% Unix: -\immediate\openout\LWR@file=lateximages.sh -\immediate\write\LWR@file{\LWR@hashmark!\OSShellPath} -} -% \end{macrocode} -% The first action of the command file is to create the -% |lateximages| directory: -% \begin{macrocode} -\immediate\write\LWR@file{\OSmkdir lateximages\OSPathSymbol} +\immediate\openout\LWR@file=lateximages.txt % \end{macrocode} % % Removes space after the caption in the \acro{HTML}: @@ -8331,37 +8586,37 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % Original code is from the \pkg{fancyvrb} package. % \begin{macrocode} \newcommand*{\LWR@fvstartnone}{% -% \typeout{fvstartnone}% +\LWR@traceinfo{fvstartnone}% \ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{div class="\LWR@Verbatimclass"}}}{}% \hbox to\z@{\LWR@atbeginverbatim{verbatim}}% } \newcommand*{\LWR@fvendnone}{% -% \typeout{fvendnone}% +\LWR@traceinfo{fvendnone}% \hbox to\z@{\LWR@afterendverbatim}% \ifbool{LWR@verbtags}{\hbox to\z@{\LWR@htmltagc{/div}}}{}% } \newcommand*{\LWR@fvstartsingle}{% -% \typeout{fvstartsingle}% +\LWR@traceinfo{fvstartsingle}% \LWR@fvstartnone% \FV@BeginListFrame@Single% } \newcommand*{\LWR@fvendsingle}{% -% \typeout{fvendsingle}% +\LWR@traceinfo{fvendsingle}% \FV@EndListFrame@Single% \LWR@fvendnone% } \newcommand*{\LWR@fvstartline}{% -% \typeout{fvstartline}% +\LWR@traceinfo{fvstartline}% \LWR@fvstartnone% \FV@BeginListFrame@Lines% } \newcommand*{\LWR@fvendline}{% -% \typeout{fvendline}% +\LWR@traceinfo{fvendline}% \FV@EndListFrame@Lines% \LWR@fvendnone% } @@ -9523,7 +9778,7 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % \begin{macro}{\LWR@docmidrule} \oarg{width} \marg{trim} \marg{leftcolumn-rightcolumn} % -% Marks |LWR@midrules}| array elements to be ``Y'' from left to right columns. +% Marks |LWR@midrules| array elements to be ``Y'' from left to right columns. % % \begin{macrocode} \NewDocumentCommand{\LWR@docmidrule}{o d() >{\SplitArgument{1}{-}}m}% @@ -10437,19 +10692,19 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% \newcommand*{\LWR@startref}[1] {% \edef\LWR@lidref{\LWR@lateximagedepthref{#1}} -% \typeout{***LWR@startref A: !#1!}% +\LWR@traceinfo{***LWR@startref A: !#1!}% % \end{macrocode} % Create the tag: % \begin{macrocode} \LWR@htmltag{a href="% -% \typeout{***LWR@startref B}% +\LWR@traceinfo{***LWR@startref B}% \LWR@htmlrefsectionfilename{#1}% -% \typeout{***LWR@startref C}% +\LWR@traceinfo{***LWR@startref C}% \#% % \end{macrocode} % See if |LWR@lateximagedepth| is unknown: % \begin{macrocode} -% \typeout{***LWR@startref D: !#1!}% +\LWR@traceinfo{***LWR@startref D: !#1!}% \ifthenelse{\equal{\LWR@lidref}{??}}% % \end{macrocode} % ``|??|'' if |LWR@lateximagedepth| is unknown: @@ -10459,24 +10714,24 @@ link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}% % If |LWR@lateximagedepth| is known: % \begin{macrocode} {% -% \typeout{***LWR@startref D1}% -% \typeout{***depthref is \LWR@lidref}% +\LWR@traceinfo{***LWR@startref D1}% +\LWR@traceinfo{***depthref is \LWR@lidref}% \ifthenelse{\cnttest{\LWR@lidref}{>}{0}}% {% -% \typeout{***LWR@startref D2}% +\LWR@traceinfo{***LWR@startref D2}% lateximage\LWR@lateximagenumberref{#1}% }% {% -% \typeout{***LWR@startref D3}% +\LWR@traceinfo{***LWR@startref D3}% #1% }% }% -% \typeout{***LWR@startref E}% +\LWR@traceinfo{***LWR@startref E}% % \end{macrocode} % closing quote: % \begin{macrocode} "{}}% -% \typeout{***LWR@startref F}% +\LWR@traceinfo{***LWR@startref F}% } % \end{macrocode} % \end{macro} @@ -12222,7 +12477,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % A |\lateximage| is typeset on its own \acro{PDF} page inside an \acro{HTML} comment starting on the preceeding page % and ending on following page, and instructions are written to -% |lateximage.sh| or |lateximages.cmd| to extract the |\lateximage| from the page of the \acro{PDF} file +% |lateximage.txt| for |lwarpmk| to extract the |\lateximage| from the page of the \acro{PDF} file % then generate an accompanying |.svg| file image file. Meanwhile, instructions to % show this image are placed into the \acro{HTML} file after the comment. % @@ -12265,7 +12520,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % \end{macrocode} % Declare the |\LWR@file| for writing -% to generate file |lateximages.sh| or |lateximages.cmd|: +% to generate file |lateximages.txt|: % \begin{macrocode} \ifcsdef{LWR@file}{}{\newwrite{\LWR@file}} % \end{macrocode} @@ -12299,7 +12554,7 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% % % \emph{Do not include the leading backslash in the name.} % \begin{macrocode} -\newcommand*{\LateximageFontSizeName}{normalsize} +\newcommand*{\LateximageFontSizeName}{large} % \end{macrocode} % \end{macro} @@ -12413,25 +12668,9 @@ class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}% \LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" % class="lateximagesource"{}} \LWR@orignewline % \end{macrocode} -% Write instructions to the lateximage.sh file: +% Write instructions to the |lateximages.txt| file: % \begin{macrocode} -\immediate\write\LWR@file{% - pdfseparate -f \theLWR@nextpage \space -l % - \theLWR@nextpage \space % - \jobname.pdf lateximagetemp-\LWR@percent d.pdf}% -% keep the space before 'd.pdf' -\immediate\write\LWR@file{% - pdfcrop --hires lateximagetemp-\theLWR@nextpage.pdf - lateximage-\theLWR@externalfilecnt.pdf}% -\immediate\write\LWR@file{% - pdftocairo -svg lateximage-\theLWR@externalfilecnt.pdf - lateximage-\theLWR@externalfilecnt.svg}% -\immediate\write\LWR@file{% - \OSmv lateximage-\theLWR@externalfilecnt.svg % - lateximages\OSPathSymbol}% -\immediate\write\LWR@file{% - \OSrm lateximage-\theLWR@externalfilecnt.pdf - lateximagetemp-\theLWR@nextpage.pdf}% +\immediate\write\LWR@file{|\theLWR@nextpage|\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 \acro{PDF} page which were picked up by @@ -16578,6 +16817,11 @@ MathJax.Hub.Config({ % \DescribeFile{lwarpmk} Creates a local copy of |lwarpmk|: % +% \changes{v0.21}{2017/02/11}{lwarpmk: Fix: \protect\texttt{lwarpmk again} for Windows.} +% \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk limages} for Windows.} +% \changes{v0.21}{2017/02/22}{lwarpmk: Fix: \protect\texttt{lwarpmk} uses \texttt{lateximages} text file instead of shell script.} +% +% % \begin{macrocode} \begin{VerbatimOut}{lwarpmk.lua} #!/usr/bin/env texlua @@ -16586,7 +16830,7 @@ MathJax.Hub.Config({ -- Print the usage of the lwarpmk command: -printversion = "v0.20" +printversion = "v0.21" function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -16633,6 +16877,7 @@ Values must be in "quotes". ]] ) ; end + -- Split one large sourcefile into a number of files, -- starting with destfile. -- The file is split at each occurance of