# chex_latex
LaTeX file checking tool.
This Perl script reads your .tex files and looks for potential problems, such as doubled words ("the the") and many other bugs. Put it in your directory of .tex files and run it to look for common mistakes. If a message confuses you, look in the Perl script itself, as there are comments and links about some of the issues flagged. You can also use this script on raw text files; the script will automatically not do LaTeX testing.
You might disagree with some of the problems flagged, but with chex_latex.pl you are at least aware of all of them. A few minutes wading through these can catch errors hard to notice otherwise. That said, definitely don't take the script's word for it. This program is no substitute for understanding the rules of grammar and LaTeX. One other trick I recommend: paste your text into Microsoft Word and see what it turns up.
The chex_latex.pl script tests for:
* Doubled words, such as "the the."
* Grammatical goofs or clunky phrasing, as well as rules for formal writing, such as not using contractions.
* Potential [inter-word vs. inter-sentence spacing problems](https://en.wikibooks.org/wiki/LaTeX/Text_Formatting#Space_between_words_and_sentences).
* Any figure \label's that do not have any \ref's, and vice versa.
* \index markers that get opened but not closed, or vice versa.
* Misspellings used in computer graphics, e.g., "tesselation" and "frustrum" (and it's easy to add your own).
* Any \bibitems's that do not have any \cite's, and vice versa.
* And much else - more than 300 tests in all.
As an example, here is testfile.tex file; first, look it over yourself:
\section{Algorithms that Use Hardware}
Here we'll discuss the very many algorithms that can be implemented on the GPU. For more information, Castelli
\cite{Castelli2018} gives a thorough overview of the use of mip-maps for level of detail, compute shaders for
frustrum culling, etc. and discusses which APIs support these techniques. Basically, you can use anything from
DirectX 12\index{DirectX 12} with C++ to WebGL\index{WebGL} with Javascript/index{Javascript} as your API , due
to that these all talk to the same underlying hardware. More specifically, there is literally no better way to
to accelerate processing data, vs. using just the CPU--so ''just do it''.
Before looking below, what errors do you see? By typing "perl chex_latex.pl testfile.tex", here's what chex_latex.pl finds:
SERIOUS: Title has a word 'that' that is uncapitalized, on line 1 in testfile.tex.
The program is set to require that titles are capitalized.
To override, use '-t' on the command line to allow uncapitalized titles.
To be sure, you can test your title at https://capitalizemytitle.com/
Sentence ending in the capital letters GPU should have a '\@.' for spacing, on line 2 in testfile.tex.
SERIOUS: For formal writing, no contractions: ''ll' to ' will' on line 2 in testfile.tex.
tip: consider removing or replacing 'very' on line 2 in testfile.tex.
'very' tends to weaken a sentence. Try substitutes: https://www.grammarcheck.net/very/
\cite needs a tilde ~\cite before citation to avoid separation, on line 3 in testfile.tex.
'mip-map' to 'mipmap' (no hyphen), on line 3 in testfile.tex.
POSSIBLY SERIOUS: you may need to change 'etc.' to 'etc.\' to avoid having a 'double-space'
appear after the period, on line 4 in testfile.tex.
(To be honest, it's better to avoid 'etc.' altogether, as it provides little to no information.)
MISSPELLING: 'frustrum' to 'frustum' on line 4 in testfile.tex.
tip: you can probably remove 'basically' on line 4 in testfile.tex.
hint: try to avoid using etc., as it adds no real information; on line 4 in testfile.tex.
If you do end up using etc., if you don't use it at the end of a sentence, add a backslash: etc.\
SERIOUS: '/index' should be \index, on line 5 in testfile.tex.
SERIOUS: change ' ,' to ',' (space in front of comma), on line 5 in testfile.tex.
Please change 'Javascript' to 'JavaScript' on line 5 in testfile.tex.
tip: 'due to that' to 'because' on line 6 in testfile.tex.
tip: 'more specifically' to 'specifically' on line 6 in testfile.tex.
tip: you can probably not use 'literally' (and may mean 'figuratively') on line 6 in testfile.tex.
If you think it's truly OK (e.g., it's part of a technical term, or you just like it),
either edit this perl script, or put on the end of this line of your .tex file the comment '% chex_latex'.
SERIOUS: word duplication problem of word 'to' on line 7 in testfile.tex.
possibly serious: change '--' (short dash) to '---' on line 7 in testfile.tex, unless you are specifying a range.
SERIOUS: U.S. punctuation rule, change ''. to .'' on line 7 in testfile.tex.
SERIOUS: the right apostrophe ' should probably be a left double-apostrophe ``, on line 7 in testfile.tex.
SERIOUS: change 'vs.' to 'versus' to avoid having a 'double-space' appear after the period,
or use 'vs.\' on line 7 in testfile.tex.
Not capitalized at start of sentence (or the period should have a \ after it), on line 7 in testfile.tex.
==========================================================================================================
This script is in no way foolproof, and will natter about all sorts of things you may not care about. Since it's a Perl script, it's easy for you to delete or modify any tests that you don't like.
# Installation and Use
Install Perl from say https://www.activestate.com/activeperl, put chex_latex.pl somewhere (easiest is to put it in the directory with your .tex files, else you need to specify the path to this file), go to the directory where your .tex files are and then:
perl chex_latex.pl
and all .tex files in your directory and subdirectories will be read and checked for this and that. If you run this command in your downloaded repository, you should get the error list shown at the top of this page for the testfile.tex file included.
To run on a single file, here shown on Windows with an absolute path:
perl chex_latex.pl C:\Users\you\your_thesis\chapter1.tex
For all files in a directory, here shown with a relative path:
perl chex_latex.pl work_files/my-thesis-master
This script is one used for the book ''Real-Time Rendering'' and so has a bunch of book-specific rules. Blithely ignore our opinions or, better yet, comment out the warning lines you don't like in the script (the program's just a text file, nothing complex). You can also add "% chex_latex" to the end of any line in your .tex file in order to have this script skip some error tests on it, e.g.:
This method of using data is reasonable. % don't flag "data is" - chex_latex
The "chex_latex" says the line is OK and won't be tested. Beware, though: if you make any other errors on this line in the future, they also won't be tested.
The main options are:
-d - turn off dash tests for '-' or '--' flagged as needing to be '---'.
-f - turn off formal writing check; allows contractions and other informal usage.
-p - turn ON picky style check, which looks for more style problems but is not so reliable.
-s - turn off style check; looks for poor usage, punctuation, and consistency problems.
-t - turn off title capitalization check; titles are assumed to be properly capitalized otherwise.
-u - turn off U.S. style tests for putting commas and periods inside quotes.
So if you want all the tests, do:
perl chex_latex.pl -p [directory or files]
If you want the bare minimum, checking just for LaTeX problems and doubled words, do:
perl chex_latex.pl -dstfu [directory or files]
To run this checker against plain text files, just specify the files, as normal:
perl chex_latex.pl my_text_file.txt another_text_file.txt
If any file is found that does not end in ".tex," the LaTeX-specific tests will be disabled (for all files, so don't mix .tex with .txt).
Two other more obscure options:
-O okword
Instead of adding a comment "% chex_latex" to lines you want
没有合适的资源?快使用搜索试试~ 我知道了~
chex_latex:LaTeX文件检查工具
共6个文件
pl:2个
license:1个
gitignore:1个
5星 · 超过95%的资源 需积分: 10 1 下载量 144 浏览量
2021-03-09
01:10:52
上传
评论
收藏 38KB ZIP 举报
温馨提示
chex_latex LaTeX文件检查工具。 该Perl脚本读取您的.tex文件,并查找潜在的问题,例如双字(“ the”)和许多其他错误。 将其放在您的.tex文件目录中,然后运行它以查找常见错误。 如果有消息让您感到困惑,请查看Perl脚本本身,因为其中有关于某些问题的注释和链接。 您还可以在原始文本文件上使用此脚本。 该脚本将自动不进行LaTeX测试。 您可能不同意标记的某些问题,但是使用chex_latex.pl您至少了解所有这些问题。 花费几分钟浏览这些错误可能会导致其他方面难以察觉的错误。 话虽这么说,但绝对不要接受脚本的字眼。 该程序不能替代理解语法和LaTeX的规则。 我建议另一种技巧:将文本粘贴到Microsoft Word中,然后查看结果。 chex_latex.pl脚本测试以下内容: 加倍的单词,例如“ the the”。 语法错误或笨拙的措词,以及正式
资源推荐
资源详情
资源评论
收起资源包目录
chex_latex-master.zip (6个子文件)
chex_latex-master
chex_latex.pl 132KB
LICENSE 1KB
aspell_sorter.pl 3KB
.gitignore 321B
README.md 12KB
testfile.tex 667B
共 6 条
- 1
资源评论
- gdgchh2021-08-17用户下载后在一定时间内未进行评价,系统默认好评。
笨猫猪
- 粉丝: 30
- 资源: 4732
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功