向 IEEE Latex 文档添加行号

向 IEEE Latex 文档添加行号

我想在 IEEE 论文样式中添加行号。我尝试过使用不同的方法,但都没有成功。例如,当\usepackage[switch,columnwise]{lineno}我使用公式时,行号会丢失。

我已经制作了一个示例乳胶文件,有人可以帮忙如何在该文档中添加行号吗?

谢谢

\documentclass[journal,onecolumn,12pt]{IEEEtran}
\usepackage{amsmath}
\usepackage[switch,columnwise]{lineno}
\begin{document}
\linenumbers
\title{\huge LINE NUMBER TEST}
\author{FIRST~LAST,~\IEEEmembership{Member}
\thanks{FIRST LAST, IS WITH INSTITUTE OF TEST (e-mail: [email protected]).} }
\markboth{JOURNAL OF TEST}%
{Shell \MakeLowercase{\textit{et al.}}: Bare Demo of IEEEtran.cls for Journals}
\maketitle
\begin{abstract}
This is for testing the appearance of line number. This is for testing the appearance of line number. 
\end{abstract}
\section{Introduction}
\IEEEPARstart{L}{line} number (LN) in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time. Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time. Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time.
\begin{align*}
z_{1}&=x_{1}+y_{1}\\
z_{2}&=x_{2}+y_{2}
\end{align*}
Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time. Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time.
\newpage
Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time. Line number in draft paper is a good option to locate exactly where you want. It helps you to find specific information in short time.
\end{document}

答案1

IEEE 的peerreview选项似乎与选项不兼容two-column。在这种情况下,该lineno包可以解决问题。

\documentclass[twocolumn, journal]{IEEEtran}

\usepackage[switch]{lineno}
...
...

\begin{document}
\linenumbers
...
...
\end{document}

switch选项在左列的左边距和右列的右边距打印行号。

(致谢Mico 的帖子以获得解决方案)

答案2

只需添加选项peereviewpeerreviewca,您就会得到可能适合您需求的东西。根据如何使用 IEEEtran LATEX 类(IEEEtran 手册),

在此处输入图片描述

\documentclass[journal,onecolumn,12pt, peerreview]{IEEEtran}

生成:

在此处输入图片描述

MWE 将是:

\documentclass[peerreview]{IEEEtran} % The critical option here is peerreview
\usepackage{lineno} % To obtain line numbers
\usepackage{lipsum} % Just for the demo, you can safely remove it.
\begin{document}
\linenumbers % Lineno command, turn on line numbering.
\title{All I Know About Trains}
\author{Thomas}
\maketitle
\lipsum[15]
\begin{equation}
  23 = 12 + 11
 \end{equation}
\lipsum[17]
\end{document}

生产:

在此处输入图片描述

否则你可以尝试在 pdf 文件中添加行号的方法,而不是在编译期间。

相关内容