Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-08-07 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> alain.coch...@unistra.fr writes on Sat  9 Jul 2022 08:10:
>
>  > the examples I found on this mailing list did not work for me).
>
> I think I now understand why this was so: because latexmk was not
> installed on my system.  In this case the docstring of
> org-latex-pdf-process says that
>
>Its value is ("%latex -interaction nonstopmode -output-directory %o
>%f" "%latex -interaction nonstopmode -output-directory %o %f"
>"%latex -interaction nonstopmode -output-directory %o %f")
>
> (which does not include bibtex, hence the problem I had) while, if
> latexmk is installed,

Can we improve the default value to have a BibTeX call?

Also, we may add a section describing recommended software to be
installed for LaTeX export (like latexmk).

WDYT?

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92



Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-12 Thread Alain . Cochard
alain.coch...@unistra.fr writes on Sat  9 Jul 2022 08:10:

 > the examples I found on this mailing list did not work for me).

I think I now understand why this was so: because latexmk was not
installed on my system.  In this case the docstring of
org-latex-pdf-process says that

   Its value is ("%latex -interaction nonstopmode -output-directory %o
   %f" "%latex -interaction nonstopmode -output-directory %o %f"
   "%latex -interaction nonstopmode -output-directory %o %f")

(which does not include bibtex, hence the problem I had) while, if
latexmk is installed,

   Its value is ("latexmk -f -pdf -%latex -interaction=nonstopmode
   -output-directory=%o %f")

In other words, in the minimal example I provided earlier in the
thread, if latexmk is installed I only need (require 'oc-natbib) in
the emacs init file, in agreement with what others have proposed.

But now I wonder if this excerpt of the docstring:

   Consider a smart LaTeX compiler such as ‘texi2dvi’ or ‘latexmk’,
   which calls the "correct" combinations of auxiliary programs.

is appropriate.  How understand it when latexmk _is_ installed?  But
even when latexmk is not installed, I don't find the sentence helpful.
In fact, I had read this part but, as I did not know what latexmk was,
I did not know what to do with it.  Perhaps I would have understood if
it had been explicit that the value of org-latex-pdf-process depends
on the existence of latexmk.  (And I still don't understand the
relevance of the reference to texi2dvi.)


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]




Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-12 Thread András Simonyi
On Tue, 12 Jul 2022 at 13:36, John Kitchin  wrote:

> Maybe it is still needed so the tooltip looks nice.

currently, oc-basic.el contains the single activation (fontification)
processor (called "basic") shipped with Org, the other oc-*.el files
provide only export processors.

best wishes,

András

>> OTOH, a small correction:  as far as I can see, oc-natbib and
>> oc-bibtex (and oc-biblatex) do not parse bib(la)tex files at all,
>> since they simply transform Org citation and bibliography commands to
>> their LaTeX equivalent.
>>
>> best wishes,
>> András
>>
> --
> John
>
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> https://kitchingroup.cheme.cmu.edu
> https://pointbreezepubs.gumroad.com/ pycse bookstore
>



Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-12 Thread John Kitchin
Maybe it is still needed so the tooltip looks nice.

On Tue, Jul 12, 2022 at 7:15 AM András Simonyi 
wrote:

> Dear All,
>
> On Sun, 10 Jul 2022 at 09:17, Ihor Radchenko  wrote:
>
> > AFAIU, oc-natbib/oc-bibtex also do not support @string because they also
> > rely upon the built-in Emacs parser for bib files.
>
> > I have submitted a bug report to Emacs devs [1]. Hopefully it can be
> > fixed on Emacs side without a need to switch the bibtex parser.
>
> Thanks Ihor for submitting the bug report, I think it will be useful
> for Emacs to contain a built-in bibtex parser with proper @string
> support.
> OTOH, a small correction:  as far as I can see, oc-natbib and
> oc-bibtex (and oc-biblatex) do not parse bib(la)tex files at all,
> since they simply transform Org citation and bibliography commands to
> their LaTeX equivalent.
>
> best wishes,
> András
>
> --
John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
https://kitchingroup.cheme.cmu.edu
https://pointbreezepubs.gumroad.com/ pycse bookstore


Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-12 Thread András Simonyi
Dear All,

On Sun, 10 Jul 2022 at 09:17, Ihor Radchenko  wrote:

> AFAIU, oc-natbib/oc-bibtex also do not support @string because they also
> rely upon the built-in Emacs parser for bib files.

> I have submitted a bug report to Emacs devs [1]. Hopefully it can be
> fixed on Emacs side without a need to switch the bibtex parser.

Thanks Ihor for submitting the bug report, I think it will be useful
for Emacs to contain a built-in bibtex parser with proper @string
support.
OTOH, a small correction:  as far as I can see, oc-natbib and
oc-bibtex (and oc-biblatex) do not parse bib(la)tex files at all,
since they simply transform Org citation and bibliography commands to
their LaTeX equivalent.

best wishes,
András



Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-10 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

> Is someone using natbib/bibtex (say) expected to never ever use
> 'basic'? (I don't know.) If so, perhaps there is indeed no need to
> implement the feature.  Otherwise, it seems to me that not
> implementing it amounts to having to give up on @string altogether.

AFAIU, oc-natbib/oc-bibtex also do not support @string because they also
rely upon the built-in Emacs parser for bib files.

I have submitted a bug report to Emacs devs [1]. Hopefully it can be
fixed on Emacs side without a need to switch the bibtex parser.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56475

Best,
Ihor



Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-09 Thread Bruce D'Arcus
On Sat, Jul 9, 2022 at 2:10 AM  wrote:

> I take the opportunity to say that I think that the simple
> self-contained example
>
>#+bibliography: references.bib
>[cite:@key]
>#+print_bibliography:
>
> should be part of the manual, especially since the
> 2021-07-31-citations post does not seem to be referred to in the
> manual any more (I have org version 9.5.4).

The terseness of this section of the manual is a known problem.

I'll try to find time to do a patch to include your suggestions, which
make sense.

Bruce



Re: @string abbreviation in bib file not honored in (basic) org-cite [and a minimal working example with natbib]

2022-07-09 Thread Alain . Cochard
Bruce D'Arcus writes on Fri  8 Jul 2022 08:05:
 > On Fri, Jul 8, 2022 at 7:25 AM  wrote:
 > 
 > > As I do not know which of these alternatives
 > >
 > >- it is normal, this feature should not be there,
 > >- it is an oversight,
 > >- this feature is not implemented yet,
 > 
 > I believe this is the answer, and it's arguable (I have no opinion,
 > and could see reasonable arguments either way) whether a "basic"
 > processor should support it?

Is someone using natbib/bibtex (say) expected to never ever use
'basic'? (I don't know.) If so, perhaps there is indeed no need to
implement the feature.  Otherwise, it seems to me that not
implementing it amounts to having to give up on @string altogether.

 > The parsebib library, which most third party packages use (for
 > org-cite, there's my citar), does support this feature.

Thank you.  I guess that if it would have be mentioned I would have
silently accepted it.

Some context: although I have been using org-mode for more than 5
years, I had always delayed the "bibliography step", namely, learn
org-ref.  But wait, now there is org-cite, so which one should I
learn?  Spending days (literally) reading a lot of material, trying to
digest the terminology (it is a real mess).  OK, org-cite seems to be
the future, so I'll give it a try.  First elementary test -> failure
-- so frustrating.  I conclude that the project is not mature enough
(at least the documentation), and I give up.  It is only because I
could not have org-ref work either that I came back to org-cite.

I take the opportunity to say that I think that the simple
self-contained example

   #+bibliography: references.bib
   [cite:@key]
   #+print_bibliography:

should be part of the manual, especially since the
2021-07-31-citations post does not seem to be referred to in the
manual any more (I have org version 9.5.4).

Frankly, the manual was cryptic to me at the beginning (and still is,
to a significant extent -- granted, I am a very slow learner), and I
don't know how much time it would have taken me to come up with this
simple example.

Similar minimal examples with natbib, biblatex, etc., together with
the required instructions in the emacs init file, would also be most
welcome (I spent a day to have one work for me with natbib...  I
include it below, in case it could be useful to someone else; the
examples I found on this mailing list did not work for me).  I
understand that it is not possible to provide an example for each
possible combination of the parameters, but a few ones are perhaps a
reasonable wish?  Not only a working example helps to get started, but
it also helps a lot to understand the documentation in return.
Furthermore, it gets much easier to ask for help: "I did this (or a
slight modification of it), it does not work, please help".

Many thanks and congratulations for org-cite.

Regards.

-
my setup for org-cite with natbib
-

org file:
-
#+cite_export: natbib plainnat
#+bibliography: cite.bib
[cite:@chouet88] 
#+print_bibliography:

NB: 'plainnat' above refers to file
/usr/share/texlive/texmf-dist/bibtex/bst/natbib/plainnat.bst, which,
on my Fedora 34 GNU/Linux distribution, is part of the
texlive-natbib-svn20668.8.31b-39.fc34.noarch rpm package.

cite.bib file:
--
@string{jgr="J. Geophys. Res."}
@ARTICLE{chouet88,
journal=jgr,
author={Chouet, B.}, title={Resonance of a fluid-driven crack: [...]},
year={1988}, volume={93}, number={B5}, pages={4375-4400}
}

emacs init file:

(require 'oc-natbib)
(setq org-latex-pdf-process '("pdflatex -interaction nonstopmode
-output-directory %o %f" "bibtex %b" "pdflatex -interaction
nonstopmode -output-directory %o %f" "pdflatex -interaction
nonstopmode -output-directory %o %f" ) )

NB: It does not work for me without '-interaction nonstopmode' (I have
emacs 27.2 and org 9.5.4.).

Then 'C-c C-e l o' from the org file to display the pdf, which shows:

Contents
[Chouet, 1988]
References
B. Chouet. Resonance of a fluid-driven crack: [...]. J. Geophys. Res.,
93(B5): 4375–4400, 1988.

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France | [ slot available for rent ]