New Zotero pdf reader and org-roam/org-roam-bibtex workflow

Hi here (@mshevchuk),

I don’t know if you see this great news !

The possibility to annotate directly is interesting and already very functional (more practical than org-pdf-tools though). It allows to integrate the notes taken (highlighted passages, comments, etc) directly from the .bib file exported by BetterBibLatex. It gives an output of this type…

@article{lefebvreAdjointEsDemocratie2020,
  title = {Les adjoint·es à la démocratie participative. Une catégorie d’élu·es entre spécialisation fonctionnelle et misère positionnelle},
  author = {Lefebvre, Rémi and Talpin, Julien and Petit, Guillaume},
  date = {2020},
  journaltitle = {Participations},
  volume = {N° 26-27},
  pages = {41--75},
  publisher = {{De Boeck Supérieur}},
  issn = {2034-7650},
  url = {https://www.cairn.info/revue-participations-2020-1-page-41.htm},
  urldate = {2021-03-08},
  abstract = {Les délégations municipales à la démocratie participative se sont banalisées depuis deux décennies, mais on manque encore d’études systématiques de ce phénomène. À partir d’une description d’ensemble et d’entretiens, l’article analyse ces adjoint·es, afin de restituer leurs caractéristiques sociales et politiques et les logiques de la fonction. Celle-ci s’avère peu valorisée, et ces élu·es oscillent entre spécialisation fonctionnelle et misère positionnelle. Une majorité ne signale pas d’appétence particulière en matière de participation, malgré des dispositions repérables. Nous décrivons quatre types d’élu·es : indifférents, croyants managériaux, croyants militants et opposants, dont l’évolution, d’ensemble et dans les trajectoires, constitue un enjeu de recherche.},
  file = {/home/manu/Zotero/storage/V85GKDSB/Lefebvre et al_2020_Les adjoint·es à la démocratie participative.pdf;/home/manu/Zotero/storage/MY7N9NTD/revue-participations-2020-1-page-41.html},
  langid = {french},
  note = {\section{Lecture pour l’intro du cahiers participation}

\par
Les éléments suivants sont mis de côté dans le cadre de la préparation de l’introduction du cahier de l’action sur les professionnels de la participations.
\par
\subsection{Intérêt pour l’introduction du cahiers}

\begin{itemize}

\item 
la typologie montre que le rapport à la démocratie participative est envisagée comme une croyance, comme un rapport aux idées. Notre travail qui approchent les choses par les pratiques montre qu’il est moins question de croyance que de logique d’alliance dans l’action.

\item 
la démocratie participative est vue ici dans un rapport aux élus. Le cahier lui apporte un regard nouveau car il laisse de la place à des pratiques de politisation plus larges.

\end{itemize}

\par
---
\par
“À la suite du renouvellement des conseils municipaux de mars 2008, où 1 552 conseils de quartier ont été mis en place, 731 postes « d’adjoint·es de quartier » ont été institués. Ces chiffres sont en progression régulière depuis 20022. L’institutionnalisation des conseils de quartier semble donc avoir eu un effet sur la création de mandats d’élu·es délégués. ” (Lefebvre et al., 2020, p. 42)
\par
\subsection{Problématique}

\par
“Quelle place pour ces élu·es dans la division du travail politique ? Quelle est leur place en particulier dans les configurations qui se déploient dans les politiques de participation (entre maire, DGS, services dédiés, mairies de quartier...) ? Une forme d’éligibilité à cette fonction se dessine-t-elle, et si oui, autour de quelles ressources ? La variable partisane structure-t-elle ces divers enjeux ? Est-ce que les élu·es à la participation incarnent des entrepreneur·es de la cause participative, ou s’agit-il d’un rapport à leur délégation plus désinvesti ? Dans quelle mesure les trajectoires sociales et politiques, les façons d’entrer dans et de prendre le rôle façonnent-elles le rapport du personnel politique à la participation ? Autrement dit, qu’est-ce qui spécifie un·e adjoint·e à la participation, au sein du groupe des élu·es et dans l’ordre des délégations ? ” (Lefebvre et al., 2020, p. 43)
\par

\end{enumerate}},
  number = {1}
}

I would be very interested in being able to get these annotations into my org-roam/org-biblatex workflow. Do you think this is possible? Would you be interested?

4 Likes

Hi @bepolymathe,

this really looks great. I haven’t been using Zotero for a while now but this looks very intriguing so I’m tempted now to download the app and try the new features.

I would be very interested in being able to get these annotations into my org-roam/org-biblatex workflow. Do you think this is possible? Would you be interested?

Well, in a broader sense this is already possible and implemented in ORB, by design. You just have to enable the note keyword in orb-preformat-keywords and put the corresponding wildcard, %^{note} or ${note} in a suitable place in your templates, e.g.

(setq orb-preformat-keywords '("citekey" "author" "note" ...)
      orb-templates '(("r" "ref" plain #'org-roam-capture--get-point 
                       "%^{note}" 
                       :file-name "${citekey}" 
                       :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n" 
                       :unnarrowed t)))

