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.

Is there a way to typeset the symbol ":⇔" correctly in LaTeX (i.e. with the right alignment and spacing)? I know that using :\Leftrightarrow or :\Longleftrightarrow gets me the symbol I'm looking for (more or less), but the spacing doesn't look right to me. Constructions using \iff or \colon didn't really seem to do the trick, either.

Do I have to define such a symbol myself (if so: how?), or is there a package proving this? Unfortunately, I did not find anything myself (especially because I don't know what to search for exactly; I got the description "defined to be logically equivalent" from Wikipedia, since I didn't even know the correct name).

share|improve this question

3 Answers 3

up vote 11 down vote accepted

Package colonequals provides a vertically centered colon: \ratio. Both \ratio and \Leftrightarrow are of kind \mathrel, therefore TeX will not put additional space between them:

\documentclass{article}
\usepackage{colonequals}
\newcommand*{\logeq}{\ratio\Leftrightarrow}

\begin{document}
\[ A \logeq B \]
\end{document}

Result


P.S. It does not matter here, whether the star form of \newcommand is used or not, because there aren't any argument and the definition is not empty. Therefore it is mostly a matter of taste here.

I prefer the star form, because I am thinking rather in terms of lower level commands. \newcommand* uses \def, whereas \newcommand uses \long\def. Without arguments I do not see a reason for \long, therefore I am using \newcommand*.

share|improve this answer
    
Just a quick question: In contrast to the other two answers (which pretty much yield the same results, I think), you used the starred version of \newcommand. Is there a good reason to do this? I thought this only makes a difference if you define a command that takes arguments. BTW: I chose your solution (but with \providecommand and without * (for now), because I like to use packages whenever possible, as I think package authors are generally more clever than I am with those things. –  Lustique Aug 28 at 14:09
    
And with that I mean the use of \ratio rather than \mathrel{\vcentcolon ... or \mathrel{\raisebox ..., not that I think the other two solutions or posters are less clever than you. :D –  Lustique Aug 28 at 14:16
    
@barbarabeeton I have removed the comment with the typo, because editing is no longer possible. It's added to the anwser, following your request. (But in a smaller font, because it is rather unrelated to the original question.) –  Heiko Oberdiek Aug 28 at 17:59

The mathtools package already has the necessary tool to do that (don't load amsmath: mathtools already does it):

\documentclass[12pt]{article}

\usepackage{mathtools}

\newcommand\logeq{\mathrel{\vcentcolon\Leftrightarrow}}

\begin{document}

\[ A \logeq A \]


\end{document} 

enter image description here

share|improve this answer

Maybe this?

\documentclass[12pt]{article}
\usepackage{amsmath}
\newcommand\logeq{\mathrel{\raisebox{.66pt}{:}}\Leftrightarrow}
\begin{document}
\[
A \logeq A
\]
\end{document}

enter image description here

share|improve this answer

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.