TransWikia.com

Importing a single greek letter from another font

TeX - LaTeX Asked on September 2, 2021

I know versions of this question have already been asked, but I’ve already spent a couple of hours trying to make their answers work in my case, and wasn’t able to.

I would like a dedicated symbol to use for Kronecker deltas, which doesn’t get confused with other deltas in my document. For this I would like to import the delta from one of the fonts in this list, say the one on page 9. I only want to import one character, and would like a new command for it that does not overwrite the ordinary delta. What is the quickest way to achieve this?

Thank you.

One Answer

The solution will be different depending on whether you use unicode-math or legacy 7-bit math fonts. Here is a solution that uses unicode-math if the engine supports it, and otherwise falls back to the font you specified:

documentclass{article}
usepackage{iftex} % For /iftutex
usepackage[paperwidth=10cm]{geometry} % To format this MWE for TeX.SX
pagestyle{empty}

iftutex
  % LuaTeX or XeTeX
  usepackage{unicode-math}
  setmathfontfacealtgrfont{AntykwaTorunskaMed-Italic.otf}[Scale=MatchLowercase]
  newcommand{kronecker}{altgrfont{δ}}
else
  % PDFTeX
  usepackage[T1]{fontenc}
  usepackage[utf8]{inputenc} % The default since 2018
  usepackage{amsmath}
  DeclareSymbolFont{altgr}{OML}{antt}{m}{it}
  DeclareMathSymbol{kronecker}{mathord}{altgr}{"0E}
fi

begin{document}
begin{tabular}{c c c}
  Kronecker delta & texttt{{textbackslash}delta} & texttt{{textbackslash}partial} 
  (kronecker)  & (delta)                 & (partial)
end{tabular}
end{document}

antt font sample

In PDFTeX, you can change the family name to get another font, or even change OML to LGR to use a LGR-encoded font. if you don’t want to waste one of your limited number of math alphabets on this one symbol, you could instead switch to textnormal and generate it with text-mode commands, e.g. usefont followed by symbol.

You would need one extra line of code in each case to declare a bold version, which you might for example use in a bold header.

Correct answer by Davislor on September 2, 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