emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* bibtex setup .dir-locals.el
@ 2018-10-28 22:19 edgar
  2018-10-31 15:27 ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: edgar @ 2018-10-28 22:19 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I would like to know how to set my ~References.bib~ as a dir-local 
variable for use with bibtex (org-ref, reftex). I have this in my 
~.dir-locals.el~. It keeps showing the global list of references. 
Thanks!

#+BEGIN_SRC emacs-lisp
   ;;; Directory Local Variables
   ;;; For more information see (info "(emacs) Directory Variables")

   (
    (org-mode
     (reftex-default-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))
     (org-ref-default-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))
     (bibtex-completion-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))
     (org-ref-bibliography-notes . 
"/Class/Biomat/Hw/Project/report-biomat.org")
     (bibtex-completion-notes-path . 
"/Class/Biomat/Hw/Project/report-biomat.org")
     (org-ref-pdf-directory . "/Class/Biomat/Hw/Project/Media/")
     (bibtex-completion-library-path . "/Class/Biomat/Hw/Project/Media/")
     )

    (bibtex-mode
     (reftex-default-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))
     (org-ref-default-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))
     (bibtex-completion-bibliography . 
("/Class/Biomat/Hw/Project/References.bib"))

     (org-ref-bibliography-notes
      .
      "/Class/Biomat/Hw/Project/report-biomat.org")

     (bibtex-completion-notes-path
      .
      "/Class/Biomat/Hw/Project/report-biomat.org")

     (org-ref-pdf-directory
      .
      "/Class/Biomat/Hw/Project/Media/")

     (bibtex-completion-library-path
      .
      "/Class/Biomat/Hw/Project/Media/")
       )
    )
#+END_SRC

As an example:
#+BEGIN_EXAMPLE
   reftex-default-bibliography is a variable defined in ‘reftex-vars.el’.
   Its value is
   ("/Class/Biomat/Hw/Project/References.bib")
   Original value was nil
   Local in buffer report-biomat.org; global value is
   ("//Research/References.bib")

     This variable’s value is directory-local, set by the file
     ‘/Class/Biomat/Hw/Project/.dir-locals.el’.

   Documentation:
   List of BibTeX database files which should be used if none are 
specified.
   When ‘reftex-citation’ is called from a document which has neither a
   ‘\bibliography{..}’ statement nor a ‘thebibliography’ environment,
   RefTeX will scan these files instead.  Intended for using 
‘reftex-citation’
   in non-LaTeX files.  The files will be searched along the BIBINPUTS or 
TEXBIB
   path.

   You can customize this variable.
#+END_EXAMPLE

My system
#+BEGIN_SRC emacs-lisp
   (concat
    (emacs-version) "\n"
    (org-version) "\n"
    (org-ref-version))
#+END_SRC

#+RESULTS:
: GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
:  of 2018-07-05
: 9.1.14
: org-ref: Version 1.1.1

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibtex setup .dir-locals.el
  2018-10-28 22:19 bibtex setup .dir-locals.el edgar
@ 2018-10-31 15:27 ` John Kitchin
  2018-11-01 17:42   ` edgar
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitchin @ 2018-10-31 15:27 UTC (permalink / raw)
  To: edgar; +Cc: emacs-orgmode

That looks right. I have this in a .dir-locals.el file and when I use
org-ref, it only shows me references from that file.

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((org-mode
  (org-ref-default-bibliography . ("./References.bib"))
  (bibtex-completion-bibliography . ("./References.bib"))))

You do have to close the org-file, and then reopen it after you make
that file, and when I do that I am prompted whether to apply or ignore
the settings.

It might be simpler to just use a bibliography link in the file though:

bibliography:References.bib



edgar@openmail.cc writes:

