Re: [PATCH] Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-11-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Ihor Radchenko  writes:
>
>> Note that apart from the problem on Emacs side, there appears to be a
>> problem with org-cite-basic-export-bibliography.
>>
>> org-cite-basic-export-bibliography uses org-cite-basic--print-entry,
>> which fails to print keys, which are not in .bib files. As a result,
>> #+print_bibliography: appears to fail all the time when the document
>> contains invalid cite keys.
>>
>> I consider this as a bug. At least org-cite-basic-export-bibliography
>> could provide a more useful error message. Or maybe even skip the
>> invalid keys. Or, similar to LaTeX, print ???. I am not sure which way
>> will be more canonical according to general oc.el design.
>
> I am suggesting to merge the attached patch.
> It will simply skip keys that are not in the bibliography when printing
> it.

Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=26a2811b06a5916a66d101b10238552db12ff6e7

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-10-22 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Note that apart from the problem on Emacs side, there appears to be a
> problem with org-cite-basic-export-bibliography.
>
> org-cite-basic-export-bibliography uses org-cite-basic--print-entry,
> which fails to print keys, which are not in .bib files. As a result,
> #+print_bibliography: appears to fail all the time when the document
> contains invalid cite keys.
>
> I consider this as a bug. At least org-cite-basic-export-bibliography
> could provide a more useful error message. Or maybe even skip the
> invalid keys. Or, similar to LaTeX, print ???. I am not sure which way
> will be more canonical according to general oc.el design.

I am suggesting to merge the attached patch.
It will simply skip keys that are not in the bibliography when printing
it.

WDYT?

>From 943b070b7e0f2b6d0bed261f831589fb918c214f Mon Sep 17 00:00:00 2001
Message-Id: <943b070b7e0f2b6d0bed261f831589fb918c214f.1666420664.git.yanta...@posteo.net>
From: Ihor Radchenko 
Date: Sat, 22 Oct 2022 14:32:17 +0800
Subject: [PATCH] org-cite-basic-export-bibliography: Skip missing bibliography
 keys

