### Build TexLab from Source Source: https://github.com/latex-lsp/texlab/blob/master/README.md Build the TexLab server in release mode using Cargo. Ensure you have Rust installed. ```shell cargo build --release ``` -------------------------------- ### Install TexLab from Git Repository Source: https://github.com/latex-lsp/texlab/blob/master/README.md Install TexLab directly from its Git repository using Cargo. Replace `` with the desired release tag. ```shell cargo install --git https://github.com/latex-lsp/texlab --locked --tag ``` -------------------------------- ### Configure Evince Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Configure Evince for forward search using the `evince-synctex` script. This requires the script to be installed separately. ```json { "texlab.forwardSearch.executable": "evince-synctex", "texlab.forwardSearch.args": ["-f", "%l", "%p", "\"texlab -i %f -l %l\""] } ``` -------------------------------- ### Configure Skim for Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the executable path and arguments for Skim's forward search integration with Texlab. Ensure Skim is installed and accessible. ```json { "texlab.forwardSearch.executable": "/Applications/Skim.app/Contents/SharedSupport/displayline", "texlab.forwardSearch.args": ["-r", "%l", "%p", "%f"] } ``` -------------------------------- ### Configure Sioyek for Forward and Inverse Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Configure Texlab to use Sioyek for both forward and inverse search. This setup allows for a unified previewing experience with Sioyek. ```json "texlab.forwardSearch.executable": "sioyek", "texlab.forwardSearch.args": [ "--reuse-window", "--execute-command", "toggle_synctex", "--inverse-search", "texlab inverse-search -i \"%%1\" -l %%2", "--forward-search-file", "%f", "--forward-search-line", "%l", "%p", ], ``` -------------------------------- ### Configure Label Definition Prefixes Source: https://github.com/latex-lsp/texlab/wiki/Configuration Associate custom prefixes with label definition commands to correctly parse labels defined by macros. For example, associating 'thm' with 'thm:' allows recognizing 'thm:foo' as a label. ```json "texlab.experimental.labelDefinitionPrefixes": [ ["thm", "thm:"] ] ``` -------------------------------- ### Show Dependency Graph Command Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands This command returns a string representing the dependency graph in DOT format. No parameters are required. ```plaintext string (A description of the graph in [DOT](https://graphviz.org/doc/info/lang.html) format) ``` -------------------------------- ### Run TexLab Unit and Integration Tests Source: https://github.com/latex-lsp/texlab/blob/master/README.md Execute the test suite for TexLab. This command should be run from the project's root directory. ```shell cargo test ``` -------------------------------- ### Configure Label Reference Commands Source: https://github.com/latex-lsp/texlab/wiki/Configuration Extend the list of commands that reference labels. Commands should be listed without the leading backslash. ```json "texlab.experimental.labelReferenceCommands": [ "ref", "eqref", "myref" ] ``` -------------------------------- ### Configure Verbatim Environments Source: https://github.com/latex-lsp/texlab/wiki/Configuration Extend the list of environments treated as verbatim to suppress diagnostics in non-LaTeX code sections. ```json "texlab.experimental.verbatimEnvironments": [ "minted", "lstlisting" ] ``` -------------------------------- ### Configure Zathura Inverse Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Enable SyncTeX and set the editor command in Zathura's configuration file for inverse search. ```bash set synctex true set synctex-editor-command "texlab inverse-search -i %{input} -l %{line}" ``` -------------------------------- ### Configure Texlab for Tectonic V1 CLI Source: https://github.com/latex-lsp/texlab/wiki/Tectonic Use this configuration to set Tectonic as the build executable for Texlab with V1 CLI arguments. Ensure 'texlab.build.pdfDirectory' and 'texlab.build.auxDirectory' are set to your build output directory. ```json { "texlab.build.executable": "tectonic", "texlab.build.args": [ "%f", "--synctex", "--keep-logs", "--keep-intermediates" ], "texlab.build.pdfDirectory": "build", "texlab.build.auxDirectory": "build" } ``` -------------------------------- ### Configure qpdfview Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the executable and arguments for qpdfview to enable forward search. This configuration uses qpdfview's unique file opening feature. ```json { "texlab.forwardSearch.executable": "qpdfview", "texlab.forwardSearch.args": ["--unique", "%p#src:%f:%l:1"] } ``` -------------------------------- ### Configure Label Definition Commands Source: https://github.com/latex-lsp/texlab/wiki/Configuration Extend the list of commands that define labels. Commands should be listed without the leading backslash. ```json "texlab.experimental.labelDefinitionCommands": [ "label", "mydef" ] ``` -------------------------------- ### Configure Okular Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the executable and arguments for Okular to enable forward search. This configuration uses Okular's unique file opening feature. ```json { "texlab.forwardSearch.executable": "okular", "texlab.forwardSearch.args": ["--unique", "file:%p#src:%l%f"] } ``` -------------------------------- ### Configure Texlab for Tectonic V2 CLI Source: https://github.com/latex-lsp/texlab/wiki/Tectonic Use this configuration to set Tectonic as the build executable for Texlab with V2 CLI arguments. Ensure 'texlab.build.pdfDirectory' and 'texlab.build.auxDirectory' are set to your build output directory. ```json { "texlab.build.executable": "tectonic", "texlab.build.args": [ "-X", "compile", "%f", "--synctex", "--keep-logs", "--keep-intermediates" ], "texlab.build.pdfDirectory": "build", "texlab.build.auxDirectory": "build" } ``` -------------------------------- ### Configure Zathura Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Configure Zathura for forward search by setting the executable and arguments. This enables SyncTeX integration. ```json { "texlab.forwardSearch.executable": "zathura", "texlab.forwardSearch.args": ["--synctex-forward", "%l:1:%f", "%p"] } ``` -------------------------------- ### Build Request Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Initiates a build process for a specified LaTeX document. This custom request is indicated by the `textDocumentBuild` experimental capability. ```APIDOC ## Build Request ### Description Sends a request from the client to the server to build a given LaTeX document. ### Method `textDocument/build` ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document to build. - **position** (Position) - Optional - The cursor position for forward search. ### Response #### Success Response (200) - **status** (BuildStatus) - The status of the build process. ### Enum: BuildStatus - **Success** (0) - The build process terminated without any errors. - **Error** (1) - The build process terminated with errors. - **Failure** (2) - The build process failed to start or crashed. - **Cancelled** (3) - The build process was cancelled. ``` -------------------------------- ### Configure Label Reference Range Commands Source: https://github.com/latex-lsp/texlab/wiki/Configuration Extend the list of commands that reference label ranges. Commands should be listed without the leading backslash. ```json "texlab.experimental.labelReferenceRangeCommands": [ "crefrange", "myrefrange" ] ``` -------------------------------- ### Configure Citation Commands Source: https://github.com/latex-lsp/texlab/wiki/Configuration Add custom commands to be recognized as citation commands. Commands should be listed without the leading backslash. ```json "texlab.experimental.citationCommands": [ "cite", "citep", "citet" ] ``` -------------------------------- ### Configure SumatraPDF Forward Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the executable path and arguments for SumatraPDF to enable forward search. This configuration is for Windows users. ```json { "texlab.forwardSearch.executable": "C:/Users/{User}/AppData/Local/SumatraPDF/SumatraPDF.exe", "texlab.forwardSearch.args": [ "-reuse-instance", "%p", "-forward-search", "%f", "%l" ] } ``` -------------------------------- ### Find Environments Command Parameters Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Use this to find all environments that contain a specified position. Requires the document and position. ```typescript export type FindEnvironmentsParams = TextDocumentPositionParams; ``` -------------------------------- ### texlab.cancelBuild Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Cancels any ongoing build requests, including those triggered automatically on save. ```APIDOC ## texlab.cancelBuild ### Description Cancels all currently active build requests (including builds triggered by `texlab.build.onSave`) ### Parameters None ``` -------------------------------- ### texlab.findEnvironments Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Retrieves a list of all environments that encompass a given position in the document. ```APIDOC ## texlab.findEnvironments ### Description Returns a list of all environments that contain the specified position. ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document to search within. - **position** (Position) - Required - The position to find environments for. ### Response #### Success Response (200) - **environments** (EnvironmentLocation[]) - A list of environments containing the specified position. ### Response Example ```json { "environments": [ { "name": { "text": "example", "range": { "start": {"line": 0, "character": 0}, "end": {"line": 1, "character": 10} } }, "fullRange": { "start": {"line": 0, "character": 0}, "end": {"line": 5, "character": 5} } } ] } ``` ``` -------------------------------- ### texlab.showDependencyGraph Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Generates and returns a description of the dependency graph in DOT format. ```APIDOC ## texlab.showDependencyGraph ### Description Returns a description of the dependency graph in DOT format. ### Parameters None ### Response #### Success Response (200) - **graphDescription** (string) - A description of the graph in DOT format. ``` -------------------------------- ### Clean Auxiliary Files Command Parameters Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Use this to specify the document for which auxiliary files should be removed. ```typescript export type CleanAuxiliaryParams = TextDocumentIdentifier; ``` -------------------------------- ### Clean Artifacts Command Parameters Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Use this to specify the document for which auxiliary files and artifacts should be removed. ```typescript export type CleanArtifactsParams = TextDocumentIdentifier; ``` -------------------------------- ### Build Text Document Params Interface Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Defines the parameters for the custom textDocument/build request, specifying the document to build and an optional cursor position. ```typescript interface BuildTextDocumentParams { /** * The text document to build. */ textDocument: TextDocumentIdentifier; /** * The position of the cursor for use in forward search (optional). */ position?: Position; } ``` -------------------------------- ### Configure qpdfview Inverse Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the source editor command in qpdfview's behavior settings to enable inverse search. This allows clicking in the PDF to navigate back to the editor. ```bash texlab inverse-search -i "%1" -l %2 ``` -------------------------------- ### Configure Okular Inverse Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the custom text editor command in Okular's settings to enable inverse search. This allows clicking in the PDF to navigate back to the editor. ```bash texlab inverse-search -i "%f" -l %l ``` -------------------------------- ### Define Custom Environments for Document Symbols Source: https://github.com/latex-lsp/texlab/wiki/Configuration Use this to extend the list of environments recognized for document symbols. Each environment can have a custom display name and control label matching. ```typescript interface SymbolEnvironmentOptions { // The name of the environment. name: string; // The name shown in the document symbols. By default, title case is used. displayName?: string; // If set, the server will try to match a label to environment and append its number. label?: false; } ``` -------------------------------- ### Forward Search Request Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Requests a forward search action, typically used with SyncTeX, initiated by the user. This custom request is indicated by the `textDocumentForwardSearch` experimental capability. ```APIDOC ## Forward Search Request ### Description Sends a request from the client to the server to perform a forward search via SyncTeX. ### Method `textDocument/forwardSearch` ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document for which to perform forward search. - **position** (Position) - Required - The position within the document for the forward search. ### Response #### Success Response (200) - **status** (ForwardSearchStatus) - The status of the previewer process. ### Enum: ForwardSearchStatus - **Success** (0) - The previewer process executed the command without any errors. - **Error** (1) - The previewer process executed the command with errors. - **Failure** (2) - The previewer process failed to start or crashed. - **Unconfigured** (3) - The previewer command is not configured. ``` -------------------------------- ### Change Environment Command Parameters Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Use this to change the name of the inner-most environment containing a specified position. Requires the document, position, and the new environment name. ```typescript export interface ChangeEnvironmentParams extends TextDocumentPositionParams { newName: string; } ``` -------------------------------- ### Environment Location Interface Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Defines the structure for environment locations, including the environment name and its range, as well as the full range of the environment. ```typescript export interface EnvironmentLocation { name: { text: string; range: Range; }; fullRange: Range; } ``` -------------------------------- ### Build Status Enum Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Enumerates the possible statuses for the build process in the textDocument/build response. ```typescript enum BuildStatus { /** * The build process terminated without any errors. */ Success = 0, /** * The build process terminated with errors. */ Error = 1, /** * The build process failed to start or crashed. */ Failure = 2, /** * The build process was cancelled. */ Cancelled = 3, } ``` -------------------------------- ### Build Result Interface Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Defines the result structure for the textDocument/build request, indicating the build status. ```typescript interface BuildResult { /** * The status of the build process. */ status: BuildStatus; } ``` -------------------------------- ### Cancel Build Command Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands This command cancels all currently active build requests. No parameters are required. ```plaintext None ``` -------------------------------- ### texlab.changeEnvironment Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Changes the name of the innermost environment containing a specified position. Requires a new name and the position within the document. ```APIDOC ## texlab.changeEnvironment ### Description Upon receiving a `newName` through the `params`, changes the name of the inner-most environment that contains the specified position. ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document containing the environment. - **position** (Position) - Required - The position within the document. - **newName** (string) - Required - The new name for the environment. ``` -------------------------------- ### Configure SumatraPDF Inverse Search Source: https://github.com/latex-lsp/texlab/wiki/Previewing Set the command line for inverse search in SumatraPDF's advanced settings. This allows clicking in the PDF to navigate back to the editor. ```ini InverseSearchCmdLine = "texlab inverse-search --input "%f" --line %l" ``` -------------------------------- ### texlab.cleanArtifacts Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Removes both auxiliary files and compilation artifacts for a given LaTeX document. This command internally uses `latexmk -C`. ```APIDOC ## texlab.cleanArtifacts ### Description Removes the auxiliary files and the artifacts produced by compiling the specified LaTeX document. At the moment, this command simply calls `latexmk -C` with the currently configured output directory. ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document for which to clean artifacts. ``` -------------------------------- ### Forward Search Result Interface Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Defines the result structure for the textDocument/forwardSearch request, indicating the status of the previewer process. ```typescript interface ForwardSearchResult { /** * The status of the previewer process. */ status: ForwardSearchStatus; } ``` -------------------------------- ### Forward Search Status Enum Source: https://github.com/latex-lsp/texlab/wiki/LSP-Internals Enumerates the possible statuses for the forward search previewer process. ```typescript enum ForwardSearchStatus { /** * The previewer process executed the command without any errors. */ Success = 0, /** * The previewer process executed the command with errors. */ Error = 1, /** * The previewer process failed to start or crashed. */ Failure = 2, /** * The previewer command is not configured. */ Unconfigured = 3, } ``` -------------------------------- ### texlab.cleanAuxiliary Source: https://github.com/latex-lsp/texlab/wiki/Workspace-commands Removes auxiliary files generated during LaTeX compilation for a specified document. This command internally uses `latexmk -c`. ```APIDOC ## texlab.cleanAuxiliary ### Description Removes the auxiliary files produced by compiling the specified LaTeX document. At the moment, this command simply calls `latexmk -c` with the currently configured output directory. ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The document for which to clean auxiliary files. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.