使用 Minipage 中的 Lineno 进行行编号

使用 Minipage 中的 Lineno 进行行编号

我正在尝试为阅读文章添加行号。问题是,当我尝试在 minipage 环境中对行进行编号时,无法显示它们。有人能回答这个看似简单的问题吗?

\documentclass[letterpaper,12pt]{book}
\usepackage{lineno}
\usepackage{lipsum}

\newsavebox{\fmbox}
\newenvironment{fmpage}[1]
{\begin{lrbox}{\fmbox}\begin{minipage}{#1}}
{\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

Introduction:  \\

\lipsum[1]

\begin{center} 
\begin{fmpage}{5in}
\vspace{.25cm} % Maybe look into frame sep
{ %
Satellites \\

\modulolinenumbers[2]
\begin{linenumbers}
When you watch the news and see pictures of weather from around the United States 
or the world, you are seeing data from NOAA's environmental satellites. NOAA's 
environmental satellites provide data from space to monitor the Earth to analyze the 
coastal waters, relay life-saving emergency beacons, and track tropical storms and 
hurricanes. 
\end{linenumbers}

\ldots and then there are some multiple-choice questions about it.
}
\vspace{.25cm}
\end{fmpage} \end{center}%
\end{document}

答案1

包装lineno提供了在盒子内添加框架编号的可能性,方法是internallinnumbers

以下是最终的 mwe:

\documentclass[letterpaper,12pt]{book}
\usepackage{lineno}
\usepackage{lipsum}

\newsavebox{\fmbox}
\newenvironment{fmpage}[1]
{\begin{lrbox}{\fmbox}\begin{minipage}{#1}}
{\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

Introduction:  \\

\lipsum[1]

\begin{center} 
\begin{fmpage}{5in}
\vspace{.25cm} % Maybe look into frame sep
{ %
Satellites \\

\modulolinenumbers[2]
\begin{internallinenumbers}
When you watch the news and see pictures of weather from around the United States 
or the world, you are seeing data from NOAA's environmental satellites. NOAA's 
environmental satellites provide data from space to monitor the Earth to analyze the 
coastal waters, relay life-saving emergency beacons, and track tropical storms and 
hurricanes. 
\end{internallinenumbers}

\ldots and then there are some multiple-choice questions about it.
}
\vspace{.25cm}
\end{fmpage} \end{center}%
\end{document}

在此处输入图片描述

相关内容