If and Only If in LaTeX (\iff)

  ⟺  \iff
LaTeX command
\iff
Package
No package needed: built into LaTeX
Mode
Math mode only
Copy the Unicode character
⟺U+27FA

Where it is used

Writes a long double-headed arrow for logical equivalence, read "if and only if".

\iff produces \Longleftrightarrow with extra thick spacing on both sides. It joins two statements that imply each other, as in a theorem like n \text{ is even} \iff n^2 \text{ is even}. Logic texts often prefer \leftrightarrow or \Leftrightarrow for the biconditional inside formulas, keeping \iff for statements in prose. Because of that padding, \iff looks too loose inside compact subscripts or set-builder conditions. Do not confuse it with \equiv, which means identically equal or congruent modulo n.

Also listed under: المنطق والبراهين

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

A⊆B  ⟺  A∩B=AA \subseteq B \iff A \cap B = A
\documentclass{article}
\begin{document}
If and Only If: $\iff$

\[ A \subseteq B \iff A \cap B = A \]
\end{document}

Related symbols

All الرموز الرياضية →

Frequently asked questions

How do I write If and Only If in LaTeX?
Type \iff in math mode, for example $A \subseteq B \iff A \cap B = A$. It works in plain LaTeX without loading any package.
Which package do I need for \iff?
None. \iff is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \iff in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\iff$ in running text. If you only need the glyph in text, paste the Unicode character ⟺ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث