引用数字很简单:
\begin{figure}
\caption{Blah blah blah blah blah}
\label{fig:name}
%shtuff goes here
\end{figure}
See figure~\ref{fig:name}.
我想知道是否可以在算法中引用行号,例如:
\begin{algorithmic}[1]
\State blah1
\State blah2 \label{lst:line:blah2}
\State blah3
\end{algorithmic}
As you can see on line~\ref{lst:line:blah2} \ldots
答案1
当然可以;这是一个基于您的代码片段的简单示例:
\documentclass{article}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithmic}[1]
\State blah1
\State blah2 \label{lst:line:blah2}
\State blah3
\end{algorithmic}
As you can see on line~\ref{lst:line:blah2} \ldots
\end{document}