diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex | 230 |
1 files changed, 149 insertions, 81 deletions
diff --git a/Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex b/Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex index c3a33e248dd..61d15db0601 100644 --- a/Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex +++ b/Master/texmf-dist/doc/latex/lgrx/textalpha-test.tex @@ -2,40 +2,35 @@ \usepackage{cmap} % fix search and cut-and-paste in PDF \usepackage{lmodern} \usepackage{parskip} +\usepackage{booktabs} \usepackage{textcomp} -\usepackage{textalpha} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} -\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} -\hypersetup{unicode=true} +\usepackage[unicode=true]{hyperref} \usepackage{bookmark} +% \pagestyle{headings} + +\usepackage{textalpha} -\newcommand{\LGR}{\fontencoding{LGR}\selectfont} -\newcommand{\Latin}{\fontencoding{T1}\selectfont} -\providecommand{\greektext}{% - \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}% -} -\providecommand*{\textgreek}[1]{\leavevmode{\greektext #1}} +\begin{document} -\DeclareTextCommand{\TextGreek}{LGR}[1]{#1} -\DeclareTextCommandDefault{\TextGreek}[1]{\textgreek{#1}} +\section*{Test the \emph{textalpha} package} -\pagestyle{empty} -\setcounter{secnumdepth}{0} +With the \emph{textalpha} package, you can easily write a single Greek +symbol (like \textPsi{} or \textmu{}) or a +\textlambda\textomicron\textgamma\textomicron\textvarsigma{} in non-Greek +text as well as ISO-conforming formulas with upright constants (like +\textpi): $A = \mbox{\textpi} r^2$ vs. $A = \pi r^2$. -\begin{document} -\subsection{Greek alphabet} +\section{Greek alphabet} Greek letters via Latin transscription in LGR font encoding: -\LGR -\MakeUppercase{a b g d e z h j i k l m n x o p r s t u f q y w} - -a b g d e z h j i k l m n x o p r s c t u f q y w +\TextGreek{A B G D E Z H J I K L M N X O P R S T U F Q Y W}\\ +\TextGreek{a b g d e z h j i k l m n x o p r s c t u f q y w} -\Latin Greek letters via default macros in other font encoding (here T1): \textAlpha{} \textBeta{} \textGamma{} \textDelta{} \textEpsilon{} @@ -43,91 +38,164 @@ Greek letters via default macros in other font encoding (here T1): \textLambda{} \textMu{} \textNu{} \textXi{} \textOmicron{} \textPi{} \textRho{} \textSigma{} \textTau{} \textUpsilon{} \textPhi{} \textChi{} \textPsi{} \textOmega{} - - +\\ \textalpha{} \textbeta{} \textgamma{} \textdelta{} \textepsilon{} \textzeta{} \texteta{} \texttheta{} \textiota{} \textkappa{} \textlambda{} \textmu{} \textnu{} \textxi{} \textomicron{} \textpi{} \textrho{} \textsigma{} \textvarsigma{} \texttau{} \textupsilon{} \textphi{} \textchi{} \textpsi{} \textomega{} -So you can easily write a single Greek symbol (like \textPsi{} or -\textmu{}) or -\textlambda\textomicron\textgamma\textomicron\textvarsigma{} in -non-Greek text or ISO-conforming formulas with an upright pi symbol -like $A = \mbox{\textpi} r^2$ instead of $A = \pi r^2$. -However, kerning is broken in other font encodings: compare -\textgreek{AUA} (LGR) to \textAlpha\textUpsilon\textAlpha (T1). -Because of this (and for proper hyphenation), use of babel and correct -language setting is recommended for Greek quotes. +\section{PDF strings} + +With the \emph{lgrx} bundle, you can get Greek letters in both, TeX +and PDF strings. \subsection{\textlambda\textomicron\textgamma\textomicron\textvarsigma{}, - λογος and \TextGreek{logos}} + λογος and \TextGreek{logos}} The subsection title above uses: text* macros, Unicode input and the LGR -transcription for the Greek word \TextGreek{logos}. The last variant (Latin -transscription) is written in Latin letters in the PDF bookmark. +transcription for the Greek word \TextGreek{logos}. Check the table of +contents in the PDF viewer: text* macros and Unicode literals work fine, the +Latin transscription stays Latin in the PDF metadata. -On 2010-11-05, Heiko Oberdiek wrote in comp.text.tex: +\section{Limitations} + +Because the internal font encoding switch interferes with other work behind +the scenes, kerning, diacritics and up/downcasing show problems if +Greek letters are used without explicit change of the font encoding. +These problems can be avoided by use of babel and the correct language +setting (greek or polutonikogreek) or an explicit font encoding switch. + +The \verb+\TextGreek+ macro ensures the argument is set in LGR font +encoding. This can be used to fix these problems without side-effects if +the font encoding is already LGR. + +\subsection{Kerning} + +No kerning occures between Greek characters in non-Greek text due to the +internal font encoding switch:compare +\TextGreek{\textAlpha\textUpsilon\textAlpha} (LGR) to +\textAlpha\textUpsilon\textAlpha (T1). Because of this (and for proper +hyphenation), use of babel and correct language setting is recommended for +Greek quotes. + +The \verb+\TextGreek+ macro is used for wrapping of combined Unicode +character definitions. Check that kerning is preserved also between accented +characters if the font encoding is LGR: \TextGreek{AΫA} vs. AΫA (T1). -\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} - \subsection{Diacritics} -In LGR encoding, shortcuts as well as named macros are set up for use with -the Latin transcription. +Composition of diacritics (like \verb+\Dasia\Tonos+) fails in other font +encodings. Long names (like \verb+\DasiaOxia+) work, however they do not +select precomposed characters. With LGR, pre-composed glyphs are chosen if +available (the difference becomes obvious if you drag-and-drop text from the +PDF version of this document): +% +\TextGreek{\<'a \Dasia\Tonos a \DasiaOxia a \DasiaOxia\textalpha} (LGR) vs. +\DasiaOxia\textalpha{} (T1). -Composition of diacritics (like \verb+\Dasia\Tonos+) fails in other -font encodings. Long names (like \verb+\DasiaOxia+) work, however they -do not select precomposed characters (the difference becomes obvious -if you drag-and-drop text from the PDF version of this document): +Diacritics (except the dialytika) are placed before capital letters in +titlecase and dropped in all-caps: % -LGR: \LGR \<'a \Dasia\Tonos a \DasiaOxia a \DasiaOxia\textalpha \Latin \\ -Latin: \DasiaOxia\textalpha +\begin{quote} + \TextGreek{% + \<{\textalpha} \>{\textepsilon} \"'{\textiota} \`>\texteta{} + \'<{\textomicron} \~<{\textupsilon} \~>{\textomega} + \\ + \<{\textAlpha} \>{\textEpsilon} \"'{\textIota} \`>\textEta{} + \'<{\textOmicron} \~<{\textUpsilon} \~>{\textOmega} + \\ + \MakeUppercase{% + \<{\textalpha} \>{\textepsilon} \"'{\textiota} \`>\texteta{} + \'<{\textomicron} \~<{\textupsilon} \~>{\textomega}. + } + } +\end{quote} +% +However, in other font encodings, this does not work: +\TextGreek{\<{\textAlpha}} (LGR) vs. \<{\textAlpha} (T1). -Diacritics (except the dialytika) should placed -before capital letters and dropped with MakeUppercase: +The dialytika marks a \emph{hiatus} (break-up of a diphthong). It must be +present in UPPERCASE even where it is redundant in lowercase (the hiatus can +also be marked by an accent on the first character of a diphthong). The +auto-hiatus feature works in LGR font encoding, +\Tonos\textalpha\textupsilon{}, \Tonos\textepsilon\textiota{} $\mapsto$ +\MakeUppercase{\TextGreek{ + \Tonos\textalpha\textupsilon{}, \Tonos\textepsilon\textiota{} +}}, but not in T1: +\MakeUppercase{ + \Tonos\textalpha\textupsilon{}, \Tonos\textepsilon\textiota{} +}. -\LGR -\<{\textalpha} \>{\textepsilon} \"'{\textiota} \`>{\texteta} -\'<{\textomicron} \~<{\textupsilon} \~>{\textomega} -\\ -\<{\textAlpha} \>{\textEpsilon} \"'{\textIota} \`>{\textEta} -\'<{\textOmicron} \~<{\textUpsilon} \~>{\textOmega} -\\ -\MakeUppercase{% - \<{\textalpha} \>{\textepsilon} \"'{\textiota} \`>\texteta{} - \'<{\textomicron} \~<{\textupsilon} \~>{\textomega} -} -\Latin However, in other font encodings, this does not work: +\section{Greek Unicode characters in non-Greek text} -No kerning: (\textgreek{ΑΥΑ} vs. ΑΥΑ), misplaced multiple (\textgreek{ἅ} vs. -ἅ) or Titlecase accents (\textgreek{Ά Έ Ή Ί} vs. Ά Έ Ή Ί) and errors with -MakeUppercase. +With the \emph{textalpha} package and inputencoding "utf8", Greek Unicode +characters can be used in text with any font encoding. -Therefore, we would need to define macros for all Unicode characters -that we want to access without explicit font-encoding change. +Combined Diacritics work ᾅ, diacritics (except diaresis) are dopped with +MakeUppercase (μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}), +% +but the Hiatus-detection does not work: Currently, the second vowel of the +diphthong must be given as macro, not Unicode literal: +(\TextGreek{ἀ\textupsilon{}πνία} $\mapsto$ +\TextGreek{\MakeUppercase{\TextGreek{ἀ\textupsilon{}πνία}}} vs. +\TextGreek{\MakeUppercase{\TextGreek{ἀυπνία}}}). +See \texttt{greek-unicode.[tex|psf]} for more details. + +No kerning occures between Greek characters in non-Greek text due to the +internal font encoding switch: \TextGreek{ΑΥΑ} (LGR) vs. ΑΥΑ (T1). + + +The following tables list Greek Unicode characters: + +\subsection{Greek and Coptic} + +* glyph missing in LGR, · Unicode point not defined + +\begin{tabular}{rrrrrrrrrrrrrrrrr} +\toprule +& 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B & C & D & E & F\\ +\midrule +370 & * & * & * & * & ʹ & ͵ & * & * & · & · & ͺ & * & * & * & ; & \\ +380 & · & · & · & · & ΄ & ΅ & Ά & · & Έ & Ή & Ί & · & Ό & · & Ύ & Ώ\\ +390 & ΐ & Α & Β & Γ & Δ & Ε & Ζ & Η & Θ & Ι & Κ & Λ & Μ & Ν & Ξ & Ο\\ +3A0 & Π & Ρ & · & Σ & Τ & Υ & Φ & Χ & Ψ & Ω & Ϊ & Ϋ & ά & έ & ή & ί\\ +3B0 & ΰ & α & β & γ & δ & ε & ζ & η & θ & ι & κ & λ & μ & ν & ξ & ο\\ +3C0 & π & ρ & ς & σ & τ & υ & φ & χ & ψ & ω & ϊ & ϋ & ό & ύ & ώ & \\ +3D0 & * & * & * & * & * & * & * & * & Ϙ & ϙ & Ϛ & ϛ & Ϝ & ϝ & * & ϟ\\ +3E0 & Ϡ & ϡ & * & * & * & * & * & * & * & * & * & * & * & * & * & *\\ +3F0 & * & * & * & * & * & * & * & * & * & * & * & * & * & * & * & *\\ +\bottomrule +\end{tabular} + +\subsection{Greek Extended} + +\begin{tabular}{rrrrrrrrrrrrrrrrr} +\toprule +& 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & A & B & C & D & E & F\\ +\midrule + 1F00 & ἀ & ἁ & ἂ & ἃ & ἄ & ἅ & ἆ & ἇ & Ἀ & Ἁ & Ἂ & Ἃ & Ἄ & Ἅ & Ἆ & Ἇ\\ + 1F10 & ἐ & ἑ & ἒ & ἓ & ἔ & ἕ & · & · & Ἐ & Ἑ & Ἒ & Ἓ & Ἔ & Ἕ & · & \\ + 1F20 & ἠ & ἡ & ἢ & ἣ & ἤ & ἥ & ἦ & ἧ & Ἠ & Ἡ & Ἢ & Ἣ & Ἤ & Ἥ & Ἦ & Ἧ\\ + 1F30 & ἰ & ἱ & ἲ & ἳ & ἴ & ἵ & ἶ & ἷ & Ἰ & Ἱ & Ἲ & Ἳ & Ἴ & Ἵ & Ἶ & Ἷ\\ + 1F40 & ὀ & ὁ & ὂ & ὃ & ὄ & ὅ & · & · & Ὀ & Ὁ & Ὂ & Ὃ & Ὄ & Ὅ & · & \\ + 1F50 & ὐ & ὑ & ὒ & ὓ & ὔ & ὕ & ὖ & ὗ & · & Ὑ & · & Ὓ & · & Ὕ & · & Ὗ\\ + 1F60 & ὠ & ὡ & ὢ & ὣ & ὤ & ὥ & ὦ & ὧ & Ὠ & Ὡ & Ὢ & Ὣ & Ὤ & Ὥ & Ὦ & Ὧ\\ + 1F70 & ὰ & ά & ὲ & έ & ὴ & ή & ὶ & ί & ὸ & ό & ὺ & ύ & ὼ & ώ & · & \\ + 1F80 & ᾀ & ᾁ & ᾂ & ᾃ & ᾄ & ᾅ & ᾆ & ᾇ & ᾈ & ᾉ & ᾊ & ᾋ & ᾌ & ᾍ & ᾎ & ᾏ\\ + 1F90 & ᾐ & ᾑ & ᾒ & ᾓ & ᾔ & ᾕ & ᾖ & ᾗ & ᾘ & ᾙ & ᾚ & ᾛ & ᾜ & ᾝ & ᾞ & ᾟ\\ + 1FA0 & ᾠ & ᾡ & ᾢ & ᾣ & ᾤ & ᾥ & ᾦ & ᾧ & ᾨ & ᾩ & ᾪ & ᾫ & ᾬ & ᾭ & ᾮ & ᾯ\\ + 1FB0 & ᾰ & ᾱ & ᾲ & ᾳ & ᾴ & · & ᾶ & ᾷ & Ᾰ & Ᾱ & Ὰ & Ά & ᾼ & ᾽ & ι & ᾿\\ + 1Fc0 & ῀ & ῁ & ῂ & ῃ & ῄ & · & ῆ & ῇ & Ὲ & Έ & Ὴ & Ή & ῌ & ῍ & ῎ & ῏\\ + 1FD0 & ῐ & ῑ & ῒ & ΐ & · & · & ῖ & ῗ & Ῐ & Ῑ & Ὶ & Ί & · & ῝ & ῞ & ῟\\ + 1FE0 & ῠ & ῡ & ῢ & ΰ & ῤ & ῥ & ῦ & ῧ & Ῠ & Ῡ & Ὺ & Ύ & Ῥ & ῭ & ΅ & `\\ + 1FF0 & · & · & ῲ & ῳ & ῴ & · & ῶ & ῷ & Ὸ & Ό & Ὼ & Ώ & ῼ & ´ & ῾ & \\ +\bottomrule +\end{tabular} -Alternative: A \verb+\TextGreek+ TextCommandDefault that wraps the argument in -the equivalent of Babel's \verb+\textgreek+ with an LGR TextCommand that -just passes the argument. This is done in the preamble of this document. -This works with the Babel transscription (\TextGreek{logos}), -keeps kerning (if the kerning pair is inside the argument, -\TextGreek{\textAlpha\textUpsilon\textAlpha}), -and allows iterative accent macros where pre-composed characters are -selected (\TextGreek{\DasiaOxia\textalpha} or -\TextGreek{\Dasia\Tonos\textalpha}). -TODO: Use this definition for multi-macro definitions in the Unicode -definition file? \end{document} |