From 93bbd44762ed1acc3679b1de5646a1386618024f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 9 Feb 2011 00:20:09 +0000 Subject: mathastext (8feb11) git-svn-id: svn://tug.org/texlive/trunk@21350 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/mathastext/mathastext.sty | 138 ++++++++++++++------- 1 file changed, 95 insertions(+), 43 deletions(-) (limited to 'Master/texmf-dist/tex/latex/mathastext') diff --git a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty index bf57a16bcf1..3dd37fcafcb 100644 --- a/Master/texmf-dist/tex/latex/mathastext/mathastext.sty +++ b/Master/texmf-dist/tex/latex/mathastext/mathastext.sty @@ -31,7 +31,21 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesFile{mathastext.sty} - [2011/02/06 1.11 Use the text font in simple mathematics] + [2011/02/07 1.12 Use the text font in simple mathematics] +\newif\ifXeTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname XeTeXinterchartoks\endcsname\relax + \XeTeXfalse +\else + \XeTeXtrue +\fi +\newif\ifLuaTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax + \LuaTeXfalse +\else + \LuaTeXtrue +\fi \def\mt@font@info@off{ \let\m@stext@info\@font@info \let\m@stext@warning\@font@warning @@ -65,7 +79,7 @@ \DeclareOption{fouriervec}{\let\mt@fouriervec\@empty} \DeclareOption{nolessnomore}{\mt@alldelimsfalse} \DeclareOption{endash}{\mt@endashtrue} -\DeclareOption{emdash}{\mt@emdashtrue} +\DeclareOption{emdash}{\mt@emdashtrue\mt@endashfalse} \DeclareOption{noendash}{\mt@endashfalse} \DeclareOption{symboldelimiters}{\mt@need@symboltrue \let\mt@symboldelimiters\@empty} @@ -83,8 +97,8 @@ \DeclareOption{noexclam}{\let\mtno@exclam\@empty} \DeclareOption{noasterisk}{\let\mtno@ast\@empty} \DeclareOption{nospecials}{\let\mtno@specials\@empty} -\DeclareOption{basic}{\ExecuteOptions{noparenthesis,% -nopunctuation,noplusnominus,noequal,noexclam,nospecials}} +\DeclareOption{basic}{\ExecuteOptions{noparenthesis,nopunctuation,% +noplusnominus,noequal,noexclam,noasterisk,nospecials,nolessnomore}} \DeclareOption{nodigits}{\let\mtno@digits\@empty} \DeclareOption{defaultimath}{\let\mt@defaultimath\@empty} \DeclareOption{alldelims}{\mt@alldelimstrue} @@ -220,13 +234,13 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \fi \ifmt@need@symbol\SetSymbolFont{mtpsymbol}{bold} {U}{psy}{\mt@boldvariant@normal}{n}\fi - \typeout{** Latin letters in math versions normal (resp. bold) are now\MessageBreak + \typeout{** Latin letters in math versions normal (resp. bold) are now^^J% ** set up to use the fonts \mt@encoding@normal/\mt@family@normal/\mt@series@normal% (\mt@boldvariant@normal)/\mt@ltshape@normal} \ifx\mtno@digits\@empty\else \typeout{** Other characters (digits, ...) and - \protect\log-like names will be\MessageBreak + \protect\log-like names will be^^J% ** typeset with the \expandafter`\mt@shape@normal' shape.} \fi \else % optional argument, then we rather do DeclareVersion @@ -259,7 +273,7 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \ifx\mt@italic\@empty \SetSymbolFont{mtletterfont}{#2}{#3}{#4}{#5}{\m@stextshletter} \typeout{** Latin letters in math version `#2' will use the font - #3/#4/#5/\m@stextshletter\MessageBreak + #3/#4/#5/\m@stextshletter^^J% ** Other characters (digits, ...) and \protect\log-like names will be in `#6' shape.} \expandafter\def\csname mt@ltshape\mt@tmp\endcsname{\m@stextshletter} @@ -272,7 +286,7 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \else \SetSymbolFont{mtletterfont}{#2}{#3}{#4}{#5}{#1} \typeout{** Latin letters in math version `#2' will use the font - #3/#4/#5/#1\MessageBreak + #3/#4/#5/#1^^J% ** Other characters (digits, ...) and \protect\log-like names will be in `#6' shape.} \expandafter\edef\csname mt@ltshape\mt@tmp\endcsname{#1} \fi @@ -292,15 +306,15 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \ifmt@defaultrm\else\renewcommand{\mathrm}{\Mathrm}\fi \ifmt@defaultbf\else\renewcommand{\mathbf}{\Mathbf}\fi \ifx\mt@symbolgreek\@empty -\typeout{** Greek letters will use the PostScript Symbol font. Use\MessageBreak +\typeout{** Greek letters will use the PostScript Symbol font. Use^^J% ** \protect\MathastextSymbolScale{factor} to scale the font by .} \fi \ifx\mt@eulergreek\@empty -\typeout{** Greek letters will use the Euler font. Use\MessageBreak +\typeout{** Greek letters will use the Euler font. Use^^J% ** \protect\MathastextEulerScale{factor} to scale the font by .} \fi \ifx\mt@selfGreek\@empty -\typeout{** Capital Greek letters from the fonts declared for latin letters:\MessageBreak +\typeout{** Capital Greek letters from the fonts declared for latin letters:^^J% ** only for OT1 or compatible encodings; glyphs may be unavailable.} \fi \DeclareRobustCommand\MTVersion[2][\@empty]{% @@ -400,6 +414,8 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \fi \ifx\mt@symboldelimiters\@empty \def\mt@font@tbu{mtpsymbol} +\mt@endashfalse +\mt@emdashfalse \else \def\mt@font@tbu{mtoperatorfont} \fi @@ -431,49 +447,71 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \def\leftarrowfill{$\m@th\mathord\leftarrow\mkern-7mu% \cleaders\hbox{$\mkern-2mu\mt@minus@sign\mkern-2mu$}\hfill \mkern-7mu\smash\mt@minus@sign$} -\edef\mt@enc{\m@stextenc} -\ifmt@endash -\ifx\mt@enc\mt@eui % xetex +\fi +\newif\ifmt@failed +\def\do@the@endashstuff{\edef\mt@enc{\m@stextenc} +\ifx\mt@enc\mt@eui % xetex+fontspec \XeTeXmathcode`\-="2 "\the\symmtoperatorfont "2013 \relax \else -\ifx\mt@enc\mt@euii % luatex +\ifx\mt@enc\mt@euii % luatex+fontspec \luatexUmathcode`\-="2 "\the\symmtoperatorfont "2013 \relax -\else % assume 8bit encoding +\else +\ifx\mt@enc\mt@ti % T1 + \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont}{21} +\else +\ifx\mt@enc\mt@oti % OT1 + \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont}{123} +\else + \ifXeTeX\mt@failedtrue\else\ifLuaTeX\mt@failedtrue\else \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont} {\expandafter\the\expandafter\csname\mt@enc\string\textendash\endcsname} -\fi\fi -\else -\ifmt@emdash -\ifx\mt@enc\mt@eui % xetex + \fi\fi +\fi\fi\fi\fi} +\def\do@the@emdashstuff{\edef\mt@enc{\m@stextenc} +\ifx\mt@enc\mt@eui % xetex+fontspec \XeTeXmathcode`\-="2 "\the\symmtoperatorfont "2014 \relax \else -\ifx\mt@enc\mt@euii % luatex +\ifx\mt@enc\mt@euii % luatex+fontspec \luatexUmathcode`\-="2 "\the\symmtoperatorfont "2014 \relax \else - \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont} +\ifx\mt@enc\mt@ti % T1 + \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont}{22} +\else +\ifx\mt@enc\mt@oti % OT1 + \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont}{124} +\else % make sure we do not have xetex or luatex + \ifXeTeX\mt@failedtrue\else\ifLuaTeX\mt@failedtrue\else + \DeclareMathSymbol{-}{\mathbin}{mtoperatorfont} {\expandafter\the\expandafter\csname\mt@enc\string\textemdash\endcsname} + \fi\fi +\fi\fi\fi\fi} +\ifx\mtno@minus\@empty\else +\mt@failedfalse +\ifmt@endash\do@the@endashstuff\else +\ifmt@emdash\do@the@emdashstuff\else + \DeclareMathSymbol{-}{\mathbin}{\mt@font@tbu}{"2D} \fi\fi -\else -\DeclareMathSymbol{-}{\mathbin}{\mt@font@tbu}{"2D} -\fi\fi\fi +\ifmt@failed\DeclareMathSymbol{-}{\mathbin}{\mt@font@tbu}{"2D}\fi +\fi %%\def\hbar{{\mathchar'26\mkern-9muh}} %% (original definition from latex.ltx) \def\mathrlap{\mathpalette\mathrlapinternal} \def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}} -\ifx\mt@ti\mt@enc - \DeclareMathAccent{\mt@ltbar}{\mathalpha}{mtletterfont}{9} - \else - \DeclareMathAccent{\mt@ltbar}{\mathalpha}{mtletterfont}{22} -\fi -\ifx\mtno@hbar\@empty\else -\ifx\mt@enc\mt@eui % xetex +\def\do@the@hbarstuff{\edef\mt@enc{\m@stextenc} +\ifx\mt@enc\mt@eui % xetex and unicode font \XeTeXmathchardef\hbar="7 "\the\symmtoperatorfont "0127 \relax \else -\ifx\mt@enc\mt@euii % luatex +\ifx\mt@enc\mt@euii % luatex and unicode font \luatexUmathchardef\hbar="7 "\the\symmtoperatorfont "0127 \relax %% or 210F? -\else % assume 8bit encoding - \def\hbar{\mathrlap{\mt@ltbar{\ }}h} -\fi\fi\fi +\else % I must leave open the T1, OT1 possibility also for XeTeX or LuaTeX + \ifx\mt@ti\mt@enc + \DeclareMathAccent{\mt@ltbar}{\mathalpha}{mtletterfont}{9} + \else %% assume OT1. Bad idea? Should not provoke an error anyhow + \DeclareMathAccent{\mt@ltbar}{\mathalpha}{mtletterfont}{22} + \fi + \def\hbar{\mathrlap{\mt@ltbar{\ }}h} +\fi\fi} +\ifx\mtno@hbar\@empty\else\do@the@hbarstuff\fi \ifx\mtno@plus\@empty\else \DeclareMathSymbol{+}{\mathbin}{\mt@font@tbu}{"2B} \fi @@ -494,7 +532,7 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} %% \ifx\mt@symboldelimiters\@empty\else %% \ifx\mt@ti\mt@enc\else %% \typeout{** mathastext: `alldelims'. Characters <,>,{,},| will be assumed -%% to\MessageBreak +%% to^^J% %% ** be located as in ascii. True for T1 fonts or OT1 fixed-width fonts.} %% \fi\fi \DeclareMathDelimiter{<}{\mathopen}{\mt@font@tbu}{"3C}{largesymbols}{"0A} @@ -733,26 +771,40 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \DeclareMathSymbol{\partial}{\mathord}{mtpsymbol}{"B6} \DeclareMathSymbol{\wp}{\mathord}{mtpsymbol}{"C3} \fi\fi -\ifx\mt@enc\mt@eui % xetex +\edef\mt@enc{\m@stextenc}\newif\ifmt@goon\mt@goontrue +\ifx\mt@enc\mt@eui % xetex and unicode font \XeTeXmathchardef\inodot="7 "\the\symmtletterfont "0131 \relax \XeTeXmathchardef\jnodot="7 "\the\symmtletterfont "0237 \relax \else -\ifx\mt@enc\mt@euii % luatex +\ifx\mt@enc\mt@euii % luatex and unicode font \luatexUmathchardef\inodot="7 "\the\symmtletterfont "0131 \relax \luatexUmathchardef\jnodot="7 "\the\symmtletterfont "0237 \relax -\else % assume 8bit encoding +\else +\ifx\mt@enc\mt@ti % T1 + \DeclareMathSymbol{\inodot}{\mathalpha}{mtletterfont}{25} + \DeclareMathSymbol{\jnodot}{\mathalpha}{mtletterfont}{26} +\else +\ifx\mt@enc\mt@oti % OT1 + \DeclareMathSymbol{\inodot}{\mathalpha}{mtletterfont}{16} + \DeclareMathSymbol{\jnodot}{\mathalpha}{mtletterfont}{17} +\else + \ifXeTeX\mt@goonfalse\else\ifLuaTeX\mt@goonfalse\else \DeclareMathSymbol{\inodot}{\mathalpha}{mtletterfont} {\expandafter\the\expandafter\csname\mt@enc\string\i\endcsname} \DeclareMathSymbol{\jnodot}{\mathalpha}{mtletterfont} {\expandafter\the\expandafter\csname\mt@enc\string\j\endcsname} -\fi\fi + \fi\fi +\fi\fi\fi\fi \ifx\mt@defaultimath\@empty\else + \ifmt@goon \renewcommand{\imath}{\inodot} \renewcommand{\jmath}{\jnodot} \let\mt@oldi\i \let\mt@oldj\j \DeclareRobustCommand{\i}{\ifmmode\inodot\else\mt@oldi\fi} \DeclareRobustCommand{\j}{\ifmmode\jnodot\else\mt@oldj\fi} + \fi \fi +\edef\mt@enc{\m@stextenc} %% rather one too many than sorry \ifx\mt@mathaccents\@empty \ifx\mt@ti\mt@enc \DeclareMathAccent{\acute}{\mathalpha}{mtoperatorfont}{1} @@ -777,7 +829,7 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \DeclareMathAccent{\dot}{\mathalpha}{mtoperatorfont}{95} \DeclareMathAccent{\mathring}{\mathalpha}{mtoperatorfont}{23} \ifx\mt@oti\mt@enc\else - \typeout{** mathastext: `mathaccents'; accents have been assumed to be\MessageBreak + \typeout{** mathastext: `mathaccents'; accents have been assumed to be^^J% ** as in OT1 encoding.} \fi\fi\fi \ifmt@defaultsizes\else @@ -803,7 +855,7 @@ nopunctuation,noplusnominus,noequal,noexclam,nospecials}} \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt} \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxvpt}{\@xxpt} \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxxpt}{\@xxvpt} -\typeout{** mathastext has declared larger sizes for subscripts.\MessageBreak +\typeout{** mathastext has declared larger sizes for subscripts.^^J% ** To keep LaTeX defaults, use option `defaultmathsizes'.} \fi \AtBeginDocument{ -- cgit v1.2.3