Page Layout ⇒ How Do I Use \label if I Just Want to Label Text?
-
- Posts: 3
- Joined: Sat Sep 26, 2009 4:07 am
How Do I Use \label if I Just Want to Label Text?
For example, in the procedure section, a sentence reads, "I used the quadratic formula." I want use \label on this sentence, so I use \ref in a later section (Additional Information). However, for every sentence that I use \label with within the section Procedure, the reference numbers are all the same because the \label command is labeling the entire section as opposed to the specific text I want to label.
\documentclass[12pt]{article}
\begin{document}
\tableofcontents
\newpage
\begin{doublespacing}
\section{Procedure}
\input{Procedure}
\section{Additional Information}
\input{Additional_Information}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: How Do I Use \label if I Just Want to Label Text?
-
- Posts: 3
- Joined: Sat Sep 26, 2009 4:07 am
Re: How Do I Use \label if I Just Want to Label Text?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How Do I Use \label if I Just Want to Label Text?
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 3
- Joined: Sat Sep 26, 2009 4:07 am
Re: How Do I Use \label if I Just Want to Label Text?
\documentclass[12pt]{article}
\usepackage{indentfirst}
\usepackage{setspace}
\usepackage{geometry}
\usepackage{endnotes}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{wasysym}
\usepackage{rotating}
\usepackage{url}
\usepackage{caption}
\geometry{left=.95in,right=.95in,top=.95in,bottom=.95in}
\begin{document}
\tableofcontents
\newpage
\begin{doublespacing}
\section{Procedure}
...One mark was made as far from the petri dish as possible; the other was about an inch from the petri dish. \label{exitbeam}$_{\ref{exitbeam}}$
%The _ used before \ref is to subscript the reference number.
...Nonetheless, lines from the center point were extended through the points of incidence and refraction. \label{circlecenter}$_\ref{circlecenter}$
\section{Error Analysis}
\ref{exitbeam}: The uncertainty this adds to the uncertainty of theta is one degree.
\ref{circlecenter}: The position of the circle's center increases the uncertainty of theta by another degree.
%As you can see, in the compilation, the reference number for both labels is the same because they are labeling the section rather than the text.
\end{doublespacing}
\end{document}
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm