TransWikia.com

change a specific symbol to a specific family of font for a beginner

TeX - LaTeX Asked by rajendra on March 9, 2021

I am a beginner to Latex using pdflatex. I am trying to change some of the math symbols to a different family. In my case, I want to change xi to XITS math. Using XITS with pdflatex I could achieve this simply using stix package. However, in my document, I am using symbols from the other fonts, for example, MnSymbol. When I am using both, it results in error, UndeclareTextCommand from stix package. The working model I am using is

   documentclass{report}
   usepackage{amsmath}
   usepackage{MnSymbol}
   usepackage{stix}
   begin{document}
    $xi$
   end{document}

Using the above code without MnSymbol, I will get all the symbols changed to stix. However, I would like to use only some of the symbols from stix. I could find some discussion about choosing specific symbol from a specific font family. Being a beginner, I could not understand the solutions to the extent that I can implement to my case.

One of the simple solution I could find is https://tex.stackexchange.com/a/324207/180603. However, this code could not run using pdflatex!

What is the simplest method by which the symbol can be changed?

One Answer

If you’re using unicode-math, there is a standard way to do this, the range= option of setmathfont. Let's say you wanted to use the “tombstone” Q.E.D. symbol from XITS Math (a fixed version of STIX) instead of the default. You could write,

setmathfont{Latin Modern Math}
setmathfont{XITS Math}[
   range=QED, Scale=MatchUppercase ]

The QED symbol will now be a black rectangle instead of a white square. (And you can renewcommandqedsymbol{QED} to use it in your proofs with amsthm.)

Many legacy packages come in OpenType versions. setmathfont[range=...] can mix and match any symbols in Unicode from any combination of them.

If you want to stick with legacy math packages, or you are unable to use LuaLaTeX or XeLaTeX, there is no universal approach. The best general method is to open up the .sty file, copy the minimal lines of code needed to define the symbols you want, and paste them into your document. Typically, these will be DeclareSymbolFont followed by DeclareMathSymbol, but STIX is unusual in that it also declares some custom font encodings.

Since you only have a limited number of math alphabets in 8-bit legacy TeX, you might run out. A way to work around this, if you only need one or two symbols, would be to use the text symbol in math mode. You could wrap a math class such as mathrel or mathbin around a mbox or text box, select a specific encoding, family and series inside that with usefont, then look up the character you want on a font table, if the package documentation comes with one, and insert it with symbol.

Answered by Davislor on March 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP