5

I have just upgraded to 12.04. I have always used LaTeX opensans package (www.ctan.org/pkg/opensans) and never had problems with it in Ubuntu. Now I installed it the same way as I always did but I cannot get it to work at all! I use it with LyX (www.lyx.org). Anyone using LaTeX opensans in Ubuntu 12.04? If so, how did you install it?

Thanks in advance.

ish
  • 139,926
daruko
  • 53
  • 1
  • 3

2 Answers2

2

There are two ways of installing it:

  1. in TEXMFLOCAL, which is usually /usr/local/share/texmf (you can check this with
    kpsewhich -var-value=TEXMFLOCAL)
  2. or in TEXMFHOME (which is usually ~/texmf)

The instruction provided in http://ww.tug.org/texlive/devsrc/Master/texmf-dist/doc/fonts/opensans/opensans.pdf ONLY works if you choose to install the files in TEXMFLOCAL. So if you move your files to TEXMFLOCAL, you should be able to follow those instructions.

However if that doesn't work for you (eg because you don't have administrator rights), you can install the files in TEXMFHOME.

To do this create the directory 'texmf' in your home directory. You can now download the zip from http://www.ctan.org/tex-archive/fonts/opensans, and unzip it in '~/texmf/', the directory you just created. You should now have a directory ~/texmf/tex/latex/opensans, which contains the .sty files you need.

Now you need to tell Latex that you have installed new files, you can do this by opening a terminal and typing

texhash ~/texmf/

Now you need to tell updmap that there are new fonts installed, so we need to create a file $HOME/texmf/web2c/updmap.cfg which contains the line Map opensans.map. Do this by executing the following commands:

mkdir ~/texmf/web2c
echo 'Map opensans.map' >> ~/texmf/web2c/updmap.cfg
updmap

At the bottom of the output you should now verify that it processed opensans.map, now we need to tell latex again that we have changed some files:

texhash ~/texmf

and that should do the trick!

EDIT: changed the answer based on feedback from OP

  • Thanks burger.ga for answering. I used to install the package following its documentation: 1. Copying doc/, fonts/, source/, and tex/ directories to my global texmf/ directory; 2. Running mktexlsr; and 3. Running updmap --enable Map=opensans.map. Now, while compiling LyX files I get the error message: !pdfTeX error: pdflatex (file OpenSans-Regular-03): Font OpenSans-Regular-03 at 432 not found. I followed your instructions with the local texmf folder but still no luck. – daruko Jul 03 '12 at 01:25
  • P.S.: opensans does not seem to be available from package manager. Maybe it will be there with Quantal ([link]https://launchpad.net/ubuntu/quantal/amd64/texlive-fonts-extra). – daruko Jul 03 '12 at 01:39
  • Thanks again burger.ga. I was actually installing in TEXMFLOCAL with admin rights. What I did now was to remove all opensans files from there and follow your updated instructions. The only difference was that I had to add "sudo" before updmap since I was getting no permissions for writing to ~/.texmf-var/web2c/updmap.log. Unfortunately, the error remains. It says now: "!pdfTeX error: pdflatex (file ec-lmtt9): Font ec-lmtt9 at 600 not found". Note that now the error is with another font (?). – daruko Jul 03 '12 at 11:48
  • I think it worked becaus I think the lmtt9 font is in the Latin modern package (http://www.ctan.org/tex-archive/fonts/lm/) Are you by any chance using that package as well? Maybe you can try a minimum example with \usepackage{default}[opensans]? – Gerhard Burger Jul 03 '12 at 13:03
  • You know, it is working if I use only opensans for the whole document. However, if I use, e.g., Latin Modern Roman for the serif fonts, the error appears! Some kind of conflict is there. The thing is that before upgrading to 12.04 everything worked properly since I often used these fonts in combination. – daruko Jul 03 '12 at 15:51
  • I think you need to install the latin modern package in the same way as you installed the opensans fonts, and in case this doesn't work I think you need to ask a separate question... Since my answer solved the opensans problem could you maybe accept my answer? – Gerhard Burger Jul 03 '12 at 19:42
0

Since years have passed, and you are using an Ubuntu-based distribution, the texlive packages will do what you want. Install texlive-fonts-extra.

sudo apt-get install -y texlive-fonts-extra

then

pdflatex document.tex
andrew.46
  • 38,003
  • 27
  • 156
  • 232