From 2ba4b1ac7860085c0b259aacb0d99bd2c730edbc Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 13 Jun 2021 03:03:20 +0000 Subject: CTAN sync 202106130303 --- support/texlab/docs/options.md | 14 ++++++-- support/texlab/docs/previewing.md | 76 +++++++++++++-------------------------- support/texlab/docs/tectonic.md | 4 +-- 3 files changed, 38 insertions(+), 56 deletions(-) (limited to 'support/texlab/docs') diff --git a/support/texlab/docs/options.md b/support/texlab/docs/options.md index 3cc2edfd8a..e1a69c4996 100644 --- a/support/texlab/docs/options.md +++ b/support/texlab/docs/options.md @@ -46,9 +46,19 @@ The placeholder `%f` will be replaced by the server. --- -## texlab.build.isContinuous +## texlab.build.forwardSearchAfter -Set this property to true if the build arguments imply a continous build (like `latexmk -pvc`). +Set this property to `true` if you want to execute a forward search after a build. + +**Type:** `boolean` + +**Default value:** `false` + +--- + +## texlab.build.onSave + +Set this property to `true` if you want to compile the project after saving a file. **Type:** `boolean` diff --git a/support/texlab/docs/previewing.md b/support/texlab/docs/previewing.md index 16a047190b..0d9f35293c 100644 --- a/support/texlab/docs/previewing.md +++ b/support/texlab/docs/previewing.md @@ -1,19 +1,25 @@ # Previewing -We believe that previewing should be a concern of the build system. -With [`latexmk`](https://ctan.org/pkg/latexmk?lang=en), you can enable the preview feature by adding the `-pv` flag -to the [`texlab.build.args`](/docs/reference/configuration/#latexbuildargs) setting. -After that, the configured previewer will start on each rebuild of the document. -Alternatively, use the `-pvc` flag to tell the previewer to continuously check for updates, -instead of opening a new window each time a build completes. - -If you want to use [SyncTeX](http://www.tug.org/TUGboat/tb29-3/tb93laurens.pdf), -you need to configure the settings in the [`texlab.forwardSearch`](/docs/reference/configuration#latexforwardsearchexecutable) section -and configure your previewer to call your editor correctly. -A forward search can then be executed by invoking the [`texlab.forwardSearch`](/docs/reference/commands#latexforwardsearch) command. - -In the following sections, we will give configurations for popular viewers with `latexmk` and Visual Studio Code. -For other build systems and editors, please refer to their respective manuals. +`texlab` supports compiling LaTeX using a custom request (`textDocument/build`) +and by building a document after saving if configured to do so. +To enable building on save, simply set `texlab.build.onSave` to true. +Previewing can be configured in a variety of ways: + +1. If you are using `latexmk`, you can create a `.latexmkrc` file and call your viewer accordingly. + Afterwards, you can add the `-pv` flag to your `texlab.build.args`. + +2. If you want the PDF viewer to stay synchronized with the cursor position in your editor, + you can instruct `texlab` to execute a forward search after every build (`texlab.build.forwardSearchAfter`). + To do so, you need to enable [SyncTeX](http://www.tug.org/TUGboat/tb29-3/tb93laurens.pdf) + and update the `texlab.forwardSearch` configuration. + If you want to use this feature, we do _not_ recommend the `-pvc` flag + because `texlab` does not get notified by `latexmk` when a document gets built. + Instead, you can use `texlab.build.onSave`. + +In the following sections, we will give forward search configurations for several popular viewers +and Visual Studio Code. +However, these settings can easily be adapted to other editors. +If your viewer is not listed here, you can send us a pull request or create an issue. --- @@ -21,11 +27,6 @@ For other build systems and editors, please refer to their respective manuals. We highly recommend [SumatraPDF](https://www.sumatrapdfreader.org) on Windows because Adobe Reader locks the opened PDF file and will therefore prevent further builds. -To use [SumatraPDF](https://www.sumatrapdfreader.org) as previewer, add the following line to your `%USERPROFILE%/.latexmkrc` file: - -```perl -$pdf_previewer = 'start "C:\Program Files\SumatraPDF\SumatraPDF.exe" %O %S'; -``` ### Forward Search @@ -33,7 +34,7 @@ Add the following lines to your editor config: ```json { - "texlab.forwardSearch.executable": "C:/Program Files/SumatraPDF/SumatraPDF.exe", + "texlab.forwardSearch.executable": "C:/Users/{User}/AppData/Local/SumatraPDF/SumatraPDF.exe", "texlab.forwardSearch.args": [ "-reuse-instance", "%p", @@ -62,11 +63,6 @@ You can execute the search by pressing `Alt+DoubleClick` in the PDF document. The SyncTeX feature of [Evince](https://wiki.gnome.org/Apps/Evince) requires communication via D-Bus. In order to use it from the command line, install the [evince-synctex](https://github.com/latex-lsp/evince-synctex) script. -Then add the following line to your `~/.latexmkrc` file: - -```perl -$pdf_previewer = 'start evince-synctex %S "code -g %f:%l"'; -``` ### Forward Search @@ -88,12 +84,6 @@ You can execute the search by pressing `Ctrl+Click` in the PDF document. ## Okular -To use [Okular](https://okular.kde.org/) as previewer, add the following line to your `~/.latexmkrc` file: - -```perl -$pdf_previewer = 'start okular'; -``` - ### Forward Search Add the following lines to your editor config: @@ -119,12 +109,6 @@ You can execute the search by pressing `Shift+Click` in the PDF document. ## Zathura -To use [Zathura](https://pwmt.org/projects/zathura/) as previewer, add the following line to your `~/.latexmkrc` file: - -```perl -$pdf_previewer = 'start zathura'; -``` - ### Forward Search Add the following lines to your editor config: @@ -151,12 +135,6 @@ You can execute the search by pressing `Alt+Click` in the PDF document. ## qpdfview -To use [qpdfview](https://launchpad.net/qpdfview) as previewer, add the following line to your `~/.latexmkrc` file: - -```perl -$pdf_previewer = 'start qpdfview --unique %S'; -``` - ### Forward Search Add the following lines to your editor config: @@ -185,14 +163,6 @@ You can execute the search by pressing `Modifier+Click` in the PDF document. ## Skim We recommend [Skim](https://skim-app.sourceforge.io/) on macOS since it is the only native viewer that supports SyncTeX. -To use [Skim](https://skim-app.sourceforge.io/) as previewer, add the following line to your `~/.latexmkrc` file: - -```perl -$pdf_previewer = 'open -a Skim'; -``` - -If you want Skim to stay in the background after building, -you can add the `-g` option to the `open` arguments. Additionally, enable the "Reload automatically" setting in the Skim preferences (Skim -> Preferences -> Sync -> Check for file changes). @@ -209,9 +179,11 @@ Add the following lines to your editor config: If you want Skim to stay in the background after executing the forward search, you can add the `-g` option -to `latex.forwardSearch.args`. +to `texlab.forwardSearch.args`. ### Inverse Search Select the Visual Studio Code preset in the Skim preferences (Skim -> Preferences -> Sync -> PDF-TeX Sync support). You can execute the search by pressing `Shift+⌘+Click` in the PDF document. + +--- diff --git a/support/texlab/docs/tectonic.md b/support/texlab/docs/tectonic.md index 1e75c2d126..38e0a7d636 100644 --- a/support/texlab/docs/tectonic.md +++ b/support/texlab/docs/tectonic.md @@ -19,8 +19,8 @@ You can quickly get started by changing `.vscode/settings.json` in your workspac // uncomment the following line. //"--outdir out", ] - // OPTIONAL: The extension needs to be configured + // OPTIONAL: The server needs to be configured // to read the logs from the out directory as well. - // "latex.build.outputDirectory": "out", + // "texlab.auxDirectory": "out", } ``` -- cgit v1.2.3