only run chktex on .tex files, not .Rtex files

the .tex files produced from knitr have macros which confuse chktex
This commit is contained in:
Brian Gough
2016-09-12 16:28:52 +01:00
parent 095e16e953
commit ee170b4e67
2 changed files with 38 additions and 1 deletions

View File

@@ -44,7 +44,9 @@ module.exports = CompileManager =
# set up environment variables for chktex
env = {}
if request.check?
# only run chktex on LaTeX files (not knitr .Rtex files or any others)
isLaTeXFile = request.rootResourcePath?.match(/\.tex$/i)
if request.check? and isLaTeXFile
env['CHKTEX_OPTIONS'] = '-nall -e9 -e10 -w15 -w16'
if request.check is 'error'
env['CHKTEX_EXIT_ON_ERROR'] = 1