拓新分享 http://blog.sciencenet.cn/u/DanYangpeng

博文

[转载]解决LaTex使用lineno无法给公式前的文字加行号的问题

已有 6079 次阅读 2021-8-21 20:34 |个人分类:LaTex|系统分类:科研笔记|文章来源:转载

本文转载自:https://tex.stackexchange.com/questions/25784/why-doesnt-lineno-number-a-paragraph-when-it-is-followed-by-an-indented-equatio/404726#404726


  1. 在LaTex文档中添加行号,导言区加入\usepackage[switch]{lineno},在\end{frontmatter}后输入命令\linenumbers,可以看到大部分文本都能编号,只有公式前的文本无法编号。一般的解决方法是在\begin{equation}前换行,但这样会导致正文和公式之间多出一行,一定程度上会影响文档布局;

  2. 另一种比较简便的做法,在\begin{document}前添加如下代码:

\let\oldequation\equation
\let\oldendequation\endequation

\renewenvironment{equation}{\linenomathNonumbers\oldequation}{\oldendequation\endlinenomath}




https://blog.sciencenet.cn/blog-2578568-1300795.html

上一篇:调整MatLab子图的标题
下一篇:[转载]解决LaTex中用url插入超链接的字体不是罗马字体的问题
收藏 IP: 202.114.107.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (1 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-30 18:41

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部