25

There's a text lexer that highlights nothing.


11

I'd never heard of chktex but texdoc chktex says 6.1.4 Per Line and File Suppressions There are many cases in which ChkTEX will give a warning about a construct which, although it usually indicates a mistake, is intentional. In these cases it can be extremely annoying to have this message appear everytime ChkTEX is run. For this reason you ...


10

According to the ChkTeX manual, you can ignore the contents of an enivronment completely by adding its name to the VerbEnvir entry of the configuration file .chktexrc. So in order to not check PGF/TikZ environments, this file should look like this: # Exclude these environments from syntax checking VerbEnvir { pgfpicture tikzpicture }


6

TeXstudio tries to help you with finding errors in your syntax. You have noticed that some commands get recognized and some don't. Additionally, TeXstudio will warn you in case you use obviously wrong syntax. First of all: Your code compiles, you get some nice output, and most probably, there is nothing wrong in the .log-file (warnings and errors). This ...


6

In the olden days, typesetting a big book could literally take hours. Most of the time was and is spent in breaking paragraphs into lines, breaking paragraphs into pages and in I/O operations. The overhead is small with modern machines, in the 80's it used to be huge. Appendix D of the TeXbook has a section about “doing only syntax check” without ...


6

TeX's \def provides delimited parameter text. So, in this case, you can use the space as a delimiter: \documentclass{article} \usepackage{xcolor} \def\ParseWordandPrint#1{% \if #1.% \textcolor{red}{\Word}\ % \else% \edef\Word{\Word#1}% \expandafter\ParseWordandPrint% \fi% } \def\InitParseWordandPrint#1{% \def\Word{}...


6

I think the answer in full generality is no. There is not. This is due to issues outline in this excellent answer. In short, LaTeX can change what the symbols mean in ways that it is tricky for a "syntax checker" to follow. I'm sure some editors do a better job than others at doing this, and so I fully expect a better answer to this question to appear.


6

It's really easy with LaTeX3: \documentclass{article} \usepackage{xparse,xcolor} \ExplSyntaxOn \NewDocumentCommand{\printfirstwordincolor}{ O{red} m } { \jubobs_pfwr:nn { #1 } { #2 } } \seq_new:N \l_jubobs_words_seq \tl_new:N \l_jubobs_first_word_tl \cs_new_protected:Npn \jubobs_pfwr:nn #1 #2 { % split the input at spaces \seq_set_split:Nnn \...


5

I'm a bit late to the party, but I wrote a LaTeX parenthesis checker myself, because I got fed up with the sometimes very poor error reporting by TeX. The source file check-parens.cc (CTAN package) contains instructions on how to compile (requires C++x0 support) and run it. It uses a stack, just as the match_parens script, but recognizes some basic LaTeX ...


5

Undeleting this in light of your edited question. It is easier to grab the word in one go with a space delimited argument and then iterate over that letter by letter. (As an example I check here that they are letters, the last example produces illegal character 0 illegal character 1 To iterate character by character stopping at a space you tent to have to ...


4

I got the desired result. For some strange reason, circle is highlighted as a grammatical error, that disappears if I select the dictionary in English (I'm italian). It is not a big deal. I'm not being able to create a working .qxf file. I've create the file and put it in the folder where there is the texstudio.ini file, as suggested by Troy, but it don't ...


3

I'm sure this is too late to help you, but ChkTeX will warn you if you mismatch ()[]{}. It also emits many other warnings, but you can configure it to only print information about mismatched parentheses. Or you could read the other warnings and become enlightened. :-)


3

Create a file called something like mychktexrc somewhere, containing WipeArg { \label:[]{} \ref:{} \eqref:{} \vref:{} \pageref:{} \index:[]{} \cite:[][]{} \nocite:{} \input:{} \verbatiminput:[]{} \listinginput:[]{}{} \verbatimtabinput:[]{} \include:{} \includeonly:{} \bibitem:[]{} \cline:{} \cmidrule:[](){} \href:{}{} # ...


2

This should work. But instead of syntonly you can use the -draftmode option to pdflatex. \documentclass[oneside]{book} \usepackage{graphicx} \usepackage{syntonly} \syntaxonly \usepackage{float} \newfloat{carte}{h}{carte} \floatname{carte}{Carte} \makeatletter \ifsyntax@ \let\fs@plain\@gobble \let\@float@setevery\@gobble \let\@fs@capt\relax \def\@...


2

The errors from the syntax checker are all spurious complaining about internal code constructs that probably should not be at the top of level of a document, but are fine (and in some cases necessary) in internal package (and generated) code. You can probably stop the syntax checker following the \input and checking the file by using a custom input command (...


2

TeXstudio does not recognise \begin{eqnarray*} ... \end{eqnarray*} as math env, therfore all math commands will be marked as "math command outside math env", this is known wont-fix TeXstudio-Bug, but as described on https://sourceforge.net/p/texstudio/bugs/1500/ you can avoid this bug with "activate latex-l2tabu.cwl in option/completion": (Picture: CC-BY-SA ...


2

As noted before, a true syntax checker for LaTeX (or any other TeX format) is strictly impossible due to TeX's Turing-completeness. However, you can find the most common errors with the lacheck script, included in your TeX distribution.


2

Because TeX is a markup language it doesn't suffer from things like undefined behaviour as C, so we are mostly down to detecting errors ahead of the run. ConTeXt comes with a syntax checker script for checking mismatched braces. Unfortunately it cannot tell you about undefined control sequences because you can (re)define your own, so this is impossible to ...


1

This was a problem with calling strcpy on overlapping strings. With some versions of glibc this caused problems and with others it didn't. This was fixed in the svn version to use memmove. I recently got svn access, so I'm hoping we can release a new version with this (and a few other bugs) fixed. Anyway, the bottom line is that if you build it yourself ...


Only top voted, non community-wiki answers of a minimum length are eligible