Rational Numbers in LaTeX (\mathbb{Q})

Q\mathbb{Q}
LaTeX command
\mathbb{Q}
Package
Add to your preamble:\usepackage{amssymb}
Mode
Math mode only
Copy the Unicode character
ℚU+211A

Where it is used

Blackboard-bold Q, the field of rational numbers (fractions of integers).

Q stands for quotient. It appears in field extensions like \mathbb{Q}(\sqrt{2}), in density statements such as \mathbb{Q} being dense in \mathbb{R}, and in algebraic number theory with \overline{\mathbb{Q}} for algebraic numbers. The p-adic numbers are written \mathbb{Q}_p. Positive rationals are \mathbb{Q}_{>0} or \mathbb{Q}^+. Since \mathbb only covers uppercase letters, it is fine here. Defining \newcommand{\Q}{\mathbb{Q}} saves typing in algebra-heavy documents. Its algebraic closure is countable, while its completion with respect to the usual absolute value gives \mathbb{R}. Rational points on curves are written C(\mathbb{Q}).

Minimal compilable example

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

[Q(2):Q]=2[\mathbb{Q}(\sqrt{2}) : \mathbb{Q}] = 2
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Rational Numbers: $\mathbb{Q}$

\[ [\mathbb{Q}(\sqrt{2}) : \mathbb{Q}] = 2 \]
\end{document}

Related symbols

All 集合論 →

Frequently asked questions

How do I write Rational Numbers in LaTeX?
Type \mathbb{Q} in math mode, for example $[\mathbb{Q}(\sqrt{2}) : \mathbb{Q}] = 2$. Load amssymb first with \usepackage{amssymb}.
Which package do I need for \mathbb{Q}?
\mathbb{Q} needs amssymb: add \usepackage{amssymb} to your preamble before the document starts.
Can I use \mathbb{Q} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\mathbb{Q}$ 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に変換
  • 論文の執筆とフォーマットに即座にサポートを取得