Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Support determinate citation file choosing #50

Closed
jaranta opened this issue Aug 4, 2015 · 6 comments
Closed

Support determinate citation file choosing #50

jaranta opened this issue Aug 4, 2015 · 6 comments
Assignees
Milestone

Comments

@jaranta
Copy link

jaranta commented Aug 4, 2015

Currently, citation files are searched recursively from a path with the assumption that they will be in the same path as the markdown file.

I have one large citation file that I use for all my papers -- it is updated by Mendeley, so I never touch it manually. Choosing the location where that file is causes Atom to crash, either because it is too big or because the path is outside the folder where the markdown file is. I tested it out by symlinking it to the folder where the markdown file is. While it absolutely kills the processor, it doesn't crash and the preview is parsed correctly. Therefore, it seems that the problem is with the path being outside the working directory.

I tried the same thing with a csl-file and it also seems to behave similarly: a path outside the working folder is not recognized, symlinking works.

It would be great if you could determine a folder where the needed files are and not rely on a recursive search that assumes they are within the same path.

@leipert leipert self-assigned this Aug 4, 2015
@leipert
Copy link
Contributor

leipert commented Aug 4, 2015

I will have a look. Are you on Windows or Mac?

The recursive works it's way up the directory. Where are your *.bib and *.csl located relative to your home directory and where is the paper working directory relative to your home directory?

If I understand you correctly, you want to specify the directory absolutely. What do you think of the following workflow:

  1. Specify an option "citation fallback" in settings.
  2. Only look for *.bib and *.csl recursively from the file up to the dir where atom is in.
  3. If it is not found, use *.bib and *.csl in the fallback dir.

I understand that it makes your cpu sweat, because every change in the markdown file triggers a complete render by pandoc, if the preview is open.

@leipert
Copy link
Contributor

leipert commented Aug 4, 2015

Regarding the last point, maybe we should add a debounce that you can change, so that the markdown just gets rendered every x milliseconds.

@jaranta
Copy link
Author

jaranta commented Aug 5, 2015

I'm on Linux and Windows. I haven't yet tested this package on Windows, because I can't get it to install.

The paper is in

/home/username/Dropbox/publications/paperfolder/papername.md (or equivalent)

The bib-file is

/home/username/Dropbox/Bibtex/library.bib (note that it is not bibliography.bib as assumed now -- the name is autogenerated and I can't change it)

and csl is

/home/username/.pandoc/csl/apa.csl

I think the suggested solution is perfect. That would account for the use-case that is presumed now, but support having the data elsewhere (I store my csl-files in the pandoc data folder). I think it should support different locations for both, because that is how I currently work.

I don't think stressing the cpu is a problem -- I just disable live preview and check the result whenever I need to. Every added letter doesn't need to be updated in real-time. An option to disable the fuzzy search might save a few cycles.

@leipert leipert modified the milestones: 1.7.0, 2.0.0 Aug 5, 2015
@leipert
Copy link
Contributor

leipert commented Aug 5, 2015

Will fix it until sunday.

@Galadirith Galadirith mentioned this issue Aug 5, 2015
8 tasks
@leipert leipert mentioned this issue Aug 8, 2015
@leipert leipert mentioned this issue Aug 9, 2015
leipert added a commit that referenced this issue Aug 9, 2015
Fixes #50 
Merged even if some specs are failing, as the failing specs are in the context of #60
@jaranta
Copy link
Author

jaranta commented Aug 10, 2015

Excellent work! Tested it out and it works.

Pandoc-citeproc doesn't seem to respect the locale setting in the file YAML-section, so the citations are not localized, but that seems like a minor issue.

@jaspervanm
Copy link

I still have some problems with using the correct bibliography and/or CSL file: it always refers to the fallback option, regardless of what I put into the settings (bibliography.bib, which lives one folder above the markdown file; or reference-style.csl which lives in the same directory) or what's in the YAML-section.

What can I do to provide an example?
I'm on OSX.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants