LaTeX forum ⇒ XeTeX ⇒ polytonic Greek

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
wegelin
Posts: 15
Joined: Sun Oct 13, 2013 2:25 am

polytonic Greek

Does the TeXLive distribution include all tools needed for xelatex with polytonic Greek?

Following http://www.chubb.wattle.id.au/PeterChubb/PolytonicGreek.html, I tried to xelatex the following, c.tex:

\documentclass[a4paper,12pt] {article}\usepackage{fontspec}%\setromanfont{FreeSerif}\begin{document}Greek? \\Ἐν ἀρχῇ ἦν ὁ λόγος,\\In [the] beginning was the word,\\\end{document}

It compiled but the Greek was not visible in the pdf. When I un-commented the FreeSerif line, to make a.tex:

\documentclass[a4paper,12pt] {article}\usepackage{fontspec}\setromanfont{FreeSerif}\begin{document}Greek? \\Ἐν ἀρχῇ ἦν ὁ λόγος,\\In [the] beginning was the word,\\\end{document}

xelatex a

halted with

fontspec error: "font-not-found"

a.log begins as follows:

This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013) (format=xelatex 2013.5.30) 4 JAN 2015 18:48

I would like to use xelatex to compile documents that include both English and polytonic Greek, as well as French, Spanish, and German accented characters; and to do this with as few workarounds as possible.

Thank you for any insight

Jacob Wegelin

Tags:

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
The error message is pretty clear: The font is not installed on your system (or can't be found by XeLaTeX).
As pointed out in the article you linked, you have to install the font by installing package ttf-freefont (in linux or Mac).

With the font, everything works just fine.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

wegelin
Posts: 15
Joined: Sun Oct 13, 2013 2:25 am
I am confused by the term "package". In my TeX experience so far, "package" has always been a software extension already available on my computer thanks to the TeXLive distribution. All I have to do is invoke it in the preamble with "usepackage."

Outside of that very specialized sense, however, "package" is a very general term like "object". It could mean just about anything.

Am I correct in believing that the "ttf-freefont" package is not a software extension in TeX? Is it not included in a TeX distribution?

I am also confused by the term "ttf-freefont". When I search for it on the Web, the search engine splits it at the hyphen. Then "ttf" merely means any TrueType font and "freefont" just means a font that one does not have to pay for. Is there some specific thing that one can download to a Mac and in some sense install, which is called "ttf-freefont"? Where does one get it and how does one "install" it? Is it a piece of software? Does other software, or do other applications, use it besides TeX?

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Mac and linux work with packages, which can more or less mean a bundle of applications or just one part of one application. The nomenclature is a bit wobbly here. So, yes, it is a piece of software.

Using google i couldn't find a trace of ttf-freefont for mac, but this might be due to my lack of Mac stuff.
On the other hand, FreeSerif.ttf is installed in my TeX Directory, and after a bit of research: Gnu-freefont. Please install this package using your tlmgr (TeX Live manager) or TeX Live Utility.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

wegelin
Posts: 15
Joined: Sun Oct 13, 2013 2:25 am
I ran

sudo tlmgr update --self

and now have gnu-freefont installed:

> tlmgr info gnu-freefont
package: gnu-freefont
category: Package
shortdesc: A Unicode font, with rather wide coverage.
longdesc: The package provides a set of outline (i.e. OpenType) fonts covering as much as possible of the Unicode character set. The set consists of three typefaces: one monospaced and two proportional (one with uniform and one with modulated stroke).
installed: Yes
revision: 29349
sizes: src: 24721k, doc: 925k, run: 17401k
relocatable: Yes
cat-date: 2012-07-05 15:28:28 +0200
collection: collection-fontsextra

but when I try to invoke it:
\documentclass[12pt]{article}\usepackage{gnu-freefont}\usepackage{fontspec}\setromanfont{FreeSerif}\begin{document}Hello world?\end{document}

> xelatex a
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
restricted \write18 enabled.
entering extended mode
(./a.tex
LaTeX2e <2011/06/27>
Babel <3.9g> and hyphenation patterns for 78 languages loaded.
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/local/texlive/2013/texmf-dist/tex/latex/base/size12.clo))

