Fonts & Character SetsFont installation fail: Installed Opensans, but CM instead

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Viridis
Posts: 3
Joined: Wed Mar 04, 2020 7:00 pm

Font installation fail: Installed Opensans, but CM instead

Post by Viridis »

Hallo LaTeX-community,

I tried to install opensans.tds.zip (CTAN) by copying the directories of the zip-file into my /usr/share/texmf (Yes, Linux user here). After that I run 'mktexlsr' and 'updmap-user --enable Map opensans.map' (as root).
In my LaTeX document, I said: \usepackage{opensans}

But, instead of using this beautiful font, it used the ugly Computer Modern fallback font.
Something went terribly wrong ...

During installation and font activation, there were no error messages.

The preamble:

Code: Select all

\documentclass[a4paper,12pt,dutch]{article} 
\usepackage[utf8x]{inputenc}
\usepackage{opensans} %% <------------ !!! %%
\usepackage{babel}
\usepackage[dvips]{graphicx}
\usepackage{ulem} %%(durchstreichen)
\usepackage{multicol}
\usepackage{eurosym}
\usepackage{chemformula}
\usepackage{amsmath,amsfonts,amssymb} %% for Math %%
\usepackage{marginnote}
\usepackage{etoolbox}
\usepackage{rotating}
\usepackage{framed}
\usepackage{color}
\definecolor{mygray}{gray}{0.6}
\makeatletter
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\reversemarginpar 
\makeatother
\usepackage{geometry}
\textwidth=390pt  %5cm
\usepackage{cancel}
\usepackage{color}
\definecolor{Blue}{rgb}{0,0,1}
\definecolor{Red}{rgb}{1,0,0}
\newcommand{\colorcancel}[2]{\renewcommand{\CancelColor}{\color{#2}}\cancel{#1}}
My log says:

Code: Select all

[ ... ]
(/usr/share/texmf/tex/latex/opensans/opensans.sty
(/usr/share/texlive/texmf-dist/tex/latex/fontaxes/fontaxes.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def)
(/usr/share/texlive/texmf-dist/tex/generic/babel-dutch/dutch.ldf
[ ... ]
Thanks for any helping suggestions.

Ulrich Viridis
Last edited by cgnieder on Sun Mar 08, 2020 10:51 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Bartman
Posts: 366
Joined: Fri Jan 03, 2020 2:39 pm

Font installation fail: Installed Opensans, but CM instead

Post by Bartman »

I use Windows and MiKTeX.

opensans is available on CTAN and should be installed with the TeX-Live-Manager tlmgr. The program should be available if you have installed the original version of TeX Live and not the version that comes with the linux distribution.

It sounds like you want to replace the serif font with the loaded sans serif. In this case, nothing went wrong. That is the intended result.

To change from serif font to sans serif, you have to insert

Code: Select all

\renewcommand{\familydefault}{\sfdefault}
into your preamble.
Viridis
Posts: 3
Joined: Wed Mar 04, 2020 7:00 pm

Font installation fail: Installed Opensans, but CM instead

Post by Viridis »

I followed your advice, but still no luck.

I used a virtual machine and did an installation of TEX-live and texlive-fonts-extra package. But all I see in the PDF-file is CM and other (unrecognised) font. Opensans is absent!
I don't receive any error or warning messages.

Bartman: what do you mean with: "if you have installed the original version of TeX Live and not the version that comes with the linux distribution."? Is there any difference, beside a minor difference in version number?

[edit] I uninstalled the TEX-live from the repository, and am doing a clean install with "install-tl". Let's see if this works ...
[edit 2] After switching to the new installation method, I'm no longer able to compile my document ("unable to start LaTeX / PDFLaTeX"). Of course, I followed all the guidelines for installation (PATH=/usr/local/texlive/2019/bin/x86_64-linux:$PATH).
Viridis
Posts: 3
Joined: Wed Mar 04, 2020 7:00 pm

Font installation fail: Installed Opensans, but CM instead

Post by Viridis »

I succeeded!

This preamble works:
\documentclass[a4paper,12pt,dutch]{article}
\usepackage[utf8]{inputenc} %% x
\usepackage[T1]{fontenc}
\usepackage[dutch]{babel}
\usepackage[default,oldstyle,scale=0.95]{opensans}
\usepackage{lmodern}

Following had to be disabled, since it loads CM-sans:
\renewcommand*\familydefault{\sfdefault}
\sffamily (after \begin{document})

And I had to pass the option 'default' to \usepackage{opensans}
Post Reply