[OS X TeX] accents
Bruno Voisin
Bruno.Voisin at hmg.inpg.fr
Thu Apr 18 03:58:59 EDT 2002
>> TeXShop in Pdftex mode displays letters with accents \`a \'n correctly
>> but printing is messed up. I switched to TeX - Ghostscript
>> and printed the ps file. Everything was as it supposed to be.
>> Is this a limitation of Pdftex, TeXShop, OS X, or what?
>
>
> I put the following as the first line in my .tex files
>
> \input special_keys
>
> I learned this trick a few years ago on an Alpha mailing list.
> The file was somewhere on an A;pha site, I do not remember where,
> so I copy it here.
>
> [snip]
The file special_keys looks pretty much like an extract from
option_keys, from the Textures distribution. I couldn't find this file
anywhere on their FTP site, but since the file says it's in the public
domain I guess it makes no harm including it here.
There's a file 8bitdefs.tex in the OzTeX distribution, with the same
functionality though implemented differently. All that, anyway, isn't
necessary in LaTeX 2e, where you just type
\usepackage[applemac]{inputenc}
(possibly accompanied by \usepackage[T1]{fontenc}) to get the same
result.
The latter solution, I think, is also the only one which stills works
should the file be sent to other platforms (provided the applemac above
is replaced by the proper name, latin1 for example on UNIX machines).
Bruno Voisin
%%%% Beginning of file Option_keys %%%%
\ifx\optionkeymacros\undefined\else\endinput\fi
% This document is in the Public Domain.
% It was created by Doug Henderson, Blue Sky Research,
% with modifications suggested by Joseph C. Várilly.
% Added single quotes on 6-4-93.
%
% option_keys - 6-4-93 (last modification)
%
% This macro set defines characters found in the Apple Macintosh
% Monaco font. They allow users to simply type the keystroke
% equivalent of the character desired, such as ø, and have Textures™
% typeset it correctly, substituting the TeX macro equivalent
% for the character.
%
% The reason for the creation of this macro set was to take
% advantage of Knuth's new TeX 3.0 capabilities with 8-bit character
% sets. This functionality has been included in our Textures™ as
% of version 1.3. By typing in nearly any character from the
% Macintosh keyboard, you can typeset with the characters directly
% rather than needing to define macros for these diacritic characters.
% Remember: these just expand single characters. They may not be
% defined in every context or mode.
%
% There are two sections to the macros; the first contains
% characters which can be rendered by depressing the option key
% and another key or shift and option keys with another key,
% and secondly, a combination of various keystrokes together
% to obtain the desired character. For example,
% to create the ø character, you depress the option and o character
% at the same time; to create the uppercase version of Ø, you
% hold the shift, option key, and o key down, and to create the
% Ñ character, you first depress the option and n characters,
% then next the shift and n characters. The option and n create
% the tilde character, and the shift n produce the N character.
%
% Math symbols and math operators need special attention.
% When typing in math symbols the same
% rules apply for math mode as before, namely, you must place dollar
% signs or double-dollar signs around these symbols. When typing
% in math operators, such as the square root symbol, TeX expects
% you to supply an argument following it. For example, if you
% would like to take advantage of the definition here for the
% plus-minus sign, ±, and would like to type it directly for use
% in your text, you need to make sure you are in math mode when
% you call for the character, or simply place dollar signs around
% it to print only the plus minus sign thusly, $±$. Similarly,
% you also need to be in math mode when asking for the square root
% symbol, √, and additionally supply an argument to it.
% The following example shows how to use both the plus-minus sign
% and the square root sign in an equation that has been simplified
% for you via these macro definitions.
% $$-b±√{b^2-4ac}\over{2a}$$
% define the macintosh "option" generated characters
\catcode`\å=\active\defå{{\aa}} % option a
\catcode`\∫=\active\def∫{\int} % option b (math mode)
\catcode`\ç=\active\defç{\c c} % option c
\catcode`\∂=\active\def∂{\partial} % option d (math mode)
\catcode`\ƒ=\active\defƒ{\oint} % option f (math mode) ?
\catcode`\∆=\active\def∆{\triangle} % option j (math mode)
\catcode`\¬=\active\def¬{\neg} % option l (math mode)
\catcode`\µ=\active\defµ{\mu} % option m (math mode)
\catcode`\ø=\active\defø{{\o}} % option o
\catcode`\π=\active\defπ{\pi} % option p (math mode w/ arg.)
\catcode`\œ=\active\defœ{{\oe}} % option q
\catcode`\ß=\active\defß{{\ss}} % option s
\catcode`\†=\active\def†{\dagger} % option t (math mode)
\catcode`\√=\active\def√{\sqrt} % option v (math mode w/ arg.)
\catcode`\∑=\active\def∑{\Sigma} % option w (math mode)
\catcode`\≈=\active\def≈{\approx} % option x (math mode)
\catcode`\Ω=\active\defΩ{\Omega} % option z (math mode)
\catcode`\£=\active\def£{{\it\$}} % option 3 ($ from italic font)
\catcode`\∞=\active\def∞{\infty} % option 5 (math mode)
\catcode`\§=\active\def§{{\S}} % option 6
\catcode`\¶=\active\def¶{{\P}} % option 7
\catcode`\•=\active\def•{\bullet} % option 8
\catcode`\ª=\active\defª{\leavevmode\raise.585ex\hbox{\b a}} %
option 9
\catcode`\º=\active\defº{\leavevmode\raise.6ex\hbox{\b o}} %
option 0
\catcode`\≠=\active\def≠{\not=} % option = (math mode)
\catcode`\≤=\active\def≤{\leq} % option , (math mode)
\catcode`\≥=\active\def≥{\geq} % option . (math mode)
\catcode`\÷=\active\def÷{\div} % option / (math mode)
\catcode`\…=\active\def…{{\dots}} % option ;
\catcode`\æ=\active\defæ{{\ae}} % option '
\catcode`\«=\active\def«{\ll} % option \ (math mode)
\catcode`\“=\active\def“{``} % option [
\catcode`\¡=\active\def¡{!`} % option !
\catcode`\¢=\active\def¢{\rlap/c} % option 4
\catcode`\‘=\active\def‘{`} % option ]
\catcode`\’=\active\def’{'} % shift option ]
% macintosh "shift-option" generated characters
\catcode`\Å=\active\defÅ{{\AA}} % shift-option A
\catcode`\Ç=\active\defÇ{\c C} % shift-option C
\catcode`\Ø=\active\defØ{{\O}} % shift-option O
\catcode`\∏=\active\def∏{\Pi} % shift-option P (math mode)
\catcode`\Œ=\active\defŒ{{\OE}} % shift-option Q
\catcode`\Æ=\active\defÆ{{\AE}} % shift-option '
\catcode`\◊=\active\def◊{\diamond} % shift-option V (math mode)
\catcode`\°=\active\def°{\accent'27} % shift-option 8
\catcode`\”=\active\def”{''} % shift-option [
\catcode`\±=\active\def±{\pm} % shift-option = (math mode)
\catcode`\»=\active\def»{\gg} % shift-option \ (math mode)
\catcode`\¿=\active\def¿{?`} % shift-option /
\catcode`\–=\active\def–{--} % option - (en-dash)
\catcode`\—=\active\def—{---} % shift-option - (em-dash)
% define the macintosh "composite" characters
\catcode`\ä=\active\defä{\"a} % option u, then a
\catcode`\ë=\active\defë{\"e} % option u, then e
\catcode`\ï=\active\defï{\"{\i}} % option u, then i
\catcode`\ö=\active\defö{\"o} % option u, then o
\catcode`\ü=\active\defü{\"u} % option u, then u
\catcode`\ÿ=\active\defÿ{\"y} % option u, then y
\catcode`\Ä=\active\defÄ{\"A} % option u, then A
\catcode`\Ö=\active\defÖ{\"O} % option u, then O
\catcode`\Ü=\active\defÜ{\"U} % option u, then U
\catcode`\á=\active\defá{\'a} % option e, then a
\catcode`\é=\active\defé{\'e} % option e, then e
\catcode`\í=\active\defí{\'{\i}} % option e, then i
\catcode`\ó=\active\defó{\'o} % option e, then o
\catcode`\ú=\active\defú{\'u} % option e, then u
\catcode`\É=\active\defÉ{\'E} % option e, then E
\catcode`\à=\active\defà{\`a} % option `, then a
\catcode`\è=\active\defè{\`e} % option `, then e
\catcode`\ì=\active\defì{\`{\i}} % option `, then i
\catcode`\ò=\active\defò{\`o} % option `, then o
\catcode`\ù=\active\defù{\`u} % option `, then u
\catcode`\À=\active\defÀ{\`A} % option `, then A
\catcode`\ã=\active\defã{\~a} % option n, then a
\catcode`\ñ=\active\defñ{\~n} % option n, then n
\catcode`\õ=\active\defõ{\~o} % option n, then o
\catcode`\Ã=\active\defÃ{\~A} % option n, then A
\catcode`\Ñ=\active\defÑ{\~N} % option n, then N
\catcode`\Õ=\active\defÕ{\~O} % option n, then O
\catcode`\â=\active\defâ{\^a} % option i, then a
\catcode`\ê=\active\defê{\^e} % option i, then e
\catcode`\î=\active\defî{\^{\i}} % option i, then i
\catcode`\ô=\active\defô{\^o} % option i, then o
\catcode`\û=\active\defû{\^u} % option i, then u
\let\optionkeymacros\null
-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
-----------------------------------------------------------------
More information about the MacOSX-TeX
mailing list