Skip to content

Latest commit

 

History

History
170 lines (105 loc) · 7.96 KB

Hover.md

File metadata and controls

170 lines (105 loc) · 7.96 KB

Hovering and previewing 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 and tweak latex-workshop.texdoc.args.

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
latex-workshop.hover.preview.newcommand.parseTeXFile.enabled Add newcommands to preview
latex-workshop.hover.preview.newcommand.newcommandFile Path of a file containing newcommands

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.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.

Hover on \ref demo

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

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.number.enabled

Show the number assigned to the reference in the previous compilation.

type default value
boolean true

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. We currently only support commands defined on a single line.

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.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"

latex-workshop.texdoc.path

Define the location of texdoc executable.

type default value
string "texdoc"

latex-workshop.texdoc.args

Texdoc arguments to see a package documentation.

type default value
array ["--view"]

The package name is automatically appended to the arguments.