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.

As comprehensive as the existing set of symbols is, it doesn't have every possible symbol that could exist, and it really takes the fun out of inventing a new symbol if you can't typeset it nicely.

One option I know of is "combining" existing symbols in some fashion, such as negative spaces. So I could write something like m \gg\!\!= k, but that technique has obvious limitations.

What's the best approach here? ("Stop making up new symbols for no good reason" is a valid answer.)

Edit: For a bit of context my actual interest is in nicer display for typeset source code, particularly making common operators written as multiple ASCII characters look more like a single symbol. This often results in symbols not otherwise used--but recognizable to other programmers--and for which the negative spacing technique suffices. As mentioned in a comment on vanden's answer, I was curious about the more general case.

share|improve this question
2  
Maybe it exists at detexify.kirelabs.org/classify.html ! –  YuppieNetworking Jul 27 '10 at 0:49
    
Sounds like you should program in APL :P –  Sharpie Jul 27 '10 at 2:59
    
@Sharpie: Actually that's the symbol for binding in monads, used in Haskell. –  KennyTM Jul 27 '10 at 6:21
    
Well, it's >>= since Haskell still uses ASCII characters. APL, on the other hand, requires whole set of non-ASCII characters to write valid programs. –  Sharpie Jul 27 '10 at 7:45

3 Answers 3

up vote 4 down vote accepted

Whilst I wouldn't go so far as to define completely new symbols, I do occasionally find myself wanting slightly different ones than the standard set. Where I've encountered this is with arrows when lecturing: I find that I want the ⇔ to look a little more important, for example. For those cases, I redraw it using TikZ:

\newcommand{\textIff}{\tikz \draw (-3ex,.25ex) -- (-.25ex,.25ex) (-3ex,-.25ex) -- (-.25ex,-.25ex) (-.5ex,.5ex) -- (0,0) -- (-.5ex,-.5ex) (-2.75ex,.5ex) -- (-3.25ex,0) -- (-2.75ex,-.5ex);\xspace}
\newcommand{\mathIff}{\mathrel{\textIff}}
\newcommand{\Iff}{\ifmmode\mathIff\else\textIff\fi\xspace}

I guess that using TikZ rather than MetaFont for this is that I already know how to use TikZ for my other diagrams.

share|improve this answer

I am trying hard to resist introducing a dontdothat tag :-)

While there genuinely are circumstances where a new symbol is needed, most areas seem to already have an embarrassment of riches. Inventing some new symbol ought be thought over long and hard, as doing so introduces a new barrier to communication.

I think we ought to be able to introduce new symbols in TeX and friends (we can), but that it ought be hard enough to discourage frivolous novelty.

If one really wants a new symbol and setting extant symbols on top of one another just won't do, that's what METAFONT is for.

share|improve this answer
    
Besides, when you have such a nice collection of ancient fonts math.harvard.edu/computing/latex/tetex/help/Catalogue/entries/… I am somewhat doubtful new symbols are strictly necessary. =) –  Willie Wong Jul 27 '10 at 1:54
1  
A fair answer! Though I should probably add a disclaimer that I'm not actually intending to start inventing symbols--I was trying to figure out the best way to represent the compound symbol I used as an example and was curious about the general case... –  camccann Jul 27 '10 at 2:21
    
Sure. But you are going to have to redefine some parts to make certain symbols to automagically use your ``condenced'' symbols. –  Dima Jul 27 '10 at 3:19

I use the lst environment defined by Gerold Meisinger here: http://lambdor.net/?p=273

enter image description here

He uses the listings environment to substitute the haskell representation of tags into the code. Notice how >>= is defined as >\!\!>\!\!=

\lstloadlanguages{Haskell}
\lstnewenvironment{HaskellCode}
    {\lstset{}%
      \csname lst@SetFirstLabel\endcsname}
    {\csname lst@SaveFirstLabel\endcsname}
    \lstset{
      basicstyle=\small\ttfamily,
      escapeinside={/+}{+/},
      flexiblecolumns=false,
      basewidth={0.5em,0.45em},
      literate={+}{{$+$}}1 {/}{{$/$}}1 {*}{{$*$}}1
               {=}{{$=$}}1 %{/=}{{$\neg$}}1
               {>}{{$>$}}1 {<}{{$<$}}1 {\\}{{$\lambda$}}1
               {++}{{$+\!\!\!+$}}1 {::}{{$:\!\!\!:$}}1
               {\\\\}{{\char`\\\char`\\}}1
               {->}{{$\rightarrow$}}2 {>=}{{$\geq$}}2 {<-}{{$\leftarrow$}}2
               {<=}{{$\leq$}}2 {=>}{{$\Rightarrow$}}2
               {\ .\ }{{$\circ$}}2 {(.)}{{($\circ$)}}2
               {<<}{{$\ll$}}2 {>>}{{$\gg$}}2 {>>=}{{$>\!\!>\!\!=$}}2
               {<<<}{{$\lll$}}2 {>>>}{{$\ggg$}}2 {-<}{{$\leftY$}}1 {^<<}{{$\hat{}\!\!\ll$}}2 {^>>}{{$\hat{}\!\!\gg$}}2
               {|}{{$\mid$}}1
               {undefined}{{$\bot$}}1
               {not\ }{{$\neg$}}1
               {`elem`}{{$\in$}}1
               {forall}{{$\forall$}}1
    }
share|improve this answer
    
Welcome to TeX.sx! –  Peter Jansson Mar 3 '13 at 20:16

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.