Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
2  
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
add comment

1 Answer

up vote 3 down vote accepted

As a fool rushing in where angels fear to tread, I'm going to stick my neck out and say that no generic solution is possible.

The reason, as I see it, is that for any given font or pair of fonts, there is no magic formula that could provide information about the position of the ink within the glyph (even by measuring the side-bearings) -- it's more like adding specialised, weird kerning pairs to the font.

Sorry.

share|improve this answer
    
well, i agree that a generic solution is highly unlikely. but i will still keep trying to find one or more reasonable approaches to particular situations with computer modern. while i don't mind the effort of testing multiple concoctions, if these end up with multiple commands for the same object, they usually get mixed up in use and it's more work to fix the mess than it was to create the definitions. for some shapes that recur, we've got a private (type 1) font that can be augmented for internal use, but that doesn't help authors who don't have access to it. –  barbara beeton Mar 13 '12 at 19:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.