1

I'd like to use the fdsymbol package together with the fedra serif b Opentype font. I'm having some problems with the following code

\documentclass{article}
\usepackage{fdsymbol}
\usepackage{fontspec}
%\setmainfont{fedraserifpro-b-book.otf}[
%BoldFont = fedraserifpro-b-medium.otf, 
%ItalicFont = fedraserifpro-b-bookitalic.otf,
%BoldItalicFont = fedraserifpro-b-mediumita.otf]

\begin{document}
\begin{equation}
\sigma(w | xv)
\end{equation}
\end{document}

Compiling with XeLaTeX, I get the following error

LaTeX error: Command '\mathdollar' already defined.

I'm not sure wether the problem is machine-specific or not. Any ideas?

EDIT: After using \let\mathdollar\undefined the code compiles, but the result is

enter image description here

Instead of

enter image description here

7
  • give the command \let\mathdollar\undefined just before \begin{document}... Possibly fdsymbol package is trying to define it at the beginning of the document... but finds it already defined... Un-define it just before get there and let it redefine it then... But I am not sure if you should use this package with XeLaTeX...
    – koleygr
    Mar 9, 2019 at 1:00
  • With \let\mathdollar\undefined the code compiles, but I'm still not getting the right font. I've updated the post to show what I mean
    – noibe
    Mar 9, 2019 at 1:05
  • Have you tried this way (tex.stackexchange.com/a/96028/120578)?
    – koleygr
    Mar 9, 2019 at 1:08
  • I saw that post but I can't put fdsymbol inside of \setmathfont.
    – noibe
    Mar 9, 2019 at 1:10
  • Usually font packages are supposed to be used with LaTeX and pdfLaTeX... Not with XeLaTeX that is created to use system fonts... I suppose that the error means that the creator of the package has not created it to be compatible with XeLaTeX... Try to use Fedora font family that is the equivalent real font to this package's font
    – koleygr
    Mar 9, 2019 at 1:16

1 Answer 1

0

You could download some Fedora Fonts (I don't really know where you could find it, but it should be compatible with math)

Then:

after adding the font on your system, you could run the code:

\documentclass{article}
\usepackage{mathspec}
\setmainfont{DejaVu Sans}
\setmathsfont(Digits,Latin,Greek)[Numbers={Lining,Proportional}]{TeX Gyre Pagella Math}
\begin{document}
Test
\begin{equation}
\boldmath{\sigma(w | xv)}
\end{equation}
\end{document}

That would give:

enter image description here

PS: I don't know where the original font should be fount and just add code that could use different main font and different font for math with some fonts available on Linux systems and on Overleaf (so that you can test the code).

3
  • Using mathspec, I simply added \setmathsfont(Digits,Latin,Greek)[Numbers={Lining,Proportional}]{fedraserifpro-b-bookitalic.otf} and it seems to work fine. Two final questions: 1) what is the use of the (Digits,Latin,Greek)[Numbers={Lining,Proportional}] options? 2) I'm trying to get bold fonts in math environemnts using the \boldsymbol command, but it doesn't do anything.
    – noibe
    Mar 9, 2019 at 17:25
  • Check this answer of @egreg for bold math using mathspec: tex.stackexchange.com/a/198138/120578 (I just copyed from the link I provided and you possibly not need all the options... Someone of us should read mathspecs documentation, but I don't need it right now :P )... [Just making fun with my non-knowledge on it]
    – koleygr
    Mar 9, 2019 at 17:37
  • aha ok got it :)
    – noibe
    Mar 9, 2019 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .