# is there a “size-independent” method for overlaying two symbols to form a composite?

in this question a composite symbol "diamond plus" is requested for use with plain TeX.

a good-looking version was provided, but it works in only one size. if the same symbol is needed for a title or a footnote (i.e., in a larger or smaller size), the image produced by the provided code will be deformed. this would be true for LaTeX as well as plain TeX, and is a different problem than the one addressed by \mathchoice.

the overlay technique is sensitive to a couple of things: the need to use explicit dimensions, and (often) the need to pack at least one of the components in a box, which "freezes" the size at the current value. (\rlap, \llap and \[math]clap, while very useful, are underlain by boxes, so are subject to the "single size" limitation.)

there are some TeXniques than can be brought to bear on this situation:

• to adjust for relative current size, the amsmath command \text is available.

• dimensions can be expressed as ex, em or mu to accommodate to the current size, but they must be employed carefully at appropriate places in a definition to get the desired effect. it is also the case that (for computer modern fonts) the different design sizes may not have the same aspect ratio; this is particularly true for bold vs. normal weight.

• another possibility is to take advantage of the fact that \mathop will vertically center a single glyph on the math axis.

has anyone come up with a robust, flexible mechanism for overlaying glyphs to form a composite symbol that will reliably adjust to the size of type in the current environment? for simplicity in a first cut, it's acceptable to stick to computer modern/latin modern fonts.

the questions overlay symbol with another, how to add a custom symbol to LaTeX, and several others deal with the construction of particular symbols, but i'm looking for a general technique.

• Maybe TikZ ? ducks rapidly :P – percusse Feb 10 '12 at 15:32
• @percusse -- well, i've been known to use scanned images and \scalebox, so tikz isn't that outlandish a suggestion, but it's really an answer to a different question. <g> – barbara beeton Feb 10 '12 at 15:40
• I think the symbol you quote shows the problem, it has some explicit positioning so the tip of the + touches the corner of the diamond. It uses ex units so it's not awful at other sizes (I tested amsart at \footnotesize to \huge but it does drift off in some cases but without access to the glyph shape it's hard to see how this can be avoided. – David Carlisle Feb 10 '12 at 15:41
• I'm afraid that CM or LM are examples to the contrary: they have different optical designs and what aligns say at 10pt size might not do at 17. – egreg Feb 10 '12 at 15:48