I googled around, and did not see something about this. I just found out that one gets an error using mdframed with tex4ht.
\documentclass{article}%
\usepackage{mdframed}
\begin{document}
\begin{mdframed}
text
\end{mdframed}
\end{document}
htlatex foo.tex
gives
(/usr/local/texlive/2013/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2013/texmf-dist/tex/latex/latexconfig/graphics.cfg))
! LaTeX Error: Something's wrong--perhaps a missing \item.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \end{mdframed}
?
The above compiles with no problem using pdflatex and with latex. So it is clearly an issue with tex4ht. Strange that it compiles ok with latex foo.tex
, yet the error above says Latex Error:
Is this a known issue? Anyone knows of a workaround? I would have to try to find alternative to mdframed since I need to compile document using pdflatex and htlatex. I just needed to put a frame around large text blocks that can contain more than one paragraph. I am sure I will find other ways to do this that will also work with tex4ht.
Using texlive 2013, on Linux
Update
Text4ht also failed with packaged framed
!
\documentclass{article}%
\usepackage{framed}
\begin{document}
\begin{framed}
text
test
\end{framed}
\end{document}
htlatex foo.tex
gives
(/usr/local/texlive/2013/texmf-dist/tex/generic/tex4ht/html4-math.4ht))
(./foo.aux)
! You can't use `\prevdepth' in horizontal mode.
\nointerlineskip ->\prevdepth
-\@m \p@
l.8 \end{framed}
?
May be putting frame around text with tex4ht can not be done. Will keep trying....
latex foo.tex; tex4ht foo.tex
.) That said, I don't get text in a framed box either. (But I do get a usablehtml
file.)htlatex foo.tex
that is the one I use. Sorry I wrotetex4ht
there, since the tag was tex4ht. I'll correct.\fbox{\parbox{.8\textwidth}{text}}
an option? Probably one of the packages for making fancier boxes based on\fbox
should be fine, too. That allows paragraphs (but not page breaks if that's even relevant in this case) and seems to work.fbox
solution does not work. I tried that before. If you look at the HTML generated, you will see it removed the paragraph formatting. Screen shot !Mathematica graphics the above was from this file : !Mathematica graphics so it does not really work. pdflatex produces the correct output.