Skip to content
Permalink
Browse files

allow verbatim in figure

cannot use verbatim in the argument to a macro in tex
  • Loading branch information...
Dan Gildea
Dan Gildea committed Jul 1, 2019
1 parent 633a1b3 commit db77bbcc79d5f974502df1568dcbee15af1758fb
Showing with 15 additions and 7 deletions.
  1. +1 −0 Changes
  2. +9 −6 latex2html.pin
  3. +4 −0 tests/formulas.tex
  4. +1 −1 versions/html5_0.pl
@@ -113,6 +113,7 @@
# the top.
#
#
# - allow verbatim in figure
# - output height with displaymath, center displaymath
# - enable -nouse_pdftex -image_type svg
# - fall back to unicode combining characters for accents
@@ -7138,16 +7138,17 @@ sub make_latex{
\lthtmltypeout{^^J:#1:lthtmlCropMarkHeight:=\the\lthtmlCropMarkHeight}%
\lthtmltypeout{^^J:#1:lthtmlCropMarkDepth:=\the\lthtmlCropMarkDepth:1ex:=\the \dimexpr 1ex}%
\begin{preview}\copy\lthtmlPageBox\end{preview}}%
\long\def\lthtmlTightFBox#1#2{%
\long\def\lthtmlTightFBoxA#1{\def\lthtmllabel{#1}%
\adjustnormalsize\setbox\lthtmlPageBox=\vbox\bgroup %
\let\ifinner=\iffalse \let\)\liih@math %
{\catcode`\_=8 #2}%
\bgroup\catcode`\_=8 }%
\long\def\lthtmlTightFBoxZ{\egroup
\@next\next\@currlist{}{\def\next{\voidb@x}}%
\expandafter\box\next\egroup %
\lthtmlCropMarkHeight=\ht\lthtmlPageBox \advance \lthtmlCropMarkHeight 6pt
\lthtmlCropMarkDepth=\dp\lthtmlPageBox
\lthtmltypeout{^^J:#1:lthtmlCropMarkHeight:=\the\lthtmlCropMarkHeight}%
\lthtmltypeout{^^J:#1:lthtmlCropMarkDepth:=\the\lthtmlCropMarkDepth:1ex:=\the \dimexpr 1ex}%
\lthtmltypeout{^^J:\lthtmllabel:lthtmlCropMarkHeight:=\the\lthtmlCropMarkHeight}%
\lthtmltypeout{^^J:\lthtmllabel:lthtmlCropMarkDepth:=\the\lthtmlCropMarkDepth:1ex:=\the \dimexpr 1ex}%
\begin{preview}\copy\lthtmlPageBox\end{preview}}%
\long\def\lthtmlinlinemathA#1#2\lthtmlindisplaymathZ{\lthtmlTightVBox{#1}{#2}}
\def\lthtmlinlineA#1#2\lthtmlinlineZ{\lthtmlTightVBox{#1}{#2}}
@@ -7157,8 +7158,10 @@ sub make_latex{
\long\def\lthtmldisplayA#1#2\lthtmldisplayZ{\lthtmlTightVBox{#1}{#2}}
\long\def\lthtmldisplayB#1#2\lthtmldisplayZ{\\edef\preveqno{(\theequation)}%
\lthtmlTightVBox{#1}{\let\@eqnnum\relax#2}}
\long\def\lthtmlfigureA#1#2\lthtmlfigureZ{\let\@savefreelist\@freelist
\lthtmlTightFBox{#1}{#2}\global\let\@freelist\@savefreelist}
\long\def\lthtmlfigureA#1{\let\@savefreelist\@freelist
\lthtmlTightFBoxA{#1}}
\long\def\lthtmlfigureZ{
\lthtmlTightFBoxZ\global\let\@freelist\@savefreelist}
\long\def\lthtmlpictureA#1#2\lthtmlpictureZ{\let\@savefreelist\@freelist
\lthtmlTightVBox{#1}{#2}\global\let\@freelist\@savefreelist}
</dvipng>
@@ -9,3 +9,7 @@ \section{Mathematic formulas}
And this is an inline formula: $\int_0^1 f(x)dx = F(x)|_0^1$ and
so it goes.

\begin{eqnarray}
a &=& 2(b+c) \\
&=& 2b + 2c
\end{eqnarray}
@@ -1434,7 +1434,7 @@ sub do_env_displaymath {
if (($DISP_SCALE_FACTOR)&&($DISP_SCALE_FACTOR >= 1.2 ));
($labels, $comment, $_) = &process_math_env($math_mode,$_);
if ($failed) {
$_ = &process_undefined_environment("displaymath", $id, $saved);
$_ = &process_math_in_latex("indisplay",'','',$saved);
s/^[ \t]*\n?/\n/; s/\n?[ \t]*$/\n/;
$_ = (($comment.$labels)? "$comment$labels\n":''). $_;
} else {

0 comments on commit db77bbc

Please sign in to comment.
You can’t perform that action at this time.