diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/lwarp/lwarp.sty | 679 |
1 files changed, 433 insertions, 246 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty index 83ca291fcb5..6c5a86c3451 100644 --- a/Master/texmf-dist/tex/latex/lwarp/lwarp.sty +++ b/Master/texmf-dist/tex/latex/lwarp/lwarp.sty @@ -17,7 +17,7 @@ %% version 2005/12/01 or later. \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{lwarp} - [2018/12/22 v0.65 Allows LaTeX to directly produce HTML5 output.] + [2019/02/08 v0.66 Allows LaTeX to directly produce HTML5 output.] @@ -145,9 +145,16 @@ For a possible alternative, see class(es) #2.} } \LWR@earlyloadnever{bxcjkjatype}{upLaTeX, bxjsarticle, ujarticle, utarticle} \LWR@earlyloadnever{hangul}{kotex, xetexko, luatexko} +\LWR@earlyloadnever{colortab}{colortbl} +\LWR@earlyloadnever{epsf}{graphicx} \LWR@earlyloadnever{fancyheadings}{fancyhdr} \LWR@earlyloadnever{glossary}{glossaries} +\LWR@earlyloadnever{hyper}{hyperref} +\LWR@earlyloadnever{picinpar}{floatflt, wrapfig} +\LWR@earlyloadnever{picins}{floatflt, wrapfig} +\LWR@earlyloadnever{sistyle}{siunitx} \LWR@earlyloadnever{t1enc}{fontenc, inputenc, inputenx} +\LWR@earlyloadnever{ucs}{inputenc, inputencx} \LWR@earlyloadnever{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} \LWR@loadafter{2in1} \LWR@loadafter{2up} @@ -171,6 +178,7 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{anonchap} \LWR@loadafter{anysize} \LWR@notmemoirloadafter{appendix} +\LWR@loadafter{ar} \LWR@loadafter{arabicfront} \LWR@notmemoirloadafter{array} \LWR@loadafter{arydshln} @@ -233,6 +241,7 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{draftwatermark} \LWR@loadafter{easy-todo} \LWR@loadafter{ebook} +\LWR@loadafter{ed} \LWR@loadafter{ellipsis} \LWR@loadafter{embrac} \LWR@loadafter{emptypage} @@ -304,7 +313,6 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{idxlayout} \LWR@loadafter{ifoddpage} \LWR@loadafter{imakeidx} -\LWR@loadafter{indentfirst} \LWR@notmemoirloadafter{index} \LWR@loadafter{intopdf} \LWR@loadafter{keyfloat} @@ -346,6 +354,7 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{multirow} \LWR@loadafter{multitoc} \LWR@loadafter{musicography} +\LWR@loadafter{nameauth} \LWR@loadafter{nameref} \LWR@loadafter{natbib} \LWR@notmemoirloadafter{nccfancyhdr} @@ -440,6 +449,7 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{srctex} \LWR@loadafter{stabular} \LWR@notltjloadafter{stfloats} +\LWR@loadafter{subcaption} \LWR@loadafter{subfig} \LWR@loadafter{subfigure} \LWR@loadafter{supertabular} @@ -472,6 +482,7 @@ For a possible alternative, see class(es) #2.} \LWR@loadafter{transparent} \LWR@loadafter{trimclip} \LWR@loadafter{trivfloat} +\LWR@loadafter{truncate} \LWR@loadafter{turnthepage} \LWR@loadafter{twoup} \LWR@loadafter{underscore} @@ -581,6 +592,10 @@ For a possible alternative, see class(es) #2.} \@ifpackageloaded{xeCJK}{ \renewcommand{\LWR@isolate}[1]{\null#1\null}% }{} +\long\def\LWR@firstoffour#1#2#3#4{#1} +\long\def\LWR@secondoffour#1#2#3#4{#2} +\long\def\LWR@thirdoffour#1#2#3#4{#3} +\long\def\LWR@fourthoffour#1#2#3#4{#4} \let\LWRpercent\@percentchar \catcode`\$=12 \def\LWRdollar{$} @@ -593,6 +608,16 @@ For a possible alternative, see class(es) #2.} &def&LWRbackslash{\} &catcode`&\=0 \catcode`\&=4 +\catcode`\&=1 +\catcode`\{=12 +\def\LWRleftbrace&{} +\catcode`\{=1 +\catcode`\&=4 +\catcode`\&=2 +\catcode`\}=12 +\def\LWRrightbrace{}& +\catcode`\}=2 +\catcode`\&=4 \catcode`\#=12 \def\LWRhash{#} \catcode`\#=6 @@ -655,6 +680,10 @@ For a possible alternative, see class(es) #2.} \DeclareStringOption[\jobname]{BaseJobname} +\DeclareStringOption[\BaseJobname-images]{ImagesDirectory} + +\DeclareStringOption[image-]{ImagesName} + \DeclareStringOption[lwarp.ist]{makeindexStyle} \DeclareStringOption[lwarp.xdy]{xindyStyle} @@ -708,15 +737,31 @@ For a possible alternative, see class(es) #2.} \ProcessKeyvalOptions*\relax + \providecommand*{\BaseJobname}{\LWR@BaseJobname} \ifcsempty{LWR@HomeHTMLFilename}{ -\newcommand*{\HomeHTMLFilename}{\BaseJobname} + \newcommand*{\HomeHTMLFilename}{\BaseJobname} }{ -\csedef{HomeHTMLFilename}{\LWR@HomeHTMLFilename} + \csedef{HomeHTMLFilename}{\LWR@HomeHTMLFilename} } \csedef{HTMLFilename}{\LWR@HTMLFilename} +\newcommand*{\LWR@sanitized}{} + +\newcommand*{\LWR@sanitize}[1]{% +\edef\LWR@sanitized{#1}% +\edef\LWR@sanitized{\detokenize\expandafter{\LWR@sanitized}}% +} + +\LWR@sanitize{\LWR@BaseJobname} +\edef\LWR@BaseJobname{\LWR@sanitized} + +\LWR@sanitize{\LWR@ImagesDirectory} +\edef\LWR@ImagesDirectory{\LWR@sanitized} + +\LWR@sanitize{\LWR@ImagesName} +\edef\LWR@ImagesName{\LWR@sanitized} \ifdefempty{\LWR@PrintIndexCmd}{ \renewcommand{\LWR@PrintIndexCmd}{% makeindex -s \LWR@makeindexStyle \space \jobname.idx% @@ -879,7 +924,7 @@ For a possible alternative, see class(es) #2.} \begin{warpall} -\RequirePackage{xstring} +\RequirePackage{xstring}[2019/02/01] \RequirePackage{environ} @@ -887,8 +932,6 @@ For a possible alternative, see class(es) #2.} \begin{warpHTML} -\RequirePackage{zref} - \RequirePackage{printlen} @@ -927,13 +970,20 @@ For a possible alternative, see class(es) #2.} \LWR@checkloadnever{#1}{boxedminipage}{boxedminipage2e} \LWR@checkloadnever{#1}{caption2}{caption} \LWR@checkloadnever{#1}{ccaption}{caption} +\LWR@checkloadnever{#1}{colortab}{colortbl} \LWR@checkloadnever{#1}{doublespace}{setspace} +\LWR@checkloadnever{#1}{epsf}{graphicx} \LWR@checkloadnever{#1}{fancyheadings}{fancyhdr} \LWR@checkloadnever{#1}{glossary}{glossaries} +\LWR@checkloadnever{#1}{hyper}{hyperref} \LWR@checkloadnever{#1}{newthm}{ntheorem} +\LWR@checkloadnever{#1}{picinpar}{floatflt, wrapfig} +\LWR@checkloadnever{#1}{picins}{floatflt, wrapfig} \LWR@checkloadnever{#1}{rplain}{fancyhdr} \LWR@checkloadnever{#1}{si}{siunitx} +\LWR@checkloadnever{#1}{sistyle}{siunitx} \LWR@checkloadnever{#1}{t1enc}{fontenc, inputenc, inputenx} +\LWR@checkloadnever{#1}{ucs}{inputenc, inputencx} \LWR@checkloadnever{#1}{wasysym}{textcomp, amssymb, amsfonts, mnsymbol, fdsymbol} \LWR@checkloadbefore{#1}{ctex} \LWR@checkloadbefore{#1}{fontspec} @@ -1050,7 +1100,8 @@ For a possible alternative, see class(es) #2.} \begin{warpHTML} -\RequirePackage{caption}% +\LWR@origRequirePackage{caption} +\AtBeginDocument{\RequirePackage{lwarp-caption}}% \end{warpHTML} @@ -1321,6 +1372,9 @@ For a possible alternative, see class(es) #2.} \let\LWR@origllap\llap \let\LWR@origrlap\rlap \let\LWR@orighfilneg\hfilneg +\let\LWR@orighspace\hspace + +\let\LWR@origrule\rule \let\LWR@origmedskip\medskip \let\LWR@origbigskip\bigskip @@ -1469,7 +1523,7 @@ For a possible alternative, see class(es) #2.} \begin{LWRwriteconf} -\newcommand*{\LWR@lwarpconfversion}{1}% also in lwarpmk.lua +\newcommand*{\LWR@lwarpconfversion}{2}% also in lwarpmk.lua \ifshellescape \def\LWR@shellescapecmd{--shell-escape } \else @@ -1485,7 +1539,7 @@ For a possible alternative, see class(es) #2.} \newcommand*{\LWR@unknownengine}{% \PackageError{lwarp} {Unknown LaTeX engine.} - {Lwarp only knows about pdflatex, dvi latex, xelatex, and lualatex.} + {Lwarp only knows about pdflatex, dvi latex, xelatex, lualatex, and upLateX.} } \newcommand*{\LWR@latexmkvar}[2]{% -e @@ -1631,6 +1685,8 @@ For a possible alternative, see class(es) #2.} \immediate\write\LWR@quickfile{sourcename = [[\jobname]]} \immediate\write\LWR@quickfile{homehtmlfilename = [[\HomeHTMLFilename]]} \immediate\write\LWR@quickfile{htmlfilename = [[\HTMLFilename]]} +\immediate\write\LWR@quickfile{imagesdirectory = [[\LWR@ImagesDirectory]]} +\immediate\write\LWR@quickfile{imagesname = [[\LWR@ImagesName]]} \immediate\write\LWR@quickfile{latexmk = [[\ifbool{LWR@latexmk}{true}{false}]]} \immediate\write\LWR@quickfile{printlatexcmd = [[\LWR@PrintLatexCmd]]} \immediate\write\LWR@quickfile{HTMLlatexcmd = [[\LWR@HTMLLatexCmd]]} @@ -2110,12 +2166,12 @@ div.titlepage div.mpfootnotes { border-top: none ; } -ol { +ul, ol { margin: 1ex 1em 1ex 0em; line-height: 1.2; } -ul, body dir, body menu { +body dir, body menu { margin: 3ex 1em 3ex 0em; line-height: 1.2; } @@ -2327,7 +2383,7 @@ div.wpminipage { border: 1px solid green ; margin: .5ex ; padding: .5ex ;} .mdframed p { padding: 0ex .5em 0ex .5em ; } -.mdframed dl { padding: 0ex .5em 0ex .5em ; } +.mdframed dl { padding: 1ex .5em 0ex .5em ; } .mdframedtitle { padding: .5ex 0pt 0pt 0pt ; @@ -2393,13 +2449,20 @@ dl { } dl dt { - margin-top: 1ex; - margin-left: 1em ; + display: block ; + float:left ; font-weight: bold; + padding-right: 1em ; } +dl dd { display: block ; } + +dl dd:after { content: "" ; display: block ; clear: both } + dl dd p { margin-top: 0em; } +dd ul, dd ol, dd dl { clear: both ; padding-top: 1ex } + nav { font-family: "URW Classico", Optima, "Linux Biolinum O", "DejaVu Sans", "Bitstream Vera Sans", @@ -2625,7 +2688,7 @@ td.tdb , td.tdbrule , td.tdB , td.tdBrule .tnotes { margin: 0ex 5% 1ex 5% ; padding: 0.5ex 1em 0.5ex 1em; - font-size:.85em; + font-size:.80em; text-align: left ; } @@ -3437,6 +3500,8 @@ div.figurecaption , .lstlisting { .tnotes { background: #fffcf5 ; + border-top: 1px solid silver ; + border-bottom: 1px solid silver ; } .theorem { @@ -3561,15 +3626,27 @@ page_compositor "." \end{LWRwriteconf} \begin{LWRwriteconf} -\begin{filecontents*}{lwarp_one_limage.txt} -@echo off -pdfseparate -f %1 -l %1 %4_html.pdf lateximages\lateximagetemp-%%d.pdf -pdfcrop --hires lateximages\lateximagetemp-%1.pdf lateximages\%3.pdf -pdftocairo -svg -noshrink lateximages\%3.pdf lateximages\%3.svg -del lateximages\%3.pdf -del lateximages\lateximagetemp-%1.pdf -exit -\end{filecontents*} +\immediate\openout\LWR@quickfile=lwarp_one_limage.txt +\immediate\write\LWR@quickfile{% + pdfseparate -f \LWRpercent 1 -l \LWRpercent 1 \LWRpercent 4_html.pdf % + \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent\LWRpercent d.pdf% +} +\immediate\write\LWR@quickfile{% + pdfcrop --hires \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf % + \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf% +} +\immediate\write\LWR@quickfile{% + pdftocairo -svg -noshrink \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf % + \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.svg% +} +\immediate\write\LWR@quickfile{% + del \LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf% +} +\immediate\write\LWR@quickfile{% + del \LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf% +} +\immediate\write\LWR@quickfile{exit} +\immediate\closeout\LWR@quickfile \end{LWRwriteconf} @@ -3679,8 +3756,8 @@ src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX- -- Copyright 2016-2018 Brian Dunn -printversion = "v0.65" -requiredconfversion = "1" -- also at *lwarpmk.conf +printversion = "v0.66" +requiredconfversion = "2" -- also at *lwarpmk.conf function printhelp () print ("lwarpmk: Use lwarpmk -h or lwarpmk --help for help.") ; @@ -3780,6 +3857,8 @@ end -- Additional defaults: confversion = "0" opsystem = "Unix" +imagesdirectory = "lateximages" +imagesname = "image-" latexmk = "false" printlatexcmd = "" HTMLlatexcmd = "" @@ -3841,6 +3920,8 @@ elseif ( cvarname == "opsystem" ) then elseif ( cvarname == "sourcename" ) then sourcename = cvalue elseif ( cvarname == "homehtmlfilename" ) then homehtmlfilename = cvalue elseif ( cvarname == "htmlfilename" ) then htmlfilename = cvalue +elseif ( cvarname == "imagesdirectory" ) then imagesdirectory = cvalue +elseif ( cvarname == "imagesname" ) then imagesname = cvalue elseif ( cvarname == "latexmk" ) then latexmk = cvalue elseif ( cvarname == "printlatexcmd" ) then printlatexcmd = cvalue elseif ( cvarname == "HTMLlatexcmd" ) then HTMLlatexcmd = cvalue @@ -4056,34 +4137,33 @@ end -- checkhtmlpdfexists function warnlimages () -- --- Warning of a missing lateximages.txt file: --- +-- Warning of a missing <sourcename>-images.txt file: print ("lwarpmk: ===") - print ("lwarpmk: \"lateximages.txt\" does not exist.") + print ("lwarpmk: \"" .. sourcename .. "-images.txt\" does not exist.") print ("lwarpmk: Your project does not use SVG math or other lateximages,") print ("lwarpmk: or the file has been deleted somehow.") print ("lwarpmk: Use \"lwarpmk html\" to recompile your project") - print ("lwarpmk: and recreate \"lateximages.txt\".") + print ("lwarpmk: and recreate \"" .. sourcename .. "-images.txt\".") print ("lwarpmk: If your project does not use SVG math or other lateximages,") - print ("lwarpmk: then \"lateximages.txt\" will never exist, and") + print ("lwarpmk: then \"" .. sourcename .. "-images.txt\" will never exist, and") print ("lwarpmk: \"lwarpmk limages\" will not be necessary.") print ("lwarpmk: ===") end -- warnlimages function checklimages () -- --- Check lateximages.txt to see if need to recompile first. +-- Check <sourcename>.txt to see if need to recompile first. -- If any entry has a page number of zero, then there were incorrect images. -- -print ("lwarpmk: Checking for a valid lateximages.txt file.") -local limagesfile = io.open("lateximages.txt", "r") +print ("lwarpmk: Checking for a valid " .. sourcename .. "-images.txt file.") +local limagesfile = io.open(sourcename .. "-images.txt", "r") if ( limagesfile == nil ) then warnlimages () os.exit(1) end -- Track warning to recompile if find a page 0 local pagezerowarning = false --- Scan lateximages.txt +-- Scan <sourcename>.txt for line in limagesfile:lines() do -- lwimgpage is the page number in the PDF which has the image -- lwimghash is true if this filename is a hash @@ -4116,20 +4196,20 @@ executecheckerror ( cmdgroupopenname .. "pdfseparate -f " .. lwimgpage .. " -l " .. lwimgpage .. " " .. sourcename .."_html.pdf " .. - "lateximages" .. dirslash .."lateximagetemp-%d" .. ".pdf" .. + imagesdirectory .. dirslash .."lateximagetemp-%d" .. ".pdf" .. seqname .. -- Crop the image: - "pdfcrop --hires lateximages" .. dirslash .. "lateximagetemp-" .. + "pdfcrop --hires " .. imagesdirectory .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf " .. - "lateximages" .. dirslash .. lwimgname .. ".pdf" .. + imagesdirectory .. dirslash .. lwimgname .. ".pdf" .. seqname .. -- Convert the image to svg: - "pdftocairo -svg -noshrink lateximages" .. dirslash .. lwimgname .. ".pdf " .. - "lateximages" .. dirslash .. lwimgname ..".svg" .. + "pdftocairo -svg -noshrink " .. imagesdirectory .. dirslash .. lwimgname .. ".pdf " .. + imagesdirectory .. dirslash .. lwimgname ..".svg" .. seqname .. -- Remove the temporary files: - rmname .. " lateximages" .. dirslash .. lwimgname .. ".pdf" .. seqname .. - rmname .. " lateximages" .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" .. + rmname .. " " .. imagesdirectory .. dirslash .. lwimgname .. ".pdf" .. seqname .. + rmname .. " " .. imagesdirectory .. dirslash .. "lateximagetemp-" .. lwimgpage .. ".pdf" .. cmdgroupclosename .. " >/dev/null " .. bgname , "File error trying to convert " .. lwimgfullname @@ -4172,7 +4252,7 @@ end -- createwindowsimage function createonelateximage ( line ) -- --- Given the next line of lateximages.txt, convert a single image. +-- Given the next line of <sourcename>.txt, convert a single image. -- -- lwimgpage is the page number in the PDF which has the image -- lwimghash is true if this filename is a hash @@ -4185,7 +4265,7 @@ if ( (i~=nil) ) then pagezerowarning = true else -- Skip is this image is hashed and already exists: - local lwimgfullname = "lateximages" .. dirslash .. lwimgname .. ".svg" + local lwimgfullname = imagesdirectory .. dirslash .. lwimgname .. ".svg" if ( (lwimghash ~= "true") or (lfs.attributes(lwimgfullname,"mode")==nil) -- file not exists @@ -4211,7 +4291,7 @@ end -- createonelateximage function createlateximages () -- --- Create lateximages based on lateximages.txt: +-- Create lateximages based on <sourcename>.txt: -- -- See if the document must be recompiled first: checklimages () @@ -4219,13 +4299,13 @@ checklimages () checkhtmlpdfexists () -- Attempt to create the lateximages: print ("lwarpmk: Creating lateximages.") -local limagesfile = io.open("lateximages.txt", "r") +local limagesfile = io.open(sourcename .. "-images.txt", "r") if ( limagesfile == nil ) then - warnlateximages () + warnlimages () os.exit(1) end -- Create the lateximages directory, ignore error if already exists -err = os.execute("mkdir lateximages") +err = os.execute("mkdir " .. imagesdirectory) -- For Windows, create lwarp_one_limage.cmd from lwarp_one_limage.txt: if opsystem=="Windows" then executecheckerror ( @@ -4237,7 +4317,7 @@ end -- create lwarp_one_limage.cmd numimageprocesses = 0 -- Track warning to recompile if find a page 0 pagezerowarning = false --- Scan lateximages.txt +-- Scan <sourcename>.txt for line in limagesfile:lines() do createonelateximage ( line ) end -- do @@ -4435,7 +4515,7 @@ os.execute(glossarycmd .. " " .. sourcename .. "_html") updateanddone () -- lwarpmk limages: --- Scan the lateximages.txt file to create lateximages. +-- Scan the <sourcename>.txt file to create lateximages. elseif arg[1] == "limages" then loadconf () @@ -4473,11 +4553,11 @@ os.execute ( rmname .. " " .. print ("lwarpmk: Done.") -- lwarpmk cleanlimages --- Remove images from the lateximages directory. +-- Remove images from the imagesdirectory. elseif arg[1] == "cleanlimages" then loadconf () -os.execute ( rmname .. " lateximages/*" ) +os.execute ( rmname .. " " .. imagesdirectory .. dirslash .. "*" ) print ("lwarpmk: Done.") -- lwarpmk epstopdf <list of file names> @@ -4546,7 +4626,6 @@ end -- not --version - \newcommand*{\LWR@closedepthone}{\LWR@depthnone}% top of the stack \newcommand*{\LWR@closedepthtwo}{\LWR@depthnone} \newcommand*{\LWR@closedepththree}{\LWR@depthnone} @@ -4621,10 +4700,13 @@ end -- not --version \begin{warpHTML} \NewDocumentCommand{\LWR@setexparray}{m m m}{% + \begingroup% + \let\par\relax% \xdef\LWR@thisexparrayname{#1#2}% \ifstrempty{#3}% {\csgdef{\LWR@thisexparrayname}{}}% {\csxdef{\LWR@thisexparrayname}{#3}}% + \endgroup% } \newcommand*{\LWR@getexparray}[2]{% \@nameuse{#1#2}% @@ -4672,21 +4754,6 @@ end -- not --version \begin{warpHTML} -\newcommand*{\LWR@sanitized}{} - -\newcommand*{\LWR@sanitize}[1]{% -\LWR@traceinfo{LWR@sanitize: !#1!}% -\edef\LWR@sanitized{#1}% -\LWR@traceinfo{LWR@sanitize expanded: !\LWR@sanitized!}% -\edef\LWR@sanitized{\detokenize\expandafter{\LWR@sanitized}}% -\LWR@traceinfo{LWR@sanitize result: !\LWR@sanitized!}% -} - -\end{warpHTML} - - -\begin{warpHTML} - \let\LWR@origampersand\& \newcommand*{\HTMLentity}[1]{% \begingroup% @@ -4699,10 +4766,10 @@ end -- not --version \renewrobustcmd*{\&}{\HTMLentity{amp}} \let\LWR@origtextless\textless -\renewcommand*{\textless}{\HTMLentity{lt}} +\renewrobustcmd*{\textless}{\HTMLentity{lt}} \let\LWR@origtextgreater\textgreater -\renewcommand*{\textgreater}{\HTMLentity{gt}} +\renewrobustcmd*{\textgreater}{\HTMLentity{gt}} \end{warpHTML} @@ -4731,33 +4798,35 @@ end -- not --version \newcommand*{\LWR@htmlsectionfilename}[1]{% \LWR@traceinfo{LWR@htmlsectionfilename A !\detokenize{#1}!}% -\edef\LWR@tempone{#1}% +\LWR@sanitize{#1}% \LWR@traceinfo{about to compare with ??}% -\ifthenelse{\equal{\LWR@tempone}{??}}% +\ifthenelse{\equal{\LWR@sanitized}{??}}% {\LWR@traceinfo{found ??}}% {\LWR@traceinfo{not found ??}}% \LWR@traceinfo{about to compare with zero or empty}% \ifthenelse{% - \equal{\LWR@tempone}{0}% - \OR \equal{\LWR@tempone}{}% - \OR \equal{\LWR@tempone}{??}% + \equal{\LWR@sanitized}{0}% + \OR \equal{\LWR@sanitized}{}% + \OR \equal{\LWR@sanitized}{??}% }% {% \LWR@traceinfo{LWR@htmlsectionfilename B \HomeHTMLFilename.html}% \HomeHTMLFilename.html% }% {% - \LWR@traceinfo{LWR@htmlsectionfilename C \LWR@tempone}% + \LWR@traceinfo{LWR@htmlsectionfilename C \LWR@sanitized}% \ifthenelse{% \equal{\HTMLFilename}{} \AND - \equal{\LWR@tempone}{Index} \OR - \equal{\LWR@tempone}{index}% + \equal{\LWR@sanitized}{Index} \OR + \equal{\LWR@sanitized}{index}% }% {% \LWR@traceinfo{Prefixing the index name with an underscore.}% - \_#1.html% + \_\LWR@sanitized.html% + }% + {% + \HTMLFilename\LWR@isolate{\LWR@sanitized}.html% }% - {\HTMLFilename\LWR@isolate{#1}.html}% }% \LWR@traceinfo{LWR@htmlsectionfilename Z}% } @@ -4792,13 +4861,17 @@ end -- not --version \AtBeginDocument{ \@ifundefined{hyperref}{ - \newcommand*{\LinkHome}{\linkhomename\ --- page \pageref{page-LWRfirstpage}} + \newcommand*{\LinkHome}{% + \linkhomename\ --- page \pageref{\BaseJobname-page-LWRfirstpage}% + } }{ - \newcommand*{\LinkHome}{\hyperref[page-LWRfirstpage]{\linkhomename}} + \newcommand*{\LinkHome}{% + \hyperref[\BaseJobname-page-LWRfirstpage]{\linkhomename}% + } } } -\AfterEndPreamble{\label{page-LWRfirstpage}} +\AfterEndPreamble{\label{\BaseJobname-page-LWRfirstpage}} \end{warpprint} @@ -4958,6 +5031,10 @@ end -- not --version }% } +\newcommand*{\LWR@indentHTML}{% + \LWR@orignewline\LWR@origrule{2em}{0pt}% +} + \newcommand*{\LWR@htmltagc}[1]{% \LWR@traceinfo{LWR@htmltagc !\detokenize{#1}!}% @@ -5073,13 +5150,16 @@ end -- not --version \LWR@traceinfo{LWR@subhtmlelementclass !#1!#2!#3!}% \ifblank{#2}% {% empty option - \LWR@htmltag{#1 class=\textquotedbl#3\textquotedbl}% -}% -{% non-empty option \LWR@htmltag{% #1 % space class=\textquotedbl#3\textquotedbl\ % space - style=\textquotedbl#2\textquotedbl% + }% +}% +{% non-empty option + \LWR@htmltag{% + #1\LWR@indentHTML% + class=\textquotedbl#3\textquotedbl\LWR@indentHTML% + style=\textquotedbl#2\textquotedbl\LWR@orignewline% }% }% \LWR@traceinfo{LWR@subhtmlelementclass done}% @@ -5269,7 +5349,7 @@ end -- not --version {}% no nested par tags {% yes nest par tags \PN@parnotes@auto% - \LWR@htmltagc{\LWR@tagregularparagraph}% + \LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline% \global\booltrue{LWR@doingapar}% \let\par\LWR@closeparagraph% }% end of yes nest par tags @@ -5277,6 +5357,17 @@ end -- not --version {}% not handling pars } +\newcommand*{\LWR@closeparagraph@br} +{% + \ifboolexpr{ + test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} and + test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} and + not bool {LWR@intabularmetadata} + }% + {\unskip\LWR@htmltagc{br /}}% + {}% +} + \newcommand*{\LWR@closeparagraph} {% \ifbool{LWR@doingapar}% @@ -5286,15 +5377,10 @@ end -- not --version test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} }% {% no nested par tags - \ifboolexpr{ - test {\ifnumcomp{\value{LWR@spandepth}}{>}{0}} and - test {\ifnumcomp{\value{LWR@lateximagedepth}}{=}{0}} - }% - {\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}}% - {}% + \LWR@closeparagraph@br% }% no nested par tags {% yes nest par tags - \unskip% + \leavevmode\LWR@orignewline% \LWR@htmltagc{/\LWR@tagregularparagraph}% \LWR@orignewline% \global\boolfalse{LWR@doingapar}% @@ -5303,9 +5389,7 @@ end -- not --version }% end of yes nest par tags }% end of handling pars {% not handling pars - \ifnumcomp{\value{LWR@spandepth}}{>}{0}% - {\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}}% - {}% + \LWR@closeparagraph@br% }% not handling pars \ifboolexpr{% not bool {LWR@doingapar} and @@ -5353,7 +5437,7 @@ end -- not --version {% \ifbool{LWR@doingapar}% {% - \unskip% + \leavevmode\LWR@orignewline% \LWR@htmltagc{/\LWR@tagregularparagraph}% \LWR@orignewline% \global\boolfalse{LWR@doingapar}% @@ -5371,6 +5455,16 @@ end -- not --version \end{warpHTML} +\begin{warpHTML} + +\AtBeginDocument{ +\def\@afterindentfalse{\let\if@afterindent\iffalse} +\@afterindentfalse +} +\let\LWR@afterindent@syntaxhighlight\fi% syntax highlighting + +\end{warpHTML} + \begin{warpall} @@ -5465,7 +5559,7 @@ end -- not --version \cnttest{\value{LWR@lateximagedepth}}{=}{0}% }% {}% - {\LWR@htmltagc{\LWR@tagregularparagraph}}% + {\LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline}% \@makefntext{#1}% \ifthenelse{% \boolean{LWR@doingstartpars} \AND% @@ -5498,7 +5592,7 @@ end -- not --version \cnttest{\value{LWR@lateximagedepth}}{=}{0}% }% {}% - {\LWR@htmltagc{\LWR@tagregularparagraph}}% + {\LWR@htmltagc{\LWR@tagregularparagraph}\LWR@orignewline}% \@makefntext{% \ignorespaces#1% }% @@ -5592,85 +5686,113 @@ end -- not --version \newbool{CombineHigherDepths} \booltrue{CombineHigherDepths} +\newcommand*{\FilenameLimit}{80} + \end{warpall} \begin{warpHTML} -\newcommand*{\LWR@thisfilename}{} +\AtBeginDocument{ +\ifbool{FileSectionNames}% + {\newcommand*{\LWR@thisfilename}{\HomeHTMLFilename}} + {\newcommand*{\LWR@thisfilename}{0}} +} \newcommand*{\LWR@thisnewfilename}{} +\NewDocumentCommand{\LWR@simplifyname}{s m}{% +\IfBooleanTF{#1}{% + \StrSubstitute{\LWR@thisnewfilename}% + {\detokenize{#2}}% + {\detokenize{-}}[\LWR@thisnewfilename]% +}{% + \StrSubstitute{\LWR@thisnewfilename}% + {#2}% + {\detokenize{-}}[\LWR@thisnewfilename]% +} +} + \newcommand*{\LWR@filenamenoblanks}[1]{% \begingroup \LWR@nullfonts% \renewcommand*{\LWR@htmltagc}[1]{}% \edef\LWR@thisnewfilename{#1}% +\RenewDocumentCommand{\LWR@subsingledollar}{s m m m}{}% +\LWR@simplifyname{\_} +\LWR@simplifyname{\#} +\LWR@simplifyname{\textbackslash} +\LWR@simplifyname{\protect} +\LWR@simplifyname{\ } +\LWR@simplifyname{<} +\LWR@simplifyname{>} +\LWR@simplifyname{\textless} +\LWR@simplifyname{\textgreater} +\edef\LWR@thisnewfilename{\detokenize\expandafter{\LWR@thisnewfilename}}% \LWR@traceinfo{LWR@filenamenoblanks edef: !\LWR@thisnewfilename!}% \fullexpandarg% -\StrSubstitute{\LWR@thisnewfilename}{\ }{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{ }{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{'}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}% - {\LWR@origampersand}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{+}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{,}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{/}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{:}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{;}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{=}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{?}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{@}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{"}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}% - {\textless}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}% - {\textgreater}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\LWR@origpound}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\_}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\%}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\{}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{\}}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{|}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}% - {\textbackslash}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{^}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{~}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{~{}}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{[}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{]}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{`}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-s-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-S-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-a-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-A-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-an-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-AN-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-to-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-TO-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-by-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-BY-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-of-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-OF-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-and-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-AND-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-for-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-FOR-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-the-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-THE-}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{-----}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{----}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{---}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{--}{-}[\LWR@thisnewfilename] +\LWR@simplifyname*{ } +\LWR@simplifyname*{!} +\LWR@simplifyname*{,} +\LWR@simplifyname*{'} +\LWR@simplifyname*{+} +\LWR@simplifyname*{,} +\LWR@simplifyname*{/} +\LWR@simplifyname*{:} +\LWR@simplifyname*{;} +\LWR@simplifyname*{=} +\LWR@simplifyname*{?} +\LWR@simplifyname*{@} +\LWR@simplifyname*{^} +\LWR@simplifyname*{&} +\LWR@simplifyname*{"} +\LWR@simplifyname*{<} +\LWR@simplifyname*{>} +\LWR@simplifyname{\LWRbackslash} +\LWR@simplifyname{\LWRleftbrace} +\LWR@simplifyname{\LWRrightbrace} +\LWR@simplifyname{\LWRpercent} +\LWR@simplifyname{\LWRdollar} +\LWR@simplifyname*{|} +\LWR@simplifyname*{^} +\LWR@simplifyname*{~} +\LWR@simplifyname*{[} +\LWR@simplifyname*{]} +\LWR@simplifyname*{`} +\LWR@simplifyname*{-s-} +\LWR@simplifyname*{-S-} +\LWR@simplifyname*{-a-} +\LWR@simplifyname*{-A-} +\LWR@simplifyname*{-an-} +\LWR@simplifyname*{-AN-} +\LWR@simplifyname*{-to-} +\LWR@simplifyname*{-TO-} +\LWR@simplifyname*{-by-} +\LWR@simplifyname*{-BY-} +\LWR@simplifyname*{-of-} +\LWR@simplifyname*{-OF-} +\LWR@simplifyname*{-and-} +\LWR@simplifyname*{-AND-} +\LWR@simplifyname*{-for-} +\LWR@simplifyname*{-FOR-} +\LWR@simplifyname*{-the-} +\LWR@simplifyname*{-THE-} +\LWR@simplifyname*{-----} +\LWR@simplifyname*{----} +\LWR@simplifyname*{---} +\LWR@simplifyname*{--} \ifPDFTeX% pdflatex or dvi latex \ifdefstring{\inputencodingname}{utf8}{% -\StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] +\LWR@simplifyname*{—} +\LWR@simplifyname*{–} }{}% \else% not PDFTeX -\StrSubstitute{\LWR@thisnewfilename}{—}{-}[\LWR@thisnewfilename] -\StrSubstitute{\LWR@thisnewfilename}{–}{-}[\LWR@thisnewfilename] +\LWR@simplifyname*{—} +\LWR@simplifyname*{–} \fi% +\IfEndWith{\LWR@thisnewfilename}{\detokenize{-}}{% + \StrGobbleRight{\LWR@thisnewfilename}{1}[\LWR@thisnewfilename]% +}{}% +\StrLeft{\LWR@thisnewfilename}{\FilenameLimit}[\LWR@thisnewfilename]% \global\let\LWR@thisfilename\LWR@thisnewfilename% \endgroup% \LWR@traceinfo{LWR@filenamenoblanks: result is \LWR@thisfilename}% @@ -5733,8 +5855,6 @@ end -- not --version \newcommand*{\LWR@newhtmlfile}[1]{ \LWR@traceinfo{LWR@newhtmlfile} - - \LWR@htmlelementclassend{section}{textbody} \LWR@htmlelementclassend{div}{bodycontainer} \LWR@htmlelementclassend{div}{bodyandsidetoc} @@ -5772,13 +5892,12 @@ end -- not --version { Section name ``#1'', at the line number listed below, generates the filename ``\LWR@thisfilename'', - which appears to be a duplicate% + which appears to be a duplicate. + There is a previous section with an identical or similar name.% } { - Look for another section of the same type with a similar - or identical name. - (Lwarp sanitizes most symbols and common short words - when generating file names, and this may cause a conflict.) + Lwarp sanitizes most symbols and a few common short words + when generating file names, and this may cause a conflict. } } } @@ -5894,6 +6013,7 @@ end -- not --version \let\@partcntformat\@seccntformat \newcommand*{\@partnameformat}{\LWR@isolate{\partname}~}% \newcounter{LWR@currentautosec} +\setcounter{LWR@currentautosec}{1} \DeclareDocumentCommand{\LWR@section}{m m m m}{% \LWR@traceinfo{LWR@section: starting}% \LWR@stoppars% @@ -5936,7 +6056,6 @@ end -- not --version \LWR@traceinfo{LWR@section: about to LWR@setlatestname}% \IfValueTF{#2}{\LWR@setlatestname{#2}}{\LWR@setlatestname{#3}}% }% - \ifbool{HTMLDebugComments}{% \begingroup% \LWR@nullfonts% @@ -5946,10 +6065,9 @@ end -- not --version \IfNoValueTF{#2}% short TOC {\LWR@htmlcomment{Opening #4 ``#3''}}% {\LWR@htmlcomment{Opening #4 ``#2''}}% - } + }\LWR@orignewline% \endgroup% -}{}% - +}{} \ifthenelse{% \cnttest{\@nameuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}% }% @@ -6036,8 +6154,10 @@ end -- not --version \LWR@isolate{#3}% \LWR@traceinfo{LWR@section: about to close the heading tag}% \LWR@htmltag{\@nameuse{LWR@tag#4end}}% +\LWR@orignewline% \LWR@traceinfo{LWR@section: about to create the LaTeX label}% -\LWR@newautopagelabel{LWR@currentautosec}% +\setcounter{LWR@latestautopage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosec}\LWR@orignewline% \ifthenelse{% \cnttest{\@nameuse{LWR@depth#4}}{<}{\LWR@depthparagraph}% }% @@ -6321,7 +6441,7 @@ end -- not --version \linespread{1.3}% \setlength{\parindent}{0pt} \setlength{\parskip}{2ex} -\immediate\openout\LWR@lateximagesfile=lateximages.txt +\immediate\openout\LWR@lateximagesfile=\BaseJobname-images.txt \setlength{\belowcaptionskip}{0ex} \setlength{\abovecaptionskip}{0ex} \renewcommand{\ps@plain}{} @@ -6357,6 +6477,8 @@ end -- not --version \LetLtxMacro\LWR@syntaxhighlightone$% balance for editor syntax highlighting \LWR@startpars \LWR@customizeMathJax +\setcounter{LWR@latestautopage}{\value{page}}% +\LWR@newautopagelabel{LWR@currentautosec}% \LWR@traceinfo{LWR@lwarpStart: done} } \catcode`\$=3% math shift until lwarp starts @@ -8552,6 +8674,7 @@ rowspan="#2" % \global\boolfalse{LWR@emptyatbang}% \StartDefiningTabulars% \protected\gdef&{\LWR@tabularampersand}% +\booltrue{LWR@forceminipagefullwidth} \addtocounter{LWR@tabularpardepth}{1}% \LWR@traceinfo{LWR@@HTML@tabular: about to LWR@getmynexttoken}% \LWR@getmynexttoken% @@ -8616,37 +8739,36 @@ rowspan="#2" % }% } - -\zref@newlist{special} -\zref@newprop{zLWR@name}{\@currentlabelname} -\zref@newprop{zLWR@htmlfilenumber}{% -\ifbool{FileSectionNames}{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}% -}% -\zref@newprop{zLWR@lateximagedepth}{\arabic{LWR@lateximagedepth}} -\zref@newprop{zLWR@lateximagenumber}{\arabic{LWR@lateximagenumber}} -\zref@addprop{special}{zLWR@name} -\zref@addprop{special}{zLWR@htmlfilenumber} -\zref@addprop{special}{zLWR@lateximagedepth} -\zref@addprop{special}{zLWR@lateximagenumber} -\newcommand*{\LWR@spref}[2]{% -\zref@extractdefault{#1}{#2}{??}% -} +\def\LWR@setref#1#2#3{% + \ifx#1\relax% + ??% + \else% + \expandafter#2#1% + \fi} \newcommand*{\LWR@nameref}[1]{% -\LWR@spref{#1}{zLWR@name}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@firstoffour{#1}% } \newcommand*{\LWR@htmlfileref}[1]{% -\LWR@spref{#1}{zLWR@htmlfilenumber}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@secondoffour{#1}% } \newcommand*{\LWR@lateximagedepthref}[1]{% -\LWR@spref{#1}{zLWR@lateximagedepth}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@thirdoffour{#1}% } \newcommand*{\LWR@lateximagenumberref}[1]{% -\LWR@spref{#1}{zLWR@lateximagenumber}% + \expandafter\LWR@setref\csname r@#1@lwarp\endcsname\LWR@fourthoffour{#1}% } -\newcommand*{\LWR@splabel}[1]{% -\LWR@traceinfo{LWR@splabel !#1!}% +\newcommand*{\LWR@lwarplabel}[1]{% +\LWR@traceinfo{LWR@lwarplabel !#1!}% \LWR@setlatestname{\@currentlabelname}% -\zref@labelbylist{#1}{special}% + \@bsphack% + \protected@write\@auxout{}% + {\string\newlabel{#1@lwarp}{% + {\@currentlabelname}% + {\ifbool{FileSectionNames}{\LWR@thisfilename}{\arabic{LWR@htmlfilenumber}}}% + {\arabic{LWR@lateximagedepth}}% + {\arabic{LWR@lateximagenumber}}% + }}% + \@esphack% } @@ -8680,7 +8802,7 @@ rowspan="#2" % \LWR@traceinfo{LWR@new@label: filesectionnames is \ifbool{FileSectionNames}{true}{false}}% \LWR@traceinfo{LWR@new@label: LWR@thisfilename is !\LWR@thisfilename!}% \LWR@traceinfo{LWR@new@label: LWR@htmlfilenumber is \arabic{LWR@htmlfilenumber}}% -\LWR@splabel{#2}% +\LWR@lwarplabel{#2}% \LWR@sublabel{#2}% \LWR@traceinfo{LWR@new@label: done}% } @@ -8688,7 +8810,6 @@ rowspan="#2" % \newcommand*{\LWR@startref}[1] {% -\edef\LWR@lidref{\LWR@lateximagedepthref{#1}}% \LWR@sanitize{#1}% \LWR@traceinfo{LWR@startref A: !#1!}% \LWR@htmltag{a href="% @@ -8697,17 +8818,15 @@ rowspan="#2" % \LWR@traceinfo{LWR@startref C}% \LWR@origpound% \LWR@traceinfo{LWR@startref D: !#1!}% -\ifthenelse{\equal{\LWR@lidref}{??}}% +\ifcsundef{r@#1@lwarp}% {% \LWR@traceinfo{LWR@startref D0: ??}% ??% }% {% - \LWR@traceinfo{LWR@startref D1: \LWR@lidref}% - \ifthenelse{\cnttest{\LWR@lidref}{>}{0}}% + \ifthenelse{\cnttest{\LWR@lateximagedepthref{#1}}{>}{0}}% {% - \LWR@traceinfo{LWR@startref D2: \LWR@lidref}% - lateximage\LWR@lateximagenumberref{#1}% + \LWR@ImagesName\LWR@lateximagenumberref{#1}% }% {% \LWR@traceinfo{LWR@startref D3}% @@ -8770,8 +8889,8 @@ autopage-\theLWR@currentautosec% \LWR@traceinfo{LWR@subhyperref !#1!}% \LWR@sanitize{#1}% \LWR@htmltag{% - a href="\LWR@sanitized" % - target="\_{}blank"\LWR@orignewline% + a href="\LWR@sanitized" % space + target="\_{}blank" % space }% } @@ -8783,12 +8902,11 @@ autopage-\theLWR@currentautosec% \NewDocumentCommand{\LWR@subhyperrefclass}{m +m m}{% \LWR@htmltag{% - a href="% - \begingroup\@sanitize#1\endgroup% - " % - class="#3"\LWR@orignewline% -}% -#2% + a % space + href="\begingroup\@sanitize#1\endgroup" % space + class="#3" % space +}\LWR@orignewline% +#2\LWR@orignewline% \LWR@htmltag{/a}% \LWR@ensuredoingapar% } @@ -8848,8 +8966,22 @@ autopage-\theLWR@currentautosec% \newcommand*{\LWR@subinlineimage}[5][]{% \ifblank{#1}% -{\LWR@htmltag{img src="#3.#4" alt="#3" style="#5" class="#2"}}% -{\LWR@htmltag{img src="#3.#4" alt="#1" style="#5" class="#2"}}% +{% + \LWR@htmltag{img \LWR@indentHTML + src="#3.#4" \LWR@indentHTML + alt="#3" \LWR@indentHTML + style="#5" \LWR@indentHTML + class="#2" \LWR@orignewline + }% +}% +{% + \LWR@htmltag{img \LWR@indentHTML + src="#3.#4" \LWR@indentHTML + alt="#1" \LWR@indentHTML + style="#5" \LWR@indentHTML + class="#2" \LWR@orignewline + }% +}% } \end{warpHTML} @@ -8970,8 +9102,8 @@ autopage-\theLWR@currentautosec% \newcounter{LWR@nextautoid} \newcounter{LWR@nextautopage} \newcommand*{\LWRsetnextfloat}[2]{% -\setcounter{LWR@nextautopage}{#1}% -\setcounter{LWR@nextautoid}{#2}% + \setcounter{LWR@nextautopage}{#1}% + \setcounter{LWR@nextautoid}{#2}% } \newcounter{LWR@latestautopage} @@ -9343,8 +9475,12 @@ autopage-\theLWR@currentautosec% } \newcommand{\hyperindexref}[1]{% -\IfInteger{#1}% - {\LWR@indexnameref{#1}}% +\def\LWR@tempone{#1}% +\IfBeginWith{\LWR@tempone}{ }{% + \StrGobbleLeft{\LWR@tempone}{1}[\LWR@tempone]% +}{}% +\IfInteger{\LWR@tempone}% + {\LWR@indexnameref{\LWR@tempone}}% {% \begingroup% \LWR@hyperindexrefnullified @@ -10186,11 +10322,15 @@ autopage-\theLWR@currentautosec% \LWR@ensuredoingapar% \addtocounter{LWR@externalfilecnt}{1}% \LWR@traceinfo{lateximage: LWR@externalfilecnt is \arabic{LWR@externalfilecnt}}% - \setcounterpageref{LWR@LIpage}{LWRlateximage\arabic{LWR@lateximagenumber}}% + \setcounterpageref{LWR@LIpage}{% + LWRlateximage-\BaseJobname-\arabic{LWR@lateximagenumber}% + }% \LWR@traceinfo{lateximage: LWR@LIpage is \arabic{LWR@LIpage}}% - \LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" % extra space - class="lateximagesource"}% - \LWR@traceinfo{lateximage: about to write to lateximages.txt}% + \LWR@htmltag{span\LWR@indentHTML% + id="lateximage-\BaseJobname-\arabic{LWR@lateximagenumber}"\LWR@indentHTML + class="lateximagesource"\LWR@orignewline + }% + \LWR@traceinfo{lateximage: about to write to \BaseJobname-images.txt}% \IfBooleanTF{#1}% starred {% hash \LWR@traceinfo{lateximage: hash true, adding % @@ -10206,7 +10346,7 @@ autopage-\theLWR@currentautosec% {% no hash \LWR@traceinfo{lateximage: hash false}% \immediate\write\LWR@lateximagesfile{% - |\arabic{LWR@LIpage}|false|lateximage-\arabic{LWR@externalfilecnt}|% + |\arabic{LWR@LIpage}|false|\LWR@ImagesName\arabic{LWR@externalfilecnt}|% }% }% no hash \LWR@traceinfo{lateximage: about to create open comment}% @@ -10223,7 +10363,7 @@ autopage-\theLWR@currentautosec% \def\thempfn{\thefootnote}% \LetLtxMacro\@footnotetext\LWR@footnotetext% \LWR@traceinfo{lateximage: about to create label}% - \LWR@orig@label{LWRlateximage\arabic{LWR@lateximagenumber}}% + \LWR@orig@label{LWRlateximage-\BaseJobname-\arabic{LWR@lateximagenumber}}% \LWR@traceinfo{lateximage: finished creating the label}% \LetLtxMacro$\LWR@origdollar% \catcode`\$=3% math shift @@ -10262,15 +10402,15 @@ autopage-\theLWR@currentautosec% {% hash \LWR@subinlineimage[#2]{lateximage}% {% - lateximages\OSPathSymbol% + \LWR@ImagesDirectory\OSPathSymbol% \LWR@print@mbox{\LWR@hashedname}% }{svg}{#4}% }% hash {% no hash \LWR@subinlineimage[#2]{lateximage}% {% - lateximages\OSPathSymbol% - \LWR@print@mbox{lateximage-\theLWR@externalfilecnt}% + \LWR@ImagesDirectory\OSPathSymbol% + \LWR@print@mbox{\LWR@ImagesName\theLWR@externalfilecnt}% }{svg}{#4}% }% no hash \LWR@ensuredoingapar% @@ -10668,10 +10808,16 @@ autopage-\theLWR@currentautosec% \newlength{\LWR@minipageheight} \newbool{LWR@minipagefullwidth} \boolfalse{LWR@minipagefullwidth} -\newcommand*{\minipagefullwidth}{\booltrue{LWR@minipagefullwidth}} +\newbool{LWR@forceminipagefullwidth} +\boolfalse{LWR@forceminipagefullwidth} +\newcommand*{\minipagefullwidth}{\global\booltrue{LWR@minipagefullwidth}} +\newcommand*{\UseMinipageWidths}{\boolfalse{LWR@forceminipagefullwidth}} +\newcommand*{\IgnoreMinipageWidths}{\booltrue{LWR@forceminipagefullwidth}} \end{warpHTML} \begin{warpprint} \newcommand*{\minipagefullwidth}{} +\newcommand*{\UseMinipageWidths}{} +\newcommand*{\IgnoreMinipageWidths}{} \end{warpprint} \begin{warpHTML} \newbool{LWR@minipagethispar} @@ -10714,11 +10860,15 @@ autopage-\theLWR@currentautosec% \ifthenelse{\equal{#3}{s}}{\LWR@print@mbox{justify-content:space-between} ; }{}% \LWR@traceinfo{minipage: about to print the width of \LWR@printlength{\LWR@minipagewidth}}% \ifbool{LWR@minipagefullwidth}% -{\boolfalse{LWR@minipagefullwidth}}% +{\global\boolfalse{LWR@minipagefullwidth}}% {% - \ifthenelse{\lengthtest{#4}=\linewidth}% - {}% - {width:\LWR@printlength{\LWR@minipagewidth} ; }% + \ifbool{LWR@forceminipagefullwidth}% + {}% + {% + \ifthenelse{\lengthtest{#4}=\linewidth}% + {}% + {width:\LWR@printlength{\LWR@minipagewidth} ; }% + }% }% \LWR@traceinfo{minipage: about to print the height}% \ifblank{#2}{}{height:\LWR@printlength{\LWR@minipageheight} ; }% @@ -10821,16 +10971,18 @@ autopage-\theLWR@currentautosec% {}% } -\newcommand*{\LWR@blackborderpadding}{% -border:\LWR@printlength{\LWR@atleastonept} solid black ; % -padding:\LWR@printlength{\fboxsep}% +\newcommand*{\LWR@fboxstyle}{% +\LWR@findcurrenttextcolor% +border:\LWR@printlength{\LWR@atleastonept} solid \LWR@origpound\LWR@tempcolor ; % +padding:\LWR@printlength{\fboxsep} ; % +color:\LWR@origpound\LWR@tempcolor% } \newcommand{\LWR@HTML@fbox}[1]{% \LWR@traceinfo{HTML fbox}% \LWR@forceminwidth{\fboxrule}% \InlineClass[% -\LWR@blackborderpadding% -]{fbox}{#1} +\LWR@fboxstyle% +]{fbox}{#1}% } \AtBeginDocument{\LWR@formatted{fbox}} \end{warpHTML} @@ -10841,7 +10993,7 @@ padding:\LWR@printlength{\fboxsep}% \newcommand{\LWR@HTML@fboxBlock}[1]{% \LWR@forceminwidth{\fboxrule}% \begin{BlockClass}[% -\LWR@blackborderpadding% +\LWR@fboxstyle% ]{fboxBlock} #1 \end{BlockClass} @@ -10889,7 +11041,7 @@ padding:\LWR@printlength{\fboxsep}% \IfValueT{#2}{\setlength{\LWR@tempheight}{#2}}% \LWR@stoppars% \begin{BlockClass}[% -\LWR@blackborderpadding ; % +\LWR@fboxstyle ; % \IfValueT{#2}{height:\LWR@printlength{\LWR@tempheight} ; }% width:\LWR@printlength{\LWR@tempwidth}% ]{fminipage}% @@ -11054,6 +11206,7 @@ width:\LWR@printlength{\LWR@tempwidth}% \DeclareRobustCommand{\LWR@null@normalfont}{} \DeclareRobustCommand{\LWR@null@em}{} +\catcode`\$=\active% redefining $ below \newcommand*{\LWR@nullfonts}{% \LetLtxMacro\emph\LWR@null@emph% \LetLtxMacro\textmd\LWR@null@textmd% @@ -11094,9 +11247,24 @@ width:\LWR@printlength{\LWR@tempwidth}% \def\(##1\){}% \def\[##1\]{}% \RenewDocumentCommand{\LWR@subsingledollar}{s m m m}{}% +\protected\def$##1${}% +\renewcommand*{\TeX}{TeX}% +\renewcommand*{\LaTeX}{LaTeX}% +\renewcommand*{\LaTeXe}{LaTeX2e}% +\renewcommand*{\LuaTeX}{LuaTeX}% +\renewcommand*{\LuaLaTeX}{LuaLaTeX}% +\renewcommand*{\XeTeX}{XeTeX}% +\renewcommand*{\XeLaTeX}{XeLaTeX}% +\renewcommand*{\ConTeXt}{ConTeXt}% +\renewcommand*{\BibTeX}{BibTeX}% +\renewcommand*{\MakeIndex}{MakeIndex}% +\renewcommand*{\AmS}{AmS}% +\renewcommand*{\MiKTeX}{MiKTeX}% +\renewcommand*{\LyX}{LyX}% \let\texorpdfstring\relax% \newcommand{\texorpdfstring}[2]{##2}% } +\catcode`\$=3% \newcommand*{\LWR@f@family}{rm} @@ -11197,7 +11365,7 @@ width:\LWR@printlength{\LWR@tempwidth}% \newcommand*{\LWR@tempcolor}{} \newcommand*{\LWR@tempcolortwo}{} \newcommand*{\LWR@findcurrenttextcolor}{% -\renewcommand{\LWR@tempcolor}{black}% +\renewcommand{\LWR@tempcolor}{000000}% } \NewDocumentCommand{\LWR@textcurrentcolor}{m}{% \renewcommand*{\LWR@currenttextcolor}{black}% @@ -11386,7 +11554,7 @@ width:\LWR@printlength{\LWR@tempwidth}% \LWR@minipagestoppars% \LWR@findcurrenttextcolor% \LWR@htmltagc{% - span + span\LWR@indentHTML% style="% \ifbool{FormatWP}{}{background:\LWR@currenttextcolor ; }% width:\LWR@printlength{\LWR@tempwidth} ; % @@ -11396,15 +11564,15 @@ width:\LWR@printlength{\LWR@tempwidth}% {% \setlength{\LWR@tempraise}{0pt-#1}% \setlength{\LWR@tempraise}{\LWR@tempraise*2}% - \LWR@orignewline% + \LWR@indentHTML% -ms-transform: translate(0pt,\LWR@printlength{\LWR@tempraise}); % - \LWR@orignewline% + \LWR@indentHTML% -webkit-transform: translate(0pt,\LWR@printlength{\LWR@tempraise}); % - \LWR@orignewline% + \LWR@indentHTML% transform: translate(0pt,\LWR@printlength{\LWR@tempraise}); % - \LWR@orignewline% + \LWR@indentHTML% }% - display:inline-block;"% + display:inline-block;"\LWR@orignewline% }% \ifbool{FormatWP}{% \setlength{\LWR@templengthone}{\LWR@tempwidth}% @@ -11639,6 +11807,25 @@ width:\LWR@printlength{\LWR@tempwidth}% }{} } \end{warpHTML} +\begin{warpHTML} +\AtBeginDocument{ +\@ifpackageloaded{kotexutf}{% + \def\LWR@kotexutf@setref#1#2#3{% + \@setref@dhucs@orig{#1}{#2}{#3}% + \ifx#1\relax\else + \bgroup + \dhucs@make@cjkchar@null + \edef\@temp{\expandafter#2#1}\global\josatoks\expandafter{\@temp}% + \egroup + \fi% + }% + + \ifdefequal{\@setref}{\LWR@kotexutf@setref}{ + \let\@setref\@setref@dhucs@orig + }{} +}{} +} +\end{warpHTML} \endinput %% %% End of file `lwarp.sty'. |