So below I've listed the basic code for my document {PACKAGES HAVE BEEN OMITTED}. I basically have a lot of sentences that I would like to put subscripts on, or at least label, and then recall them in later sections. (In other words, use the command \label for 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}
Page Layout ⇒ How Do I Use \label if I Just Want to Label Text?
-
- Posts: 3
- Joined: Sat Sep 26, 2009 4:07 am
NEW: TikZ book now 40% off at Amazon.com for a short time.
-
- 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?
The cross-references need something to point at. Sentences don't have that: they are just sentences. I'm intrigued about how you feel this will look. Is there an example you can point us to?
Joseph Wright
-
- Posts: 3
- Joined: Sat Sep 26, 2009 4:07 am
Re: How Do I Use \label if I Just Want to Label Text?
Well, in class I completed a lab exercise, and the write up is supposed to include a procedure and an error analysis (qualitative and quantitative). I was thinking about combining the procedure with a qualitative error analysis, and then cross-referencing these qualitative errors with a different section, the error analysis section, where the qualitative errors are explained quantitatively.
- 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?
Just a hint. Somebody asking for an example wants to see some code in the sense of a minimal working example (MWE).
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
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?
Oh, sorry about that. I actually don't know of a working example that does what I'm asking for, but here is the "working" code for my document.
\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}
\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
Re: How Do I Use \label if I Just Want to Label Text?
I was thinking of an occasion where someone has done something similar to what you want. Could be done in a word processor or page layout app, for example.
Joseph Wright