{"id":13476040,"url":"https://github.com/sylvainhalle/textidote","last_synced_at":"2025-05-15T17:06:32.011Z","repository":{"id":37743281,"uuid":"136962671","full_name":"sylvainhalle/textidote","owner":"sylvainhalle","description":"Spelling, grammar and style checking on LaTeX documents","archived":false,"fork":false,"pushed_at":"2025-04-22T11:44:57.000Z","size":1706,"stargazers_count":967,"open_issues_count":37,"forks_count":70,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-01T10:19:05.707Z","etag":null,"topics":["grammar-checker","languagetool","latex","linter","spell-check","spell-checker"],"latest_commit_sha":null,"homepage":"https://sylvainhalle.github.io/textidote","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sylvainhalle.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-11T18:03:31.000Z","updated_at":"2025-04-25T14:47:05.000Z","dependencies_parsed_at":"2024-11-15T10:31:35.688Z","dependency_job_id":"043a3daa-d57c-4888-a6b3-da3c332ac9ef","html_url":"https://github.com/sylvainhalle/textidote","commit_stats":{"total_commits":280,"total_committers":31,"mean_commits":9.03225806451613,"dds":"0.21785714285714286","last_synced_commit":"c9abf447bec814d74954a08b8514b44cc972ac65"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2Ftextidote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2Ftextidote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2Ftextidote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sylvainhalle%2Ftextidote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sylvainhalle","download_url":"https://codeload.github.com/sylvainhalle/textidote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254384988,"owners_count":22062422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grammar-checker","languagetool","latex","linter","spell-check","spell-checker"],"created_at":"2024-07-31T16:01:26.026Z","updated_at":"2025-05-15T17:06:27.003Z","avatar_url":"https://github.com/sylvainhalle.png","language":"Java","funding_links":[],"categories":["Java","Misc. Tools","General Tools"],"sub_categories":["Quality Check Tools","Checker \u0026 Formatter"],"readme":"TeXtidote: a correction tool for LaTeX documents and other formats\n==================================================================\n\n[![Travis](https://img.shields.io/travis/sylvainhalle/textidote.svg?style=flat-square)](https://travis-ci.org/sylvainhalle/textidote)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=sylvainhalle_textidote\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=sylvainhalle_textidote)\n\u003cimg src=\"http://leduotang.ca/textidote.svg\" height=\"16\" alt=\"Downloads\"/\u003e\n\nHave you ever thought of using a grammar checker on LaTeX files?\n\nIf so, you probably know that the process is far from simple. Since LaTeX\ndocuments contain special commands and keywords (the so-called \"markup\") that\nare not part of the \"real\" text, you cannot run a grammar checker directly on\nthese files: it cannot tell the difference between markup and text. The other\noption is to remove all this markup, leaving only the \"clear\" text; however,\nwhen a grammar tool points to a problem at a specific line in this clear text,\nit becomes hard to retrace that location in the original LaTeX file.\n\nTeXtidote solves this problem; it can read your original LaTeX file and\nperform various sanity checks on it: for example, making sure that every\nfigure is referenced in the text, enforcing the correct capitalization of\ntitles, etc. In addition, TeXtidote can remove markup from the file and send\nit to the [Language Tool](https://www.languagetool.org) library, which\nperforms a verification of **both spelling and grammar** in a dozen languages.\nWhat is unique to TeXtidote is that it keeps track of the relative position of\nwords between the original and the \"clean\" text. This means that it can\ntranslate the messages from Language Tool back to their proper location\n**directly in your source file**.\n\nYou can see the list of all the rules checked by TeXtidote at the end of this\nfile.\n\nTeXtidote also supports spelling and grammar checking of files in the [Markdown](https://en.wikipedia.org/wiki/Markdown) format.\n\n## Getting TeXtidote\n\nYou can either install TeXtidote by downloading it manually, or by installing\nit using a package.\n\n### Under Debian systems: install package\n\nUnder Debian systems (Ubuntu and derivatives), you can install TeXtidote using\n`dpkg`. Download the latest `.deb` file in the\n[Releases](https://github.com/sylvainhalle/textidote/releases) page; suppose\nit is called `textidote_X.Y.Z_all.deb`. You can install TeXtidote by typing:\n\n    $ sudo apt-get install ./textidote_X.Y.Z_all.deb\n\nThe `./` is mandatory; otherwise the command won't work.\n\n### Manual download\n\nYou can also download the TeXtidote executable manually: this works on all\noperating systems. Simply make sure you have Java version 8 or later installed\non your system. Then, download the [latest\nrelease](https://github.com/sylvainhalle/textidote/releases/latest) of\nTeXtidote; put the JAR in the folder of your choice.\n\n## Using TeXtidote\n\nTeXtidote is run from the command line. The TeXtidote repository contains a\nsample LaTeX file called\n[example.tex](https://raw.githubusercontent.com/sylvainhalle/textidote/master/example.tex).\nDownload this file and save it to the folder where TeXtidote resides. You then\nhave the choice of producing three types of \"reports\" on the contents of your\nfile: an \"HTML\" report (viewable in a web browser), a \"console\" report \n(viewable in a terminal) and a \"single-line\" report (typically destined to be consumed by other scripts, see below).\n\n### HTML report\n\nTo run TeXtidote and perform a basic verification of the file, run:\n\n    java -jar textidote.jar --output html example.tex \u003e report.html\n\nIn Linux, if you installed TeXtidote using `apt-get`, you can also call it\ndirectly by typing:\n\n    textidote --output html example.tex \u003e report.html\n\nHere, the `--output html` option tells TeXtidote to produce a report in HTML format;\nthe `\u003e` symbol indicates that the output should be saved to a file, whose name\nis `report.html`. TeXtidote will run for some time, and print:\n\n```\nTeXtidote v0.8 - A linter for LaTeX documents\n(C) 2018-2019 Sylvain Hallé - All rights reserved\n\nFound 23 warnings(s)\nTotal analysis time: 2 second(s)\n```\n\nOnce the process is over, switch to your favorite web browser, and open the\nfile `report.html` (using the *File/Open* menu). You should see something like this:\n\n![Screenshot](https://raw.githubusercontent.com/sylvainhalle/textidote/master/docs/assets/images/Screenshot.png)\n\nAs you can see, the page shows your original LaTeX source file, where some\nportions have been highlighted in various colors. These correspond to regions\nin the file where an issue was found. You can hover your mouse over these\ncolored regions; a tooltip will show a message that describes the problem.\n\nIf you don't write any filename (or write `--` as the filename), TeXtidote\nwill attempt to read one from the standard input.\n\n### Plain report\n\nTo run TeXtidote and display the results directly in the console, simply omit\nthe `--output html` option (you can also use `--output plain`), and do not redirect the output to a file:\n\n    java -jar textidote.jar example.tex\n\nTeXtidote will analyze the file like before, but produce a report that looks\nlike this:\n\n```\n* L25C1-L25C25 A section title should start with a capital letter. [sh:001]\n  \\section{a first section}\n  ^^^^^^^^^^^^^^^^^^^^^^^^^\n* L38C1-L38C29 A section title should not end with a punctuation symbol.\n  [sh:002]\n  \\subsection{ My subsection. }\n  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n* L15C94-L15C99 Add a space before citation or reference. [sh:c:001]\n   things, like a citation\\cite{my:paper} .The text\n```\n\nEach element of the list corresponds to a \"warning\", indicating that\nsomething in the text requires your attention. For each warning, the position\nin the original source file is given: LxxCyy indicates line xx, column yy. The\nwarning is followed by a short comment describing the issue, and an excerpt\nfrom the line in question is displayed. The range of characters where the\nproblem occurs is marked by the \"^^^^\" symbols below the text. Each of these\nwarnings results from the evaluation of some \"rule\" on the text; an identifier\nof the rule in question is also shown between brackets.\n\n### Single line report\n\nAnother option to display the results directly in the console is the single line report:\n\n    java -jar textidote.jar --output singleline example.tex\n\nTextidote will analyze the file like before, but this time the report looks like this:\n\n```\nexample.tex(L25C1-L25C25): A section title should start with a capital letter. \"\\section{a first section}\"\nexample.tex(L38C1-L38C29): A section title should not end with a punctuation symbol. \"\\subsection{ My subsection. }\"\nexample.tex(L15C94-L15C99): Add a space before citation or reference. \"things, like a citation\\cite{my:paper} .The text\"\n```\n\nEach line corresponds to a warning, and is parseable by regular expressions\neasily, e.g., for further processing in another tool. The file is given at the\nbeginning of the line, followed by the position in parentheses. Then, the\nwarning message is given, and the excerpt causing the warning is printed in\ndouble quotes (\"\"). Note, that sometimes it may happen that a position cannot\nbe determined. In this case, instead of LxxCyy, ? is printed.\n\nYou can disable the use of color in any form of command-line output using the\n`--no-color` switch.\n\n### Spelling, grammar and style\n\nYou can perform further checks on spelling and grammar, by passing the\n`--check` option at the command line. For example, to check text in English,\nyou run:\n\n    java -jar textidote.jar --check en example.tex\n\nThe `--check` parameter must be accompanied by a two-letter code indicating\nthe language to be used. Language Tool is a powerful library that can verify\nspelling, grammar, and even provide suggestions regarding style. TeXtidote\nsimply passes a cleaned-up version of the LaTeX file to Language Tool,\nretrieves the messages it generates, and coverts the line and column numbers\nassociated to each message back into line/column numbers of the original\nsource file. For more information about the kind of verifications made by\nLanguage Tool, please refer to [its website](https://languagetool.org).\n\nAdditionally, the `--firstlang lang` option can be used to make Language Tool check for false friends in your first language.\nFor example, to check a text in english, when your first language is german, you may run:\n\n    java -jar textidote.jar --check en --firstlang de example.tex\n\nThe language codes you can use are:\n\n- `de`: (Germany) German, and the variants `de_AT` (Austrian) and `de_CH`\n  (Swiss)\n- `en`: (US) English, and the variants `en_CA` (Canadian) and `en_UK`\n  (British)\n- `es`: Spanish\n- `fr`: French\n- `nl`: Dutch\n- `pt`: Portuguese\n- `pl`: Polish\n\n### Using a dictionary\n\nIf you have a list of words that you want TeXtidote to ignore when checking\nspelling, you can use the `--dict` parameter to specify the location of a\ntext file:\n\n    java -jar textidote.jar --check en --dict dico.txt example.tex\n\nThe file `dico.txt` must be a plain text file contain a list of words to be\nignored, with each word on a separate line. (The list is case sensitive.)\n\nIf you already spell checked you file using [Aspell](https://aspell.net) and\nsaved a [local dictionary](http://aspell.net/0.50-doc/man-html/5_Working.html)\n(as is done for example by the\n[PaperShell](https://github.com/sylvainhalle/PaperShell) environment),\nTeXtidote can automatically load this dictionary when invoked. More\nspecifically, it will look for a file called `.aspell.XX.pws` in the folder\nwhere TeXtidote is started (this is the filename Aspell gives to local\ndictionaries). The characters `XX` are to be replaced with the two-letter\nlanguage code. If such a file exists, TeXtidote will load it and mention it at\nthe console:\n\n```\nFound local Aspell dictionary\n```\n\n### Analyzing a file from the clipboard\n\nIf you omit a filename, TeXtidote analyzes the standard input. You can use this to copy a piece of code to the clipboard and analyze it without the need to save it as a file first. The procedure depends on your operating system.\n\n- In Linux, you can copy text and pipe it to TeXtidote using [xclip](https://manpages.org/xclip): `xclip -o | textidote [options...]`.\n- In Windows' PowerShell, the same can be done with [GetClipboard](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-clipboard): `GetClipboard | textidote [options...]`\n- In MacOS X, the same can be done with [pbpaste](https://ss64.com/osx/pbpaste.html): `pbpaste | textidote [options...]`\n\n### Ignoring rules\n\nYou may want to ignore some of TeXtidote's advice. You can do so by specifying\nrule IDs to ignore with the `--ignore` command line parameter. For example,\nthe ID of the rule \"A section title should start with a capital letter\" is\n`sh:001` (rule IDs are shown between brackets in the reports given by\nTeXtidote); to ignore warnings triggered by this rule, you call TeXtidote as\nfollows:\n\n    java -jar textidote.jar --ignore sh:001 myfile.tex\n\nIf you want to ignore multiple rules, separate their IDs with a comma (but no\nspace).\n\n### Ignoring environments\n\nTeXtidote can be instructed to remove user-specified environments using the `--remove` command line parameter. For example:\n\n    $ java -jar textidote.jar --remove itemize myfile.tex\n\nThis command will remove all text lines between `\\begin{itemize}` and `\\end{itemize}` before further processing the file.\n\n### Ignoring macros\n\nThe same can be done with macros:\n\n    $ java -jar textidote.jar --remove-macros foo myfile.tex\n\nThis command will remove all occurrences of use-defined command `\\foo` in the text. Alternate syntaxes like `\\foo{bar}` and `\\foo[x=y]{bar}` are also recognized and deleted.\n\n### Replacing strings\n\nBefore TeXtidote analyses a file, you can ask it to apply a set of\nfind/replace operations (for example, to replace a macro by some predefined\ncharacter string). You can write these patterns into a text file and pass them\nto the program at the command line:\n\n    $ java -jar textidote.jar --replace replacements.txt\n\nHere, `replacements.txt` is the file that contains the find/replace patterns,\nfomatted as follows:\n\n```\n# Empty lines beginning with a pound sign are ignored\n# Search and replace patterns are separated by a tab\nfind\treplace\nfoo\t\tbar\n# Patterns can also be regular expressions\nabc\\d+[^x]\t\t123\n\"---\t\t\t---\n\"s\t\t\t\tß\n\\\\myellipsis\t\\\\ldots\n\\\\[Bb]igm\t\t\\|\n```\n\nReplacement rules are applied line-wise, so multiline replacements are not\npossible.\n\n### Reading a sub-file\n\nBy default, TeXtidote ignores everything before the `\\begin{document}`\ncommand. If you have a large document that consists of multiple included LaTeX\n\"sub-files\", and you want to check one such file that does not contain a\n`\\begin{document}`, you must tell TeXtidote to read all the file using the\n`--read-all` command line option. Otherwise, TeXtidote will ignore the whole\nfile and give you no advice.\n\nTeXtidote also automatically follows sub-files that are embedded from a main document using `\\input{filename}` and `\\include{filename}` (braces are mandatory). Any such *non-commented* instruction will add the corresponding filename to the running queue. If you want to *exclude* an `\\input` from being processed, you must surround the line with `ignore begin`/`end` comments (see below, *Helping TeXtidote*).\n\nTeXtidote takes into account the `%!TEX root = ...` directive for following sub-files. You can also use `--root` argument to specify it separatedly.\nHowever, if your usecase requires a more complex handling of sub-files you can use many of the available tools to pre-process your project. Some\nsuggestions are listed [here](https://tex.stackexchange.com/questions/21838/replace-inputfilex-by-the-content-of-filex-automatically/377404).\n\n### Removing markup\n\nYou can also use TeXtidote just to remove the markup from your original LaTeX\nfile. This is done with the option `--clean`:\n\n    java -jar textidote.jar --clean example.tex\n\nBy default, the resulting \"clean\" file is printed directly at the console. To\nsave it to a file, use a redirection:\n\n    java -jar textidote.jar --clean example.tex \u003e clean.txt\n\nYou will see that TeXtidote performs a very aggressive deletion of LaTeX\nmarkup:\n\n- All `figure`, `table` and `tabular` environments are removed\n- All equations are removed\n- All inline math expressions (`$...$`) are replaced by \"X\"\n- All `\\cite` commands are replaced by \"0\"\n- All `\\ref` commands are replaced by \"[0]\"\n- Commands that alter text (`\\textbf`, `\\emph`, `\\uline`, `\\footnote`)\n  are removed (but the text is kept)\n- Virtually all other commands are simply deleted\n\nSurprisingly, the result of applying these modifications is a text that is\nclean and legible enough for a spelling or grammar checker to provide\nsensible advice.\n\nAs was mentioned earlier, TeXtidote keeps a mapping between character ranges\nin the \"cleaned\" file, and the same character ranges in the original LaTeX\ndocument. You can get this mapping by using the `--map` option:\n\n    java -jar textidote.jar --clean --map map.txt example.tex \u003e clean.txt\n\nThe `--map` parameter is given the name of a file. TeXtidote will put in this\nfile the list of correspondences between character ranges. This file is made\nof lines that look like this:\n\n```\nL1C1-L1C24=L1C5-L128\nL1C26-L1C28=L1C29-L1C31\nL2C1-L2C10=L3C1-L3C10\n...\n```\n\nThe first entry indicates that characters 1 to 24 in the first line of the\nclean file correspond to characters 5 to 28 in the first line of the original\nLaTeX file --and so on. This mapping can have \"holes\": for example, character\n25 line 1 does not correspond to anything in the original file (this happens\nwhen the \"cleaner\" inserts new characters, or replaces characters from the\noriginal file by something else). Conversely, it is also possible that\ncharacters in the original file do not correspond to anything in the clean\nfile (this happens when the cleaner deletes characters from the original).\n\n### Character encodings\n\nTeXtidote uses the OS default encoding when reading files (e.g. `utf-8` in Linux, `cp1252` in Windows). You can override this setting using the `--encoding` command line option:\n\n    java -jar textidote.jar --encoding cp1252 example.tex\n\n### Using a configuration file\n\nIf you need to run TeXtidote with many command line arguments (for example:\nyou load a local dictionary, ignore a few rules, apply replacements, etc.), it\nmay become tedious to invoke the program with a long list of arguments every\ntime. TeXtidote can be \"configured\" by putting those arguments in a text\nfile called `.textidote` in the directory from which it is called. Here is an\nexample of what such a file could contain:\n\n```\n--output html --read-all\n--replace replacements.txt\n--dict mydict.txt\n--ignore sh:001,sh:d:001\n--check en mytext.tex\n```\n\nAs you can see, arguments can be split across multiple lines. You can then\ncall TeXtidote without any arguments like this:\n\n    textidote \u003e report.html\n\nIf you call TeXtidote with command line arguments, they will be merged with\nwhatever was found in `.textidote`. You can also tell TeXtidote to explicitly\nignore that file and only take into account the command line arguments using\nthe `--no-config` argument.\n\n### Markdown input\n\nTeXtidote also supports files in the Markdown format. The only difference is that rules specific to LaTeX (references to figures, citations) are not evaluated.\n\nSimply call TeXtidote with a Markdown input file instead of a LaTeX file. The format is auto-detected by looking at the file extension. However, if you pass a file through the standard input, you must tell TeXtidote that the input file is Markdown by using the command line parameter `--type md`. Otherwise, TeXtidote assumes by default that the input file is LaTeX.\n\n## Helping TeXtidote\n\nIt order to get the best results when using TeXtidote, it is advisable that\nyou follow a few formatting conventions when writing your LaTeX file:\n\n- Avoid putting multiple `\\begin{environment}` and/or `\\end{environment}` on\n  the same line\n- Keep the arguments of a command on a single line. Commands (such as\n  `\\title{}`) that have their opening and closing braces on different lines\n  are not recognized by TeXtidote and will result in garbled output and\n  nonsensical warnings.\n- Do not hard-wrap your paragraphs. It is easier for TeXtidote to detect\n  paragraphs if they have no hard carriage returns inside. (If you need word\n  wrapping, it is preferable to enable it in your text editor.)\n- Put headings like `\\section` or `\\paragraph` alone on their line and\n  separate them from the text below by a blank line.\n\nAs a rule, it is advisable to first see what your text looks like using the\n`--clean` option, to make sure that TeXtidote is performing checks on\nsomething that makes sense.\n\nIf you realize that a portion of LaTeX markup is not handled properly and\nmesses up the rest of the file, you can tell TeXtidote to ignore a region\nusing a special LaTeX comment:\n\n```\n% textidote: ignore begin\nSome weird LaTeX markup that TeXtidote does not\nunderstand...\n% textidote: ignore end\n```\n\nThe lines between `textidote: ignore begin` and `textidote: ignore end` will\nbe handled by TeXtidote as if they were comment lines.  \nWhen you are using markdown you can also selectively ignore parts of the document:\n\n```markdown\n\u003c!-- textidote: ignore begin --\u003e\nThis should be ignored\n\u003c!-- textidote: ignore end --\u003e\n```\n\n## Linux shortcuts\n\nTo make using TeXtidote easier, you can create shortcuts on your system. Here\nare a few recommended tips.\n\nFirst, we recommend you create a folder called `/opt/textidote` and put the\nbig `textidote.jar` file there (this requires root privileges). This step is\nalready taken care of if you installed the TeXtidote package using `apt-get`.\n\n### Command line shortcut\n\n(This step is not necessary if TeXtidote has been installed with `apt-get`.)\nIn`/usr/local/bin`, create a file called `textidote` with the following\ncontents:\n\n```\n#! /bin/bash\njava -jar /opt/textidote/textidote.jar \"$@\"\n```\n\nMake this file executable by typing at the command line:\n\n    sudo chmod +x /usr/local/bin/textidote\n\n(These two operations also require root privileges.) From then on, you can\ninvoke TeXtidote on the command line from any folder by simply typing\n`textidote`, e.g.:\n\n    textidote somefile.tex\n\n### Desktop shortcut\n\nIf you use a desktop environment such as Gnome or Xfce, you can automate\nthis even further by creating a TeXtidote icon on your desktop. First,\ncreate a file called `/opt/textidote/textidote-desktop.sh` with the following\ncontents, and make this file executable:\n\n```bash\n#!/bin/bash\nif [ -x /usr/bin/notify-send ]; then\n  err() { notify-send -a TeXtidote -i /opt/textidote/textidote-icon.svg \"$*\"; }\nelse\n  err() { printf \"%s\\n\" \"$*\" \u003e\u00262; }\nfi\n\n[ $# -lt 1 ] \u0026\u0026 err \"At least one file should be provided as input\" \u0026\u0026 exit\ndir=$(dirname \"$1\")\n\npushd \"$dir\" || err \"$dir does not exist\" \u0026\u0026 exit\njava -jar /opt/textidote/textidote.jar --check en --output html \"$@\" \u003e /tmp/textidote.html\npopd || exit\n\nxdg-open /tmp/textidote.html \u0026\n```\n\nThis script enters into the directory of the file passed as an argument,\ncalls TeXtidote, sends the HTML report to a temporary file, and opens the\ndefault web browser to show that report.\n\nThen, on your desktop (typically in your `~/Desktop` folder), create another\nfile called `TeXtidote.desktop` with the following contents:\n\n```ini\n[Desktop Entry]\nVersion=1.0\nType=Application\nName=TeXtidote\nComment=Check text with TeXtidote\nExec=/opt/textidote/textidote-desktop.sh %F\nIcon=/opt/textidote/textidote-icon.svg\nPath=\nTerminal=false\nStartupNotify=false\n```\n\nThis will create a new desktop shortcut; make this file executable. From then\non, you can drag LaTeX files from your file manager with your mouse and drop\nthem on the TeXtidote icon. After the analysis, the report will automatically\npop up in your web browser. Voilà!\n\n## MacOS Shortcut\n\nOn MacOS, first open Automator, select Application, double-click on the \n`Run Shell Script` item in the library, select to receive input as arguments\nand enter the following:\n```bash\n[ $# -lt 1 ] \u0026\u0026 echo \"At least one file should be provided as input\" 1\u003e\u00262 \u0026\u0026 exit 1\ndir=$(dirname \"$1\")\n\ncd \"$dir\" || (echo \"$dir does not exist\" 1\u003e\u00262 \u0026\u0026 exit 1)\njava -jar /path/to/textidote.jar --check en --output html \"$@\" \u003e /tmp/textidote.html || true\n\nopen /tmp/textidote.html\n```\n\nRemember to modify `/path/to/textidote.jar` to the correct location.\nFinally, go to File-\u003eSave to create the shortcut. You can add this application\nto the Dock or the location you prefer. From then on, you can drag LaTeX files\nwith your mouse and drop them on the created app. After the analysis, the\nreport will automatically pop up in your web browser. Voilà!\n\n### Tab completions\n\nYou can auto-complete the commands you type at the command-line using the TAB\nkey (as you are probably used to). If you installed TeXtidote using `apt-get`,\nauto-completion for [Bash](https://www.gnu.org/software/bash/) comes built-in.\nYou can also enable auto-completion for other shells as follows.\n\n#### Zsh\n\nUsers of [Zsh](https://zsh.org) can also enable auto-completion; in your\n`~/.zshrc` file, add the line\n\n    source /opt/textidote/textidote.zsh\n\n(Create the file if it does not exist.) You must then restart your Zsh shell\nfor the changes to take effect.\n\n### Visual Studio Code integration\n\nUsers of Visual Studio Code can integrate TeXtidote by calling it with the `--output singleline` and `--no-color` options and parse its results. Moreover, user [cphyc](https://github.com/cphyc) also wrote a nice [build task](https://github.com/sylvainhalle/textidote/issues/125#issue-603278987).\n\n### Emacs integration\n\nEmacs users can benefit from TeXtidote through [flycheck](https://www.flycheck.org/en/latest/).  \nA dedicated `flycheck-checker` can be defined as in the following `init.el/.emacs` snippet.\nReplace `~/PATH/TO/textidote.jar` with the correct path for your system.\n\n```emacs-lisp\n(flycheck-define-checker tex-textidote\n  \"A LaTeX grammar/spelling checker using textidote.\n\n  See https://github.com/sylvainhalle/textidote\"\n  :modes (latex-mode plain-tex-mode)\n  :command (\"java\" \"-jar\" (eval (expand-file-name \"~/PATH/TO/textidote.jar\"))\n            \"--read-all\"\n            \"--output\" \"singleline\"\n            \"--no-color\"\n            \"--check\"   (eval (if ispell-current-dictionary (substring ispell-current-dictionary 0 2) \"en\"))\n            ;; Try to honor local aspell dictionary and replacements if they exist\n            \"--dict\"    (eval (expand-file-name \"~/.aspell.en.pws\"))\n            \"--replace\" (eval (expand-file-name \"~/.aspell.en.prepl\"))\n            ;; Using source ensures that a single temporary file in a different dir is created\n            ;; such that textidote won't process other files. This serves as a hacky workaround for\n            ;; https://github.com/sylvainhalle/textidote/issues/200.\n            source)\n  :error-patterns ((warning line-start (file-name)\n                            \"(L\" line \"C\" column \"-\" (or (seq \"L\" end-line \"C\" end-column) \"?\") \"): \"\n                            (message (one-or-more (not \"\\\"\"))) (one-or-more not-newline) line-end)))\n(add-to-list 'flycheck-checkers 'tex-textidote)\n```\n\n## Rules checked by TeXtidote\n\nHere is a list of the rules that are checked on your LaTeX file by TeXtidote.\nEach rule has a unique identifier, written between square brackets.\n\n### Language Tool\n\nIn addition to all the rules below, the `--check xx` option activates all the\n[rules verified by Language Tool](https://community.languagetool.org/rule/list?sort=pattern\u0026max=10\u0026offset=0\u0026lang=en)\n(more than 2,000 grammar and spelling errors). Note that the verification time\nis considerably longer when using that option.\n\nIf the `--check` option is used, you can add the `--languagemodel xx` option to [find errors using n-gram data](http://wiki.languagetool.org/finding-errors-using-n-gram-data). In order to do so, `xx` must be a path pointing to an n-gram-index directory. Please refer to the LanguageTool page (link above) on how to use n-grams and what this directory should contain.\n\n### Style\n\n- A section title should start with a capital letter. [sh:001]\n- A section title should not end with a punctuation symbol. [sh:002]\n- A section title should not be written in all caps. The LaTeX stylesheet\n  takes care of rendering titles in caps if needed. [sh:003]\n- Use a capital letter when referring to a specific section, chapter\n  or table: 'Section X'. [sh:secmag, sh:chamag, sh:tabmag]\n- A (figure, table) caption should end with a period. [sh:capperiod]\n\n### Citations and references\n\n- There should be one space before a \\cite or \\ref command [sh:c:001], and\n  no space after [sh:c:002].\n- Do not use 'in [X]' or 'from [X]': the syntax of a sentence should not be\n  changed by the removal of a citation. [sh:c:noin]\n- Do not mix `\\cite` and `\\citep` or `\\citet` in the same document.\n  [sh:c:mix]\n- When citing more than one reference, do not use multiple `\\cite` commands;\n  put all references in the same `\\cite`. [sh:c:mul, sh:c:mulp]\n\n### Figures\n\n- Every figure should have a label, and every figure should be referenced at\n  least once in the text. [sh:figref]\n- Use a capital letter when referring to a specific figure: 'Figure X'.\n  [sh:figmag]\n\n### Structure\n\n- A section should not contain a single sub-section. More generally, a\n  division of level n should not contain a single division of level n+1.\n  [sh:nsubdiv]\n- The first heading of a document should be the one with the highest level.\n  For example, if a document contains sections, the first section cannot be\n  preceded by a sub-section. [sh:secorder]\n- There should not be a jump down between two non-successive section\n  levels (e.g. a `\\section` followed by a `\\subsubsection` without a\n  `\\subsection` in between). [sh:secskip]\n- You should avoid stacked headings, i.e. consecutive headings without\n  text in between. [sh:stacked]\n\n### Hard-coding\n\n- Figures should not refer to hard-coded local paths. [sh:relpath]\n- Do not refer to sections, figures and tables using a hard-coded number.\n  Use `\\ref` instead. [sh:hcfig, sh:hctab, sh:hcsec, sh:hccha]\n- You should not break lines manually in a paragraph with `\\\\`. Either start a\n  new paragraph or stay in the current one. [sh:nobreak]\n- If you are writing a research paper, do not hard-code page breaks with\n  `\\newpage`. [sh:nonp]\n\n### LaTeX subtleties\n\n- Use a backslash or a comma after the last period in \"i.e.\", \"e.g.\" and \"et al.\";\n  otherwise LaTeX will think it is a full stop ending a sentence. [sh:010, sh:011]\n- There should not be a space before a semicolon or a colon. If in your\n  language, typographic rules require a space here, LaTeX takes care of\n  inserting it without your intervention. [sh:d:005, sh:d:006]\n\n### Potentially suspicious\n\n- There should be at least N words between two section headings (currently\n  N=100). [sh:seclen]\n\n## Hints for using CI (Continuous Integration)\nTeXtidote returns the number of warnings as exit code.\nGitHub and Gitlab exspect a default exit code auf `0` or else the pipeline will fail.\nTo circumvent this you have disable this feature.\n\n### Github\n`continue-on-error: true`\n\nSee more at [GitHub documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error)\n\n### Gitlab\n`allow_failure: true`\n\nSee more at [Gitlab documentation](https://docs.gitlab.com/ee/ci/yaml/#allow_failure)\n\n## Building TeXtidote\n\nFirst make sure you have the following installed:\n\n- The Java Development Kit (JDK) to compile. TeXtidote requires version 8\n  of the JDK (and probably works with later versions).\n- [Ant](http://ant.apache.org) to automate the compilation and build process\n\nDownload the sources for TeXtidote from\n[GitHub](http://github.com/sylvainhalle/Bullwinkle) or clone the repository\nusing Git:\n\n    git clone git@github.com:sylvainhalle/textidote.git\n\n### Compiling\n\nFirst, download the dependencies by typing:\n\n    ant download-deps\n\nThen, compile the sources by simply typing:\n\n    ant\n\nThis will produce a file called `textidote.jar` in the folder. This\nfile is runnable and stand-alone, or can be used as a library, so it can be\nmoved around to the location of your choice.\n\nIn addition, the script generates in the `docs/doc` folder the Javadoc\ndocumentation for using TeXtidote.\n\n### Testing\n\nTeXtidote can test itself by running:\n\n    ant test\n\nUnit tests are run with [jUnit](http://junit.org); a detailed report of\nthese tests in HTML format is available in the folder `tests/junit`, which\nis automatically created. Code coverage is also computed with\n[JaCoCo](http://www.eclemma.org/jacoco/); a detailed report is available\nin the folder `tests/coverage`.\n\nAbout the author\n----------------\n\nTeXtidote was written by [Sylvain Hallé](https://leduotang.ca/sylvain), Full\nProfessor in the Department of Computer Science and Mathematics at\n[Université du Québec à Chicoutimi](http://www.uqac.ca), Canada.\n\nLike TeXtidote?\n---------------\n\nTeXtidote is free software licensed under the GNU [General Public License\n3](https://www.gnu.org/licenses/gpl-3.0.en.html). It is released as\n[postcardware](https://en.wikipedia.org/wiki/Postcardware): if you use and\nlike the software, please tell the author by sending a postcard of your town\nat the following address:\n\n    Sylvain Hallé\n    Department of Computer Science and Mathematics\n    Univerité du Québec à Chicoutimi\n    555, boulevard de l'Université\n    Chicoutimi, QC\n    G7H 2B1 Canada\n\nIf you like TeXtidote, you might also want to look at\n[PaperShell](https://github.com/sylvainhalle/PaperShell), a template\nenvironment for writing scientific papers in LaTeX.\n\nReferences to TeXtidote\n-----------------------\n\nSome evidence that TeXtidote is used by actual humans:\n\n- Someone developed an [extension for Vim](https://github.com/PatrBal/vim-textidote)\n- A [demo video](https://www.youtube.com/watch?v=T1lmwYQNnsc) shows how to use it (and I was not involved in this)\n- TeXtidote is part of the formulas in [Homebrew](https://github.com/Homebrew/homebrew-core/blob/aa980d5b5ec08b3c2de62af5962693bfa625e2f4/Formula/textidote.rb)\n- Number of downloads and GitHub stars ;-)\n\nWhy is it called TeXtidote?\n---------------------------\n\nTeXtidote is a play on *Antidote*, which is a spelling/grammar checker well\nknown to French-speaking users and works with word processors. So TeXtidote is\nlike a version of Antidote for TeX.\n\n\u003c!-- :maxLineLen=78:wrap=soft: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvainhalle%2Ftextidote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsylvainhalle%2Ftextidote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsylvainhalle%2Ftextidote/lists"}