在文章中添加行號

第一種:Adding line numbers to a LaTeX document



download the lineno package (http://www.ctan.org/get/macros/latex/contrib/lineno.zip)
unpack it ('unzip lineno.zip') and from the subdirectory lineno/ copy all files *.sty into the directory with your LaTeX main document
in the LaTeX preamble include the line
  \RequirePackage{lineno} 
before the \documentclass{...} command. 


(Note: this rather unusual way of including a package is necessary due to incompatibilities between the lineno package and revtex. If you are not using revtex to prepare your document you can also use the standard way: \usepackage{lineno})
line numbers can be activated by adding the line
  \linenumbers
after \begin{document}
The package has several options, for instance printing only every 5th line number, or starting to count at 1 for each page, etc. A users guide is available at http://www.ctan.org/tex-archive/macros/latex/contrib/lineno/ulineno.pdf




Example for D0 PRL template with line numbers printed every 5 lines and starting at 1 for each page:




\RequirePackage{lineno}
\documentclass[aps,prl,twocolumn,showpacs,groupedaddress]{revtex4}  % for review and submission 
\usepackage{graphicx}  % needed for figures
\usepackage{dcolumn}   % needed for some tables
\usepackage{bm}        % for math
\usepackage{amssymb}   % for math


\begin{document}
\setpagewiselinenumbers
\modulolinenumbers[5]
\linenumbers
....




Notes:
In case that the table of content becomes garbled, add the \linenumbers command after the \tableofcontent command.
To increase the font size of the line numbers add


    \def\linenumberfont{\normalfont\small\sffamily}


(in two column layouts this might have the unwanted effect of line numbers of the right column overlapping with the text in the left column)


第二種:在word中自動實現正文加上行號(line numbers)

在頁面設置裏有這一項。參考附件圖示,試試看。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章