Fonts & Character SetsGreek with non default font

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
bartomeu vallori
Posts: 8
Joined: Wed Feb 25, 2009 2:09 pm

Greek with non default font

Post by bartomeu vallori »

I'm writing my PhD thesis and I write some texts in ancient greek, but while it works whith default font of LaTeX, when I put a different font (like newcent or whathever else) it gives me an error and doesn't produce any file. The software I'm using is MikTeX and ProTeX. I suspect something in the preamble is mistaken, but I can't find it out. My entire preamble is like follows:

Code: Select all

\documentclass[12pt]{thesis}
\usepackage[greek,catalan]{babel}
\usepackage[or]{teubner}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{fancyhdr}
\usepackage{cite}
\usepackage[bf]{caption}
\textheight=19cm
\textwidth=14cm
\newcommand{\fullref}[1]{\ref{#1} pàgina \pageref{#1}}
\renewcommand{\baselinestretch}{1.3}
\parskip=3mm
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{3}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{\emph{#1}}{}}
\fancyhf{}
\fancyhead[LE]{\emph{Bartomeu Vallori}}
\fancyhead[RO]{\emph{Urbanisme i arquitectura a la ciutat romana de \emph{Pollentia}..}.}
\fancyfoot[CO,CE]{\thepage}
And the way with witch I introduce greek texts:

Code: Select all

{\greektext{<'anjropos}}
Could anybody help me?
Thank you in advance
Bartomeu Vallori

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Greek with non default font

Post by localghost »

It should work when replacing the greek language option by polutonikogreek for the babel package. For detailed explanations see the manual.

Concerning page dimensions and interline spacing and for avoiding other sins when working with LaTeX take a look into the l2tabu document.


Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
bartomeu vallori
Posts: 8
Joined: Wed Feb 25, 2009 2:09 pm

Greek with non default font

Post by bartomeu vallori »

My file still doesn't works! I have changed the greek option for babel to polutonikogreek (and also others concerning tipographical matters), but it remains the same...

Code: Select all

\documentclass[11pt]{book}
\usepackage[polutonikogreek,catalan]{babel}
\usepackage[or]{teubner}
\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{fancyhdr
\usepackage{cite}
\usepackage[bf]{caption}[2004/07/16]
\newcommand{\fullref}[1]{\ref{#1} pàgina \pageref{#1}}
\linespread{1.4}
\setlength{\parindent}{0.7em}
\setcounter{tocdepth}{5}
\setcounter{secnumdepth}{3}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markboth{\emph{#1}}{}}
\fancyhf{}
\fancyhead[LE]{\emph{Bartomeu Vallori}}
\fancyhead[RO]{\emph{Urbanisme i arquitectura a la ciutat romana de \emph{Pollentia}..}.}
\fancyfoot[CO,CE]{\thepage}
The error it gives me is:

Code: Select all

LaTeX Font Warning: Font shape `LGR/pnc/bx/n' undefined
(Font)              using `LGR/pnc/m/n' instead on input line 207.
and

Code: Select all

LaTeX Font Warning: Font shape `OMS/pnc/bx/n' undefined
(Font)              using `OMS/pnc/m/n' instead
(Font)              for symbol `textperiodcentered' on input line 211.

LaTeX Font Info:    Font shape `OMS/pnc/m/n' in size <14.4> not available
(Font)              Font shape `OMS/cmsy/m/n' tried instead on input line 211.
LaTeX Font Info:    Font shape `OMS/pnc/m/it' in size <10.95> not available
(Font)              Font shape `OMS/cmsy/m/n' tried instead on input line 214.
[114]
Bartomeu Vallori
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Greek with non default font

Post by localghost »

Please prepare a complete minimal working example (MWE) and clarify which language shall be the default one. I remember that there has been a similar issue here some time ago. Searching the forum might yield some more help.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
bartomeu vallori
Posts: 8
Joined: Wed Feb 25, 2009 2:09 pm

Greek with non default font

Post by bartomeu vallori »

Thank you a lot for your help!
The MWE has been useful and I've finally found the problem, although haven't solved it. The problem is that a non-default font doesn't support some manners to use greek texts in the titles, being catalan the default language. They work very good in the main text, but not in the chapter/section/subsection/... titles. I've by the moment avoided to put greek texts in the titles, expecting to solve it further.
The MWE remains like this:

Code: Select all

\documentclass[11pt]{article}
\usepackage[polutonikogreek,catalan]{babel}
\usepackage[or]{teubner}
\usepackage[T1]{fontenc}
\title{Greek?}

\begin{document}
\maketitle

\section{Look! Here comes \begin{greektext}>Anast'asioc\end{greektext}!}
\begin{greektext}>Anast'asioc \end{greektext} was PhD student, martirized by greek fonts.
As you can see, if we take off the \verb9\begin{greektext}>Anast'asioc\end{greektext}9 from the section title the document is built, but not if we leave it there...

But if we take de \verb9\usepackage{newcent}9 off leaving the \verb9\begin{greektext}>Anast'asioc\end{greektext}9 in the title it all works well!

\end{document}
Bartomeu Vallori
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Greek with non default font

Post by localghost »

It is simply the fact that the chosen font doesn't support that. Perhaps you should use some other fonts which support Greek [1]. I took a brief look at Section 28 (The Greek language, p. 96ff) of the babel manual and found a better solution to typeset short Greek text snippets in the first paragraph.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[polutonikogreek,catalan]{babel}
\usepackage[or]{teubner}
%\usepackage{lmodern}

\title{Greek?}
\author{Bartomeu Vallori}

\begin{document}
  \maketitle

\section{Look! Here comes \textgreek{>Anast'asioc}}
  \textgreek{>Anast'asioc} was PhD student, martirized by greek fonts. As you can see, if we take off the \verb|\begin{greektext} >Anast'asioc \end{greektext}| from the section title the document is built, but not if we leave it there...

  But if we take de \verb|\usepackage{newcent}| off leaving the \verb|\begin{greektext} >Anast'asioc \end{greektext}| in the title it all works well!
\end{document}
[1] The TeX Catalogue Online, Topic Index - Greek
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
Post Reply