0

Back in the days of plain TeX, when Omega was the default/only way to write Greek in TeX, the default font was OmegaSerif. For Greek typesetting it had the following extra (neat) features:

  1. When in beginning of a word, beta would be the normal β, but when mid-words beta would automatically transform into ϐ.

  2. In a word phi, would be ϕ and not φ. (text: {phisymbol vs phi}, or math: {phi vs varphi})

Now, its successor, FreeSerif, from GNU FreeFont Project has the same glyphs, but not these 2 features from OmegaSerif.

Can I somehow play with FreeSerif to achieve these features or is there, somewhere, OmegaSerif for LaTeX?

Following pictures depict these 2 features.

beta

phi

3

1 Answer 1

3

enter image description here

\documentclass{article}

\usepackage{fontspec}
\setmainfont{FreeSerif.otf}

% turn on xetex character class feature
\XeTeXinterchartokenstate=1

% character class for beta 
\newXeTeXintercharclass\myc

% assign beta to the class
\XeTeXcharclass`β=\myc

% specify that \swapbeta should be inserted between any 
% normal character (class zero) and a beta (class \mych)
\XeTeXinterchartoks 0 \myc{\swapbeta}

% define \swapbeta to swallow a β and expand to ϐ
\def\swapbeta β{ϐ}

% To do the same for phi just define a new class and a new \swapphi
% command and set up a substitution for that.

 % testing...    
\begin{document}

 abc βέβα

\end{document}
4
  • Thank you! But what about the φ vs ϕ thing? Commented Oct 7, 2016 at 18:12
  • Also, could you elaborate on your macros, for learning purposes? Commented Oct 7, 2016 at 18:14
  • @st.vit you just do exactly the same but with those two characters instead of the betas. I'll add some comments to the code Commented Oct 7, 2016 at 19:27
  • @st.vit comments added Commented Oct 7, 2016 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .