【发布时间】:2013-07-29 07:33:08
【问题描述】:
我在终端中使用 perl 脚本 texcount 来计算我的 tex 文件中的单词数。然而,我正在写的论文很长,我已经把它分解了,每个部分都有自己的 tex 文件,当我想打印文档时,有一个整体文件 (Thesis.tex) 结合了每个部分。在 Thesis.tex 上运行 texcount 不会给我每个文件的组合字数,而只是给我 Thesis.tex 的字数。
我想编写一个小脚本,在每个部分调用 texcount 并总结字数,以便我得到一个整体字数。
我有 5 个部分不包括 Thesis.tex:
-Thesis.tex (which combines them all),
-Introduction.tex
-Literature.tex
-Model.tex
-Results.tex
-Conclusion.Tex
texcount 命令的输出如下所示:
JoeDanger:Dissertation joedanger$ texcount Thesis.tex
File: Thesis.tex
Encoding: ascii
Words in text: 34
Words in headers: 13
Words in float captions: 0
Number of headers: 1
Number of floats: 0
Number of math inlines: 0
Number of math displayed: 0
我想总结的是 Words in text: 输出。
【问题讨论】:
-
texcount *.tex不工作吗? -
它会,但我已经设置好了,以便每个部分都在其自己的文件夹中,以及这些文件夹中的相关图形、表格等。将所有内容移动到一个文件夹中并更改与 tex 文件中这些图形关联的路径会有点痛苦。
-
find . -name \*.tex | xargs texcount?
标签: bash shell terminal latex word-count