* lisp/oc-basic.el (org-cite-basic-export-bibliography): Ignore
citation keys that are not present in bibliography.  Previously, an
error was thrown.
---
 lisp/oc-basic.el | 20 +++-
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index f1b7c8263..3ef7a37e3 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -713,15 +713,17 @@ (defun org-cite-basic-export-bibliography (keys _files style _props backend info
 style, as a string.  BACKEND is the export back-end, as a symbol.  INFO is the
 export state, as a property list."
   (mapconcat
-   (lambda (k)
- (let ((entry (org-cite-basic--get-entry k info)))
-   (org-export-data
-(org-cite-make-paragraph
- (and (org-export-derived-backend-p backend 'latex)
-  (org-export-raw-string "\\noindent\n"))
- (org-cite-basic--print-entry entry style info))
-info)))
-   (org-cite-basic--sort-keys keys info)
+   (lambda (entry)
+ (org-export-data
+  (org-cite-make-paragraph
+   (and (org-export-derived-backend-p backend 'latex)
+(org-export-raw-string "\\noindent\n"))
+   (org-cite-basic--print-entry entry style info))
+  info))
+   (delq nil
+ (mapcar
+  (lambda (k) (org-cite-basic--get-entry k info))
+  (org-cite-basic--sort-keys keys info)))
"\n"))
 
 
-- 
2.35.1


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-05-11 Thread Ihor Radchenko
Kaushal Modi  writes:

> On Mon, May 9, 2022 at 5:44 PM Kaushal Modi  wrote:
>>
>> I have now sent this to Emacs bug tracking:
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342
>
> Thanks for the debug[1] Ihor!
>
> This issue was quickly fixed on Emacs master in
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d221c02fa1db17e1275687f0bbce4ff1499119a1.
>
> [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342#11

Thanks for reporting back!

Note that apart from the problem on Emacs side, there appears to be a
problem with org-cite-basic-export-bibliography.

org-cite-basic-export-bibliography uses org-cite-basic--print-entry,
which fails to print keys, which are not in .bib files. As a result,
#+print_bibliography: appears to fail all the time when the document
contains invalid cite keys.

I consider this as a bug. At least org-cite-basic-export-bibliography
could provide a more useful error message. Or maybe even skip the
invalid keys. Or, similar to LaTeX, print ???. I am not sure which way
will be more canonical according to general oc.el design.

Best,
Ihor



Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-05-10 Thread Kaushal Modi
On Mon, May 9, 2022 at 5:44 PM Kaushal Modi  wrote:
>
> I have now sent this to Emacs bug tracking:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342

Thanks for the debug[1] Ihor!

This issue was quickly fixed on Emacs master in
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d221c02fa1db17e1275687f0bbce4ff1499119a1.

[1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342#11



Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-05-09 Thread Kaushal Modi
I have now sent this to Emacs bug tracking:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55342



Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-05-09 Thread Kaushal Modi
On Mon, May 9, 2022 at 10:21 AM Kaushal Modi  wrote:
> Can someone using emacs
> built from master branch confirm that they see this same error when
> `org-cite-process-bibliography` is called? It should be reproducible
> without using ox-hugo too.


Alright I was able to confirm this possibly upstream bug on Emacs 29
after building it from source.

Here's a minimal test recipe:

=
#+title: "Wrong value for ENTRY-OR-KEY: nil" error on Emacs 29

#+bibliography: test.bib

#+begin_src bib :tangle test.bib
@article{Foo,
 author={Bar},
 journal={Zoo},
 title={Foo by Bar},
 year={2021}}
#+end_src

[cite:@Foo]

#+print_bibliography:

Evaluate the below code block.

#+begin_src emacs-lisp :results none
(org-babel-tangle)
(org-export-as 'ascii)
#+end_src
=

1. Open the above file in Emacs.
2. Run C-c C-c in that emacs-lisp code block

On Emacs 28: No error
On Emacs 29: org-cite-basic--get-field: Wrong value for ENTRY-OR-KEY: nil



oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub]

2022-05-09 Thread Kaushal Modi
On Thu, Nov 25, 2021 at 6:21 AM juh  wrote:
> With cite_export: basic I get
>
> Wrong value for ENTRY-OR-KEY: nil

Hello,

I saw the ox-hugo CI fail with emacs master (29.0.50) over the past
few days with this backtrace, but this error is probably not related
to ox-hugo, and I need help confirming if that's the case.


=

  signal(error ("Wrong value for ENTRY-OR-KEY: nil"))
  error("Wrong value for ENTRY-OR-KEY: %S" nil)
  org-cite-basic--get-field(author nil (:export-options (subtree)
:back-end #s(org-export-backend :name hugo :parent blackfriday
:transcoders ((code . org-hugo-kbd-tags-maybe) (example-block .
org-hugo-example-block) (export-block . org-hugo-export-block)
(export-snippet . org-hugo-export-snippet) (headline .
org-hugo-heading) (inner-template . org-hugo-inner-template)
(inline-src-block . org-hugo-inline-src-block) (keyword .
org-hugo-keyword) (link . org-hugo-link) (paragraph .
org-hugo-paragraph) (src-block . org-hugo-src-block) (special-block .
org-hugo-special-block)) :options ((:with-toc nil "toc"
org-hugo-export-with-toc) (:section-numbers nil "num"
org-hugo-export-with-section-numbers) (:author "AUTHOR" nil
user-full-name newline) (:creator "CREATOR" nil
org-hugo-export-creator-string) (:with-smart-quotes nil "'" nil)
(:with-special-strings nil "-" nil) (:with-sub-superscript nil "^"
...) (:hugo-with-locale "HUGO_WITH_LOCALE" nil nil)
(:hugo-front-matter-format "HUGO_FRONT_MATTER_FORMAT" nil
org-hugo-front-matter-format) (:hugo-level-offset "HUGO_LEVEL_OFFSET"
nil "1") (:hugo-preserve-filling "HUGO_PRESERVE_FILLING" nil
org-hugo-preserve-filling) (:hugo-delete-trailing-ws
"HUGO_DELETE_TRAILING_WS" nil org-hugo-delete-trailing-ws)
(:hugo-section "HUGO_SECTION" nil org-hugo-section) (:hugo-bundle
"HUGO_BUNDLE" nil nil) (:hugo-base-dir "HUGO_BASE_DIR" nil
org-hugo-base-dir) (:hugo-goldmark "HUGO_GOLDMARK" nil
org-hugo-goldmark) (:hugo-code-fence "HUGO_CODE_FENCE" nil t)
(:hugo-use-code-for-kbd "HUGO_USE_CODE_FOR_KBD" nil
org-hugo-use-code-for-kbd) (:hugo-prefer-hyphen-in-tags
"HUGO_PREFER_HYPHEN_IN_TAGS" nil org-hugo-prefer-hyphen-in-tags)
(:hugo-allow-spaces-in-tags "HUGO_ALLOW_SPACES_IN_TAGS" nil
org-hugo-allow-spaces-in-tags) (:hugo-auto-set-lastmod
"HUGO_AUTO_SET_LASTMOD" nil org-hugo-auto-set-lastmod)
(:hugo-custom-front-matter "HUGO_CUSTOM_FRONT_MATTER" nil nil space)
(:hugo-blackfriday "HUGO_BLACKFRIDAY" nil nil space)
(:hugo-front-matter-key-replace "HUGO_FRONT_MATTER_KEY_REPLACE" nil
nil space) (:hugo-date-format "HUGO_DATE_FORMAT" nil
org-hugo-date-format) (:hugo-paired-shortcodes
"HUGO_PAIRED_SHORTCODES" nil org-hugo-paired-shortcodes space)
(:hugo-pandoc-citations "HUGO_PANDOC_CITATIONS" nil nil)
(:bibliography "BIBLIOGRAPHY" nil nil newline) (:html-container
"HTML_CONTAINER" nil org-hugo-container-element)
(:html-container-class "HTML_CONTAINER_CLASS" nil "") (:hugo-aliases
"HUGO_ALIASES" nil nil space) (:hugo-audio "HUGO_AUDIO" nil nil) ...)
:filters ((:filter-body . org-hugo-body-filter)) :blocks nil :menu (72
"Export to Hugo-compatible Markdo..." (... ... ... ... ... ...)))
:translate-alist ((code . org-hugo-kbd-tags-maybe) (example-block .
org-hugo-example-block) (export-block . org-hugo-export-block)
(export-snippet . org-hugo-export-snippet) (headline .
org-hugo-heading) (inner-template . org-hugo-inner-template)
(inline-src-block . org-hugo-inline-src-block) (keyword .
org-hugo-keyword) (link . org-hugo-link) (paragraph .
org-hugo-paragraph) (src-block . org-hugo-src-block) (special-block .
org-hugo-special-block) (center-block . org-blackfriday-center-block)
(example-block . org-blackfriday-example-block) (fixed-width .
org-blackfriday-fixed-width) (footnote-reference .
org-blackfriday-footnote-reference) (inner-template .
org-blackfriday-inner-template) (italic . org-blackfriday-italic)
(item . org-blackfriday-item) (latex-environment .
org-blackfriday-latex-environment) (latex-fragment .
org-blackfriday-latex-fragment) (line-break . org-html-line-break)
(plain-list . org-blackfriday-plain-list) (plain-text .
org-blackfriday-plain-text) (quote-block .
org-blackfriday-quote-block) (radio-target .
org-blackfriday-radio-target) (special-block .
org-blackfriday-special-block) (src-block . org-blackfriday-src-block)
(strike-through . org-blackfriday-strike-through) (table-cell .
org-blackfriday-table-cell) (table-row . org-blackfriday-table-row)
(table . org-blackfriday-table) ...) :exported-data # :input-buffer "*Ox-hugo Pre-processed all-posts..."
:input-file "/home/runner/work/ox-hugo/ox-hug..." :with-toc nil
:section-numbers nil :author "" :creator "Emacs + Org mode + ox-hugo"
:with-smart-quotes nil :with-special-strings nil :with-sub-superscript
{} :hugo-with-locale nil :hugo-front-matter-format "toml"
:hugo-level-offset "1" ...))
  org-cite-basic--print-entry(nil nil (:export-options (subtree)
:back-end #s(org-export-backend :name hugo :parent blackfriday
:transcoders ((code . org-hugo-kbd-tags-maybe) (example-block .
org-hugo-example-block) (export-block . 

Re: Bibliographies on export with ox-context and ox-epub

2022-01-12 Thread John Kitchin
These two packages can co-exist. This message means do not mix citations
from both in a single org file; use one or the other.

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



On Wed, Jan 12, 2022 at 11:42 AM juh  wrote:

> On 12.01.22 15:53, Nicolas Goaziou wrote:
> > Note that Org Cite and Org Ref are, unfortunately, incompatible
> > projects. Org Cite defines citations as a new kind of object, whereas
> > Org Ref extends links to create citations. In short, you cannot mix
> > both.
>
> Do I have to erase every trace of Org Ref in my setup?
>
> juh
>
>


Re: Bibliographies on export with ox-context and ox-epub

2022-01-12 Thread Bruce D'Arcus
On Wed, Jan 12, 2022 at 11:42 AM juh  wrote:
>
> On 12.01.22 15:53, Nicolas Goaziou wrote:
> > Note that Org Cite and Org Ref are, unfortunately, incompatible
> > projects. Org Cite defines citations as a new kind of object, whereas
> > Org Ref extends links to create citations. In short, you cannot mix
> > both.
>
> Do I have to erase every trace of Org Ref in my setup?

No, you don't.

You just can't mix the two (well, I guess now three) types of
citations in the same document and expect things to work correctly.

Bruce



Re: Bibliographies on export with ox-context and ox-epub

2022-01-12 Thread juh

On 12.01.22 15:53, Nicolas Goaziou wrote:

Note that Org Cite and Org Ref are, unfortunately, incompatible
projects. Org Cite defines citations as a new kind of object, whereas
Org Ref extends links to create citations. In short, you cannot mix
both.


Do I have to erase every trace of Org Ref in my setup?

juh



Re: Bibliographies on export with ox-context and ox-epub

2022-01-12 Thread juh

On 12.01.22 15:53, Nicolas Goaziou wrote:

Hello,

juh  writes:


The last step was to make a symlink.

sudo ln -s /usr/share/citation-style-language/locales
/usr/share/emacs/27.1/etc/org/csl


This is odd. Locales and Styles are two different things.


Citations in this format now works.
[cite: @bibtex_key S. 63]

I define the style in the preamble:

#+cite_export: csl /home/juh/csl.styles-distribution/kritische-ausgabe.csl

What I can't do is to insert a citation because org-cite-insert runs
forever


You could try , then insert a citation, and
quit with C-g when it freezes. It should give you a full backtrace,
which you could send here. It is better if you reload Org uncompiled
first, with .


Debugger entered--Lisp error: (quit)
  org-cite-basic--get-entry("noauthor_nouvelle_nodate" nil)
  org-cite-basic--get-field(year "noauthor_nouvelle_nodate" nil raw)
  org-cite-basic--get-year("noauthor_nouvelle_nodate" nil no-suffix)
  org-cite-basic--key-completion-table()
  org-cite-basic--complete-key(t)
  #f(compiled-function (select-key select-style arg) #0x1561cc164ae1>)(org-cite-basic--complete-key 
org-cite-basic--complete-style nil)

  #f(compiled-function (context arg) #)(nil nil)
  org-cite-insert(nil)
  funcall-interactively(org-cite-insert nil)
  call-interactively(org-cite-insert record nil)
  command-execute(org-cite-insert record)
  execute-extended-command(nil "org-cite-insert" nil)
  funcall-interactively(execute-extended-command nil "org-cite-insert" nil)
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)



The offending entry:

@misc{noauthor_nouvelle_nodate,
title = {Nouvelle {Vague} – {Wikipedia}},
url = {http://de.wikipedia.org/wiki/Nouvelle_Vague},
urldate = {2011-01-06},
	file = {Nouvelle Vague – 
Wikipedia:/home/juh/Zotero/storage/B7UGCJCN/Nouvelle_Vague.html:text/html},

}

Before this entry was marked I deleted another one. So I fear that I 
have some entries that org-cite-insert does not like.


juh



Re: Bibliographies on export with ox-context and ox-epub

2022-01-12 Thread Nicolas Goaziou
Hello,

juh  writes:

> The last step was to make a symlink.
>
> sudo ln -s /usr/share/citation-style-language/locales
> /usr/share/emacs/27.1/etc/org/csl

This is odd. Locales and Styles are two different things.

> Citations in this format now works.
> [cite: @bibtex_key S. 63]
>
> I define the style in the preamble:
>
> #+cite_export: csl /home/juh/csl.styles-distribution/kritische-ausgabe.csl
>
> What I can't do is to insert a citation because org-cite-insert runs
> forever

You could try , then insert a citation, and
quit with C-g when it freezes. It should give you a full backtrace,
which you could send here. It is better if you reload Org uncompiled
first, with .

Another option is to send a minimal bibliography file so we can
reproduce your problem.

>and org-ref-cite-insert-helm inserts this:
>
> [[cite:_key_1984]]
>
> which does not render.

Note that Org Cite and Org Ref are, unfortunately, incompatible
projects. Org Cite defines citations as a new kind of object, whereas
Org Ref extends links to create citations. In short, you cannot mix
both.

Regards,
-- 
Nicolas Goaziou



Re: Bibliographies on export with ox-context and ox-epub

2022-01-11 Thread juh

Dear all,

On 01.12.21 16:06, Nicolas Goaziou wrote:

You can also shorten this with `org-cite-csl-styles-dir' variable. E.g.,
if _all_ your style files are located in "~/Projekte/csl.styles/", you
could use:

   (setq org-cite-csl-styles-dir "~/Projekte/csl.styles/")



Finally citations are working for me.

The last step was to make a symlink.

sudo ln -s /usr/share/citation-style-language/locales 
/usr/share/emacs/27.1/etc/org/csl


Maybe this is a debian problem.

Citations in this format now works.
[cite: @bibtex_key S. 63]

I define the style in the preamble:

#+cite_export: csl /home/juh/csl.styles-distribution/kritische-ausgabe.csl

What I can't do is to insert a citation because org-cite-insert runs 
forever and org-ref-cite-insert-helm inserts this:


[[cite:_key_1984]]

which does not render.

But at least I now have it working kind of.

Thanks to all you helped me.

juh



Re: Bibliographies on export with ox-context and ox-epub

2021-12-02 Thread Jason Ross

There is a ConTeXt-specific citation exporter that's in development:

https://github.com/Jason-S-Ross/oc-context

On 12/2/21 12:11 AM, juh wrote:

Am 01.12.21 um 16:01 schrieb Eric S Fraga:

What completion engine are you using?  In selectrum, typing C-j at that
point finishes the completion.  Other engines will differ.  You might
also try up-arrow and RET.

Thanks a lot. I use selectrum and would've never found this door out.

juh





Re: Bibliographies on export with ox-context and ox-epub

2021-12-02 Thread juh

Am 01.12.21 um 16:01 schrieb Eric S Fraga:

What completion engine are you using?  In selectrum, typing C-j at that
point finishes the completion.  Other engines will differ.  You might
also try up-arrow and RET.

Thanks a lot. I use selectrum and would've never found this door out.

juh



Re: Bibliographies on export with ox-context and ox-epub

2021-12-01 Thread Nicolas Goaziou
Hello,

juh  writes:

> thanks a lot.
>
> basic works

Good! We're getting close.

> but with csl I get:
>
> citeproc-style-parse: Opening input file: Datei oder Verzeichnis nicht 
> gefunden, /usr/share/emacs/27.1/etc/org/csl/chicago-author-date.csl
>
> File or directory not found.

That's unexpected. I am curious to know why `org-cite-csl--etc-dir' is
set to "/usr/share/emacs/27.1/etc/org/csl/chicago-author-date.csl".

If you have some time to spare, you could edebug this defconst by using
 on its definition and move with successive . In
particular, (locate-library "oc") should not point to
/usr/share/emacs/27.1/... since it was not available at that time.

> I tried to point 
>
> #+csl_style: ~/Projekte/csl.styles/chicago-author-date.csl
>
> but there is no change in the error message.

Location of the CSL style file should be the second token in the
"cite_export" keyword. So the above should be:

  #+cite_export: csl ~/Projekte/csl.styles/chicago-author-date.csl

You can also shorten this with `org-cite-csl-styles-dir' variable. E.g.,
if _all_ your style files are located in "~/Projekte/csl.styles/", you
could use:

  (setq org-cite-csl-styles-dir "~/Projekte/csl.styles/")

In that case, the second token from "cite_export" keyword would become:

  #+cite_export: csl chicago-author-date.csl

Note there is no "csl_style" keyword in Org Cite. It might be related to
Org Ref, which is a different citation system.

HTH,
-- 
Nicolas Goaziou



Re: Bibliographies on export with ox-context and ox-epub

2021-12-01 Thread Eric S Fraga
On Wednesday,  1 Dec 2021 at 15:57, juh wrote:
> But then I can't get out, because:
>
> Key ("" to exit) 
>
> What key is this? 

What completion engine are you using?  In selectrum, typing C-j at that
point finishes the completion.  Other engines will differ.  You might
also try up-arrow and RET.

-- 
: Eric S Fraga, with org release_9.5.1-231-g6766c4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: Bibliographies on export with ox-context and ox-epub

2021-12-01 Thread juh
Am Wed, Dec 01, 2021 at 03:44:48PM +0100 schrieb juh:
> but with csl I get:
> 
> citeproc-style-parse: Opening input file: Datei oder Verzeichnis nicht 
> gefunden, /usr/share/emacs/27.1/etc/org/csl/chicago-author-date.csl
> 
> File or directory not found.
> 
> I tried to point 
> 
> #+csl_style: ~/Projekte/csl.styles/chicago-author-date.csl
> 
> but there is no change in the error message.

One more thing.

org-cite-insert gives me the list of entries in test.bib as expected.

Pressing ENTER adds "doe"

But then I can't get out, because:

Key ("" to exit) 

What key is this? 

juh

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


Re: Bibliographies on export with ox-context and ox-epub

2021-12-01 Thread juh
Hi Nicolas,

thanks a lot.

basic works

Am Wed, Dec 01, 2021 at 02:42:10PM +0100 schrieb Nicolas Goaziou:
> If I change the second line to "#+cite_export: csl" instead, with the
> external Citeproc Emacs library properly loaded, I get:
> 
> (org et al. 2021, 45)
> 
> org et al. (2021, 45)
> 
> 
> org, mode, Citation Syntax, Mailing List, and Time Effort. 2021.
> “Elegant Citations with Org-Mode. J/o”urnal of Plain Text Formats/ 42
> (1).
> --8<---cut here---end--->8---

but with csl I get:

citeproc-style-parse: Opening input file: Datei oder Verzeichnis nicht 
gefunden, /usr/share/emacs/27.1/etc/org/csl/chicago-author-date.csl

File or directory not found.

I tried to point 

#+csl_style: ~/Projekte/csl.styles/chicago-author-date.csl

but there is no change in the error message.

juh




Re: Bibliographies on export with ox-context and ox-epub

2021-12-01 Thread Nicolas Goaziou
Hello,

juh  writes:

> I fixed this, updated to the newest org but still no rendering in no
> format.
>
> Thanks to all.
>
> I will give up for the moment and maybe come back again later.

For the record, with the following test.bib file:

--8<---cut here---start->8---
@article{doe,
 author={org, mode and Syntax, Citation and List, Mailing and Effort, 
Time},
 journal={Journal of Plain Text Formats},
 title={Elegant Citations with Org-Mode},
 year={2021},
 month={7},
 volume={42},
 number={1}}
--8<---cut here---end--->8---

and the following document:

--8<---cut here---start->8---
#+title: Citation tests
#+cite_export: basic

#+bibliography: test.bib

[cite:@doe 45]

[cite/text:@doe 45]


#+print_bibliography: 
--8<---cut here---end--->8---

I get, when exporting to text ():

--8<---cut here---start->8---

 CITATION TESTS



(org, mode and Syntax, Citation and List, Mailing and Effort, Time, 2021
45)

org, mode and Syntax, Citation and List, Mailing and Effort, Time (2021
45)


org, mode and Syntax, Citation and List, Mailing and Effort, Time
(2021). /Elegant Citations with Org-Mode/, Journal of Plain Text
Formats.
--8<---cut here---end--->8---

If I change the second line to "#+cite_export: csl" instead, with the
external Citeproc Emacs library properly loaded, I get:

--8<---cut here---start->8---

 CITATION TESTS



(org et al. 2021, 45)

org et al. (2021, 45)


org, mode, Citation Syntax, Mailing List, and Time Effort. 2021.
“Elegant Citations with Org-Mode. J/o”urnal of Plain Text Formats/ 42
(1).
--8<---cut here---end--->8---

I tested with development Org, but I don't think it would change using
stable Org. Maybe someone wants to confirm this.

Regards,
-- 
Nicolas Goaziou



Re: Bibliographies on export with ox-context and ox-epub

2021-11-25 Thread juh
Am Thu, Nov 25, 2021 at 01:49:01PM +0100 schrieb András Simonyi:
> if that's the entire content then it is not a well-formed bib(la)tex
> bibliography file: the value of the pages field and the entry's
> closing bracket are missing.

Thanks a lot. 

I fixed this, updated to the newest org but still no rendering in no
format.

Thanks to all.

I will give up for the moment and maybe come back again later.

juh
-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


Re: Bibliographies on export with ox-context and ox-epub

2021-11-25 Thread András Simonyi
On Thu, 25 Nov 2021 at 12:21, juh  wrote:

> After I fixed my installation I now use org-mode 9.5.1 but still
> citations are not rendered in no export format neither with basic nor
> with csl.

> test.bib in same directory:
>
>
> @article{doe,
>  author={org, mode and Syntax, Citation and List, Mailing and Effort, 
> Time},
>  journal={Journal of Plain Text Formats},
>  title={Elegant Citations with Org-Mode},
>  year={2021},
>  month={7},
>  volume={42},
>  number={1},
>  pages
>
if that's the entire content then it is not a well-formed bib(la)tex
bibliography file: the value of the pages field and the entry's
closing bracket are missing.

best wishes,
András



Re: Bibliographies on export with ox-context and ox-epub

2021-11-25 Thread juh
Am Wed, Nov 24, 2021 at 08:29:46PM +0100 schrieb András Simonyi:
> > The error disappears but the bibliography still is not rendered.
> >
> > I get the plain code:
> >
> > [@doe 45]
> >
> > [cite/t:@doe 45]
> >
> > juh
> is the rendering OK when you export using the built-in, standard
> backends, e.g., html or txt? As a data point, on my system org-cite
> export with the CSL processor using ox-context works as expected.

After I fixed my installation I now use org-mode 9.5.1 but still
citations are not rendered in no export format neither with basic nor
with csl.

Sample is:

#+title: Citation tests
#+cite_export: basic
#+bibliography: test.bib

[cite:@doe 45]

[cite/text:@doe 45]


#+print_bibliography: 



test.bib in same directory:


@article{doe,
 author={org, mode and Syntax, Citation and List, Mailing and Effort, 
Time},
 journal={Journal of Plain Text Formats},
 title={Elegant Citations with Org-Mode},
 year={2021},
 month={7},
 volume={42},
 number={1},
 pages


With cite_export: csl I get

Scan error: "Unbalanced parentheses" , 9, 299

With cite_export: basic I get

Wrong value for ENTRY-OR-KEY: nil

With org-cite-insert my modeline shows

0 Key ("" to exit): 


TIA
juh


-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread András Simonyi
Dear All,
On Wed, 24 Nov 2021 at 16:49, juh  wrote:
> The error disappears but the bibliography still is not rendered.
>
> I get the plain code:
>
> [@doe 45]
>
> [cite/t:@doe 45]
>
> juh
is the rendering OK when you export using the built-in, standard
backends, e.g., html or txt? As a data point, on my system org-cite
export with the CSL processor using ox-context works as expected.

best wishes,
András



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread John Kitchin
If you are happy with org-ref, here is a minimal example that shows how to
get a bibliography via csl, and a pre-processing hook.


* test

A sentence with ref [[cite:]].


* Bibliography
bibliography:~/Dropbox/emacs/bibliography/references.bib

* build
 :noexport:

#+csl-style: apa-5th-edition.csl
#+csl-locale: en-US

#+BEGIN_SRC emacs-lisp
(require 'ox-epub)
(let ((org-export-before-parsing-hook '(org-ref-csl-preprocess-buffer)))
  (org-open-file (org-epub-export-to-epub)))
#+END_SRC


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



On Wed, Nov 24, 2021 at 3:00 AM juh  wrote:

> Hi all,
>
> I am kind of lost with references and ox-context and ox-epub.
>
> Is there a tutorial how to integrate a bibliography in ConTeXt and
> epub-Export?
>
>
> What I want to achieve is to use a bibtex bibliographies with org-roam and
> export them to epub and ConTeXt to generate bibliographies in the output.
>
> The first wish kind of works as I can insert entries from the bibtex file
> with C-].
>
> They look like this:
>
> Nam a sapien.[[cite:@horkheimer_dialektik_1984]]
>
> This is the org-ref entry in settings.org.
>
>   (straight-use-package 'org-ref)
>   (with-eval-after-load "org-ref"
>   (setq reftex-default-bibliography '("~/org/bibliography.bib")))
>
>   (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
> bibtex-completion-library-path '("~/org/bibtex-pdfs/")
> bibtex-completion-notes-path "~/org/notes/"
> bibtex-completion-pdf-open-function
> (lambda (fpath)
>   (call-process "open" nil 0 nil fpath)))
>
>   (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)
>
>
> What puzzles me is that I could not find a hint to create a bibliography
> for epub export and context export. Maybe there isn't. But as some
> things with references does not work in my setup I fear that my
> configuration is not working. I take snippets from the documentations of
> the packages.
>
> I miss an overall example or tutorial for note taking via org-roam and
> exporting to epub and ConTeXt.
>
> So for now my current publishing workflow is split into two.
>
> 1. Zettelkasten via org-roam
>
> 2. PDF and epub creation via pandoc and cite-proc.
>
> As you can see there is a break of tools, so I would like to avoid this.
>
> TIA
> juh
>
> --
> Autoren-Homepage: . http://literatur.hasecke.com
> Satiren & Essays: . http://www.sudelbuch.de
> Privater Blog:  http://www.hasecke.eu
> Netzliteratur-Projekt:  http://www.generationenprojekt.de
>
>
>
>


Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh
Am Wed, Nov 24, 2021 at 11:59:19AM +0100 schrieb Denis Maier:
> 
> Am 24.11.2021 um 10:32 schrieb juh:
> > [...]
> 
> > Thanks a lot but I get:
> > 
> > Unknown processor csl
> What happens after this?
> 
> M-: (require 'oc-csl)
> 
> Will this evaluate or do you get an error message?
> 

The error disappears but the bibliography still is not rendered.

I get the plain code:

[@doe 45]

[cite/t:@doe 45] 

juh
-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de




signature.asc
Description: PGP signature


Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh

Am 24.11.21 um 09:43 schrieb Denis Maier:
Are you already on org 9.5? Looks like your still using the "old" 
org-ref links.


The following mwe might get you started:

%%
#+title: Citation tests
#+cite_export: csl
#+bibliography: test.bib

[cite: @doe 45]

[cite/text: @doe 45]

#+print_bibliography:
%%



Thanks a lot but I get:

Unknown processor csl

I also followed the example given here:
https://blog.tecosaur.com/tmio/2021-07-31-citations.html

juh



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Colin Baxter 
> Eric S Fraga  writes:

> On Wednesday, 24 Nov 2021 at 09:59, Colin Baxter  wrote:
>> Where is citeproc.el? I'm using Org mode version 9.5.1
>> (release_9.5.1-194-gd82936) and I don't see it.

> It's a separate Emacs package which you will need to install.
> It's available on MELPA.  The csl citation engine depends on it.
> It is not part of org itself.

Ah, I see. Tthanks again Eric

Best wishes,



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Eric S Fraga
On Wednesday, 24 Nov 2021 at 09:59, Colin Baxter  wrote:
> Where is citeproc.el? I'm using Org mode version 9.5.1
> (release_9.5.1-194-gd82936) and I don't see it.

It's a separate Emacs package which you will need to install.  It's
available on MELPA.  The csl citation engine depends on it.  It is not
part of org itself.

-- 
: Eric S Fraga, with org release_9.5-230-g2bbac4 in Emacs 29.0.50
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier



Am 24.11.2021 um 10:32 schrieb juh:

[...]



Thanks a lot but I get:

Unknown processor csl

What happens after this?

M-: (require 'oc-csl)

Will this evaluate or do you get an error message?

Denis






Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier

Am 24.11.2021 um 10:59 schrieb Colin Baxter :

Denis Maier  writes:

 > Are you already on org 9.5? Looks like your still using the "old"
 > org-ref links.

 > The following mwe might get you started:

 > %%

 > #+title: Citation tests #+cite_export: csl

 > #+bibliography: test.bib

 > [cite: @doe 45]

 > [cite/text: @doe 45]

 > #+print_bibliography:
 > %%

 > This will use the new citation export framework. citeproc-el needs
 > to be installed for this to be working.

Where is citeproc.el? I'm using Org mode version 9.5.1
(release_9.5.1-194-gd82936) and I don't see it.

Best wishes,


You'll need to install it. It's an independent package.

Denis





Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Colin Baxter 
> Denis Maier  writes:

> Are you already on org 9.5? Looks like your still using the "old"
> org-ref links.

> The following mwe might get you started:

> %%

> #+title: Citation tests #+cite_export: csl

> #+bibliography: test.bib

> [cite: @doe 45]

> [cite/text: @doe 45]

> #+print_bibliography:
> %%

> This will use the new citation export framework. citeproc-el needs
> to be installed for this to be working.

Where is citeproc.el? I'm using Org mode version 9.5.1
(release_9.5.1-194-gd82936) and I don't see it.

Best wishes,




Re: Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread Denis Maier
Are you already on org 9.5? Looks like your still using the "old" 
org-ref links.


The following mwe might get you started:

%%
#+title: Citation tests
#+cite_export: csl
#+bibliography: test.bib

[cite: @doe 45]

[cite/text: @doe 45]

#+print_bibliography:
%%

This will use the new citation export framework. citeproc-el needs to be 
installed for this to be working.


Anyway, I can export this to plain text, html, and latex without 
problems. I have not yet tried out the context exporter, but I don't see 
why it should not work there as well.


In case you haven't seen it already: 
https://blog.tecosaur.com/tmio/2021-07-31-citations.html


Best,
Denis

Am 24.11.2021 um 08:22 schrieb juh:

Hi all,

I am kind of lost with references and ox-context and ox-epub.

Is there a tutorial how to integrate a bibliography in ConTeXt and
epub-Export?


What I want to achieve is to use a bibtex bibliographies with org-roam and
export them to epub and ConTeXt to generate bibliographies in the output.

The first wish kind of works as I can insert entries from the bibtex file with 
C-].

They look like this:

Nam a sapien.[[cite:@horkheimer_dialektik_1984]]

This is the org-ref entry in settings.org.

   (straight-use-package 'org-ref)
   (with-eval-after-load "org-ref"
   (setq reftex-default-bibliography '("~/org/bibliography.bib")))

   (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
 bibtex-completion-library-path '("~/org/bibtex-pdfs/")
 bibtex-completion-notes-path "~/org/notes/"
 bibtex-completion-pdf-open-function
 (lambda (fpath)
   (call-process "open" nil 0 nil fpath)))

   (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)


What puzzles me is that I could not find a hint to create a bibliography
for epub export and context export. Maybe there isn't. But as some
things with references does not work in my setup I fear that my
configuration is not working. I take snippets from the documentations of
the packages.

I miss an overall example or tutorial for note taking via org-roam and
exporting to epub and ConTeXt.

So for now my current publishing workflow is split into two.

1. Zettelkasten via org-roam

2. PDF and epub creation via pandoc and cite-proc.

As you can see there is a break of tools, so I would like to avoid this.

TIA
juh






Bibliographies on export with ox-context and ox-epub

2021-11-24 Thread juh
Hi all,

I am kind of lost with references and ox-context and ox-epub.

Is there a tutorial how to integrate a bibliography in ConTeXt and
epub-Export?


What I want to achieve is to use a bibtex bibliographies with org-roam and
export them to epub and ConTeXt to generate bibliographies in the output.

The first wish kind of works as I can insert entries from the bibtex file with 
C-].

They look like this:

Nam a sapien.[[cite:@horkheimer_dialektik_1984]]

This is the org-ref entry in settings.org.

  (straight-use-package 'org-ref)
  (with-eval-after-load "org-ref" 
  (setq reftex-default-bibliography '("~/org/bibliography.bib")))

  (setq bibtex-completion-bibliography '("~/org/bibliography.bib")
bibtex-completion-library-path '("~/org/bibtex-pdfs/")
bibtex-completion-notes-path "~/org/notes/"
bibtex-completion-pdf-open-function
(lambda (fpath)
  (call-process "open" nil 0 nil fpath)))

  (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)


What puzzles me is that I could not find a hint to create a bibliography
for epub export and context export. Maybe there isn't. But as some
things with references does not work in my setup I fear that my
configuration is not working. I take snippets from the documentations of
the packages.

I miss an overall example or tutorial for note taking via org-roam and
exporting to epub and ConTeXt.

So for now my current publishing workflow is split into two.

1. Zettelkasten via org-roam

2. PDF and epub creation via pandoc and cite-proc.

As you can see there is a break of tools, so I would like to avoid this.

TIA
juh

-- 
Autoren-Homepage: . http://literatur.hasecke.com
Satiren & Essays: . http://www.sudelbuch.de
Privater Blog:  http://www.hasecke.eu
Netzliteratur-Projekt:  http://www.generationenprojekt.de