Skip to content
Takashi Tamura edited this page May 12, 2019 · 46 revisions

Hovering features

Hover can also be triggered using C-k C-i.

Documentation of a package

To open a package documentation, hover the package name inside the \usepackage call and click on the View documentation link. As it internally calls texdoc, if it is not in your path you may need to set latex-workshop.texdoc.path to the full path of texdoc.

Hover on a package demo

You may also directly run the LaTex Workshop: Show package documentation command from the Command Palette and type in the package name.

Previewing equations

When you move the mouse cursor over inline math, \[, $$, \begin{align}, and \begin{...} of other math environments, math preview on hover is rendered. When you move the mouse cursor over \ref, and other reference commands referring math equations, math preview on hover is also rendered.

Preview maths demo

Supported math environments are align, align*, alignat, alignat*, aligned, alignedat, array, Bmatrix, bmatrix, cases, CD, eqnarray, eqnarray*, equation, equation*, gather, gather*, gathered, matrix, multline, multline*, pmatrix, smallmatrix, split, subarray, Vmatrix, vmatrix.

The tabular environment is not supported.

Setting key Description
latex-workshop.hover.preview.enabled Enable math preview
latex-workshop.hover.preview.scale Scale of math preview
latex-workshop.hover.preview.cursor.enabled Render cursor in math preview
latex-workshop.hover.preview.cursor.symbol Define the cursor symbol
latex-workshop.hover.preview.cursor.color Define the cursor color

Previewing citation details

When latex-workshop.hover.citation.enabled is set to true, moving the mouse over an argument of a \cite related command displays the details of the bibliography as a tooltip.

Hover on \cite demo

Previewing references

When latex-workshop.hover.reference.enabled is set to true, moving the mouse over a \ref related command displays the piece of tex with the corresponding label as a tooltip. Moreover, if the label refers to a math environment as described in Preview equations and latex-workshop.hover.preview.ref.enabled is set to true, math preview is rendered instead of showing the tex content.

Hover on \ref demo
Setting key Description
latex-workshop.hover.ref.enabled Enable hover on references
latex-workshop.hover.ref.numberAtLastCompilation.enabled Show number the given to ref at the last compilation.

Documentation of a command

When latex-workshop.hover.command.enabled is set to true, moving the mouse over a command displays the different forms (signatures) of the command with their arguments as a tooltip. You can directly access the documentation of the package(s) defining the command by clicking on the package name(s).

Hover on a command demo

Configuration variables

latex-workshop.hover.ref.enabled

Enable Hover on References.

type default value
boolean true

latex-workshop.hover.ref.numberAtLastCompilation.enabled

Show number the given to ref at the last compilation.

type default value
boolean false

latex-workshop.hover.citation.enabled

Enable Hover on Citations.

type default value
boolean true

latex-workshop.hover.command.enabled

Enable Hover on Commands to show the possible signatures.

type default value
boolean true

latex-workshop.hover.preview.enabled

Enable math preview on hover.

type default value
boolean true

latex-workshop.hover.preview.scale

Scale of math preview on hover.

type default value
number 1

latex-workshop.hover.preview.newcommand.parseTeXFile.enabled

Enable newcommands defined in the current TeX file to be included in Hover Preview.

type default value
boolean true

latex-workshop.hover.preview.newcommand.newcommandFile

Set the path of a file containing newcommands to be used in Hover Preview. If the path is relative, it is joined with the root dir.

type default value
string ""

latex-workshop.hover.preview.cursor.enabled

Render cursor in math preview on hover at the current position.

type default value
boolean true

latex-workshop.hover.preview.cursor.symbol

Define the cursor symbol in math preview on hover.

type default value
string \ddagger

latex-workshop.hover.preview.cursor.color

Define the color of the cursor in math preview on hover.

type default value possible values
string "auto" "auto", "black", "blue", "brown", "cyan", "darkgray", "gray", "green", "lightgray", "lime", "magenta", "olive", "orange", "pink", "purple", "red", "teal", "violet", "white", "yellow"

latex-workshop.hover.preview.ref.enabled

Render math preview on hover over \ref, and other reference commands.

type default value
boolean true

latex-workshop.view.pdf.ref.viewer

PDF viewer used for [View on PDF] link on hover over \ref, and other reference commands.

type default value possible values
string "auto" "auto", "tabOrBrowser", "external"

Table of Contents

Clone this wiki locally