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.

I need a character in plain TeX that combines a plus with a quadrilateral whose corners are the four endpoints of the plus. Is there a way to create such a thing?

I apologize for editing the question; I could not figure out how to enter an answer. I was able to construct the character using gpic, put the resulting specials in a box, and define \gjoin to copy from that box. I will use this character in the third edition of my graph theory textbook to denote the join of two graphs, for a variety of reasons. I believe it is a useful and natural character.

The suggested overstrike using \ooalign did not do the job for me. Drawing the character as lines that join four specified points should avoid spacing difficulties due to overstrikes.

Here is the answer I found:

\expandafter\ifx\csname dplus\endcsname\relax \csname newbox\endcsname\dplus\fi
\expandafter\ifx\csname dplustemp\endcsname\relax
\csname newdimen\endcsname\dplustemp\fi

\setbox\dplus=\vtop{\vskip -7pt\hbox{%  
    \kern .021in%  
    \special{pn 11}%  
    \special{pa 0 50}%  
    \special{pa 50 100}%  
    \special{fp}%  
    \special{pa 50 100}%  
    \special{pa 100 50}%  
    \special{fp}%  
    \special{pa 100 50}%  
    \special{pa 50 0}%  
    \special{fp}%  
    \special{pa 50 100}%  
    \special{pa 50 0}%  
    \special{fp}%  
    \special{pa 50 0}%  
    \special{pa 0 50}%  
    \special{fp}%  
    \special{pa 0 50}%  
    \special{pa 100 50}%  
    \special{fp}%  
    \hbox{\vrule depth0.100in width0pt height 0pt}%  
    \kern 0.110in  
  }%  
}%  

\def\gjoin{\copy\dplus}

$G\gjoin H$ and $G_1\gjoin G_2$
share|improve this question
    
It might help if you have a sample and post it in your question. –  topskip Feb 10 '12 at 8:28
    
is this standard notation, or a symbol you're defining yourself? it isn't in unicode. if it is standard notation, and examples published by "recognized" publishers can be provided, a case can be made for adding it to unicode. you can submit such a request by sending it to tech-support@ams.org. –  barbara beeton Feb 10 '12 at 13:46
    
We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  Werner Feb 10 '12 at 19:34

2 Answers 2

There would basically be at least three obvious ways to accomplish this:

  1. Make the plus sign smaller so it fits inside the diamond, and
  2. Make the diamond sign bigger, so the plus sign fits inside, and
  3. Both of above, just not so much

each of which could be defined as

\font\Bigmath=cmsy10 scaled \magstep2
\font\bigmath=cmsy10 scaled \magstep1
\def\diamondplus{\mathrel{%
  \ooalign{\raise.29ex\hbox{$\scriptscriptstyle+$}\cr\hss$\diamond$\hss}}}
\def\diamondplustwo{\mathrel{%
  \ooalign{$+$\cr\hss\lower.255ex\hbox{\Bigmath\char5}\hss}}}
\def\diamondplusthree{\mathrel{%
  \ooalign{$\scriptstyle+$\cr\hss\lower.29ex\hbox{\bigmath\char5}\hss}}}
$$\displaylines{
  a \diamondplus b \cr
  a \diamondplustwo b \cr
  a \diamondplusthree b \cr
}$$
\bye

enter image description here

(don't mind the way they look on screen here, because depending on the zoom-level, the superimposed glyphs can drift a little on screen)

Note that the ex values used here are font face design dependant, so even changing to another Computer Modern optical size would break the positioning.

For more information on \ooalign, see this egreg's answer

share|improve this answer
    
.3ex seems a little off. How about .29ex? –  Todd Lehman Feb 10 '12 at 9:18
    
@ToddLehman: you are absolutely right, I'll correct the answer. Thanks! –  morbusg Feb 10 '12 at 9:23
    
Picture is still off, however. (That's how I noticed it orginally—it's about 1 pixel.) –  Todd Lehman Feb 10 '12 at 9:39
    
@todd: You're right, I forgot to update the image. Thanks. –  morbusg Feb 10 '12 at 9:53
1  
if this is used in a footnote or a title (i.e., at a different size), the "other" size won't look as good. i'm intrigued by the problem of creating a size-independent technique, and will put it on my list of things to look into when time is available. –  barbara beeton Feb 10 '12 at 13:59

you can scale it by setting the unit.

\input pstricks
\def\gjoin{\psset{unit=0.15ex,linewidth=0.4pt}%
 \mathrel{\pspicture(10,10)
 \psline(5,0)(5,10)
 \psline(0,5)(10,5)
 \pspolygon(0,5)(5,10)(10,5)(5,0)
\endpspicture}}

$G \gjoin H$ and $G_1\gjoin G_2$

\bye

enter image description here

it should also take different font sizes into account.

share|improve this answer
    
on my screen, this shows up with the vertical rule a bit to the right, and the horizontal rule a bit low. the relative positioning doesn't change with changes in browser magnification (firefox). but it looks spot on when tex'ed and printed. so there's some roundoff problem in the conversion to e-pixels. –  barbara beeton Feb 10 '12 at 20:32
    
that depends on the magnification of the viewer. With xpdf it looks also a bit different for 600% and 400%. However, printing it should alsways be ok –  Herbert Feb 10 '12 at 20:38

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.