Skip to content

My Snippents in LaTeX Files doesn't work? #234018

Open
@Explorer-cc

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.88.0
  • OS Version: Windows 11 professional version-22H2-22621.4317

Steps to Reproduce:

I have use the Help: Start Extension Bisect and after I disabled the extension, the problem still exist:

the code can't detect the ¥¥ and trigger the snippets as the link shows:

James-Yu/LaTeX-Workshop#4455

Here below is my settings.json, maybe a little long for other configure

hidden code block `settings.json`
{
    "latex-workshop.latex.autoBuild.run": "never",
    "latex-workshop.showContextMenu": true,
    "latex-workshop.intellisense.package.enabled": true,
    "latex-workshop.message.error.show": false,
    "latex-workshop.message.warning.show": false,
    "latex-workshop.latex.tools": [
        {
            "name": "xelatex",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "xelatex-shell-escape",
            "command": "xelatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-shell-escape",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "pdflatex-shell-escape",
            "command": "pdflatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-shell-escape",
                "%DOCFILE%"
            ]
        },
        {
            "name": "lualatex",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOCFILE%"
            ]
        },
        {
            "name": "bibtex",
            "command": "bibtex",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmkpdf",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-halt-on-error",
                "-file-line-error",
                "-pdflatex",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmkxe",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-halt-on-error",
                "-file-line-error",
                "-xelatex",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmklua",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-halt-on-error",
                "-file-line-error",
                "-lualatex",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmkxe-shell-escape",
            "command": "latexmk",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-halt-on-error",
                "-file-line-error",
                "-xelatex",
                "--shell-escape",
                "%DOCFILE%"
            ]
        },
        {
            "name": "latexmk-SmallClean",
            "command": "latexmk",
            "args": [
                "-c"
            ]
        },
        {
            "name": "latexmk-FullClean",
            "command": "latexmk",
            "args": [
                "-C"
            ]
        },
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "latexmkxe",
            "tools": [
                "latexmkxe"
            ]
        },
        {
            "name": "latexmkxe-shell-escape",
            "tools": [
                "latexmkxe-shell-escape"
            ]
        },
        {
            "name": "latexmklua",
            "tools": [
                "latexmklua"
            ]
        },
        {
            "name": "latexmkpdf",
            "tools": [
                "latexmkpdf"
            ]
        },
        {
            "name": "latexmk-clean",
            "tools": [
                "latexmk-SmallClean"
            ]
        },
        {
            "name": "latexmk-Clean",
            "tools": [
                "latexmk-FullClean"
            ]
        },
        {
            "name": "XeLaTeX",
            "tools": [
                "xelatex",
            ]
        },
        {
            "name": "XeLaTeX*2",
            "tools": [
                "xelatex",
                "xelatex",
            ]
        },
        {
            "name": "LuaLaTeX",
            "tools": [
                "lualatex",
            ]
        },
        {
            "name": "XeLaTeX-shell-escape",
            "tools": [
                "xelatex-shell-escape",
            ]
        },
        {
            "name": "PDFLaTeX",
            "tools": [
                "pdflatex",
            ]
        },
        {
            "name": "PDFLaTeX-shell-escape",
            "tools": [
                "pdflatex-shell-escape",
            ]
        },
        {
            "name": "BibTeX",
            "tools": [
                "bibtex",
            ]
        },
        {
            "name": "Biber",
            "tools": [
                "biber",
            ]
        },
        {
            "name": "XeLaTeX -> BibTeX -> XeLaTeX*2",
            "tools": [
                "xelatex",
                "bibtex",
                "xelatex",
                "xelatex",
            ]
        },
        {
            "name": "XeLaTeX -> Biber -> XeLaTeX*2",
            "tools": [
                "xelatex",
                "biber",
                "xelatex",
                "xelatex",
            ]
        },
        {
            "name": "XeLaTeX-shell-escape -> BibTeX -> XeLaTeX*2",
            "tools": [
                "xelatex-shell-escape",
                "bibtex",
                "xelatex-shell-escape",
                "xelatex-shell-escape",
            ]
        },
        {
            "name": "XeLaTeX-shell-escape -> Biber -> XeLaTeX*2",
            "tools": [
                "xelatex-shell-escape",
                "biber",
                "xelatex-shell-escape",
                "xelatex-shell-escape",
            ]
        },
        {
            "name": "XeLaTeX-shell-escape -> BibTeX -> XeLaTeX*2",
            "tools": [
                "xelatex-shell-escape",
                "bibtex",
                "xelatex-shell-escape",
                "xelatex-shell-escape",
            ]
        },
    ],
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.xdv",
        "*.nav",
        "*.snm",
        "*.fdb_latexmk"
    ],
    "latex-workshop.latex.autoClean.run": "onFailed",
    "latex-workshop.latex.recipe.default": "lastUsed",
    "latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
    "files.autoSave": "afterDelay",
    "extensions.autoCheckUpdates": false,
    "update.mode": "none",
    "backgroundCover.autoStatus": true,
    "backgroundCover.randomImageFolder": "e:\\Pictures\\vsc-wallpaper",
    "backgroundCover.imagePath": "e:\\Pictures\\vsc-wallpaper\\jhjjgh.png",
    "editor.wordWrap": "on",
    "Codegeex.Privacy": false,
    "Codegeex.DisabledFor": {
        "": true
    },
    "typescript.suggest.paths": false,
    "javascript.suggest.paths": false,
    "security.workspace.trust.untrustedFiles": "open",
    "vscode_custom_css.imports": [
        "file:///C:/Users/Kasmir/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/vscode-custom.css"
    ],
    "workbench.iconTheme": "vscode-great-icons",
    "explorer.confirmDelete": false,
    "explorer.confirmDragAndDrop": false,
    "editor.fontFamily": "'Cascadia Code',霞鹜文楷,Consolas,'Courier New',monospace",
    "editor.fontLigatures": true,
    "workbench.startupEditor": "none",
    "jupyter.askForKernelRestart": true,
    "window.zoomLevel": 2,
    "terminal.integrated.fontWeightBold": 800,
    "notebook.lineNumbers": "on",
    "makefile.configureOnOpen": true,
    "workbench.colorCustomizations": {},
    "terminal.integrated.profiles.windows": {
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash"
        },
        "Windows PowerShell": {
            "path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
        }
    },
    "terminal.integrated.defaultProfile.windows": "Windows PowerShell",
    "workbench.list.smoothScrolling": true,
    "terminal.integrated.smoothScrolling": true,
    "editor.cursorSmoothCaretAnimation": "on",
    "editor.cursorBlinking": "smooth",
    "jupyter.interactiveWindow.textEditor.executeSelection": true,
    "terminal.integrated.fontFamily": "'MesloLGS Nerd Font Mono',霞鹜文楷,'Cascadia Code',Consolas,'Courier New',monospace",
    "python.languageServer": "Pylance",
    "git.useEditorAsCommitInput": false,
    "git.confirmSync": false,
    "workbench.editorAssociations": {
        "{git,gitlens}:/**/*.{md,csv,svg}": "default",
        "*.csv": "gc-excelviewer-csv-editor"
    },
    "git.enableSmartCommit": true,
    "Codegeex.License": "",
    "editor.scrollbar.ignoreHorizontalScrollbarInContentHeight": true,
    "editor.smoothScrolling": true,
    "editor.stickyScroll.enabled": false,
    "python.terminal.activateEnvironment": false,
    "tinymist.formatterMode": "typstyle",
    "[latex]": {
    },
    "editor.defaultFormatter": "ms-python.autopep8",
    "terminal.integrated.mouseWheelZoom": true,
    "terminal.integrated.fontSize": 15,
    "editor.unicodeHighlight.nonBasicASCII": false,
    "workbench.colorTheme": "One Dark Pro Darker",
    "terminal.integrated.rescaleOverlappingGlyphs": true,
    "code-runner.executorMap": {
        "python": "python -u -X utf8",
    },
    "[markdown]": {
        "editor.defaultFormatter": "yzhang.markdown-all-in-one"
    },
    "vscode-hanzi-counter.template.tooltipTemplateName": "zh-hans",
    "editor.mouseWheelZoom": true,
    "git.openRepositoryInParentFolders": "never",
}

