Sender: |
|
Date: |
Tue, 21 Jan 2003 22:07:49 -0800 |
Reply-To: |
|
Content-Transfer-Encoding: |
8bit |
Subject: |
|
From: |
|
Content-Type: |
text/plain; charset=iso-8859-1 |
In-Reply-To: |
Frank Mittelbach's message of "Tue, 21 Jan 2003 11:54:17 +0100" |
Organization: |
TRIUMF: Canada's national meson facility |
MIME-Version: |
1.0 |
Parts/Attachments: |
|
|
Frank Mittelbach <[log in to unmask]> writes:
> Donald,
>
> > > nope nope (imho:-)
> > >
> > > that's for the case where \"a is precisely *not* executing an \accent but is
> > > actually a glyph in the current font
> >
> > But that is the only case you have to handle! \accent combinations
> > don't have the right kerning anyway, so just stick \relax before
> > the \accent.
>
> you both are right and i was wrong (for the case of accents). however you would
> have to identify that \"a is a glyph first, even more, you would need to do the
> right thing concerning any text character eg some are fetched from a different
> encoding so all that would be very messy indeed
Not at all. You test the same way as ever,
\ifx \csname \<encoding>\<cmd>-<char>\endcsname \relax
e.g.:
\ifx \\T1\"-q \relax
> > Definition to convert from LICR to glyph:
Note that statement! This really doesn't have anything to do with
*input* encoding, but deals with the output encoding.
> >
> > \def{\"a}{\ifmmode \relax % make sure we are in math mode to stay
> > \ifmmode \ddot a%
> > \else \string ä\fi
> > \else \string ä\fi}
>
> sorry, perhaps i'm still dumb from my cold or else dumb anyway, but i don't
> get you here. what is this supposed to tell me?
>
> one of the problem is that pressing key ä (umlaut-a) on the keyboard maps to
> \"a alright in the LICR but that is not equiv to doing
>
> \string ä
>
> for typesetting --- the slot to use varies from encoding to encoding. so if i
> interpret your definition above correctly then you end up with exactly
> typesetting \char `ä always for \"a ... or what?
Yes, this is pseudo-TeX. Replace \string ä with \\T1\"-a as for T1.
To get past some of the "pseudo" aspect, here is a concrete demonstration,
though *not* a proper implementation:
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
Test {\tracingall ä \"a \"q}
\makeatletter
\@namedef{T1\string\"}#1{%
\expandafter\@mathtext@composite %% <-- changed from \@text@composite
\csname T1\string\"\endcsname
#1\@empty
\@mathtext@composite
{\add@accent{4}{#1}}%
{\ddot{#1}}% %% <-- added new option
}
\let\@inmathwarn\@gobble % omit prohibition on math mode
\def\@mathtext@composite #1#2#3\@mathtext@composite{%
\expandafter \@mathtext@composite@x \csname \string #1-\string #2\endcsname}
\def\@mathtext@composite@x #1{% based on \@text@composite
\ifx #1\relax % No single-glyph defined, use choice of accent commands
\relax % stop \halign pre-expansion when using accents
\ifmmode \@use@third
\else \@use@second
\fi
\else % Single character for text mode
\ifmmode \relax \fi % test for math mode, even in \halign
\ifmmode \@use@third
\else \@use@first
\fi
\fi
\@use@ #1}
\def\@use@first#1\@use@#2#3#4{#1#2}
\def\@use@second#1\@use@#2#3#4{#1#3}
\def\@use@third#1\@use@#2#3#4{#1#4}
\mathcode`\ä="8000
Test {\tracingall ä \"a \"q
\halign{#\hfil&$#$\hfil&#\hfil\cr
char: & ää & ää\cr
glyph: & \"a\"a & \"a\"a\cr
comp: & \"q\"q & \"q\"q\cr}
}
\showoutput
\end{document}
Donald Arseneau [log in to unmask]
|
|
|