Feb 4 2009

Identification in PDFs

If you need to create a PDF with no embedded identification it may not be enough to simply refrain from typing your name. For example:

$ strings foo.pdf | egrep -i '(hans|fugal)'
/PTEX.FileName (./0_Users_fugalh_research_foo_fig1.pdf)
/Author (Hans Fugal)
/PTEX.FileName (./1_Users_fugalh_research_foo_fig2.pdf)
/Author (Hans Fugal)
/PTEX.FileName (./2_Users_fugalh_research_foo_fig3.pdf)
/Author (Hans Fugal)
/PTEX.FileName (./3_Users_fugalh_research_foo_fig4.pdf)
/Author (Hans Fugal)
/PTEX.FileName (./4_Users_fugalh_research_foo_fig5.pdf)
/Author (Hans Fugal)

The /PTEX lines are from pdftex and the /Author lines originated from gnuplot

/Title (fig1.pdf)
/Author (Hans Fugal)
/Creator (gnuplot 4.2 patchlevel 4 )

Removing the offending lines didn’t hurt the PDF in this situation. So if you must anonymize a PDF (e.g. to submit a paper for blind review), be sure to check for hidden identification. Of course, most reviewers wouldn’t go digging for it, but you will rest easy knowing it’s truly anonymous.


Nov 1 2007

LaTeX Search Path

I recently had need to put a .bst file in my LaTeX search path. This turned out to be difficult to search for. I found a lot of pages and style files telling users to put such and such file in their LaTeX search path. I began to wonder if I was the only LaTeX user on earth who had no idea what the LaTeX search path was.

With some effort I found that the global path’s root is usually something like /usr/share/texmf. I’m not interested in putting it in the global path though. We have home directories for a reason here.

Finally I found the answer, with some creative googling. The answer depends on your distribution/OS. Apparently on Debian it’s ~/.texmf-config (untested). The MacTeX distribution (which I have installed) looks in ~/Library/texmf. The macports build (don’t ask) looks in ~/texmf, which I learned only by trial and error. My guess is that latter answer is the answer if you build by yourself, and so might be a good initial guess no matter what the distribution.

So, I did this:

mkdir -p ~/Library/texmf/bibtex/bst
ln -s ~/Library/texmf ~/texmf
mv acm-annotated.bst ~/texmf/bibtex/bst

Feb 13 2007

align Environment

How I managed to get along for so long without knowing this I don’t know.
The align environment in LaTeX is very nice for typesetting a series of equations, e.g. in a proof. Here is an example:

\begin{align*}
P(A)\text{ and }P(\overline A\cap B)&\text{ are mutually exclusive.}\
P(\overline A\cap B)+P(A\cap B) &= P(B)\
P(A\cup(\overline A\cap B)) &= P(A)+P(\overline A\cap B) &\because           \text{Third axiom of probability}\
P(A)+P(\overline A\cap B) &\le 1 &\because \text{First axiom of probability}\
P(A)+P(\overline A\cap B)+P(A\cap B)-1 &\le P(A\cap B)\
P(A)+P(B)-1 &\le P(A\cap B)
\end{align*}

That will typeset a series of equations aligned by the &s.