Below is my snippets latex.json and the tex.json is empty(by deafult)

hidden code block `latex.json`
{
	// Place your snippets for latex here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }
	"replace ¥¥": {
		"prefix": "¥¥",
		"body": [
		  "$$"
		],
		"description": "replace ¥¥"
	},
	"fraction": {
		"prefix": "fr",
		"body": [
			"\\frac{$1}{$2} ",
		 ],
		 "description": "fraction"
	}, 
	 "partial fraction": {
		"prefix": "pf",
		"body": [
			"\\frac{\\partial $1}{\\partial $2} $3",
		 ],
		 "description": "partial fraction"
	}, 
	"partial fraction 2": {
		"prefix": "pft",
		"body": [
			"\\frac{\\partial^2 $1}{\\partial {$2}^2} $3",
		 ],
		 "description": "partial fraction"
	}, 
	 "left right ()": {
		"prefix": "le",
		"body": [
			"\\left( $1\\right) $2",
		 ],
		 "description": "big()"
	}, 
	 "power": {
		"prefix": "dj",
		"body": [
			"^{$1} ",
		 ],
		 "description": "^{}"
	}, 
	 "underline": {
		"prefix": "ud",
		"body": [
			"_{$1} $2",
		 ],
		 "description": "_{}"
	}, 
	"and": {
		"prefix": "and",
		"body": [
			"& $1",
		 ],
		 "description": "&"
	},
	"cdot": {
		"prefix": "cd",
		"body": [
			"\\cdot $1",
		 ],
		 "description": "cdot"
	},
	"cdots": {
		"prefix": "cs",
		"body": [
			"\\cdots $1",
		 ],
		 "description": "cdots"
	},
	 "listing": {
		"prefix": "ls",
		"body": [
			"$1_1,$2_2,\\ldots,$3_n $4",
		 ],
		 "description": "x_1,x_2,...,x_n"
	}, 
	 "fig": {
		"prefix": "fig",
		"body": [
			"\\begin{figure}[!ht]\n    \\centering\n    \\includegraphics[$2]{$1}\n    \\caption{$3}\n    \\label{$4}\n\\end{figure}",
		],
		"description": "fig"
	}, 
	"infty": {
		"prefix": "inf",
		"body": [
			"\\infty $1",
		],
		"description": "infty"
	}, 
	"int upper inf": {
		"prefix": "ininf",
		"body": [
			"\\int^\\infty_{$1} $2",
		],
		"description": "infty"
	}, 
	"suminf": {
		"prefix": "suminf",
		"body": [
			"\\sum^\\infty_{$1} $2",
		],
		"description": "sum upper infty"
	}, 
	"table": {
		"prefix": "tab",
		"body": [
			"\\begin{table*}[!ht]\n    \\caption{$1}\n    \\vspace*{3pt}\n    \\renewcommand\\arraystretch{1.5}\n    \\centering\n    \\begin{tabular}{p{3cm}<{\\centering}p{3cm}<{\\centering}p{1.5cm}<{\\centering}p{1.5cm}<{\\centering}}\n        \\toprule\n        $2&&& \\\\\\ \n        \\midrule\n        $3&&& \\\\\\\n        \\bottomrule\n    \\end{tabular}\n\\end{table*}\n$4",
		],
		"description": "table"
	}, 
	"overline": {
		"prefix": "ov",
		"body": [
			"\\overline{$1}$2",
		],
		"description": "overline"
	}, 
	"vec": {
		"prefix": "vec",
		"body": [
			"\\overrightarrow{$1}$2",
		],
		"description": "overrightarrow"
	}, 
	"alpha": {
		"prefix": "alp",
		"body": [
			"\\alpha ",
		],
		"description": "alpha"
	}, 
	"beta": {
		"prefix": "bet",
		"body": [
			"\\beta ",
		],
		"description": "beta"
	}, 
	"phi": {
		"prefix": "phi",
		"body": [
			"\\varphi ",
		],
		"description": "phi"
	}, 
	"pi": {
		"prefix": "pi",
		"body": [
			"\\pi ",
		],
		"description": "pi"
	}, 
	"mu": {
		"prefix": "mu",
		"body": [
			"\\mu ",
		],
		"description": "mu"
	}, 
	"int": {
		"prefix": "int",
		"body": [
			"\\int",
		],
		"description": "int"
	}, 
	"zeta": {
		"prefix": "zet",
		"body": [
			"\\zeta ",
		],
		"description": "zeta"
	}, 
	"lim_0": {
		"prefix": "lim0",
		"body": [
			"\\lim_{$1 \\rightarrow 0} $2",
		],
		"description": "lim x -> 0"
	}, 
	"lim_inf": {
		"prefix": "linf",
		"body": [
			"\\lim_{$1 \\rightarrow \\infty} $2",
		],
		"description": "lim x -> oo"
	}, 
	"liomega": {
		"prefix": "om",
		"body": [
			"\\omega ",
		],
		"description": "omega"
	}, 
	"frame": {
		"prefix": "frame",
		"body": [
			"\\begin{frame}[fragile]{$1}\n    $2\n\\end{frame}\n",
		],
		"description": "frame environment"
	}, 
	"cols": {
		"prefix": "cols",
		"body": [
			"\\begin{columns}\n$1\n\\end{columns}",
		],
		"description": "columns environment"
	}, 
	"col": {
		"prefix": "col",
		"body": [
			"\\begin{column}{$1\\textwidth}\n$2\n\\end{column}$3",
		],
		"description": "column environment"
	}, 
	"height": {
		"prefix": "hei",
		"body": [
			"height = $1 \\textheight - $2 cm",
		],
		"description": "height"
	}, 
	"width": {
		"prefix": "wid",
		"body": [
			"width = $1 \\textwidth - $2 cm",
		],
		"description": "wid"
	}, 
	"item": {
		"prefix": "it",
		"body": [
			"\\begin{itemize}\n    \\item $1 \n\\end{itemize}",
		],
		"description": "itemize"
	}, 
	"CJK": {
		"prefix": "cjk",
		"body": [
			"\\begin{CJK*}{UTF8}{gbsn}\n    $1 \n\\end{CJK*}",
		],
		"description": "CJK-song"
	}, 
	"Noindentqquad": {
		"prefix": "nq",
		"body": [
			"\\noindent\\qquad ",
		],
		"description": "缩进"
	}, 
	"define": {
		"prefix": "ejgs",
		"body": [
			"\\begin{ejgs}\\textbf{$1}\\\\\\\n    \\phantom{占位} $2 \n\\end{ejgs}",
		],
		"description": "ejgs环境"
	}, 
	"Delta": {
		"prefix": "del",
		"body": [
			"\\Delta",
		],
		"description": "Delta"
	}, 
	"delta": {
		"prefix": "delta",
		"body": [
			"\\delta",
		],
		"description": "delta"
	},
	"rho": {
		"prefix": "rho",
		"body": [
			"\\rho ",
		],
		"description": "rho"
	},
	"BoldinMath": {
		"prefix": "cu",
		"body": [
			"\\textit{\\textbf{$1}} ",
		],
		"description": "bold"
	},
	"Boldinalpha": {
		"prefix": "calp",
		"body": [
			"\\boldsymbol{$1} ",
		],
		"description": "bold"
	},
	"dd frac": {
		"prefix": "df",
		"body": [
			"\\frac{\\mathrm{d} $1}{\\mathrm{d} $2} ",
		],
		"description": "dd frac"
	},
	"times": {
		"prefix": "ch",
		"body": [
			"\\times ",
		],
		"description": "times"
	},
	"varepsilon": {
		"prefix": "ep",
		"body": [
			"\\varepsilon ",
		],
		"description": "varepsilon"
	},
	"varepsilon_0": {
		"prefix": "ep0",
		"body": [
			"\\varepsilon_0 ",
		],
		"description": "varepsilon_0"
	},
	"varepsilon_r": {
		"prefix": "epr",
		"body": [
			"\\varepsilon_r ",
		],
		"description": "varepsilon_r"
	},
	"dwk": {
		"prefix": "dwk",
		"body": [
			"\\frac{1}{4 \\pi \\varepsilon _{0} } ",
		],
		"description": "大学物理的k"
	},
	"sigma": {
		"prefix": "sig",
		"body": [
			"\\sigma ",
		],
		"description": "sigma"
	},
	"partial": {
		"prefix": "par",
		"body": [
			"\\partial ",
		],
		"description": "partial"
	},
	"sintefblue": {
		"prefix": "sint",
		"body": [
			"\\bf\\large\\color{sintefblue}",
		],
		"description": "sintefblue"
	},
	"bfsintefblue": {
		"prefix": "bs",
		"body": [
			"\\bf\\color{sintefblue}",
		],
		"description": "bfsintefblue"
	},	
	"align*": {
		"prefix": "ali",
		"body": [
			"\\begin{align*}\n    $1\n\\end{align*}\n",
		],
		"description": "align*"
	},
	"sqrt": {
		"prefix": "sq",
		"body": [
			"\\sqrt{$1}",
		],
		"description": "sqrt"
	},
	"lnot": {
		"prefix": "ln",
		"body": [
			"\\lnot ",
		],
		"description": "lnot"
	},
	"wedge": {
		"prefix": "wl",
		"body": [
			"\\wedge ",
		],
		"description": "wedge"
	},
	"vee": {
		"prefix": "lw",
		"body": [
			"\\vee ",
		],
		"description": "vee"
	},
	"overbar": {
		"prefix": "ba",
		"body": [
			"\\overline{$1} ",
		],
		"description": "overline"
	},
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

info-neededIssue requires more information from postersnippets

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions