tecosaur / LaTeX-Utilities

An add-on to LaTeX Workshop that provides some features that go beyond the bare essentials
MIT License
474 stars 28 forks source link

Why didn't Live Snippets work? #359

Closed carveybunt closed 2 years ago

carveybunt commented 2 years ago

Bug Report

Disable all the other extensions except for LaTeX Workshop and LaTeX Utilities, and check that you still see this issue.

You still see this issue?: Yes

Describe the bug

Live Snippets don't work in the tex file.

To Reproduce

Steps to reproduce the behaviour:

  1. Setting "latex-utilities.liveReformat.enabled": true.
  2. Coding in the tex file, but the Live Snippets couldn't work.

Expected behaviour

Live Snippets work.

Logs

Nothing changed.

Screenshots

截屏2022-08-19 16 54 16

截屏2022-08-19 16 55 11

Desktop

leoleoasd commented 2 years ago

Hi @carveybunt

I can't reproduce this. Which exactly snippet are you trying to execute? And can you take a screenshot of the "LaTeX-Utilities" log panel?

leoleoasd commented 2 years ago

Try typing 1 xx 2 inside a math environment (e.g. inside \begin{equation})

carveybunt commented 2 years ago

Try typing 1 xx 2 inside a math environment (e.g. inside \begin{equation})

Thanks, this is working, seem just doesn't work inside \begin{tikzpicture}. How can make it work inside tikzpicture, please?

carveybunt commented 2 years ago

Latex-Utilities.log

[17:43:18] onDidChangeActiveTextEditor_tex_wordcounter
[17:43:18] onDidChangeTextDocument
[17:43:18] onDidChangeTextDocument
[17:43:18] onDidSaveTextDocument_tex_wordcounter
[17:43:22] onDidChangeActiveTextEditor_tex_wordcounter
[17:43:22] TeXCount output: 0+0+0 (0/0/0/0) File: test.tex
[17:43:26] onDidChangeTextDocument
[17:43:26] onDidChangeTextDocument
[17:43:27] onDidChangeTextDocument
[17:43:28] onDidChangeTextDocument
[17:43:29] onDidChangeTextDocument
[17:43:29] onDidChangeTextDocument
[17:43:29] onDidChangeTextDocument
[17:43:30] onDidChangeTextDocument
[17:43:30] onDidChangeTextDocument
[17:43:30] onDidChangeTextDocument
[17:43:39] onDidChangeActiveTextEditor_tex_wordcounter
[17:43:39] onDidChangeTextDocument
[17:43:39] onDidChangeTextDocument
[17:43:39] onDidSaveTextDocument_tex_wordcounter

My code:

\documentclass[dvisvgm]{standalone} 
\usepackage{tikz } 

\begin{document}

\begin{tikzpicture}[> = latex, scale = .5]
    \draw [fill=red](-4,0)node[above]{$C$}--(0,3)node[right]{$B$}--(4,0)node[above]{$A$}--(0,-3)node[right]{$D$}--(-4,0); 

\end{tikzpicture}

\end{document}
leoleoasd commented 2 years ago

The live snippet doesn't support inline math with $. Try quoting them with \( and \)

carveybunt commented 2 years ago

The live snippet doesn't support inline math with $. Try quoting them with \( and \)

Thanks, I will try that.