Comments (6)
Wouldn't it be better to generate a link of the following form?:
** [[/home/julian/Documents/Refs/Lurton2015.pdf][Backscatter measurements by seafloor-mapping sonars]]
Or do you really need to see the Bibtex-key?
The code for the citation format above is:
(defun helm-bibtex-format-citation-my-org-link-to-PDF (keys)
"Formatter for org-links to PDF. Uses first matching PDF if
several are available. Entries for which no PDF is available are
omitted."
(s-join ", " (-non-nil
(--map (when (cdr it)
(format "[[%s][%s]]"
(car it)
(helm-bibtex-get-value "title" (cdr it))))
(--map (cons (helm-bibtex-find-pdf it)
(helm-bibtex-get-entry it)) keys)))))
(setq helm-bibtex-format-citation-functions
'((org-mode . helm-bibtex-format-citation-my-org-link-to-PDF)
(latex-mode . helm-bibtex-format-citation-cite)
(markdown-mode . helm-bibtex-format-citation-pandoc-citeproc)
(default . helm-bibtex-format-citation-default)))
from helm-bibtex.
Thanks Titus! The Bibtex key would be useful because it gives me the first author and year of publication. Could you add it?
from helm-bibtex.
Here ya go:
(defun helm-bibtex-format-citation-my-org-link-to-PDF (keys)
"Formatter for org-links to PDF. Uses first matching PDF if
several are available. Entries for which no PDF is available are
omitted."
(s-join ", " (-non-nil
(--map (when (cdr it)
(format "[[%s][%s]] %s"
(car it)
(helm-bibtex-get-value "=key=" (cdr it))
(helm-bibtex-get-value "title" (cdr it))))
(--map (cons (helm-bibtex-find-pdf it)
(helm-bibtex-get-entry it)) keys)))))
from helm-bibtex.
Thanks again! One last question. I would like to have this as an action, rather than the default citation format in org mode (because most of the time I use LaTex citations in org-mode). In other words, I would like to call helm-bibtex, select a reference, press TAB, and see "Insert link to pdf and title" as one of the possible actions. That is why I was trying to make a function similar to helm-bibtex-insert-key. I suspect cannot just modify helm-source bibtex as below, calling helm-bibtex-format-citation-my-org-link-to-PDF as one of the actions, right?
(defvar helm-source-bibtex
'((name . "BibTeX entries")
(init . helm-bibtex-init)
(candidates . helm-bibtex-candidates)
(filtered-candidate-transformer . helm-bibtex-candidates-formatter)
(action . (("Open PDF file (if present)" . helm-bibtex-open-pdf)
("Insert link to pdf and title" . Helm-bibtex-format-citation-my-org-link-to-PDF) ; NEW ACTION
("Open URL or DOI in browser" . helm-bibtex-open-url-or-doi)
("Insert citation" . helm-bibtex-insert-citation)
("Insert reference" . helm-bibtex-insert-reference)
("Insert BibTeX key" . helm-bibtex-insert-key)
("Insert BibTeX entry" . helm-bibtex-insert-bibtex)
("Attach PDF to email" . helm-bibtex-add-PDF-attachment)
("Edit notes" . helm-bibtex-edit-notes)
("Show entry" . helm-bibtex-show-entry))))
"Source for searching in BibTeX files.")
from helm-bibtex.
Hi Julian, sorry I don't have time to deal with this. You have to create a new function similar to helm-bibtex-insert-citation
and add it as an action to the source. Perhaps a good opportunity to get your feet wet. Basic Elisp knowledge will allow you to get much more out of Emacs, so it should be worth your time.
from helm-bibtex.
Ok, fair enough. :) I will dive into this. Many thanks for your help!
from helm-bibtex.
Related Issues (20)
- Dynamic bibtex-completion-library-path HOT 4
- Prenote and Postnote options for citations in org-mode HOT 4
- Symbol’s function definition is void: org-cite-register-processor HOT 7
- bibtex-completion-format-citation-org-cite gives wrong format HOT 2
- org-ref-helm-bibtex-insert-citation results in wrong type argument HOT 3
- helm-bibtex-candidates-formatter not applied (?) HOT 11
- Invalid image type 'svg' HOT 3
- Symbol’s value as variable is void: browse-url-mosaic-program HOT 4
- Inquiry about Automatic Updating of BibTeX Files from Online Databases in Helm-Bibtex. HOT 1
- Set the variable bibtex-completion-bibliography used by helm-bibtex to the dynamical generated bib files list corresponding to the current master tex file. HOT 14
- Trigger bibliography completion list in-situ in TeX source document when typing `\cite{}` command.
- Inquiry about citation commands supported by helm-bibtex package. HOT 11
- The problem related to `(require 'helm-config)` and `(require 'helm-bibtex)`. HOT 9
- What's the mode hook defined in `helm-bibtex` to conditionally activate it when AUCTeX's `LaTeX-mode` is called? HOT 4
- Allow additional functions for format entry HOT 1
- Bug?: Abstract may be invalid if final character is `}` HOT 4
- Feature request: Integration with Zotra HOT 5
- Clarify documentation for `org-bibtex` bibliography. HOT 3
- helm-bibtex-follow doesn't fail properly for non-existent keys HOT 7
- Unicode Support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm-bibtex.