diff options
author | Karl Berry <karl@freefriends.org> | 2013-07-17 22:12:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-07-17 22:12:47 +0000 |
commit | d9add100de8f268f2b408533a41cc5624ef1ee7a (patch) | |
tree | a50a9317ff4e1bc15403820318ab44ae97e99d0a /Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex | |
parent | 989e69000a109aa206742cc979fb247b9294ef7a (diff) |
greek-fontenc (17jul13)
git-svn-id: svn://tug.org/texlive/trunk@31220 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex b/Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex new file mode 100644 index 00000000000..e37f51334b3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/greek-fontenc/greekhyperref.tex @@ -0,0 +1,124 @@ +\documentclass{article} +\usepackage{fixltx2e} % LaTeX patches, \textsubscript +\usepackage{cmap} % fix search and cut-and-paste in Acrobat +\usepackage[LGR,T1]{fontenc} +\usepackage{lmodern} + +\usepackage[greek,english]{babel} +\usepackage{alphabeta} +\usepackage[utf8]{inputenc} + +\usepackage[unicode,colorlinks=true,linkcolor=blue]{hyperref} +\usepackage{bookmark} + +% \pagestyle{headings} + +\begin{document} + +\title{Greek and hyperref} +\maketitle + +\noindent +On 2010-11-05, Heiko Oberdiek wrote in comp.text.tex: +% +\begin{quote} + \textbackslash pdfstringdef (converting TeX code to PDF strings for + bookmarks) supports NFSS2 and needs active characters. Encoding + stuff based on the internal font machinery of TeX (letters with + catcode 11 or 12, ligatures) does not work, because the strings + don't reach TeX's stomach. +\end{quote} +% +The \emph{greek-fontenc} package allows input of Greek characters in a way +that ``reaches TeX's stomach'' and hence works in both, the main document as +well as in PDF strings (e.g. bookmarks). Hyperref's ``puenc.def`` font +encoding file defines LICR macros for monotonic Greek (Greek characters of +the ``Greek and Coptic'' unicode block). + +All utf8-encoded literal Unicode characters work in PDF strings. With +\emph{greek-fontenc} and \emph{greek-inputenc}, this enables use of all +Greek character in text and PDF strings. + +\section{Transcription: \ensuregreek{logos}, \foreignlanguage{greek}{logos}} + +\textbackslash{}textgreek + LGR transcription or +Greek language (babel) + LGR transcription: +In the PDF-bookmark are Latin letters instead of Greek ones. + + +\section{Macros: + \textlambda\textomicron\textgamma\textomicron\textvarsigma{}, + \lambda\omicron\gamma\omicron\varsigma{}, + λογος} + +textalpha package with \textbackslash{}textgreek* macros, +alphabeta package with \textbackslash{}alpha ... \textbackslash{}Omega macros, +and literal Greek Unicode characters. + +Works, if the ``unicode'' or ``pdfencoding=auto'' option is given to hyperref. +(With the ``xpdf'' viewer, Greek letters are not shown in PDF bookmarks.) + +The generic short macros from the \emph{alphabeta} package result in +hyperref warnings. See ``alphabeta-text.tex`` and ``alphabeta-test.pdf`` +from the `lgrx` package for details an workarounds. + + +\section{LGR + Macros: \foreignlanguage{greek}{ + \textlambda\textomicron\textgamma\textomicron\textvarsigma{}}} + +LICR-macro input works also if the font encoding is LGR. + +\section{% + Kerning: \textAlpha\textUpsilon\textLambda{} + \ensuregreek{\textAlpha\textUpsilon\textLambda} + \foreignlanguage{greek}{\textAlpha\textUpsilon\textLambda}% +} + +Kerning is impossible if the font encoding is switched for every single +character. Wrap the Greek part in a command switching to LGR font encoding +to fix this, either \verb+\ensuregreek{...}+ (with package textalpha) or +\verb+\foreignlanguage{greek}{...}+ (with babel). + +% letters of the Greek and Coptic Unicode Block supported by LGR: +\newcommand{\GreekAndCoptic}{ʹ͵ͺ; ΄ ΅ Ά·ΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫϘϚϜϠ} +\newcommand{\greekandcoptic}{άέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϙϛϝϟϡ} + +\section{Literal Unicode input} +The following subsection headings contain all characters from the ``Greek +and Coptic'' and ``Greek Extended'' Unicode Blocks that are supported by the +LGR font encoding as literal Unicode characters. +\subsection{\GreekAndCoptic} +\subsection{\greekandcoptic} +\subsection{ἀἁἂἃἄἅἆἇἈἉἊἋἌἍἎἏ ἐἑἒἓἔἕἘἙἚἛἜἝ} +\subsection{ἠἡἢἣἤἥἦἧἨἩἪἫἬἭἮἯ ἰἱἲἳἴἵἶἷἸἹἺἻἼἽἾἿ} +\subsection{ὀὁὂὃὄὅὈὉὊὋὌὍ ὐὑὒὓὔὕὖὗὙὛὝὟ} +\subsection{ὠὡὢὣὤὥὦὧὨὩὪὫὬὭὮὯ ὰάὲέὴήὶίὸόὺύὼώ} +\subsection{ᾀᾁᾂᾃᾄᾅᾆᾇᾈᾉᾊᾋᾌᾍᾎᾏ ᾐᾑᾒᾓᾔᾕᾖᾗᾘᾙᾚᾛᾜᾝᾞᾟ} +\subsection{ᾠᾡᾢᾣᾤᾥᾦᾧᾨᾩᾪᾫᾬᾭᾮᾯ ᾰᾱᾲᾳᾴᾶᾷᾸᾹᾺΆᾼ᾽ι᾿} +\subsection{῀῁ῂῃῄῆῇῈΈῊΉῌ῍῎῏ ῐῑῒΐῖῗῘῙῚΊ῝῞῟} +\subsection{ῠῡῢΰῤῥῦῧῨῩῪΎῬ῭΅` ῲῳῴῶῷῸΌῺΏῼ´῾} + +\section{non-standard and combined diacritics: \ensuregreek{\>a \'"a}} + +Currently, there is no hyperref support for LICR input with non-standard +accents or combined diacritics characters. + +\section{Makeuppercase} + +According to Greek typesetting conventions, +diacritics (except the dialytika) are dropped in ALL CAPS. + +However, \verb|\Makeuppercase| is not supported in PDF-strings, so we +do not need to care for this. + +\section{Conclusion} + +For Greek text parts in section headers use either literal Unicode +characters or macros. For multi-accented letters or non-standard accents, +use literal pre-composed Unicode characters. (Combining Unicode characters +do not work with inputenc and 8-bit LaTeX. This is a general restriction.) + +For proper kerning in the main document, combine this with the +\verb+\textgreek+ or \verb+\foreignlanguage{greek}+ macros. + +\end{document} |