> Hello,
>
> I would like to know how to set my ~References.bib~ as a dir-local variable for
> use with bibtex (org-ref, reftex). I have this in my ~.dir-locals.el~. It keeps
> showing the global list of references. Thanks!
>
> #+BEGIN_SRC emacs-lisp
>   ;;; Directory Local Variables
>   ;;; For more information see (info "(emacs) Directory Variables")
>
>   (
>    (org-mode
>     (reftex-default-bibliography . ("/Class/Biomat/Hw/Project/References.bib"))
>     (org-ref-default-bibliography . ("/Class/Biomat/Hw/Project/References.bib"))
>     (bibtex-completion-bibliography .
> ("/Class/Biomat/Hw/Project/References.bib"))
>     (org-ref-bibliography-notes . "/Class/Biomat/Hw/Project/report-biomat.org")
>     (bibtex-completion-notes-path .
> "/Class/Biomat/Hw/Project/report-biomat.org")
>     (org-ref-pdf-directory . "/Class/Biomat/Hw/Project/Media/")
>     (bibtex-completion-library-path . "/Class/Biomat/Hw/Project/Media/")
>     )
>
>    (bibtex-mode
>     (reftex-default-bibliography . ("/Class/Biomat/Hw/Project/References.bib"))
>     (org-ref-default-bibliography . ("/Class/Biomat/Hw/Project/References.bib"))
>     (bibtex-completion-bibliography .
> ("/Class/Biomat/Hw/Project/References.bib"))
>
>     (org-ref-bibliography-notes
>      .
>      "/Class/Biomat/Hw/Project/report-biomat.org")
>
>     (bibtex-completion-notes-path
>      .
>      "/Class/Biomat/Hw/Project/report-biomat.org")
>
>     (org-ref-pdf-directory
>      .
>      "/Class/Biomat/Hw/Project/Media/")
>
>     (bibtex-completion-library-path
>      .
>      "/Class/Biomat/Hw/Project/Media/")
>       )
>    )
> #+END_SRC
>
> As an example:
> #+BEGIN_EXAMPLE
>   reftex-default-bibliography is a variable defined in ‘reftex-vars.el’.
>   Its value is
>   ("/Class/Biomat/Hw/Project/References.bib")
>   Original value was nil
>   Local in buffer report-biomat.org; global value is
>   ("//Research/References.bib")
>
>     This variable’s value is directory-local, set by the file
>     ‘/Class/Biomat/Hw/Project/.dir-locals.el’.
>
>   Documentation:
>   List of BibTeX database files which should be used if none are specified.
>   When ‘reftex-citation’ is called from a document which has neither a
>   ‘\bibliography{..}’ statement nor a ‘thebibliography’ environment,
>   RefTeX will scan these files instead.  Intended for using ‘reftex-citation’
>   in non-LaTeX files.  The files will be searched along the BIBINPUTS or TEXBIB
>   path.
>
>   You can customize this variable.
> #+END_EXAMPLE
>
> My system
> #+BEGIN_SRC emacs-lisp
>   (concat
>    (emacs-version) "\n"
>    (org-version) "\n"
>    (org-ref-version))
> #+END_SRC
>
> #+RESULTS:
> : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
> :  of 2018-07-05
> : 9.1.14
> : org-ref: Version 1.1.1
>
> -------------------------------------------------
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!  15GB disk! No bandwidth
> quotas!
> Commercial and Bulk Mail Options!


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibtex setup .dir-locals.el
  2018-10-31 15:27 ` John Kitchin
@ 2018-11-01 17:42   ` edgar
  2018-11-01 17:48     ` John Kitchin
  0 siblings, 1 reply; 4+ messages in thread
From: edgar @ 2018-11-01 17:42 UTC (permalink / raw)
  To: John Kitchin; +Cc: John Kitchin, emacs-orgmode

On 2018-10-31 15:27, John Kitchin wrote:
> You do have to close the org-file, and then reopen it after you make
> that file, and when I do that I am prompted whether to apply or ignore
> the settings.

Oh! may be I need to re-open the file. I tried with reloading dir-local 
variables and reverting the buffer.

> It might be simpler to just use a bibliography link in the file though:
> 
> bibliography:References.bib

Yes, I used to have \addbibresource{References.bib}, but I wanted to 
have the whole configuration on the .dir-locals.el file. I guess that 
bibliography:References.bib is more general.

Thank you very much, Dr. Kitchin!

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bibtex setup .dir-locals.el
  2018-11-01 17:42   ` edgar
@ 2018-11-01 17:48     ` John Kitchin
  0 siblings, 0 replies; 4+ messages in thread
From: John Kitchin @ 2018-11-01 17:48 UTC (permalink / raw)
  To: edgar; +Cc: org-mode-email

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

the bibliography link is just for bibtex. If you are using biblatex/biber I
think you would put that in a latex header, e.g.

#+latex_header: \addbibresource{References.bib}

Both of these are file-local though, and won't affect other files in that
directory.

John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Thu, Nov 1, 2018 at 1:43 PM <edgar@openmail.cc> wrote:

> On 2018-10-31 15:27, John Kitchin wrote:
> > You do have to close the org-file, and then reopen it after you make
> > that file, and when I do that I am prompted whether to apply or ignore
> > the settings.
>
> Oh! may be I need to re-open the file. I tried with reloading dir-local
> variables and reverting the buffer.
>
> > It might be simpler to just use a bibliography link in the file though:
> >
> > bibliography:References.bib
>
> Yes, I used to have \addbibresource{References.bib}, but I wanted to
> have the whole configuration on the .dir-locals.el file. I guess that
> bibliography:References.bib is more general.
>
> Thank you very much, Dr. Kitchin!
>
> -------------------------------------------------
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of
> the NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!
> 15GB disk! No bandwidth quotas!
> Commercial and Bulk Mail Options!
>

[-- Attachment #2: Type: text/html, Size: 2131 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-01 17:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-28 22:19 bibtex setup .dir-locals.el edgar
2018-10-31 15:27 ` John Kitchin
2018-11-01 17:42   ` edgar
2018-11-01 17:48     ` John Kitchin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).