Re: Defining new symbols in a robust manner



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$
.



Relevant Pages

  • Defining new symbols in a robust manner
    ... X \mltoY$ (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 ... and the circles appropriately sized to fit the text. ... 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. ...
    (comp.text.tex)
  • Fit sphere to planar circles
    ... I'm confident that the average of the X and Y columns represent the X and Y sphere centre, but I don't know the best way to get the Z location. ... A simple average of Z locations is inaccurate because the detected circles are not necessarily centrally detected along the Z-direction. ... Perhaps I could try to fit a curve to the radii values and find its peak, but I'm not sure how to fit anything robustly to so few data points. ...
    (comp.soft-sys.matlab)
  • Re: Problems finding out the area of a 0.5mm circle.
    ... wrote:>I'm still unsure how to find out how many circles with an area of>7850nm2 will fit into a circle with the area of 196250000000nm2. ... in my>novice way I am assuming that I would divide 196250000000nm2 by>7850nm2, but as I am dealing with squared units I wonder if a simple>division is inapplicable? ... How many unit diameter circles will fit into a rectangle that is 8 by ...
    (uk.education.maths)
  • Goodness of Fit Metric for Circle Fits
    ... I have been trying to fit circles, portions of circles and arcs to my ... Now I am in need of a metric for the goodness of fit. ...
    (comp.soft-sys.matlab)
  • Re: Haas VF fixture offset hell
    ... displays the geometry with pan, zoom, fit, etc functions. ... points, lines and circles. ... It uses OpenGL (which yes, is overkill for ...
    (alt.machines.cnc)