! LaTeX Error: File gnu-freefont.sty' not found.

My own search finds no such file, although there are 266 files containing the string "gnu-freefont":

> find /usr/local/texlive | egrep -i 'freefont.*sty' | wc
0 0 0
> find /usr/local/texlive | egrep -i 'gnu-freefont' | wc
266 266 22022

Also "FreeSerif" appears to be installed:

> find /usr/local/texlive -type f | egrep '\bFreeSerif\b'
<snip>
/usr/local/texlive/2013/texmf-dist/fonts/opentype/public/gnu-freefont/FreeSerif.otf
/usr/local/texlive/2013/texmf-dist/fonts/truetype/public/gnu-freefont/FreeSerif.ttf
/usr/local/texlive/2013/texmf-dist/source/fonts/gnu-freefont/FreeSerif.sfd

Am I making some obvious error?

If the package is installed by tlmgr, why is there no style file?

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
As i wrote, the word package is not clearly defined. There are some meta packages in TeX Live as well. Package as in piece of software. Package (gnu-freefonts) contains fonts, to be used by fontspec. It is not a LaTeX package (file ending sty). This must be really confusing for you know.

Run the example in your very first post above, it should work now just as it did on my machine.

btw: Why do you need a font like free serif? All you need is a font that supporst (i.e. includes) glyphs of different alphabets. Standard font for use with LaTeX is computer modern/Latin modern. They include the latin alphabet and some additional stuff. But there are more alphabets. Accented latin letters, greek letters, cyrillyc, hebrew, arabic the whole CJK stuff.

Some projects like the above mentioned GNU project, Linux Libertine, or the liberation project try give users a font that can be used with all alphabets. Giving a document a unified look.

Remember the old days, latin letters and some symbols from different fonts. Documents with math or other alphabets used to look like ransom letters with the letters cut out from different newspapers
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

wegelin
Posts: 15
Joined: Sun Oct 13, 2013 2:25 am
a1.tex is

\documentclass[a4paper,12pt] {article}\usepackage{fontspec}\setromanfont{FreeSerif}\begin{document}Greek? \\Ἐν ἀρχῇ ἦν ὁ λόγος,\\In [the] beginning was the word,\\\end{document}

> xelatex a1

At the following line it pauses for about a minute:

kpathsea: Running mktextfm FreeSerif

and then

/usr/local/texlive/2013/texmf-dist/web2c/mktexnam: Need to update /usr/local/texlive/2013/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FreeSerif
This is METAFONT, Version 2.718281 (TeX Live 2013)

kpathsea: Running mktexmf FreeSerif
! I can't find file FreeSerif'.
<*> ...jfour; mag:=1; nonstopmode; input FreeSerif

Please type another input file name
! Emergency stop.
<*> ...jfour; mag:=1; nonstopmode; input FreeSerif

Transcript written on mfput.log.
grep: FreeSerif.log: No such file or directory
mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input FreeSerif' failed to make FreeSerif.tfm.
kpathsea: Appending font creation commands to missfont.log.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "FreeSerif" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.3 \setromanfont{FreeSerif}

?

I'm puzzled that it "needs to update" when I ran

sudo tlmgr update --self

earlier today.

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
Please try the following Finding a font for XeTeX.

It is possible, that this font is installed system-wide on my machine. I was expecting that to work out of the box, maybe this will help. Personally, i have the font multiple times on my system, maybe XeTeX picked up a system font.
The call for metafont seemed a bit odd for me, so i asked Chat transcript.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

wegelin
Posts: 15
Joined: Sun Oct 13, 2013 2:25 am
The following compiled and the Greek was visible:

\documentclass[12pt]{article}\usepackage{fontspec}\setmainfont{Times New Roman}%\setmainfont{Latin Modern Roman}\begin{document}         This is a test.           Greek:          382         οὔτ'         ἄκριες         ἔσχεθον         ὁρμήν: \end{document}`

With "Latin Modern Roman" instead of "Times New Roman", it returns an error. Without any "setmainfont" statement, it compiles but the Greek is invisible.

Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm
As the name might suggest (latin, roman) it doesn't include greek glyphs.

As soon as you need glyphs of a non latin aplhabet, you basically have to look out for another font.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.