Hover can also be triggered using C-k C-i
.
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
and tweak latex-workshop.texdoc.args
.
You may also directly run the LaTex Workshop: Show package documentation command from the Command Palette and type in the package name.
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.
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 |
latex-workshop.hover.preview.newcommand.parseTeXFile.enabled |
Add newcommands to preview |
latex-workshop.hover.preview.newcommand.newcommandFile |
Path of a file containing newcommands |
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.
When latex-workshop.hover.ref.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, math preview is rendered instead of showing the tex content. The tooltip has a View on pdf
link to jump to the corresponding location in the PDF
viewer. It only calls synctex
as if you were directly calling SyncTeX from cursor and therefore it requires a PDF viewer for the current .tex
file to be opened.
Setting key | Description |
---|---|
latex-workshop.hover.ref.enabled |
Enable hover on references |
latex-workshop.hover.ref.number.enabled |
Show number assigned to the reference in the previous compilation |
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).
Enable Hover on References.
type | default value |
---|---|
boolean | true |
Show the number assigned to the reference in the previous compilation.
type | default value |
---|---|
boolean | true |
Enable Hover on Citations.
type | default value |
---|---|
boolean | true |
Enable Hover on Commands to show the possible signatures.
type | default value |
---|---|
boolean | true |
Enable math preview on hover.
type | default value |
---|---|
boolean | true |
Scale of math preview on hover.
type | default value |
---|---|
number | 1 |
Enable newcommands defined in the current TeX file to be included in Hover Preview. We currently only support commands defined on a single line.
type | default value |
---|---|
boolean | true |
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 | "" |
Render cursor in math preview on hover at the current position.
type | default value |
---|---|
boolean | true |
Define the cursor symbol in math preview on hover.
type | default value |
---|---|
string | \ddagger |
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" |
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" |
Define the location of texdoc executable.
type | default value |
---|---|
string | "texdoc" |
Texdoc arguments to see a package documentation.
type | default value |
---|---|
array | ["--view"] |
The package name is automatically appended to the arguments.