Path in LaTeX (P_n)

PnP_n
LaTeX command
P_n
Package
No package needed: built into LaTeX
Mode
Math mode only

Try Path in a real LaTeX document

Open a ready-to-compile document that already uses P_n, with the right packages loaded. Edit it and see the PDF, no install needed.

Where it is used

Path graph on n vertices: n vertices joined in a line by n - 1 edges.

P_n is a basic family in graph theory, along with C_n and K_n. Conventions differ, which is a real source of confusion: many texts let n count vertices, while others, including Diestel, write P^k for a path with k edges. State yours. Paths have chromatic number 2 for n \geq 2 and are trees. In walk counting, the number of paths is distinct from walks because vertices cannot repeat. The subscript is a plain index; for longer indices, use braces, P_{n+1}. Do not confuse with P(n, k), permutations.

Minimal compilable example

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

Pn has n vertices and n−1 edgesP_n \text{ has } n \text{ vertices and } n - 1 \text{ edges}
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Path: $P_n$

\[ P_n \text{ has } n \text{ vertices and } n - 1 \text{ edges} \]
\end{document}

Related symbols

All نظرية البيان →

Frequently asked questions

How do I write Path in LaTeX?
Type P_n in math mode, for example $P_n \text{ has } n \text{ vertices and } n - 1 \text{ edges}$. It works in plain LaTeX without loading any package.
Which package do I need for P_n?
None. P_n is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use P_n in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $P_n$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

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

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

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