LaTeX forum ⇒ XeTeXpolytonic 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

Postby wegelin » Mon Jan 05, 2015 2:22 am

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:

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


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

  1. \documentclass[a4paper,12pt] {article}
  2. \usepackage{fontspec}
  3. \setromanfont{FreeSerif}
  4. \begin{document}
  5. Greek? \\
  6. Ἐν ἀρχῇ ἦν ὁ λόγος,\\
  7. In [the] beginning was the word,\\
  8. \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:

User avatar
Johannes_B
Site Moderator
Posts: 3907
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Jan 05, 2015 11:55 am

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

Postby wegelin » Tue Jan 06, 2015 3:37 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?

User avatar
Johannes_B
Site Moderator
Posts: 3907
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jan 06, 2015 10:06 am

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

Postby wegelin » Tue Jan 06, 2015 7:25 pm

I ran

  1. 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
cat-license: gpl3
collection: collection-fontsextra

but when I try to invoke it:
  1. \documentclass[12pt]{article}
  2. \usepackage{gnu-freefont}
  3. \usepackage{fontspec}
  4. \setromanfont{FreeSerif}
  5. \begin{document}
  6. Hello world?
  7. \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?

User avatar
Johannes_B
Site Moderator
Posts: 3907
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jan 06, 2015 8:54 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

Postby wegelin » Tue Jan 06, 2015 9:26 pm

a1.tex is

  1. \documentclass[a4paper,12pt] {article}
  2. \usepackage{fontspec}
  3. \setromanfont{FreeSerif}
  4. \begin{document}
  5. Greek? \\
  6. Ἐν ἀρχῇ ἦν ὁ λόγος,\\
  7. In [the] beginning was the word,\\
  8. \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: Could not map source abbreviation F for FreeSerif.
/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.

User avatar
Johannes_B
Site Moderator
Posts: 3907
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Tue Jan 06, 2015 11:09 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

Postby wegelin » Thu Jan 22, 2015 11:28 pm

The following compiled and the Greek was visible:

  1. \documentclass[12pt]{article}
  2. \usepackage{fontspec}
  3. \setmainfont{Times New Roman}
  4. %\setmainfont{Latin Modern Roman}
  5. \begin{document}
  6. This is a test.
  7.  
  8. Greek:
  9.  
  10. 382
  11. οὔτ'
  12. ἄκριες
  13. ἔσχεθον
  14. ὁρμήν:
  15.  
  16. \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.

User avatar
Johannes_B
Site Moderator
Posts: 3907
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Jan 23, 2015 12:16 am

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.


Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 2 guests