正确的LaTeX文档字数统计 [英] Correct word-count of a LaTeX document

查看:89
本文介绍了正确的LaTeX文档字数统计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在搜索对LaTeX文档进行正确字数统计的应用程序或脚本.

I'm currently searching for an application or a script that does a correct word count for a LaTeX document.

到目前为止,我只遇到了只能在单个文件上运行的脚本,但是我想要的是一个可以安全地忽略LaTeX关键字并且还可以遍历链接文件的脚本...即遵循 \ include \ input 链接为整个文档生成正确的字数.

Up till now, I have only encountered scripts that only work on a single file but what I want is a script that can safely ignore LaTeX keywords and also traverse linked files...ie follow \include and \input links to produce a correct word-count for the whole document.

在vim中,我目前使用 ggVGg CTRL + G ,但是显然,它显示了当前文件的计数,并且不会忽略LaTeX关键字.

With vim, I currently use ggVGg CTRL+G but obviously that shows the count for the current file and does not ignore LaTeX keywords.

有人知道可以执行此工作的任何脚本(或应用程序)吗?

Does anyone know of any script (or application) that can do this job?

推荐答案

我使用 texcount .网页具有要下载的Perl脚本(和手册).

I use texcount. The webpage has a Perl script to download (and a manual).

它将包括文档中包含的 tex 文件( \ input \ include )(请参见 -inc ),支持宏并具有许多其他不错的功能.

It will include tex files that are included (\input or \include) in the document (see -inc), supports macros, and has many other nice features.

关注包含的文件时,您将获得有关每个单独文件以及总计的详细信息.例如,这是我的12页文档的总输出:

When following included files you will get detail about each separate file as well as a total. For example here is the total output for a 12 page document of mine:

TOTAL COUNT
Files: 20
Words in text: 4188
Words in headers: 26
Words in float captions: 404
Number of headers: 12
Number of floats: 7
Number of math inlines: 85
Number of math displayed: 19

如果您只对总数感兴趣,请使用 -total 自变量.

If you're only interested in the total, use the -total argument.

这篇关于正确的LaTeX文档字数统计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