5

So I want to write a document (german) with Charter and Helvetica. The problem is that I need to have lowercase upright greek letters in the body as well as in the section headers in their respective fonts.

My attempt with LaTeX:

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[charter,greeklowercase=upright]{mathdesign}
\usepackage{helvet}

\begin{document}

\section{Text: ä ß $\alpha$ $\beta$ $\mu$ in Helvetica}

Text: ä ß $\alpha$ $\beta$ $\mu$ in Charter

\end{document}

results in:

enter image description here

I guess I would need two things here:
1. a version of Helvetica with matching math support and
2. a way to input more than one math font in LaTeX.

Is this possible?

My attempt with XeLaTeX:

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont{XCharter}
\setsansfont{Helvetica}

\begin{document}

\section{Text: ä ß α β μ in Helvetica}

Text: ä ß α β μ in Charter

\end{document}

results in:

enter image description here

This is almost as I want it, but XCharter does not have greek letters. So I guess I would need one of two things here:
1. a version of Charter with greek letters or
2. a way to substitute those missing glyphs in Charter from a very similar font.

I am aware of Charis SIL, but I really don't like its thickness and especially its greek letters.

Any help is much appreciated!

  • 1
    Imho your font choice looks odd -- helvetica is too heavy. But beside this, are your greek symbols meant as mathematical symbols or do you want to write some greek words? – Ulrike Fischer Jan 6 '17 at 15:52
  • Don't need to write any greek words. Only single letters. But very often. And I really want them in Charter and Helvetica. The absolute ideal solution would be a version of Charter with real greek letters for XeLaTeX. But I would be OK with having the ones from LaTeX's mathdesign in XeLaTeX too. – Philip Jan 6 '17 at 19:28
  • Are these Greek letter in math formulas or do you just use math mode for getting Greek? – egreg Jan 8 '17 at 12:12
  • @egreg I would use math mode here just to get the greek letters in-text. – Philip Jan 8 '17 at 12:54
3

You can use textgreek with its quite powerful substitution mechanism.

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}

\usepackage[charter]{mathdesign}
\usepackage{helvet}
\usepackage{textgreek}
\renewcommand*{\textgreekfontmap}{%
  {phv/*/*}{LGR/neohellenic/*/*}%
  {*/b/n}{LGR/artemisia/b/n}%
  {*/bx/n}{LGR/artemisia/bx/n}%
  {*/*/n}{LGR/artemisia/m/n}%
  {*/b/it}{LGR/artemisia/b/it}%
  {*/bx/it}{LGR/artemisia/bx/it}%
  {*/*/it}{LGR/artemisia/m/it}%
  {*/b/sl}{LGR/artemisia/b/sl}%
  {*/bx/sl}{LGR/artemisia/bx/sl}%
  {*/*/sl}{LGR/artemisia/m/sl}%
  {*/*/sc}{LGR/artemisia/m/sc}%
  {*/*/sco}{LGR/artemisia/m/sco}%
}

\begin{document}

\section{Text: ä ß α β μ in Helvetica}

Text: ä ß α β μ in Charter

\end{document}

Here I use NeoHellenic for sans serif and Artemisia for serif.

enter image description here

With XeLaTeX you can use ucharclasses:

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage[Latin,Greek]{ucharclasses}
\usepackage{pdftexcmds}

\setmainfont{XCharter}
\setsansfont{Helvetica}[Scale=MatchUppercase,NFSSFamily=phv]

\newfontfamily{\artemisia}{GFS Artemisia}

\setTransitionsForGreek{\begingroup\checkhelvetica}{\endgroup}
\makeatletter
\newcommand{\checkhelvetica}{%
  \ifnum\pdf@strcmp{\f@family}{phv}=\z@\else\artemisia\fi
}
\makeatother

\begin{document}

\section{Text: ä ß α β μ in Helvetica}

Text: ä ß α β μ in Charter

\end{document}

The test can be made more complicated if you also need to cope with other font families. As you see, if Helvetica is the current font, the transition just opens and closes a group; otherwise it chooses the Artemisia font.

  • You can use \textalpha and so on, if you have problems in inputting Greek letters. – egreg Jan 8 '17 at 14:14
  • this is getting closer and closer. I just read the textgreek doc but don't really understand those advanced comments. How do you define Helvetica for sans serif (basically just leave as is) and only change sans serif? In another answer from you here I learned about ucharclasses that looks kind of promising too for a XeLaTeX solution, but I again don't understand how you would define different substitutions for serif and sans serif. – Philip Jan 9 '17 at 8:07
  • @Philip You have defined Helvetica (in LaTeX, phv), so I tell textgreek to change it with NeoHellenic; all other font famileies are chenged into Artemisia. Probably it can be simplified. – egreg Jan 9 '17 at 9:01
  • How do you do it the other way around. Keep the original greek letters in Helvetica but substitute the missing greek letters in Charter by greek letters of another font? That would basically be the final solution...preferably in XeLaTeX. – Philip Jan 9 '17 at 12:24
  • @Philip I'm not sure of what you mean: your question is based on pdflatex. – egreg Jan 9 '17 at 12:55
2

You can use \boldsymbol{\alpha} to get bold greek letters.

\documentclass{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[charter,greeklowercase=upright]{mathdesign}
\usepackage{helvet}

\usepackage{amsmath}

\begin{document}

\section{Text: ä ß $\boldsymbol{\alpha}$ $\boldsymbol{\beta}$ $\boldsymbol{\mu}$ in Helvetica}

Text: ä ß $\alpha$ $\beta$ $\mu$ in Charter

\end{document}

enter image description here

  • Thanks, didn't know about that one either, but it's not what I wanted. I basically want to input it the same in body and in sections and then have it in its corresponding font. – Philip Jan 7 '17 at 7:46
2

The easy way to do this is to use Xelatex with Linux Libertine which provides good greek characters and the accentuations.

It's available here

If you want it juste for typesetting greek you can do a little :

\newfontfamily{\gkfont}[]{Biolinum Regular}
\newcommand{\greek}[1]{\gkfont #1}

That way you can keep your usual font and to typeset greek you just have to do \greek{your text}.

And with \newfontfamily you can use as much fonts you can possibly imagine, it's the beauty of fontspec.


In fact it is more simple than that :

With the code :

\documentclass{scrartcl}

\usepackage{fontspec}
\setmainfont{Linux Libertine}
\setsansfont{Helvetica}

\begin{document}

\section{Text: ä ß α β μ in Helvetica}

Text: ä ß α β μ in Linux Libertine

\end{document}

You get that :

desc

Which is kind of the desired effect. You can then adjust some of the font properties with fontspec.

  • I probably didn't emphasize enough that the most important part is using Charter and Helvetica. I have tried many other fonts with greek support, as I said even Charis SIL...not satisfied. Little OCD here. But that's a great way to substitute, thanks. Although it's not possible to be able to input body text and section header text exactly the same and still get this result, is it? Because when I would substitute a specific glyph, e.g. the beta, it would substitute it in the section header too. – Philip Jan 7 '17 at 7:58
  • If it works well in helvetica, you can still use it for main font, the proposition was mainly to avoid the non-existing glyphs with charter, in fact the '\greek' command is used to define a minimal multilingual environnement. – Rémi Nazin Jan 8 '17 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.