Last active
April 29, 2021 12:09
-
-
Save felixfbecker/4a1ee1d03d8c7b8ae4de to your computer and use it in GitHub Desktop.
VS Code tasks.json for Latex to PDF compilation w/ problem matcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An example tasks.json for VS Code that defines a task for compiling Latex to PDF including a problem matcher. | |
This is for Windows but it should be easy to adopt it for Linux/Mac, basically replace powershell with sh and -Command with -c | |
*/ | |
{ | |
"version": "0.1.0", | |
"isShellCommand": true, | |
"suppressTaskName": true, | |
"windows": { | |
"command": "powershell", | |
"args": ["-Command"], | |
"tasks": [ | |
{ | |
"taskName": "pdflatex", | |
"args": ["cd ${fileDirname}; pdflatex.exe -c-style-errors -interaction=nonstopmode ${fileBasename}; $pdf = [System.IO.Path]::GetFileNameWithoutExtension('${fileBasename}') + '.pdf'; start $pdf"], | |
"showOutput": "silent", | |
"isBuildCommand": true, | |
"problemMatcher": { | |
"owner": "latex", | |
"fileLocation": ["relative", "${fileDirname}"], | |
"pattern": { | |
"regexp": "^(.*):([0-9]+): (.*)$", | |
"file": 1, | |
"line": 2, | |
"message": 3 | |
} | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment