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

Empty Latex Command for Citation picker #365

Open samuelsaari opened 1 year ago

samuelsaari commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe.

I would like to cite from zotero and only get the citation key without \autocite{}, citep{} or the like.

Describe the solution you'd like

It would be great if when the setting "Zotero: Latex Command" was left empty, no text would be added around the citation key.

Describe alternatives you've considered

not applicable.

Sometime you already have the \autocite{} command and you want to keep on adding citations or would occasionally like to use \textcite{}. I also switch between natbib and biblatex and would like to automate that process myself

leoleoasd commented 1 year ago

Sorry, for now I don't have the environment to test this. What is the current behavior if you set an empty string in LaTex Command settings? According to the code, it should be able to output only the cite key.

samuelsaari commented 1 year ago

When the setting is an empty string, it will type "\autocite{}" around the citation key. Can't find the setting in json settings, only in the point and click settings.

This behavior was reproduced after reloading vscode and rebooting.

If this would be fixed some time in the future, would be grateful.

jooyoungseo commented 1 year ago

As a piggyback request, it would be great if markdown user could customize the citation key as @key. {"latex-utilities.zotero.latexCommand": "@"} does not work for this purpose because it behaves like \@{key}.

jooyoungseo commented 1 year ago

As far as I tested the empty LaTeX command works only when "latex-utilities.zotero.citeMethod": "vscode", not with the default Zotero citation picker.

{
  "latex-utilities.zotero.citeMethod": "vscode",
  "latex-utilities.zotero.latexCommand": ""
}