Thursday, September 11, 2014

Embedding BASE-14 Fonts in PDF from Latex output

By looking into the fonts pane of the  properties of a PDF File with Adobe Acrobat Reader you see, whether all fonts are embedded or not.

Initially I followed this little Tutorial to set the options right:

http://www.hamilton.ie/gavinmc/docs/timesinpdfs.html

However, one configuration entry was still missing to get everything embedded in a Miktex Windows environment:
-dPDFSETTINGS=/prepress

Finally, I print to pdf with the following flags using GPL Ghostscript 9.14:

-dPDFSETTINGS=/prepress  -dCompatibilityLevel=1.3 -dHaveTrueTypes=true -dEmbedAllFonts=true -sPAPERSIZE=a4 -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile="%bm.pdf" -c save pop -f "%bm.ps"

(%bm.pdf are just wildards for document names of texnic center)

Thanks to Georg for sending me his options and giving me the important hint!

Wednesday, September 10, 2014

Myth about [T1]{fontenc}

http://tex.stackexchange.com/questions/664/why-should-i-use-usepackaget1fontenc

! LaTeX Error: Command \iint already defined. Problem between pxfonts and other package e.g. amsmath

Problem cause:
The included packages have the same commands defined instead of redefined.
The solution here was simply to load amsmath first and afterwards pxfonts:


\usepackage[intlimits]{amsmath}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{pxfonts}


However, this might generate the problem, that your entire document text changes.
In my case I just wanted to have fixed/monofont inside the lstlistings.
For that I got rid of the general usepackage and did the following in my lstlisting setup:

basicstyle=\fontfamily{pxtt}\selectfont

Monday, September 1, 2014

Cannot run batch file with double click (Windows 8) (*.bat)

All you have to do is open the registry and delete this key:

"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.BAT\UserChoice"

Done.

Taken from here