13.11.2015 Views

my Latex and Tex4ht cheat sheet

my Latex cheat sheet - 12000.org

my Latex cheat sheet - 12000.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

So what will happen now, is if the file was img.eps, then pdflatex will convert it to pdf automatically <strong>and</strong><br />

use the img.pdf file for the graphics. htlatex see the eps file <strong>and</strong> is happy.<br />

So rule of thumb: If it was img.png, convert to eps first to make htlatex happy. If it was .eps, then include<br />

the above packages to make pdflatex happy. And always leave the extension off the image name in the latex file<br />

as above.<br />

It will be better to generate .eps image to start with from the app which created the images if possible, so do<br />

not have to remember to convert them each time to eps, But if not, do the above.<br />

3.21 adding white space<br />

tex4ht does not support \quad or \qquad out of the box, as it generates normal spaces in HTML for these which<br />

will be collapsed to single space. Replace this by something such as \hspace{5mm}<br />

Another work around is found here<br />

http://comments.gmane.org/gmane.comp.tex.tex4ht/86<br />

3.22 Avoid vref<br />

Watch out. Do not use \vref, <strong>and</strong> replace with \ref. Using \vref caused me many hours trying to find out<br />

why the document was cut off in HTML. <strong>Tex4ht</strong> does not work with \vref <strong>and</strong> will cause many problems. As<br />

of texlive 2014<br />

3.23 Where are the 4ht files located?<br />

They are in /usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/*.4ht<br />

3.24 Where is tex4ht.env located ?<br />

This file is in /usr/local/texlive/2014/texmf-dist/tex4ht/base/unix/tex4ht.env<br />

3.25 Patch for report style<br />

added August 10, 2014<br />

There is a bug in tex4ht as of texlive 2014. When using report style the table of content shows section even<br />

if told not to.<br />

Use the patch shown in this link. Edit your report.4ht by the patch shown<br />

here<br />

The report.4ht file is located in<br />

/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/report.4ht<br />

This is until the fix is added to texlive.<br />

Note: The above only work if the HTML page is not split. If you are splitting it, then the bug is stil there<br />

<strong>and</strong> not fixed.<br />

3.26 Watch out for Verbatim frame not showing in Chrome<br />

added August 14, 2014<br />

To add frame around Verbatim, the framerule must be used to force the frame thickness to be at least<br />

0.8pt else it will not show in Chrome. (Thanks for Michal Hoftich for finding why the frame was not showing in<br />

Chrome).<br />

So to use a frame <strong>and</strong> having it show in all three major browsers, use something as follows (until Chrome<br />

can h<strong>and</strong>le all rule thickness.<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!