You will of course get a raw value of the note field, a LaTeX-formatted note. Although the LaTeX output is technically acceptable thanks to the built-in LaTeX support in Org mode, you’ll probably
want to convert it to Org. I will look for an Emacs library that can do this. Nothing comes to my mind right at the moment though. One could use the Swiss knife, Pandoc, but this implies an external dependency. On the other hand, I guess, the markup in Zotero and BetterBibTeX export uses only a small subset of the most basic LaTeX formatting, so providing a reverse translation of \section, \subsection, \item and a few others directly in ORB is also trivial.

Or maybe you have other ideas in mind. Please feel free to file a feature request in any case. Unfortunately, I can’t spare much time for ORB apart from the bug fixes at the moment and there are already several feature requests, which I’m also committed to implement, so don’t expect it to be done quickly. But if there is an issue on GitHub, I’ll get to it sooner or later.

2 Likes

Hi @mshevchuk
I apologize for the reaction time. It’s been a complicated week. Yes, it is what you describe that I had in mind in terms of further integration. I just tried your template but it doesn’t work for me. I try a little more…

Hi @bepolymathe, you must have tried the template you’ve received with a notification email. I’ve edited the post since then. The correct format for the “template string” (the fifth element of the list) is of course %^{note}, the ${...}-style wildcards work only in :head and :file-name sections, which are Org Roam-specific additions. Sorry for that.

Thanks for that @mshevchuk . I have change this… but it’s seems te be a problem (maybe not relative) with org-ref :thinking:

orb-edit-notes: cite:galvez-beharAffaireTurpinPolitique2020 is not a valid ref

My config looks like this

(use-package! org-roam-bibtex
  :load-path "~/Documents/Biblio/biblio.bib" ;Modify with your own path
  :after org-roam
  :hook (org-roam-mode . org-roam-bibtex-mode)
  :bind (:map org-mode-map
              (("C-c n a" . orb-note-actions))))

(setq orb-note-actions-interface 'helm)
(setq orb-preformat-keywords   '(("citekey" . "=key=") "note" "title" "url" "file" "author-or-editor" "keywords"))
(setq orb-templates
      '(("r" "ref" plain #'org-roam-capture--get-point ""
          %^{note}
         :file-name "${citekey}"
         :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n"
         :unnarrowed t)))

@bepolymathe, see this GitHub issue. It could be that Org-ref is not loaded yet when you run the capture.

This is incorrect. I see this piece keeps popping up in user configs, I don’t know who invented it, but one should specify the path to the bibfile(s) in bibtex-completion-bibliography, not in the use-package's :load-path!

You are right on this point. I suppress this line. I actually had the right command below

(setq bibtex-completion-bibliography '("~/Documents/Biblio/biblio.bib"))

My org-ref config

I now a have another error message :thinking:

orb-edit-notes: Template needs to specify ‘:file-name’

Probably missed a parenthesis when editing the config. Right, it should be

'(("r" "ref" plain #'org-roam-capture--get-point
          "%^{note}"
         :file-name "${citekey}"
         :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n"
         :unnarrowed t))

not

'(("r" "ref" plain #'org-roam-capture--get-point ""
          %^{note}
         :file-name "${citekey}"
         :head "#+TITLE: ${title}\n#+ROAM_KEY: ${ref}\n"
         :unnarrowed t))

This statement is redundant:

(setq org-ref-notes-function 'orb-edit-notes)

because org-roam-bibtex-mode takes care of it.

This is unnecessary:

(setq bibtex-completion-notes-path "~/Org/roam/annotations")

because you use Org Roam and ORB to manage your notes, not bibtex-completion.

Finally, this

(use-package! org-ref)

is not enough and is likely responsible for the error

cite:galvez-beharAffaireTurpinPolitique2020 is not a valid ref

Org-ref package should be loaded before you run the capture process. This package has not been designed to be loaded lazily, unfortunately. So one must (require 'org-ref) at some point. You should decide when.

Ok thanks for clarifications. I will try it.

Everything is working well now. Thank you.

1 Like

New feature request created on github. :wink:

1 Like

I don’t know if I’m necroposting here, but I’ve just discovered this thread and am trying to figure out how best to use it. I have installed zotero-beta and made a test note in a PDF, but I don’t see it showing up in my betterbibtex export. Am I missing something? Thanks!

You probably need to tell betterbibtex to export with notes.