3

I have some problems using Linux libertine font within equations or pgfplots and tried this answer but it doesn't work.

\documentclass{article}
\usepackage{fontspec}
\usepackage{pgfplots}

\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\usepackage{blindtext}
\begin{document}

\blindtext[1]

\begin{equation}
x = 4 \cdot 3 
\end{equation}

\begin{tikzpicture}
 \begin{axis}
  \addplot {x};
 \end{axis}
\end{tikzpicture}

\end{document}

  • Could you say what the problems are other than saying "some problems"? – Sverre Jun 13 '14 at 13:10
  • I had added a picture to show the problems. – SLx64 Jun 13 '14 at 14:05
  • I see the picture, but I still don't know what the problems are. Please be explicit, don't leave it to us to guess what the problems are. – Sverre Jun 13 '14 at 14:25
  • In the picture are red marks. The numbers and any other symbols are in a different font. – SLx64 Jun 13 '14 at 14:29
4
\documentclass{article}
\usepackage{unicode-math}
\usepackage{pgfplots}
\usepackage{libertine}%% lOADS ROMAN/SANS/MONO

\usepackage{blindtext}
\begin{document}
\blindtext[1]

\begin{equation}
x = 4 \cdot 3 
\end{equation}

\begin{tikzpicture}
 \begin{axis}
  \addplot {x};
 \end{axis}
\end{tikzpicture}

\setmathfont[range=\mathit]{LinLibertineOI}
\setmathfont[range={\mathrm,0048-0057}]{LinLibertineO}

%% We now use Libertine for math characters    
\begin{equation}
x = 4 \cdot 3 
\end{equation}

\begin{tikzpicture}
 \begin{axis}
  \addplot {x};
 \end{axis}
\end{tikzpicture}
\end{document}
  • 1
    The x is different but the numbers are still the same. – SLx64 Jun 11 '14 at 20:29
  • see my edited answer, I'd forgotten the digits for \mathrm – user2478 Jun 11 '14 at 20:37
  • Okay great it works but the \cdot is missing now.. and any other math symbols – SLx64 Jun 11 '14 at 20:39
  • 1
    Don't know the number for \cdot. Add it to the list. However, I suppose that nobody will see the difference .... ;-) – user2478 Jun 11 '14 at 20:40
  • I've changed the range and it works now. Thank you very much! :) – SLx64 Jun 11 '14 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.