For the FrameLabel, I have:
Style["\[NumberSign] Humans per city", FontFamily -> "Latin Modern Math"]
How can I make only "Humans" in the label to be italic?
For the FrameLabel, I have:
Style["\[NumberSign] Humans per city", FontFamily -> "Latin Modern Math"]
How can I make only "Humans" in the label to be italic?
Select "Humans" and press Ctrl-I (or Command-I on macOS) to format it in italics. This is by far the simplest way.
Note that Latin Modern Math is intended only for math, not text, and does not have an italics version. Your OS will likely fake the italics style by simply slanting letters. Install Latin Modern Roman instead to get proper italics.
Illustration:
Something like this might work:
Row[
{"\[NumberSign] ", Style["Humans", FontSlant -> Italic], " per city"},
BaseStyle -> {FontFamily -> "Latin Modern Math"}]
If you don't want to insert your own spaces, you can add a spacer argument to Row:
Row[
{"\[NumberSign]", Style["Humans", FontSlant -> Italic], "per city"},
" ",
BaseStyle -> {FontFamily -> "Latin Modern Math"}]
As per WReach
Style[
StringJoin["\[NumberSign] ",
ToString[Style["Humans", Italic], StandardForm], " per city"],
FontFamily -> "Latin Modern Math"]
# Humans per city
lmodernpackage. In math mode,lmodernuses the "Math" variant. In text mode, the "Roman" variant. How these actually show up in Mathematica depends on your system, ... – Szabolcs Nov 08 '22 at 17:01