notZaki / PandocCiter

Visual Studio Code extension for autocompleting citations and cross-references for Pandoc/Markdown documents
https://marketplace.visualstudio.com/items?itemName=notZaki.pandocciter
MIT License
65 stars 9 forks source link

Ability to specify per-project bib files #51

Open LeaVerou opened 2 months ago

LeaVerou commented 2 months ago

Thanks for making this wonderful plugin!

I see there are two ways to specify bibliography files, corresponding to two scoping extremes: either as a global default, applied to every project, or by specifying them on the individual file.

In most of my use cases (and for many colleagues I know) it would be most helpful to specify bibliography files per project.

Perhaps via a project config file or something?

notZaki commented 2 months ago

Something similar was brought up in #31 and now I believe the bib file can be defined at the workspace level, by doing (on windows) Ctrl+Shift+P -> Preferences: Open Workspace Settings (JSON) and then adding something like

{
    "PandocCiter.DefaultBibs": ["./path/to/refs.bib"],
    "PandocCiter.UseDefaultBib": true
}

to the config. This will save them in a .vscode/settings.json file and that should only apply to the specific workspace.

I don't regularly use this feature, so let me know if it actually works/helps or if something else should be done. If it does work, then the readme could be updated with this information.

mtompkins commented 1 month ago

I would really love this feature and have been struggling with the extension for some time on linux.

What I've come to understand is, the relative path in linux (using VSCodium) isn't relative to the working directory.

For example I have a project folder as /home/user/directory/report however when using the relative path in the settings.json it refers to /home/user/.config/VSCodium/User/

LeaVerou commented 1 month ago

Something similar was brought up in #31 and now I believe the bib file can be defined at the workspace level, by doing (on windows) Ctrl+Shift+P -> Preferences: Open Workspace Settings (JSON) and then adding something like

{
    "PandocCiter.DefaultBibs": ["./path/to/refs.bib"],
    "PandocCiter.UseDefaultBib": true
}

to the config. This will save them in a .vscode/settings.json file and that should only apply to the specific workspace.

I don't regularly use this feature, so let me know if it actually works/helps or if something else should be done. If it does work, then the readme could be updated with this information.

I forgot το answer but this worked great, thank you! I guess this can be closed, I don't think there is anything PandocCiter can do to facilitate this better — I would just suggest documenting this.

@mtompkins It resolves relative to the working dir for me. These are my settings:

{
    "PandocCiter.DefaultBibs": ["./bib/zotero.bib", "./bib/manual.bib"],
    "PandocCiter.UseDefaultBib": true,
    "PandocCiter.ViewType": "browser"
}

Perhaps it behaves differently if you start with ./?