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 poweredAIでLaTeXを書く

最高のAI LaTeXエディタ、Overleaf代替

Octreeは15以上の大学の研究者がAIを使って論文をより速く書くのを支援

  • AIで美しいTikZダイアグラムを生成
  • 画像をアップロードしてシームレスにLaTeXに変換
  • 論文の執筆とフォーマットに即座にサポートを取得