Re: Defining new symbols in a robust manner
- From: Peter Ullrich <x@xxx>
- Date: Thu, 26 Mar 2009 08:48:32 +0100
James Avery schrieb:
Dear All,
I need to define a couple of new mathematical symbols.
The first should basically be a triangle with a small text written in the middle. For example: The new command $\deltaop{p+1}$ should typeset a $\triangle$, appropriately scaled to fit the text $p+1$, which should in turn be correctly centered.
The second is "--oo", i.e. a line with two circles, which each should contain a small integer or a single letter. I.e. $A: X \mlto{3}{2} Y$ (meaning, for the sake anyone curious, "A is a multilinear map from X to Y of contravariant rank 3 and covariant rank 2") should typeset
"A: X --(3)(2) Y$ with 3 and 2 positioned at the center of the circles, and the circles appropriately sized to fit the text.
I've basically done this through extremely painful trial and error using \raisebox and negative \hspace and whatnot, yielding an somewhat acceptable but terribly fragile result: If text size is changed, or if the wind blows the wrong way, it will completely screw up.
Searching on google for "defining new symbols in latex" and multiple variants thereof mostly yields references to predefined symbols, and I've been completely unable to find good pointers on what the kosher way is to define "robust" mathematical symbols in LaTeX. And MetaFont seems (correct me if I'm wrong) not to solve the problem, since I need the symbols to fit dynamic text.
Any help will be well and truly appreciated!
not the solution to your problem, but I would suggest pgf tikz because it is easy to create new symbols...
e.g. these two:
\usepackage{pgf}
\usepackage{tikz}
.....
\newlength{\XHeight}
\newcommand{\WS}{\ensuremath{\operatorname{\settoheight{\XHeight}{X}\tikz[baseline]{
\draw (0em,\XHeight) -- (.4em,0ex);
\draw (.4em,\XHeight) -- (0em,0ex);
\draw (.2em,.5\XHeight) circle (.3ex);
}}}}
\newcommand{\CUT}{\ensuremath{\operatorname{\settoheight{\XHeight}{X}\tikz[baseline]{
\draw (0em,\XHeight) -- (.4em,0ex);
\draw (.4em,\XHeight) -- (0em,0ex);
% \draw (.2em,.5\XHeight) circle (.3ex);
}}}}
$f\WS g\CUT h$
.
- Follow-Ups:
- Re: Defining new symbols in a robust manner
- From: James Emil Avery
- Re: Defining new symbols in a robust manner
- References:
- Defining new symbols in a robust manner
- From: James Avery
- Defining new symbols in a robust manner
- Prev by Date: Re: Slides
- Next by Date: Re: insert a \newline automatically
- Previous by thread: Defining new symbols in a robust manner
- Next by thread: Re: Defining new symbols in a robust manner
- Index(es):
Relevant Pages
|