From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Joseph Vidal-Rosset <joseph@vidal-rosset.net>
Cc: org-mode-email <emacs-orgmode@gnu.org>,
"András Simonyi" <andras.simonyi@gmail.com>
Subject: Re: citeproc-org and org-ref 3
Date: Wed, 01 Dec 2021 17:16:43 -0500 [thread overview]
Message-ID: <m2zgpkotoh.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <573b6fad-e445-3f53-9cd5-43d5b7f86904@vidal-rosset.net>
Joseph Vidal-Rosset <joseph@vidal-rosset.net> writes:
> Dear Andras,
>
> You are very probably right. I will have a look on this entry in my
> default bibliography file.
>
> The code
>
> (let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
> (org-open-file (org-html-export-to-html)))
>
> put in .emacs.d/personal/preload/myorgexport.el
>
This code should not go in your init file. It is executed each time, and
not what you want. I usually put it a src block at the end in a section
tagged noexport and run it from there.
Alternatively, if this is the only preprocessing you do, I think you can
do C-c C-e rh to export to html (this runs the org-ref html exporter.
Finally, if you really want something in your init file it should be
like this:
(defun my-html ()
(interactive)
(let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
(org-open-file (org-html-export-to-html))))
and then later you run it with M-x my-html
> provokes the request of opening a html file, when emacs --daemon is
> started; therefore I conclude that it should not be used as I did...
>
> Anyway, every tentative to export in a bibliography in html fails at
> the moment, even with a new bibliography file... :(
See of the one at
https://github.com/jkitchin/org-ref/blob/master/examples/basic-csl.org
works. The bib file is in
https://github.com/jkitchin/org-ref/blob/master/org-ref.bib.
>
> Best wishes,
>
> Le 01/12/2021 à 17:33, András Simonyi a écrit :
>> Dear Joseph,
>>
>> based on the error message there seems to be a problem with the
>> 'curley-nil-on-bennet-spinoz' bibliography entry, is it possible that
>> it contains a 'year = nil' row? If yes then I don't think that is
>> well-formed, at least citeproc-el cannot currently parse it. Anyhow,
>> apparently I need to improve/add citeproc-el error messages about
>> bib(la)tex parsing, because several parsing problems have surfaced
>> lately and the current error messages aren't helpful at all.
>>
>> best wishes,
>> András
>>
>> On Wed, 1 Dec 2021 at 16:50, Joseph Vidal-Rosset
>> <joseph@vidal-rosset.net> wrote:
>>>
>>> Dear John,
>>>
>>> I must say that to export references in html with org-ref 3, I meet a
>>> lot of problems (with LaTeX, it's fine).
>>>
>>> I am using prelude emacs and GNU Emacs 29.0.50 .
>>>
>>> Starting emacs --daemon, the code
>>>
>>> (let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
>>> (org-open-file (org-html-export-to-html)))
>>>
>>> in my setup provokes this unwanting effect:
>>>
>>> [Prelude] Loading personal configuration files in
>>> /home/joseph/.emacs.d/personal/preload...
>>> Loading /home/joseph/.emacs.d/personal/preload/myorgexport.el (source)...
>>> Output file:
>>>
>>> and with Enter :
>>>
>>> [Prelude] Loading personal configuration files in
>>> /home/joseph/.emacs.d/personal/preload...
>>> Loading /home/joseph/.emacs.d/personal/preload/myorgexport.el (source)...
>>> Output file:
>>> Warning (initialization): An error occurred while loading
>>> ‘/home/joseph/.emacs.d/init.el’:
>>>
>>> Wrong type argument: stringp, nil
>>>
>>> To ensure normal operation, you should investigate and remove the
>>> cause of the error in your initialization file. Start Emacs with
>>> the ‘--debug-init’ option to view a complete error backtrace. Disable
>>> showing Disable logging
>>> Starting Emacs daemon.
>>>
>>> With --debug-init, I get:
>>>
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>> string-to-number(nil)
>>> citeproc-bt--to-csl-date("nil" nil)
>>> citeproc-blt-entry-to-csl((("Url" .
>>> "http://dx.doi.org/10.1163/9789004246638_005") ("Doi" .
>>> "10.1163/9789004246638_005") ("Date_added" . "Mon May 16 19:09:37 2016")
>>> ("Booktitle" . "Spinoza: Issues and Directions") ("Series" . "Spinoza:
>>> Issues and Directions") ("Year" . "nil") ("Publisher" . "Brill Academic
>>> Publishers") ("Pages" . "39-52") ("Author" . "Edwin Curley") ("Title" .
>>> "ON BENNETTS SPINOZA: THE ISSUE OF TELEOLOGY") ("=type=" . "InBook")
>>> ("=key=" . "curley-nil-on-bennet-spinoz")) nil nil)
>>> #f(compiled-function (key entry) #<bytecode
>>> -0x7fcb46b5c8e80b3>)("curley-nil-on-bennet-spinoz" (("Url" .
>>> "http://dx.doi.org/10.1163/9789004246638_005") ("Doi" .
>>> "10.1163/9789004246638_005") ("Date_added" . "Mon May 16 19:09:37 2016")
>>> ("Booktitle" . "Spinoza: Issues and Directions") ("Series" . "Spinoza:
>>> Issues and Directions") ("Year" . "nil") ("Publisher" . "Brill Academic
>>> Publishers") ("Pages" . "39-52") ("Author" . "Edwin Curley") ("Title" .
>>> "ON BENNETTS SPINOZA: THE ISSUE OF TELEOLOGY") ("=type=" . "InBook")
>>> ("=key=" . "curley-nil-on-bennet-spinoz")))
>>> maphash(#f(compiled-function (key entry) #<bytecode
>>> -0x7fcb46b5c8e80b3>) #<hash-table equal 665/730 0x156f8acb26b7>)
>>> citeproc-hash-itemgetter-from-any(("~/Dropbox/Orgzly/reforg.bib"))
>>> org-ref-process-buffer(html)
>>> org-ref-csl-preprocess-buffer(html)
>>> run-hook-with-args(org-ref-csl-preprocess-buffer html)
>>> org-export-as(html nil nil nil (:output-file "~/test.html"))
>>> org-export-to-file(html "~/test.html" nil nil nil nil nil)
>>> org-html-export-to-html()
>>> (org-open-file (org-html-export-to-html))
>>> (let ((org-export-before-parsing-hook
>>> '(org-ref-csl-preprocess-buffer))) (org-open-file
>>> (org-html-export-to-html)))
>>> eval-buffer(#<buffer *load*-634240> nil
>>> "/home/joseph/.emacs.d/personal/preload/myorgexport..." nil t) ;
>>> Reading at buffer position 3196
>>>
>>> load-with-code-conversion("/home/joseph/.emacs.d/personal/preload/myorgexport..."
>>> "/home/joseph/.emacs.d/personal/preload/myorgexport..." nil nil)
>>> load("/home/joseph/.emacs.d/personal/preload/myorgexport...")
>>> mapc(load ("/home/joseph/.emacs.d/personal/preload/myorgexport..."))
>>> (progn (message "[Prelude] Loading personal configuration files in
>>> ..." prelude-personal-preload-dir) (mapc 'load (directory-files
>>> prelude-personal-preload-dir 't "^[^#.].*el$")))
>>> (if (file-exists-p prelude-personal-preload-dir) (progn (message
>>> "[Prelude] Loading personal configuration files in ..."
>>> prelude-personal-preload-dir) (mapc 'load (directory-files
>>> prelude-personal-preload-dir 't "^[^#.].*el$"))))
>>> eval-buffer(#<buffer *load*> nil "/home/joseph/.emacs.d/init.el" nil
>>> t) ; Reading at buffer position 4489
>>> load-with-code-conversion("/home/joseph/.emacs.d/init.el"
>>> "/home/joseph/.emacs.d/init.el" t t)
>>> load("/home/joseph/.emacs.d/init" noerror nomessage)
>>> startup--load-user-init-file(#f(compiled-function () #<bytecode
>>> 0xec639179d6199fa>) #f(compiled-function () #<bytecode
>>> -0x1f3c686ddc0dc635>) t)
>>> command-line()
>>> normal-top-level()
>>>
>>> It's too complicated for me.
>>> org-ref version 2 with citeproc-org by Andras worked well, but now I am
>>> afraid that to downgrade to org-ref 2 is not necessarily the best
>>> solution. I am lost.
>>>
>>> Best wishes, and thanks for your help.
>>>
>>> Jo.
>>>
>>>
>>> Le 30/11/2021 à 18:31, John Kitchin a écrit :
>>>> See https://www.youtube.com/watch?v=rRR-5NSpKyE
>>>> <https://www.youtube.com/watch?v=rRR-5NSpKyE> for an overview of what to
>>>> do. basically you need a csl file that provides the style you want, and
>>>> you specify it like this in the org file or in default settings. You may
>>>> also need a locale file if you are not blogging in english.
>>>>
>>>> #+csl-style: apa-5th-edition.csl
>>>>
>>>> #+csl-locale: en-US
>>>>
>>>>
>>>> You can find a basic example org file for html export with CSL at
>>>> https://github.com/jkitchin/org-ref/blob/master/examples/basic-csl.org
>>>> <https://github.com/jkitchin/org-ref/blob/master/examples/basic-csl.org>
>>>>
>>>> Here is a minimal way to export your blog file I suppose.
>>>>
>>>> (let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
>>>> (org-open-file (org-html-export-to-html)))
>>>>
>>>>
>>>> John
>>>>
>>>> -----------------------------------
>>>> Professor John Kitchin (he/him/his)
>>>> Doherty Hall A207F
>>>> Department of Chemical Engineering
>>>> Carnegie Mellon University
>>>> Pittsburgh, PA 15213
>>>> 412-268-7803
>>>> @johnkitchin
>>>> http://kitchingroup.cheme.cmu.edu <http://kitchingroup.cheme.cmu.edu>
>>>>
>>>>
>>>>
>>>> On Tue, Nov 30, 2021 at 12:16 PM András Simonyi
>>>> <andras.simonyi@gmail.com <mailto:andras.simonyi@gmail.com>> wrote:
>>>>
>>>> Dear Joseph,
>>>>
>>>> unfortunately, my note on the `citeproc-org` page has become kind of
>>>> misleading and has to be updated because org-ref didn't switch to the
>>>> new org-cite citation syntax after all, although this was the plan for
>>>> a while. I think if you wish to use org-ref 3 then you should simply
>>>> remove citeproc-org entirely -- if I understand correctly the latest
>>>> version of org-ref supports the old syntax as well and is capable of
>>>> CSL-based export (among others) on its own.
>>>>
>>>> best regards,
>>>> András
>>>>
>>>> On Tue, 30 Nov 2021 at 18:00, Joseph Vidal-Rosset
>>>> <joseph@vidal-rosset.net <mailto:joseph@vidal-rosset.net>> wrote:
>>>> >
>>>> >
>>>> > Dear John, and dear Andras,
>>>> >
>>>> > Having updated my org-ref to the last version, I see that the html
>>>> > export of bibliography does not work any longer for my blog.
>>>> >
>>>> > Reading Andras's note here
>>>> > https://github.com/andras-simonyi/citeproc-org
>>>> <https://github.com/andras-simonyi/citeproc-org>
>>>> > I confess that I am lost.
>>>> >
>>>> > What have I to do to not waste too much time with this problem?
>>>> >
>>>> > Best wishes,
>>>> >
>>>> > Jo.
>>>> >
>>>>
>>>
--
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
Pronouns: he/him/his
next prev parent reply other threads:[~2021-12-01 22:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-30 17:00 citeproc-org and org-ref 3 Joseph Vidal-Rosset
2021-11-30 17:16 ` András Simonyi
2021-11-30 17:24 ` Joseph Vidal-Rosset
2021-11-30 17:31 ` John Kitchin
2021-11-30 18:15 ` Joseph Vidal-Rosset
2021-12-01 15:49 ` Joseph Vidal-Rosset
2021-12-01 16:33 ` András Simonyi
2021-12-01 16:48 ` Joseph Vidal-Rosset
2021-12-01 22:16 ` John Kitchin [this message]
2021-12-02 13:17 ` Joseph Vidal-Rosset
2021-12-02 15:56 ` Joseph Vidal-Rosset
2021-12-02 17:35 ` John Kitchin
2021-12-03 8:04 ` Joseph Vidal-Rosset
2021-12-03 15:24 ` John Kitchin
2021-12-03 16:48 ` Joseph Vidal-Rosset
2021-12-03 17:13 ` John Kitchin
2021-12-04 14:23 ` Max Nikulin
2021-12-04 14:45 ` Joseph Vidal-Rosset
2021-12-04 15:07 ` John Kitchin
2021-12-04 15:31 ` Joseph Vidal-Rosset
2021-12-01 22:08 ` John Kitchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2zgpkotoh.fsf@andrew.cmu.edu \
--to=jkitchin@andrew.cmu.edu \
--cc=andras.simonyi@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=joseph@vidal-rosset.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.