Rational Numbers in LaTeX (\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.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Rational Numbers: $\mathbb{Q}$
\[ [\mathbb{Q}(\sqrt{2}) : \mathbb{Q}] = 2 \]
\end{document}Related symbols
- Real Numbers
\mathbb{R} - Integers
\mathbb{Z} - Complex Numbers
\mathbb{C} - Natural Numbers
\mathbb{N} - Power Set
\mathcal{P} - Complement
\complement
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).
أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf
يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي
- أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
- ارفع صورة وحولها إلى LaTeX بسلاسة
- احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث