# How to change the font type for the first few words of a line of verse?

I am typesetting a two column parallel poem written by some friends. The first few words on the left column are the words of the right column almost verbatim.

I want to create a visual play on that. So I want to have the first few word of every line in a completely different type than the rest of the line. Say, Fraktur and Pallatino. Despite having been using latex for many years I still strugle to mix font types, and I still get confused by the terms "font face" and "font family". Most answers that I have found only change from regular face to bold or italic. What I want is really to mix types more or less ad libitum in a easy way,maybe with a newcommand instance.

If it is more viable with XeLatex I do not mind.

To make it clearer I have allready some example of the poem in parallel columns like this, using paracol. Here I will "bold" the words that I would like in a different type.

\begin{paracol}{2}

\poemtitle{Tiempos en pausa.}
\switchcolumn
\poemtitle{Tiempo.}
\switchcolumn

\begin{verse}
\textbf{Pausa que como hoyo negro }se traga todo. \\
\textbf{Todo} al mismo tiempo traga y al mismo tiempo vacía. \\
\textbf{Vacío} que abrasa y abraza. \\
\textbf{Abrazo} que devora y a su vez escupe y devuelve. \\
\end{verse}

\switchcolumn
\begin{verse}

Pausa que como hoyo negro \\
todo \\
vacía y \\
abraza. \\

\end{verse}


So, let us take these "bold" word and transform them to something really contrasting.

This is an example of using type 1 fonts (with \usepackage[T1]{fontenc}). This is why I can select a specific font using font family codes.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{paracol}

\begin{document}

\newcommand{\textempha}[1]{%
\bgroup\fontfamily{qhv}\selectfont #1\egroup%
}

\newcommand{\textemphb}[1]{%
\bgroup\fontfamily{bch}\selectfont #1\egroup%
}

\newcommand{\poemtitle}[1]{%
\bgroup\bfseries #1\egroup
}

\begin{paracol}{2}

\poemtitle{Tiempos en pausa.}
\switchcolumn
\poemtitle{Tiempo.}
\switchcolumn

\begin{verse}
\textempha{Pausa que como hoyo negro }se traga todo. \\
\textempha{Todo} al mismo tiempo traga y al mismo tiempo vacía. \\
\textemphb{Vacío} que abrasa y abraza. \\
\textemphb{Abrazo} que devora y a su vez escupe y devuelve. \\
\end{verse}

\switchcolumn
\begin{verse}

Pausa que como hoyo negro \\
todo \\
vacía y \\
abraza. \\

\end{verse}

\end{paracol}

\end{document}


Since you are using XeLaTeX, you are probably not using type 1 fonts. It is really easy to adapt this code to fontspec package:

1. Comment out \usepackage[T1]{fontenc}
2. Load fontspec package
3. Replace \fontfamily{...} with \setmainfont{...}. You can specify your own font file here.

Notice the use of \bgroup and \egorup restricts the change of font within these few words.

• I don’t recommend redefining \setmainfont in the middle of the document. It would be better to declare a \newfontfamily and switch to it as in my answer. – Davislor Aug 5 '20 at 4:32
• @Davislor Thanks for pointing out. Why is \setmainfont less than ideal here? – Alan Xiang Aug 6 '20 at 1:23
• Several reasons, but one’s that it makes automatic scaling to x-height or caps-height impossible. Another’s that it wastes time and resources. – Davislor Aug 6 '20 at 1:50

Here’s an example using fontspec and \DeclareTextFontCommand. This simplifies the details of wrapping text in font commands for you.

For Palatino, I used the clone TeX Gyre Pagella, and for Fraktur, I used the modern style of Unifraktur Maguntia.

\documentclass[spanish]{article}
\usepackage{babel}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{paracol}

\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX }
\setmainfont{TeX Gyre Pagella}[Scale=1.0]
%% From: https://tug.org/fonts/getnonfreefonts/ or
%%       https://ctan.org/pkg/classico
\setsansfont{URW Classico}
%% From: http://unifraktur.sourceforge.net/maguntia.html
\newfontfamily\initialfont{Unifraktur Maguntia}[StylisticSet=1]

\DeclareTextFontCommand{\poemtitle}{\normalfont\large\sffamily\bfseries}
\DeclareTextFontCommand{\textinitial}{\initialfont}

\begin{document}
\begin{paracol}{2}
\poemtitle{Tiempos en pausa.}
\switchcolumn
\poemtitle{Tiempo.}
\switchcolumn

\begin{verse}
\textinitial{Pausa que como hoyo negro }se traga todo. \\
\textinitial{Todo} al mismo tiempo traga y al mismo tiempo vacía. \\
\textinitial{Vacío} que abrasa y abraza. \\
\textinitial{Abrazo} que devora y a su vez escupe y devuelve. \\
\end{verse}

\switchcolumn
\begin{verse}

Pausa que como hoyo negro \\
todo \\
vacía y \\
abraza. \\

\end{verse}
\end{paracol}
\end{document}


Another possible font you might use, by the same designer as Palatino (of which Pagella is a clone) and Optima (of which Classico is a clone) would be Zapf Chancery (or its clone TeX Gyre Chorus).

If for some reason you wanted to use Type 1 fonts, you might try the oldgerm package.

• I also use URW Classico the clone of Optima Font. I like very much. – Sebastiano Aug 5 '20 at 11:40