Fonts & Character Sets ⇒ Changing math fonts
Changing math fonts
Thank you.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Changing math fonts
Anyway, you might look at the mathspec package for XeLaTeX, which makes it kind of easy for using an arbitrary font for the letters in math mode, while keeping the usual symbol (The Unicode math package provides even greater flexibility, but may not quite be ready for every day use.) But that’s only if you’re using XeLaTeX.
If using regular pdfLaTeX or LaTeX, and there isn't already a math package for the font, it gets trickier.
Re: Changing math fonts
Can it be done without using XeTeX??
Salu2
Changing math fonts
I was, however, experimenting with how it might be done with regular pdfLaTeX the other day. I had meant to experiment with it more and tweak my results, but I was able to make the normal variables for the letters A-Z a-z appear in the font (italics), and the numerals 0-9 similarly (no italics), keeping Computer Modern for all the other symbols. I had wanted to keep experimenting to get things like Greek letters, etc., working too, but hadn’t made it that far. Maybe someone else will know. (I’m no expert about this, and probably should have asked myself, but sometimes I like to learn by trying.)
To do this, you need to know the font family name (usually a three-letter "Berry" abbreviation) of the font you want to use, and the encoding it’s using. What these would be for Bembo depends on how you installed it, which is actually why I asked. (You didn’t say.)
In my example, I’m using T1 encoding for the “Baservald ADF” font, font-family ybv, which just recently appeared on CTAN. It would be up to you to make the necessary adjustments to get Bembo instead. You'll see {T1}{ybv} appear four times. You’d need to change it everywhere to whatever the appropriate thing would be for Bembo.
It's already a bit involved. I don't know whether or not there would be a way of shortening this. Obviously, the important part is where the comment says “experiment”.
Code: Select all
\documentclass[12pt]{article}\usepackage{baskervald}\usepackage[english]{babel}\usepackage{blindtext}% ------------------------ experiment -----------------------\DeclareSymbolFont{mymathvariables}{T1}{ybv}{m}{it}\SetSymbolFont{mymathvariables}{normal}{T1}{ybv}{m}{it}\DeclareSymbolFontAlphabet{\mathnormal}{mymathvariables}\DeclareMathSymbol{a}{\mathalpha}{mymathvariables}{`a}\DeclareMathSymbol{b}{\mathalpha}{mymathvariables}{`b}\DeclareMathSymbol{c}{\mathalpha}{mymathvariables}{`c}\DeclareMathSymbol{d}{\mathalpha}{mymathvariables}{`d}\DeclareMathSymbol{e}{\mathalpha}{mymathvariables}{`e}\DeclareMathSymbol{f}{\mathalpha}{mymathvariables}{`f}\DeclareMathSymbol{g}{\mathalpha}{mymathvariables}{`g}\DeclareMathSymbol{h}{\mathalpha}{mymathvariables}{`h}\DeclareMathSymbol{i}{\mathalpha}{mymathvariables}{`i}\DeclareMathSymbol{j}{\mathalpha}{mymathvariables}{`j}\DeclareMathSymbol{k}{\mathalpha}{mymathvariables}{`k}\DeclareMathSymbol{l}{\mathalpha}{mymathvariables}{`l}\DeclareMathSymbol{m}{\mathalpha}{mymathvariables}{`m}\DeclareMathSymbol{n}{\mathalpha}{mymathvariables}{`n}\DeclareMathSymbol{o}{\mathalpha}{mymathvariables}{`o}\DeclareMathSymbol{p}{\mathalpha}{mymathvariables}{`p}\DeclareMathSymbol{q}{\mathalpha}{mymathvariables}{`q}\DeclareMathSymbol{r}{\mathalpha}{mymathvariables}{`r}\DeclareMathSymbol{s}{\mathalpha}{mymathvariables}{`s}\DeclareMathSymbol{t}{\mathalpha}{mymathvariables}{`t}\DeclareMathSymbol{u}{\mathalpha}{mymathvariables}{`u}\DeclareMathSymbol{v}{\mathalpha}{mymathvariables}{`v}\DeclareMathSymbol{w}{\mathalpha}{mymathvariables}{`w}\DeclareMathSymbol{x}{\mathalpha}{mymathvariables}{`x}\DeclareMathSymbol{y}{\mathalpha}{mymathvariables}{`y}\DeclareMathSymbol{z}{\mathalpha}{mymathvariables}{`z}\DeclareMathSymbol{A}{\mathalpha}{mymathvariables}{`A}\DeclareMathSymbol{B}{\mathalpha}{mymathvariables}{`B}\DeclareMathSymbol{C}{\mathalpha}{mymathvariables}{`C}
-
- Posts: 7
- Joined: Sat Sep 05, 2009 5:16 am