I created a custom font Computer Modern Roman Blackboard Bold
, similar to the Computer Modern Roman - italic
as the following image:
As you can imagine, I want to implement this font in math-mode
such as \cmrbb{hello}
or maybe substitute \mathsf
alphabet for mine, then rename a new command \cmrbb
.
Specifications
- I'm using
fontspec
- I'm using
LuaLaTeX
- I have some packages like
amsmath, amssymb, mathtools
(I don't know if it can cause trouble) - I want to use the new font as a simple command like
\cmrbb{text}
inside math-mode - I'm working currently on Overleaf and have loaded
cmrbb.ttf
I have no idea how I can do it, I tried using mathspec
but the document doesn't even compile (I think it only works in XeLaTeX
).
And just in case there is no incompatibility, I don't use any command for font encoding, and I have already loaded some fonts. I don't know much about fontspec, any additional information to make it easier to implement the solution would be really helpful.
Best Answer
It's not clear if your font is OT1 encoded like the original cmr or TU Unicode encoded, but basically
or
together with a suitable fd file if using OT1 and declare the font using
\newfontfamily\cmrbbfam[NFSSFamily=cmrbb]
if using TU encoded fonts.An example (produced with xelatex) using some opentype font found on this system, the declarations would be the same for any font.