diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/textgreek/textgreek.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/textgreek/textgreek.sty | 229 |
1 files changed, 181 insertions, 48 deletions
diff --git a/Master/texmf-dist/tex/latex/textgreek/textgreek.sty b/Master/texmf-dist/tex/latex/textgreek/textgreek.sty index a12cd504d25..4099af10042 100644 --- a/Master/texmf-dist/tex/latex/textgreek/textgreek.sty +++ b/Master/texmf-dist/tex/latex/textgreek/textgreek.sty @@ -28,7 +28,7 @@ %% \NeedsTeXFormat{LaTeX2e}[2009/09/24] \ProvidesPackage{textgreek} - [2011/03/30 v0.4 greek symbols in text] + [2011/04/08 v0.5 greek symbols in text] \InputIfFileExists{lgrenc.def}{% \PackageInfo{textgreek}{Loading the definitions for the Greek font% encoding.}}{% @@ -37,58 +37,73 @@ font encoding LGR. Maybe it comes with the babel package.}} \DeclareOption{cbgreek}{% \renewcommand*{\textgreekfontmap}{% -{eur/m/n}{U/eur/m/n} -{eur/b/n}{U/eur/b/n} -{phv/m/n}{U/psy/m/n}}}% +{eur/*/*}{U/eur/*/*} +{phv/*/*}{U/psy/*/*}}}% \DeclareOption{euler}{% \renewcommand*{\textgreekfontmap}{% -{eur/m/n}{U/eur/m/n} -{eur/b/n}{U/eur/b/n} -{cmr/m/n}{U/eur/m/n} -{cmr/b/n}{U/eur/b/n} -{cmr/bx/n}{U/eur/b/n} -{lmr/m/n}{U/eur/m/n} -{lmr/b/n}{U/eur/b/n} -{lmr/bx/n}{U/eur/b/n} -{phv/m/n}{U/psy/m/n}}}% +{phv/*/*}{U/psy/*/*} +{*/bx/n}{U/eur/b/n} +{*/b/n}{U/eur/b/n} +{*/*/n}{U/eur/m/n}}}% \DeclareOption{artemisia}{% \renewcommand*{\textgreekfontmap}{% -{eur/m/n}{U/eur/m/n} -{eur/b/n}{U/eur/b/n} -{cmr/m/n}{LGR/artemisia/m/n} -{cmr/b/n}{LGR/artemisia/b/n} -{cmr/bx/n}{LGR/artemisia/bx/n} -{lmr/m/n}{LGR/artemisia/m/n} -{lmr/b/n}{LGR/artemisia/b/n} -{lmr/bx/n}{LGR/artemisia/bx/n} -{phv/m/n}{U/psy/m/n}}}% + {eur/*/*}{U/eur/*/*} + {phv/*/*}{U/psy/*/*} + {*/b/n}{LGR/artemisia/b/n} + {*/bx/n}{LGR/artemisia/bx/n} + {*/*/n}{LGR/artemisia/m/n} + {*/b/it}{LGR/artemisia/b/it} + {*/bx/it}{LGR/artemisia/bx/it} + {*/*/it}{LGR/artemisia/m/it} + {*/b/sl}{LGR/artemisia/b/sl} + {*/bx/sl}{LGR/artemisia/bx/sl} + {*/*/sl}{LGR/artemisia/m/sl} + {*/*/sc}{LGR/artemisia/m/sc} + {*/*/sco}{LGR/artemisia/m/sco}}}% \newcommand*{\textgreekfontmap}{}% \ExecuteOptions{cbgreek} \ProcessOptions\relax% \PackageInfo{textgreek}{Loaded fontmap: \textgreekfontmap.} -\def\textgreek@setfont#1/#2/#3/#4\relax{\usefont{#1}{#2}{#3}{#4}}% -\def\textgreek@skipencoding#1/#2\relax{#2}% -\def\textgreek@substfont#1#2{% -\begingroup\edef\tempa{#1}\edef\tempb{\curr@fontshape}% -\edef\tempc{\expandafter\textgreek@skipencoding\tempb\relax}% -\def\spit##1##2\endgroup{\fi\endgroup##1}% -\ifx\tempa\tempc\spit{\expandafter\textgreek@setfont #2\relax}\fi\endgroup}% +\def\textgreek@setfont#1/#2/#3/#4\relax{% +\textgreek@ematch{#1}{*}{}{\fontencoding{#1}}% +\textgreek@ematch{#2}{*}{}{\fontfamily{#2}}% +\textgreek@ematch{#3}{*}{}{\fontseries{#3}}% +\textgreek@ematch{#4}{*}{}{\fontshape{#4}}}% \def\textgreek@eof{}% \def\textgreek@return#1#2\textgreek@eof{% -\fi #1} -\newcommand{\textgreeksubstfonts}[1]{% - \ifx#1\textgreek@eof% - \else\textgreek@return{\textgreek@substfonts#1\textgreek@eof}% - \fi\textgreek@eof} -\def\textgreek@substfonts#1#2#3\textgreek@eof{% - \textgreek@substfont{#1}{#2}% - \def\textgreek@temp{#3}\ifx\textgreek@temp\textgreek@eof\else% - \textgreek@return{\textgreek@substfonts#3\textgreek@eof}% - \fi\textgreek@eof} +\fi#1}% +\def\textgreek@ematch#1#2#3#4{% + \begingroup% + \edef\tempa{#1}\edef\tempb{#2}\def\tempc{*}% + \def\return##1##2\endgroup{\fi\endgroup##1}% + \ifx\tempa\tempb\return{#3}\fi% + \ifx\tempa\tempc\return{#3}\fi% + \iftrue\return{#4}\fi% + \endgroup}% +\def\textgreek@matchfont#1/#2/#3\relax#4#5{% + \textgreek@ematch{#1}{\f@family}{% + \textgreek@ematch{#2}{\f@series}{% + \textgreek@ematch{#3}{\f@shape}{#4}{#5}}% + {#5}}% + {#5}% +}% +\def\textgreek@findfont@#1#2#3\textgreek@eof{% + \textgreek@matchfont#1\relax% + {\textgreek@setfont#2\relax}% + {\textgreek@findfont#3\textgreek@eof}}% +\def\textgreek@findfont#1\textgreek@eof{% + \begingroup% + \def\temp{#1}% + \def\return##1##2\endgroup{\fi\endgroup##1}% + \ifx\temp\textgreek@eof\else% + \return{\textgreek@findfont@#1\textgreek@eof}% + \fi\endgroup}% \newcommand*{\textgreekfont}{% \fontencoding{LGR}% - \expandafter\textgreeksubstfonts\expandafter{\textgreekfontmap}% - \selectfont}% + \edef\textgreek@fontmap{\textgreekfontmap}% + \expandafter\textgreek@findfont\textgreek@fontmap\textgreek@eof% + \selectfont% +}% \newcommand*{\lgrtoeuler}[1]{% \if G#1\textgreek@return{\char0}\fi% \if D#1\textgreek@return{\char1}\fi% @@ -108,7 +123,7 @@ \if 3#1\textgreek@return{\char15}\fi% element-of style epsilon \if z#1\textgreek@return{\char16}\fi% \if h#1\textgreek@return{\char17}\fi% -\if 0#1\textgreek@return{\char18}\fi% temperature style theta +\if j#1\textgreek@return{\char18}\fi% temperature style theta \if i#1\textgreek@return{\char19}\fi% \if k#1\textgreek@return{\char20}\fi% \if l#1\textgreek@return{\char21}\fi% @@ -125,19 +140,77 @@ \if y#1\textgreek@return{\char32}\fi% \if w#1\textgreek@return{\char33}\fi% \if e#1\textgreek@return{\char34}\fi% -\if j#1\textgreek@return{\char35}\fi% +\if 0#1\textgreek@return{\char35}\fi% \if f#1\textgreek@return{\char39}\fi% \fontencoding{LGR}\selectfont #1% \textgreek@eof}% +\newcommand*{\lgrtosymbol}[1]{% +\if A#1\textgreek@return{A}\fi% +\if B#1\textgreek@return{B}\fi% +\if Q#1\textgreek@return{C}\fi% +\if D#1\textgreek@return{D}\fi% +\if E#1\textgreek@return{E}\fi% +\if F#1\textgreek@return{F}\fi% +\if G#1\textgreek@return{G}\fi% +\if H#1\textgreek@return{H}\fi% +\if I#1\textgreek@return{I}\fi% +\if 0#1\textgreek@return{J}\fi% +\if K#1\textgreek@return{K}\fi% +\if L#1\textgreek@return{L}\fi% +\if M#1\textgreek@return{M}\fi% +\if N#1\textgreek@return{N}\fi% +\if O#1\textgreek@return{O}\fi% +\if P#1\textgreek@return{P}\fi% +\if J#1\textgreek@return{Q}\fi% +\if R#1\textgreek@return{R}\fi% +\if S#1\textgreek@return{S}\fi% +\if T#1\textgreek@return{T}\fi% +\if U#1\textgreek@return{U}\fi% +\if c#1\textgreek@return{V}\fi% +\if W#1\textgreek@return{W}\fi% +\if X#1\textgreek@return{X}\fi% +\if Y#1\textgreek@return{Y}\fi% +\if Z#1\textgreek@return{Z}\fi% +\if a#1\textgreek@return{a}\fi% +\if b#1\textgreek@return{b}\fi% +\if q#1\textgreek@return{c}\fi% +\if d#1\textgreek@return{d}\fi% +\if e#1\textgreek@return{e}\fi% +\if v#1\textgreek@return{f}\fi% +\if g#1\textgreek@return{g}\fi% +\if h#1\textgreek@return{h}\fi% +\if i#1\textgreek@return{i}\fi% +\if f#1\textgreek@return{j}\fi% +\if k#1\textgreek@return{k}\fi% +\if l#1\textgreek@return{l}\fi% +\if m#1\textgreek@return{m}\fi% +\if n#1\textgreek@return{n}\fi% +\if o#1\textgreek@return{o}\fi% +\if p#1\textgreek@return{p}\fi% +\if j#1\textgreek@return{q}\fi% +\if r#1\textgreek@return{r}\fi% +\if s#1\textgreek@return{s}\fi% +\if t#1\textgreek@return{t}\fi% +\if u#1\textgreek@return{u}\fi% +\if w#1\textgreek@return{w}\fi% +\if x#1\textgreek@return{x}\fi% +\if y#1\textgreek@return{y}\fi% +\if z#1\textgreek@return{z}\fi% +\fontencoding{LGR}\selectfont #1% +\textgreek@eof}% \DeclareRobustCommand*{\TextGreek}[1]{% \begingroup% \textgreekfont% -\def\tempa{eur}\edef\tempb{\f@family}% -\ifx\tempa\tempb\expandafter\lgrtoeuler\expandafter#1\else#1\noboundary\fi% -\endgroup} +\edef\tempa{\f@family}% +\def\tempb{eur}\def\tempc{psy}% +\ifx\tempa\tempb\textgreek@return{\lgrtoeuler#1}\fi% +\ifx\tempa\tempc\textgreek@return{\lgrtosymbol#1}\fi% +#1% +\textgreek@eof% +\endgroup}% \newcommand*{\DeclareTextGreekSymbol}[2]{% \expandafter\DeclareTextCommandDefault\csname text#1\endcsname% -{\TextGreek#2}}% +{\TextGreek{#2}}}% \DeclareTextGreekSymbol{alpha}{a} \DeclareTextGreekSymbol{beta}{b} \DeclareTextGreekSymbol{gamma}{g} @@ -157,7 +230,8 @@ \DeclareTextGreekSymbol{omikron}{o} \DeclareTextGreekSymbol{pi}{p} \DeclareTextGreekSymbol{rho}{r} -\DeclareTextGreekSymbol{sigma}{s} +\DeclareTextGreekSymbol{sigma}{s\noboundary} +\DeclareTextGreekSymbol{varsigma}{c} \DeclareTextGreekSymbol{tau}{t} \DeclareTextGreekSymbol{upsilon}{u} \DeclareTextGreekSymbol{phi}{f} @@ -188,6 +262,65 @@ \DeclareTextGreekSymbol{Chi}{Q} \DeclareTextGreekSymbol{Psi}{Y} \DeclareTextGreekSymbol{Omega}{W} +\DeclareTextCommand{\straightphi}{PU}% + {\83\325} % U+03D5 GREEK PHI SYMBOL +\DeclareTextCommandDefault{\straightphi}{% +\begingroup\textgreekfont% +\edef\tempa{\f@family}% +\edef\tempb{\f@shape}% +\def\tempc{eur}\def\tempd{psy}% +\def\tempe{it}% +\ifx\tempa\tempc\textgreek@return{\lgrtoeuler{v}}\fi% +\ifx\tempa\tempd\textgreek@return{\lgrtosymbol{v}}\fi% +\ifx\tempb\tempe\textgreek@return{% + \fontencoding{OML}\selectfont\char30}\fi% +\fontencoding{U}\fontfamily{eur}\selectfont\lgrtoeuler{v}% +\textgreek@eof% +\endgroup}% +\DeclareTextCommand{\scripttheta}{PU}% + {\83\321}% U+03D1 GREEK THETA SYMBOL +\DeclareTextCommandDefault{\scripttheta}{% +\begingroup\textgreekfont% +\edef\tempa{\f@family}% +\edef\tempb{\f@shape}% +\def\tempc{eur}\def\tempd{psy}% +\def\tempe{it}% +\ifx\tempa\tempc\textgreek@return{\lgrtoeuler{0}}\fi% +\ifx\tempa\tempd\textgreek@return{\lgrtosymbol{0}}\fi% +j% default theta in cbgreek and artemisia +\textgreek@eof% +\endgroup}% +\DeclareTextCommand{\straighttheta}{PU}% + {\83\270} % U+03B8 GREEK THETA SYMBOL +\DeclareTextCommandDefault{\straighttheta}{% +\begingroup\textgreekfont% +\edef\tempa{\f@family}% +\edef\tempb{\f@shape}% +\def\tempc{eur}\def\tempd{psy}% +\def\tempe{it}% +\ifx\tempa\tempc\textgreek@return{\lgrtoeuler{j}}\fi% +\ifx\tempa\tempd\textgreek@return{\lgrtosymbol{j}}\fi% +\ifx\tempb\tempe\textgreek@return{% + \fontencoding{OML}\selectfont\char18}\fi% +\fontencoding{U}\fontfamily{eur}\selectfont\lgrtoeuler{j}% +\textgreek@eof% +\endgroup}% +\iffalse\fi % U+03F5 GREEK LUNATE EPSILON SYMBOL +\DeclareTextCommand{\straightepsilon}{PU}{\83\365}% +\DeclareTextCommandDefault{\straightepsilon}{% +\begingroup\textgreekfont% +\edef\tempa{\f@family}% +\edef\tempb{\f@shape}% +\def\tempc{eur}\def\tempd{psy}% +\def\tempe{it}% +\ifx\tempa\tempc\textgreek@return{\lgrtoeuler{3}}\fi% +\ifx\tempa\tempd\textgreek@return{% + \fontfamily{eur}\fontseries{b}\selectfont\lgrtoeuler{3}}\fi% +\ifx\tempb\tempe\textgreek@return{% + \fontencoding{OML}\selectfont\char15}\fi% +\fontencoding{U}\fontfamily{eur}\selectfont\lgrtoeuler{3}% +\textgreek@eof% +\endgroup}% \endinput %% %% End of file `textgreek.sty'. |