Git Product home page Git Product logo

Comments (6)

khaledhosny avatar khaledhosny commented on August 20, 2024

There is serif italic bold math alphabet, but no sans-serif italic bold one. There are italic bold math alphabets, both serif and sans serif, what makes you think otherwise?

from xits.

ptoche avatar ptoche commented on August 20, 2024

Thanks for your help Khaled. I know nothing about fonts and I'm probably misunderstanding things. Apologies! Clarification: I was referring to a xits-math bold+italic font. So here was my reasoning.

First, I noticed that in http://tex.stackexchange.com/questions/43642 or more recently http://tex.stackexchange.com/questions/296603, you and other font experts only ever write

\setmathfont
[    Extension = .otf,
      BoldFont = *bold,
]{xits-math}

with no reference to bold italic math fonts. So that was my first clue. When I added the line

BoldItalicFont = *-bolditalic,

to the above, I received an error message 'fontspec error: "font-not-found". Second clue.

When I looked inside the font .otf files, I didn't see a bold-italic-math font. Third clue.

And when I tried to insert this in the preamble:

\DeclareMathAlphabet{\mathbit}{OML}{cmm}{b}{it}

which is something I read here (http://tex.stackexchange.com/questions/14395/bold-italic-vectors) about how to emulate a bold italic font, the outcome was very ugly. That was my fourth clue. But perhaps I just don't know how to set it up properly?

Below a MWE used for my experiments:

\documentclass{article}
\usepackage[bold-style=ISO]{unicode-math}
%\usepackage[bold-style=TEX]{unicode-math}
\setmainfont
[    Extension = .otf,
   UprightFont = *-regular,
      BoldFont = *-bold,
    ItalicFont = *-italic,
BoldItalicFont = *-bolditalic,
]{xits}
\setmathfont
[    Extension = .otf,
      BoldFont = *bold,
]{xits-math}
\DeclareMathAlphabet{\mathbit}{OML}{cmm}{b}{it}
\begin{document}
\begin{itemize}
\item
mainfont:
\[x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df\] 
\item 
boldmath: 
{\boldmath
\[ x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df\]
}
\item 
mathbf: 
\[\mathbf{x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df}\] 
\item 
mathbit: 
\[\mathbit{x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df}\] 
\end{itemize}    
\end{document}

from xits.

khaledhosny avatar khaledhosny commented on August 20, 2024

The way OpenType math fonts is structured is different than traditional TeX fonts. All math alphabets are included in a single font file, so If you installed XITS Math in the system font directories (the recommended way), then all you need is \setmathfont{XITS Math}. The invocation you use is for loading the fonts by file name and in this case you need to load the bold font manually, however this bold font is not for bold math alphabets but for \boldmath, \boldsymbol and similar commands that expects a math font where everything is bold.

The \DeclareMathAlphabet is definitely wrong, you are trying to load the Computer Modern Math (cmm) bold italic font, you should drop it. \mathbf and \mathbi used to work with uncode-math out of box, but it seems that for some LaTeX people compatibility with crippled 8-bit TeX engines is more important than a system that works in the 21 century, so that was dropped and you now have to use \symbf and \symbfit instead, please refer to unicode-math documentation (hopefully it was updated, I didn’t check).

So your document should look like:

\documentclass{article}
\usepackage[bold-style=ISO]{unicode-math}
%\usepackage[bold-style=TEX]{unicode-math}
\setmainfont
[    Extension = .otf,
   UprightFont = *-regular,
      BoldFont = *-bold,
    ItalicFont = *-italic,
BoldItalicFont = *-bolditalic,
]{xits}
\setmathfont
[    Extension = .otf,
      BoldFont = *bold,
]{xits-math}
\begin{document}
\begin{itemize}
\item
mainfont:
\[x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df\] 
\item 
boldmath: 
{\boldmath
\[ x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df\]
}
\item 
mathbf: 
\[\symbf{x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df}\] 
\item 
mathbit: 
\[\symbfit{x(t)=\int_{-B}^B X(f)e^{j2\pi ft} df}\] 
\end{itemize}    
\end{document}

from xits.

ptoche avatar ptoche commented on August 20, 2024

Thanks Khaled! Your explanation clarifies a lot of things for me. I noticed \setmainfont{XITS} is throwing errors, so I'm going to look into my setup again.

I'm not seeing a big difference between \symbf and \symbfit and no difference at all between \symbf{A} and \symbfit{A}. See screenshot here: http://s33.postimg.org/gt176cu6n/tmp.png
Should there not be a difference ?

from xits.

khaledhosny avatar khaledhosny commented on August 20, 2024

They are different in the font. You probably need to ask in unicode-math tracker, or some general TeX questions site like http://tex.stackexchange.com/.

from xits.

ptoche avatar ptoche commented on August 20, 2024

Will do, thanks Khaled!

from xits.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.