[texhax] Putting char on the top other char

Uwe Lück uwe.lueck at web.de
Sun Nov 26 19:28:24 CET 2006

At 00:29 24.11.06, wa2n wrote:

>How to put char on the top other char, for example I want write the star
>symbol (*) in the top (n) char than I write \myfont \ni
>The result that I want is the "*" char than stay at the top of (i) char.

Hi Wawan,

look at the suggestions in the following LaTeX code:

\documentclass[12pt]{article}
\usepackage{exaccent}
% The package
%
%     CTAN:/fonts/tipa/tipa-1.3/sty/exaccent.sty
%
% is needed for the last examples (\Upperaccent) only;
% the first examples use \shortstack from the LaTeX kernel.

\begin{document}

First line.

A\shortstack{*\\\i}B
% The first example shows that it is not just putting some
% character over another; rather you have to deal with the
% size of the upper character.

\renewcommand{\ni}{\shortstack{$\scriptscriptstyle*$\\[-.55ex]\i}}
% This version of \ni is what I ended with. The next two
% examples demonstrate how to vary my suggestion.
%
% Note that your suggestion "\ni" for the macro is usually
% the reversed "element of"/"\in" math symbol.
% Therefore the \renewcommand.
%
% \scriptscriptstyle is to adapt the size of the upper char
% to the surrounding font size.
A\ni B
A\shortstack{$\scriptstyle*$\\[-.6ex]\i}B
A\shortstack{$\scriptscriptstyle*$\\[-.6ex]\i}B
\renewcommand{\ni}{\Upperaccent{$\scriptscriptstyle*$}{\i}}
% This again shows with what I ended with using the
% exaccent package. The last two examples show how
% how to vary it.
A\ni B
A\Upperaccent[.07ex]{$\scriptscriptstyle*$}{\i}B
A\Upperaccent{$\scriptstyle*$}{\i}B

Last line.

\end{document}

-- HTH -- Uwe.



More information about the texhax mailing list