3

This question already has an answer here:

Although spelling mistakes can be easily corrected within compiler itself, I'm wondering if LaTeX is capable of detecting wrong use of grammar. Like if we write "Solution are" in MS word then both words would get underlined with red line. Is there any similar feature available with latex ?

marked as duplicate by user13907, Maarten Dhondt, Jesse, Andrew Swann, Przemysław Scherwentke Jul 1 '16 at 11:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 7
    Depends on the editor you are using, not sure about grammar but for ortography i think it still a light correction comparing to MS word (at least i am talking about TeXMaker). tex.stackexchange.com/q/6333/92620 – SAM Jul 1 '16 at 2:21
  • 3
    Thankfully, LaTeX 'corrects' neither my spelling nor my grammar. Nor does it second guess my formatting intentions. Equally thankfully, my editor does highlight possible spelling errors. Further thanks are to be given for the fact that it does not attempt to correct them. – cfr Jul 1 '16 at 2:33
  • 1
    Exactly what I said. The features I mentioned are LaTeX delights for which I give thanks. – cfr Jul 1 '16 at 2:47
  • 1
    LaTeX itself does not correct grammar or spelling. Your IDE or editor of choice may be capable of doing so. – naphaneal Jul 1 '16 at 6:22
  • 5
    @cfr I still remember with a smile students' handouts where ”codominio“ (codomain) was happily changed into ”condominio" (apartment lot). Guess what software they were using. – egreg Jul 1 '16 at 8:53
13

The simple answer to your question is: No, LaTeX can not do that!

LaTeX or TeX is desiged to typeset text, it is not designed to make a spelling or grammar correcting. It tooks the text as it comes (considdering it is well spelled and follows the grammar).

If you want to have a grammer correction or an spelling correcting, choose an LaTeX Editor which has an included tool for that or is able to let you include one.

  • 4
    Are the grammar/spelling errors made on purpose?😎 – egreg Jul 1 '16 at 8:48
  • 1
    You might want to say that it does not do that rather than can't - before somebody mentions that TeX is Turing complete again ... :-) – cfr Jul 1 '16 at 9:56
  • @cfr, too late! :-) – alexis Jul 1 '16 at 10:24
3

The more literal answer to your question is: TeX, the engine behind LaTeX, is Turing-complete so it could in principle do anything you can program in another language. But you'd be crazy to try, because TeX is not a general-purpose programming language.

LaTeX doesn't handle spelling correction either, that's your latex editor at work. In fact TeX cannot control what you see in your editor window-- only the formatted document and auxiliary files it generates. So you should focus on choosing an editor that does what you need. Looks like you use WinEdt, which according to this post had no plans to add grammar checking ten years ago. A minute's googling turned up this page, which suggests TeXstudio is the way to go. Here's also an older tex.sx question which asks the same question, but for Linux. (Since you're on Windows I'm not proposing it as a duplicate, but note that several solutions are available cross-platform.)

This is all based on a quick check, so I suggest you do some more research in case there are options that suit you better.

PS. I should add that nothing keeps you from firing up Word on your LaTeX document and looking for the green lines. It'll get confused by latex mark-up, but for clean runs of text its grammar checker is probably far superior to the alternatives. (Just make sure it's saved in plain-text mode again!)

  • 1
    Note that TeX is also Schmuring-complete (patent pending) that is to say any feature that invokes Turing-completeness argument will not exist within that language. – percusse Jul 1 '16 at 11:01
  • Saving a .tex document as 'plain text' in Word will not, as far as I know, save it as plain text. At least, it certainly never used to. Note that your second paragraph is inconsistent with your first. If TeX is Turing complete, it could control what you see in your editor window, I assume. Or at least what you see in an editor window. Of course, that would be even more crazy, but that's a different question. – cfr Jul 1 '16 at 13:04
  • @cfr, TeX can control what you see in the editor window only if you write the editor itself in TeX! (or an editor plug-in.) No program can control what the editor displays unless it can control the editor. – alexis Jul 2 '16 at 9:01
  • Um, check your settings or explain? I never had trouble saving text files in Word. – alexis Jul 2 '16 at 9:03
  • @alexis What I meant was that, since it is Turing complete, you could theoretically do precisely that i.e. use it to write an editor. Doing so would be nuts, but that's a different matter. As for Word, it has been my understanding that saving 'plain text' in Word does not save the file as plain text because the software still adds stuff which will, e.g., screw up compilation. Perhaps they have improved things in newer versions of Word. I certainly cannot check my settings as I don't have any. – cfr Jul 2 '16 at 15:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.