Prerequisites
texlive
sudo apt install texlive
Tutorial
- Download and install Visual Studio Code.
- Install extensions. ‘latex-workshop’ and ‘Code Spell Checker’
- Open the directory of your latex project in vscode.
mkdir latex_project && code latex_project
- Create vscode tasks for building ‘.tex’ and ‘.bib’ documents.
- Make ‘.vscode’ directory in the root of your latex project.
- Create ‘task.json’ file inside the ‘.vscode’ directory with the following content.
{ "version": "2.0.0", "tasks": [ { "label": "Run pdflatex", "type": "shell", "group": { "kind": "build", "isDefault": true }, "command": "pdflatex", "args": [ "-interaction=nonstopmode", "-file-line-error", "*.tex" ] }, { "label": "Run bibtex", "type": "shell", "group": { "kind": "test", "isDefault": true }, "command": "bibtex", "args": [ "-terse", "*.aux" ] } ] }
-
Set up a spell checker.
Create the cSpell.json file inside the ‘.vscode’ directory with the following content.
{ "version": "0.1", "language": "en", "dictionaryDefinitions": [ { "name": "projectDictionary", "path": "./dictionary.txt"} ], "dictionaries": ["projectDictionary"], "languageSettings": [ { "languageId": "*", "dictionaries": ["projectDictionary"] } ], "ignoreRegExpList": [ "\\\\cite{[A-Za-z0-9, -]+}", "\\\\begin{\\w+}", "\\\\end{\\w+}", "\\\\usepackage{\\w+}", "\\\\bibliographystyle{\\w+}", "\\\\hyphenation{[A-Za-z0-9, -]+}", "\\w+{?"] }
The configuration instructs the Code Spell Checker to use a default English extended by a custom list of words loaded from the ‘dictionary.txt’ file. Spelling errors will not be reported for latex commands and text in-between curly brackets of the shortlisted command.
Create an empty ‘dictionary.txt’ file in the ‘.vscode’ directory. It should contain words that are not recognized by the spell checker. An example of the valid file format, a list of words separated by a newline character, is provided below.
aforementioned combinatorial decremental forementioned polytope pseudocode scalability superset subproblem
-
Alter editor settings for better work with text files.
Create the ‘setting.json’ file in the ‘.vscode’ directory with the following content.
{ "cSpell.enabled": true, "editor.cursorBlinking": "solid", "editor.wordWrap": "on", "editor.wordWrapColumn": 80, "editor.wrappingIndent": "same", "latex-workshop.debug.showUpdateMessage": false, "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false }