share
TeX - LaTeXHow to use Fraktur/Gothic fonts in text mode
[+44] [3] Vineet Menon
[2012-06-19 08:29:25]
[ fonts xetex ]
[ https://tex.stackexchange.com/questions/60360/how-to-use-fraktur-gothic-fonts-in-text-mode ]

Is there any way to use fraktur font styles in text mode? I cannot enter math and do \mathfrak because then spaces are eaten up by LaTeX.

Any pointers?

[+59] [2012-06-19 08:46:09] egreg [ACCEPTED]

You have available some beautiful fonts designed by Yiannis Haralambous (these can be used also with XeLaTeX, but unfortunately they don't accept Unicode input for accented letters).

\documentclass{article}
\usepackage{yfonts}

\begin{document}
\textfrak{This: is: Fraktur}

\textswab{This: is: Schwabacher}

\textgoth{This: is: Gothic}
\end{document}

(Notice how the "round s" is obtained. Thanks to @Christian for noticing it.)

plain example

You find a description of the fonts in this article in TUGboat [1]

It is of note that the package also provides initials.

example with initials

This was produced by this code, notice the change between long and round s:

\documentclass{article}
\usepackage{yfonts}

\begin{document}
{\frakfamily\fraklines
   \yinipar{T}his: is: an initial with a sentence in Fraktur.\\
   \textfrak{This: is: also Fraktur.}\\
   \textswab{This: is: Schwabacher.}\\
   \textgoth{This: is: Gothic.}
}
\end{document}
[1] http://www.tug.org/TUGboat/tb12-1/tb31hara.pdf

I am using mictex and it can't compile it. It says yfonts.sty is needed. - rainman
(1) @Ome You should install it: miktex.org/packages/yfonts - egreg
@egreg: How to install this yfonts in Ubuntu? - rainman
(1) @far.westerner first search for yfonts using apt-get search yfonts, then find the package e.g. texlive-yfonts, and then install it using sudo apt-get install texlive-yfonts. - K1.
1
[+33] [2012-06-20 13:08:15] Håkon Malmedal

The UniFraktur project [1] is rather nice.

\documentclass{minimal}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{UnifrakturMaguntia}
\renewcommand\emshape{\addfontfeature{LetterSpace=20.0,Ligatures=Required,Ligatures=NoCommon}}
\begin{document}
This is an \emph{important} teſt.
\end{document}

This is an important teſt.

A quote from the page Fraktur letterſpacing [2]:

The fraktur ligatures ‹ch›, ‹ck›, ‹ſt›, ‹tz› are treated as ſingle letters with regard to letterſpacing.

The line

\renewcommand\emshape{\addfontfeature{LetterSpace=20.0,Ligatures=Required,Ligatures=NoCommon}}

is taken from that page.

A contrived example:

\documentclass{minimal}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{UnifrakturMaguntia}
\renewcommand\emshape{\addfontfeature{LetterSpace=20.0,Ligatures=Required,Ligatures=NoCommon}}
\begin{document}
Uſe the \emph{tzar's checkliſt}!
\end{document}

Uſe the tzar's checkliſt!

The project has a forum, and one post [3] recommends the lines

\usepackage{xspace}
\renewcommand\emshape{\xspace\addfontfeature{LetterSpace=20.0,WordSpace=2.0,Ligatures={Required,NoCommon}}}

instead.

The difference can be illustrated with this example:

\documentclass[a5paper]{scrartcl}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{UnifrakturMaguntia}
\usepackage{xspace}
\newcommand{\exampletext}{%
‘Now, it is very remarkable that this is ſo extenſively overlooked,’
continued the Time Traveller, with a ſlight acceſſion of cheerfulneſs.
‘Really this is what is meant by the Fourth Dimenſion, though ſome
people who talk about the Fourth Dimenſion do not know they mean it. It
is only another way of looking at Time. \emph{There is no difference
between Time and any of the three dimenſions of Space except that our
conſciouſneſs moves along it.} But ſome fooliſh people have got hold of
the wrong ſide of that idea. You have all heard what they have to ſay
about this Fourth Dimenſion?’%
}
\begin{document}
\renewcommand\emshape{\addfontfeature{LetterSpace=20.0,Ligatures=Required,Ligatures=NoCommon}}
\exampletext

\renewcommand\emshape{\xspace\addfontfeature{LetterSpace=20.0,WordSpace=2.0,Ligatures={Required,NoCommon}}}
\exampletext
\end{document}

example text

It is important to note the effect of the \xspace (to be introduced with the xspace-package). Without it, the space preceeding the spaced out text will be a normal interword space and thus to thin; making it hard to recognise the beginning of the spaced text.

[1] http://unifraktur.sourceforge.net/
[2] http://unifraktur.sourceforge.net/letterspacing.html
[3] http://unifraktur.sourceforge.net/unifraktur-forum/viewtopic.php?f=5&t=51#p718

(5) +1 for noting the Fraktur uses letter-spacing for emphasis. - J. C. Salomon
(1) Also for getting the ligatures feature correct. The UniFraktur site you link to has this information, but perhaps you can include the “ſchwitzen” example they use to explain in your answer why you’ve set the font features as you (correctly) did. - J. C. Salomon
2
[+11] [2012-06-19 08:44:01] bodo

With XeLaTeX you could use a special fraktur font (maybe http://www.fontspace.com/george-williams/fractur). Use for example:

\usepackage{fontspec}
\setmainfont[Ligatures=TeX]{frakturfontname}

It is certainly possible to only apply such a font to specific part of the document, but I did not need that before.


On how to apply a font only to part of a document, see tex.stackexchange.com/a/37251/4012. - doncherry
@canaaerus:i could have used this, but xltxtra causes osf in kpfonts to revert back to ordinary numbers...do u know the reason for this?? - Vineet Menon
(1) @VineetMenon I don't see why using XeLaTeX with kpfonts that are not OpenType fonts. In any case, loading xltxtra is not needed, but fontspec is for being able to load an OpenType font. - egreg
Please, change xltxtra to fontspec and Mapping=tex-text to Ligatures=TeX. - egreg
Shouldn't this also work with LuaLaTeX? Then you don't need XeLaTeX which only gave me worries on anything but Mac OS. - Christian
Sorry, I didn't see the little xetex tag, in the text it says LaTeX. My bad. - Christian
3