2

I want to buld a book, but I have non stop error! The file use everywhere on tex file Linux Libertine O and other linux libertine font. I would like to know, how to change all font without change every font by another font.

\documentclass[12pt,french]{book}
\usepackage{libertine}
\setmainfont{Linux Libertine O}
\setromanfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Mapping=tex-text]{Linux Biolinum O}

\begin{document}
\include{frontmatter}
\pagestyle{headings}
\pagenumbering{arabic}
\include{touslesserpents}
\include{8multipliés}
\include{Tortues}
ABC abc
\end{document}

Error is :

The font "Linux Libertine O" cannot be found.
The font "Linux Biolinum O" cannot be found
cfr
  • 198,882
SigmaPi
  • 21
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Apr 07 '15 at 22:20
  • 1
    Could you explain what you want to do, as well? What do you mean by changing all the fonts (?) without changing every font? We definitely need an MWE to see how you are configuring the fonts now. It would also help to know what errors you are getting - what makes you think the font is the problem? – cfr Apr 07 '15 at 22:22
  • 1
    What happens if you replace \usepackage{libertine} with \usepackage{fontspec}? – Mico Apr 07 '15 at 22:29
  • even after your edit, the question is totally unclear. You have specified linux libertine, but you haven't said which font you want to change or which font you want to use instead. – David Carlisle Apr 07 '15 at 22:29
  • 2
    You need to install the linux libertine fonts or delete the lines \usepackage{libertine} \setmainfont{Linux Libertine O} \setromanfont[Mapping=tex-text]{Linux Libertine O} \setsansfont[Mapping=tex-text]{Linux Biolinum O} and use the default tex fonts instead – David Carlisle Apr 07 '15 at 22:31
  • If I delete \usepackage{libertine} \setmainfont{Linux Libertine O} \setromanfont[Mapping=tex-text]{Linux Libertine O} \setsansfont[Mapping=tex-text]{Linux Biolinum O} I always error because the othor because the author has add \fontspec{Linux Libertine O C} or other font throughout on tex file. (Linux libertine font is instaled on my mac) – SigmaPi Apr 07 '15 at 22:42
  • Yes i compile with xelatex. This is the file link – SigmaPi Apr 07 '15 at 22:44
  • @SigmaPi: Well, your example runs without problems, but your are not showing the relevant portion, I fear. I believe, \fontspec{Linux Libertine O C} is wrong in this case, but removing the C in that will provide a working MWE –  Apr 07 '15 at 22:46
  • Yes, if you are the editor and the author is using broken commands, then either consider getting the author to make changes throughout, or just use a sed command to rewrite the incorrect strings. – Joe Corneli Apr 07 '15 at 22:54
  • @DavidCarlisle The fonts are included in standard TeX distributions in opentype format, as well as type1. – cfr Apr 07 '15 at 23:55
  • 1
    @cfr they are, but then tex wouldn't say it couldn't find them in a standard distribution, so given the rather sketchy information in the question, backing stuff out to get a working document seems like the start of a plan:-) – David Carlisle Apr 07 '15 at 23:58

2 Answers2

4

The best solution is probably just to load the libertine package. This package will automatically detect that you are using XeLaTeX or LuaTeX and load fontspec in that case. If you are using LaTeX or pdfLaTeX, it will use a traditional font configuration instead.

\documentclass[12pt,french]{book}
\usepackage{libertine}

\begin{document}
\include{frontmatter}
\pagestyle{headings}
\pagenumbering{arabic}
\include{touslesserpents}
\include{8multipliés}
\include{Tortues}
\end{document}

I do get a couple of warnings in this case. Apparently, the libertine package attempts to pick some font features which the fonts don't actually support. (At least, not in the versions I have.) But starting with the package is definitely the best strategy. You can then customise it by picking appropriate options if you wish.

cfr
  • 198,882
0

I don't know what operating system or TeX platform you're using but on Ubuntu with TeXLive 2014 this works for me, when compiled with xelatex.

\documentclass[12pt,french]{book}
\usepackage[MnSymbol]{mathspec}
\setmainfont{Linux Libertine O}
\setromanfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Mapping=tex-text]{Linux Biolinum O}

\begin{document}
« Bonjour tout le monde ! »
\end{document}

Alternatively, if that does not work, try:

\documentclass[12pt,french]{book}
\usepackage[MnSymbol]{mathspec}
\setmainfont{Linux Libertine}
\setromanfont[Mapping=tex-text]{Linux Libertine}
\setsansfont[Mapping=tex-text]{Linux Biolinum}

\begin{document}
« Bonjour tout le monde ! »
\end{document}
Joe Corneli
  • 4,340
  • How does this solve the problem? –  Apr 07 '15 at 22:51
  • On OS X 10.10 and all tex update installed this code doesn't work! fontspec error: "font-not-found" The font "Linux Libertine O" cannot be found. – SigmaPi Apr 07 '15 at 22:54
  • Try Linux Libertine and Linux Biolinum without the O at the end and see if that works. – Joe Corneli Apr 07 '15 at 22:55
  • Same probleme... – SigmaPi Apr 07 '15 at 22:56
  • @ChristianHupfer it is a Minimum Working Example which is generally the first step towards solving a LaTeX problem. – Joe Corneli Apr 07 '15 at 22:57
  • @JoeCorneli: Yes, it's a starter, but still not the solution ;-) I tested the OP's MWE half an hour ago and it run without problems ;-) I suspect the error in those \fontspec{...} commands, see my comment below the OP –  Apr 07 '15 at 22:59
  • Googling the error message ponts to this prior question, have a look: http://tex.stackexchange.com/questions/51803/linux-libertine-o-and-linux-biolinum-o-not-found – Joe Corneli Apr 07 '15 at 22:59
  • @ChristianHupfer now that the OP has tested this MWE and found that it fails, attention is focused on getting this MWE to work. – Joe Corneli Apr 07 '15 at 23:02
  • The key part may be this remark on the linked question "Remember to rehash your db." sudo mktexlsr or whatever the equivalent is on your machine. – Joe Corneli Apr 07 '15 at 23:04
  • @JoeCorneli I already find the discution but I have other error. What is db? – SigmaPi Apr 07 '15 at 23:09
  • 1
    Ok I fund a part of the solution! If I remove the O that work. thx @JoeCorneli – SigmaPi Apr 07 '15 at 23:16