0

I have this:

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage{lmodern}
\begin{document}
Hello \textgreek{κόσμος}.
\end{document}

However, it gives me this error:

! Package babel Error: Unknown option `greek'. Either you misspelled it
(babel)                or the language definition file greek.ldf was not found.

So I looked around and it says to try installing the texlive package. However, all the instructions are for Linux. So I tried it on Mac, but package not found:

$ sudo tlmgr install texlive-lang-greek
tlmgr: package repository http://ctan.math.illinois.edu/systems/texlive/tlnet (verified)
tlmgr install: package texlive-lang-greek not present in repository.
tlmgr: action install returned an error; continuing.
tlmgr: An error has occurred. See above messages. Exiting.

How do I get this working?

Lance
  • 1,799
  • 2
    texlive-lang-greek is an ubuntu and not a tlmgr package. You need the package babel-greek – DG' Oct 27 '19 at 20:40
  • What TeX distribution are you using? – Herb Schulz Oct 27 '19 at 21:59
  • See also this or several other answers on the site. If you want to use Latin Modern fonts for the Latin alphabet and something else for Greek, there’s substitutefont. – Davislor Oct 28 '19 at 04:28
  • If you know the name of the missing file, in this case greek.ldf, you can usually do a package search by filename at CTAN.org. It will tell you the name of the TeX Live and the MikTeX package, if there is one. The babel-greek package is an unfortunate exception; the package on CTAN creates greek.ldf during installation. You’re better off doing a keyword search. – Davislor Oct 28 '19 at 04:37

2 Answers2

1

If you download MacTeX, which is a large download, you'll get a nice UI for your package installations, and updates. Then you just have to point your package link to the correct directory. It should show as an option in your paths.

If you're using Texpad on MacOS I could advise you further, as that's my setup.

Michelle
  • 519
  • 1
  • 4
  • 15
  • I am using XeLaTeX from the command line. – Lance Oct 27 '19 at 23:48
  • 2
    If you’ve installed MacTeX, which installs a full TeX Live distribution, you will already have the necessary files. – Herb Schulz Oct 28 '19 at 14:02
  • 1
    And then it's just a matter of pointing to the right file location, which XeLaTeX should autodetect. All available packages are shown in the TeX Live Utility, which is installed with MacTeX. Then it's a simple matter of making sure the relevant packages are installed (if not already so). – Michelle Oct 28 '19 at 23:40
0

On my Mac I used the following preamble, exactly as follows, but with personal details and most comments removed, for a multi-lingual document that included Greek and Hebrew. I was unable, after several attempts, to get babel to work for me, and you will see I used polyglossia instead. This worked on TexShop Version 3.51 with XeLaTeX typesetting.

\documentclass[12pt, a4paper, twoside, openright]{extbook}
\usepackage{amssymb}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{paracol}
\usepackage{wrapfig,graphicx,lipsum}    
\usepackage{environ,longtable,threeparttablex,booktabs,multirow,array,adjustbox,supertabular}% table adjustment packages
\newcolumntype{L}[1]{>{\raggedright\let\newline\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\arraybackslash\hspace{0pt}}p{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\arraybackslash\hspace{0pt}}p{#1}}
\usepackage{setspace}
\usepackage{geometry}
\geometry{a4paper, total={210mm,297mm}, left=30mm,top=20mm, footskip=30pt, headsep=15pt, textwidth=160mm, textheight=250mm}
\usepackage{fancyhdr}
\usepackage{afterpage}
\usepackage{extramarks}
\pagestyle{fancy}
\titleformat{\chapter}[display]{\center\normalfont\bfseries}{}{0pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-35pt}{20pt}
\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\usepackage[toc]{multitoc}
\renewcommand{\contentsname}{Table of Contents}
\title{Names in the Bible}
\author{Compiler: (REDACTED)}
\setlength{\parskip}{0pt}
\raggedbottom
\usepackage{indentfirst}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{greek}
\newfontfamily\greekfont[Script=Greek, Renderer=AAT]{Gentium Plus}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew, Renderer=AAT]{Ezra SIL}
\setlength{\headheight}{16pt}
\setlength{\columnsep}{2.5em}
\setlength{\parindent}{0pt} % Default is 15pt.
\setlength{\baselineskip}{1.0em}   %single spacing
\setlength{\oddsidemargin}{.3in}  % left margin is 1.3in on right pages
\setlength{\evensidemargin}{-0.4in} % .6in left margin for even pages, 2-sided document
\setlength{\parskip}{5pt plus 1fil minus 6pt}
\setcolumnwidth{4cm,11cm}[2pt]
\setstretch{1.0}
\widowpenalty=10000
\clubpenalty=10000
\singlespacing
\newcommand{\mystrut}{\rule{0pt}{12pt}}
\begin{document}

In the document itself, I then had entries where the language for the text was specified, as illustrated below:

\extramarks{Aaron}{Aaron}\lhead{\firstxmark}\rhead{\lastxmark}\parbox[t][][t]{4cm}{\textbf{Aaron} \\ \hspace*{1.5cm}\footnotesize{H175}} &  \parbox[t][][t]{12cm}{\textbf{\texthebrew{אַהֲרוֹן} ʼAhărôwn,    a-har-one'; of uncertain derivation; Aharon, the brother of Moses:--Aaron.}}   \\
\footnotesize{ } & \footnotesize{ } \\

\extramarks{Aaron}{Aaron}\lhead{\firstxmark}\rhead{\lastxmark}\parbox[t][][t]{4cm}{\textbf{Aaron} \\ \hspace*{1.5cm}\footnotesize{G2}} &  \parbox[t][][t]{12cm}{\textbf{\textgreek{Ἀαρών} Aarṓn,    ah-ar-ohn'; of Hebrew origin (H175); Aaron, the brother of Moses:--Aaron.}} \\
\footnotesize{ } & \footnotesize{ } \\
Polyhat
  • 355