Greek pdf bookmarks
The following works: one has to pass the unicode
option to hyperref
and also a correct Unicode string for the bookmark:
\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[greek,english]{babel}
\usepackage[unicode]{hyperref}
\usepackage{bookmark}
\begin{document}
\mainmatter
\chapter{Introduction}
An introduction.
\cleardoublepage
\begin{otherlanguage}{greek}
\addchap{\texorpdfstring{Per'ilhyh}{Περίληψη}}
Per'ilhyh
\end{otherlanguage}
\end{document}
Unfortunately, the utf8x
option to inputenc
that would allow to use the Greek alphabet for the language is not compatible with the bookmark system of hyperref
.
With the new greek-fontenc
and updated greek-inputenc
packages,
you are now able to use Greek Unicode characters in the LaTeX source
(and the utf8 "LaTeX encoding" option in LyX).
Together with \usepackage[pdfencoding=auto]{hyperref}
his solves
the problem with PDF-strings.
Alternatively, Greek LICR macros (like \textalpha
... \textomega
) can be used.
See the package documentation.
A minimal working example that answers the raised question about Greek in a PDF's Content (index or bookmark or however it might be called correctly) along with Greek text in the body (of course!):
\documentclass[greek,english]{scrbook}
\usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\usepackage[greek,english]{babel}
\usepackage[unicode]{hyperref}
\usepackage{bookmark}
\begin{document}
\mainmatter
\addchap{\texorpdfstring{Ambivalence/\textgreek{Amfijum'ia}}{Ambivalence/Aμφιθυμία}}
\textit{Ambivalence}, catalyst in spreading the great disease which is called Fear.\\
\begin{otherlanguage}{greek}
\textit{Aμφιθυμία}, καταλύτης στην εξάπλωση της μεγάλης νόσου που ονομάζεται Φόβος.
\end{otherlanguage}
\end{document}
It also works when using [english,greek] (instead of [greek,english]):
\documentclass[english,greek]{scrbook}
\usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\usepackage[english,greek]{babel}
\usepackage[unicode]{hyperref}
\usepackage{bookmark}
\begin{document}
\mainmatter
\selectlanguage{english}
\addchap{\texorpdfstring{Ambivalence/\textgreek{Amfijum'ia}}{Ambivalence/Aμφιθυμία}}
\textit{Ambivalence}, catalyst in spreading the great disease which is called Fear.\\
\\
\begin{otherlanguage}{greek}
\textit{Aμφιθυμία}, καταλύτης στην εξάπλωση της μεγάλης νόσου που ονομάζεται Φόβος.
\end{otherlanguage}
\addsec{\texorpdfstring{Small and Ending sigma: \textgreek{σ}~and~\textgreek{ς},~\textgreek{Mikr'o kai Telik'o s'igma: sv kai s}}{Small and Ending sigma: σ and ς, Μικρό και Tελικό: σ και ς}}
\foreignlanguage{english}{However, in LyX, both sigma~(\textgreek{\textit{σ, ς}})~in a Greek text, do not appear correctly in the Contents of a PDF file}! Why?
\begin{otherlanguage}{greek}\\
\\
Ωστόσο, στο \foreignlanguage{english}{LyX}, και τα δυο σίγμα~(\textit{σ, ς})~σε ελληνικό κείμενο, δεν εμφανίζονται σωστά στα περιεχόμενα ενός αρχείου \end{otherlanguage} PDF! Γιατί;
\end{document}
A LyX (not-so-)Minimal Working Example
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
\usepackage{bookmark}
%\usepackage{kerkis}
\usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\end_preamble
\options iso-8859-7,latin9,utf8
\use_default_options true
\begin_modules
fixltx2e
fix-cm
logicalmkup
\end_modules
\maintain_unincluded_children false
\language greek
\language_package default
\inputencoding utf8
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf true
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement h
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_title "Ελληνικοί χαρακτήρες στα περιεχόμενα αρχείου PDF"
\pdf_author "Νίκος Αλεξανδρής"
\pdf_subject "Ελληνικοί χαρακτήρες στα περιεχόμενα αρχείου μορφής PDF"
\pdf_keywords "ελληνικά, ελληνικοί χαρακτήρες, pdf, latex, utf8, content, bookmarks, hyperref"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_breaklinks true
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref page
\pdf_pdfusetitle true
\pdf_quoted_options "unicode=true"
\papersize a4paper
\use_geometry false
\use_amsmath 0
\use_esint 0
\use_mhchem 0
\use_mathdots 0
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\use_refstyle 0
\boxbgcolor #f0f0f0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 10mm
\topmargin 20mm
\rightmargin 20mm
\bottommargin 15mm
\secnumdepth 1
\tocdepth 0
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\bullet 0 0 9 -1
\bullet 1 0 8 -1
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Chapter
\lang english
Introduction
\end_layout
\begin_layout Standard
\lang english
Introductive text...
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
addchap{
\backslash
texorpdfstring{Per'ilhyh}{
\backslash
textvarsigma~
\end_layout
\end_inset
και
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
textsigma}}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
textit{Ambivalence}, catalyst in spreading the great disease which is called
Fear.
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
\backslash
\backslash
\end_layout
\begin_layout Plain Layout
\backslash
begin{otherlanguage}{greek}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
textit{
\end_layout
\end_inset
\lang greek
Aμφιθυμία
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
}
\end_layout
\end_inset
\lang greek
, καταλύτης στην εξάπλωση της μεγάλης νόσου που ονομάζεται Φόβος.
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
end{otherlanguage}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
addsec{
\backslash
texorpdfstring{Small and Ending sigma:
\backslash
textgreek{
\end_layout
\end_inset
\lang greek
σ
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
}~and~
\backslash
textgreek{
\end_layout
\end_inset
\lang greek
ς
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
},~
\backslash
textgreek{Mikr'o kai Telik'o s'igma: sv kai s}}{Small and Ending sigma:
\end_layout
\end_inset
\lang greek
σ
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
and
\end_layout
\end_inset
\lang greek
ς
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
,
\end_layout
\end_inset
\lang greek
Μικρό και Tελικό: σ και ς
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
}}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
foreignlanguage{english}{In LyX, the ending sigma~
\backslash
textgreek{
\backslash
textit{
\end_layout
\end_inset
\lang greek
ς
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
}}~~in a text with greek does not appear correctly in the Contents of a
PDF file}!
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
begin{otherlanguage}{greek}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Στο
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
foreignlanguage{english}{LyX},
\end_layout
\end_inset
\lang greek
το τελικό σίγμα σε κείμενο με ελληνικά δεν εμφανίζεται σωστά στα περιεχόμενα
αρχείου
\lang english
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
foreignlanguage{english}{PDF}
\end_layout
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
end{otherlanguage}
\end_layout
\end_inset
\lang greek
!
\end_layout
\end_body
\end_document
Credits go to Günter Milde. See also:
- http://www.mail-archive.com/[email protected]/msg91078.html
- https://tex.stackexchange.com/a/13077/8272