Showing posts with label dvips. Show all posts
Showing posts with label dvips. Show all posts

25 May 2012

163. Long rant over LaTeX problems caused by my own stupidity: tex.pro


25 May 2012.
I'm having problems turning dvi into ps
latex test.tex
works fine.
dvips test.dvi
however gives
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) dvips: ! Couldn't find header file: tex.pro Process exited with error(s)
Solution:
Diagnosis: PEBKAC
I was being a bloody idiot.
cat ~/.bashrc|grep TEX
export TEXINPUTS=/usr/share/texmf/tex/latex/prosper/prosper.cls:$TEXINPUTS
export TEXMFMAIN=/usr/share/texmf/

Once I commented those lines out and did
export TEXINPUTS=""
export TEXMFMAIN=""

everything was fine.

I wasted 1h30 min of prime working time on THIS. Anyway, I'm putting it all up here in case someone is having a similar problem. The moral of the story is:
always begin by checking your ~/.bashrc, ~/.cshrc and ~/.profile.

The other reason for posting it online is because the troubleshooting steps may be useful to have in the future.

Troubleshooting
kpsewhich tex.pro
gave nothing

locate tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro

neither
sudo texconfig
or
sudo mktexlsr
or
sudo texhash
helped (they pretty much do the same thing).

dpkg -S tex.pro
texlive-science: /usr/share/texlive/texmf-dist/dvips/gastex/gastex.pro texlive-base: /usr/share/texlive/texmf/dvips/base/tex.pro

show dpkg is aware of the files.
kpsewhich -path /usr/share/texlive/texmf/dvips/base tex.pro
/usr/share/texlive/texmf/dvips/base/tex.pro
obviously works.
dvips -d 2 draft_1.dvi
[..]
This is dvips(k) 5.991 Copyright 2011 Radical Eye Software (www.radicaleye.com) input file draft_1.dvi output file draft_1.ps swmem 180000 kdebug:Search path for PostScript header files (from texmf.cnf) kdebug: = .:/usr/share/texlive/texmf/dvips/base//dvips//:/usr/share/texlive/texmf/dvips/base//fonts/enc//:/usr/share/texlive/texmf/dvips/base//fonts/type1//:/usr/share/texlive/texmf/dvips/base//fonts/type42//:/usr/share/texlive/texmf/dvips/base//fonts/type3// kdebug: before expansion = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: application override path = (none) kdebug: application config file path = (none) kdebug: texmf.cnf path = .:$TEXMF/{dvips,fonts/{enc,type1,type42,type3}}// kdebug: compile-time path = /nonesuch kdebug: environment variables = TEXPSHEADERS PSHEADERS [..] dvips: ! Couldn't find header file: tex.pro
export TEXMF=/usr/share/texlive/texmf
solves the tex.pro problem, but gives this instead:
tex.dvips: Can't open font metric file cmr10.tfm dvips: I will use cmr10.tfm instead, so expect bad output. dvips: ! I can't find cmr10.tfm; please reinstall me with proper paths
locate cmr10.tfm
/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr10.tfm
export TEXMF=$TEXMF:/usr/share/texlive/texmf-dist/fonts/tfm/public/cm
and we're back to
dvips: ! Couldn't find header file: tex.pro
sudo dpkg-reconfigure texlive-base
didn't do anything for me.
Solution
aptitude search texlive|grep ^i|gawk '{print $2,$3}>texlive.list
I then edited texlive.list and remove all the initial A on the relevant rows.

Then
sudo apt-get purge texlive

followed by
cat texlive.list|xargs >list
I the took the list there
sudo apt-get install `cat list`
which did
sudo apt-get install feynmf latex-beamer latex-xcolor pgf prosper texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-common texlive-doc-base texlive-extra-utils texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended texlive-latex-recommended-doc texlive-luatex texlive-metapost texlive-metapost-doc texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc texlive-publishers texlive-publishers-doc texlive-science texlive-science-doc texpower tipa

It still doesn't [censored] work!

It's the same shit with

dvipdfm draft_1.dvi
** WARNING ** Could not open config file "dvipdfmx.cfg". draft_1.dvi -> draft_1.pdf [1] 22057 bytes written

locate dvipdfmx.cfg
/usr/share/texlive/texmf/dvipdfmx/dvipdfmx.cfg /usr/share/texlive/texmf-dist/tex/generic/pstricks/config/xdvipdfmx.cfg
sudo texhash and sudo texconfig do nothing.
cat /usr/share/texlive/texmf/ls-R|egrep "tex.pro|dvipdfmx.cfg"
dvipdfmx.cfg dvipdfmx.cfg.ucf-dist tex.pro
So what the bloody hell is the effing problem?
locate ls-R
/usr/share/texlive/texmf/ls-R /usr/share/texlive/texmf-dist/ls-R /usr/share/texmf/ls-R /var/lib/texmf/ls-R /var/lib/texmf/ls-R-TEXLIVE /var/lib/texmf/ls-R-TEXLIVEDIST /var/lib/texmf/ls-R-TEXLIVEMAIN /var/lib/texmf/ls-R-TEXMFMAIN
So which ones have tex.pro in them?
/usr/share/texlive/texmf/ls-R -- yes /usr/share/texlive/texmf-dist/ls-R -- no /usr/share/texmf/ls-R -- no /var/lib/texmf/ls-R -- no /var/lib/texmf/ls-R-TEXLIVE -- yes /var/lib/texmf/ls-R-TEXLIVEDIST -- no /var/lib/texmf/ls-R-TEXLIVEMAIN -- yes/var/lib/texmf/ls-R-TEXMFMAIN -- no