emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Citations in tables are not exported
@ 2021-07-15  4:38 Timothy
  2021-07-18 23:28 ` John Kitchin
  0 siblings, 1 reply; 9+ messages in thread
From: Timothy @ 2021-07-15  4:38 UTC (permalink / raw)
  To: org-mode-email

Hi,

I've just started playing with citations, but it seems that I've
stumbled across a bug where if the citation is in a table cell it will
be left "raw". See the following example

#+begin_org
,#+begin_src bibtex :tangle activedoc.bib
@article{SchulteActiveOrg,
         author={Schulte, Eric and Davison, Dan},
         journal={Computing in Science Engineering},
         title={Active Documents with Org-Mode},
         year={2011},
         volume={13},
         number={3},
         pages={66-73},
         doi={10.1109/MCSE.2011.41}}
,#+end_src

,#+bibliography: activedoc.bib
,#+print_bibliography:

[cite/a:@SchulteActiveOrg]

| [cite/a:@SchulteActiveOrg] |
#+end_org

When exporting to ASCII, I see this:

#+begin_example
Schulte, Eric, and Dan Davison. 2011. “Active Documents with Org-Mode.”
/Computing in Science Engineering/ 13 (3):66–73.

(Schulte and Davison 2011)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 [cite/a:@SchulteActiveOrg]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#+end_example

I hope that's enough to go off.

--
Timothy


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

* Re: [BUG] Citations in tables are not exported
  2021-07-15  4:38 [BUG] Citations in tables are not exported Timothy
@ 2021-07-18 23:28 ` John Kitchin
  2021-07-27 11:52   ` Matt Price
  2021-07-29 12:26   ` Nicolas Goaziou
  0 siblings, 2 replies; 9+ messages in thread
From: John Kitchin @ 2021-07-18 23:28 UTC (permalink / raw)
  To: Timothy; +Cc: emacs-orgmode

I also see this behavior. I think this should be considered a bug, it is
pretty common to see citations in a table cell.

Additionally, I cannot insert a citation in a caption that is above a
table (or a figure), I get
"user-error: Cannot insert a citation here". That should be considered a
bug in org-cite--allowed-p  I think. It fails because in the caption the
context is a table, and it has :post-affiliated item which causes
org-cite--allowed-p  to return nil.

If I put a citation in the caption anyway, it does seem to get exported
correctly.

I am not sure why the cites don't export inside the table cell though.

Thanks,

Timothy <tecosaur@gmail.com> writes:

> Hi,
>
> I've just started playing with citations, but it seems that I've
> stumbled across a bug where if the citation is in a table cell it will
> be left "raw". See the following example
>
> #+begin_org
> ,#+begin_src bibtex :tangle activedoc.bib
> @article{SchulteActiveOrg,
>          author={Schulte, Eric and Davison, Dan},
>          journal={Computing in Science Engineering},
>          title={Active Documents with Org-Mode},
>          year={2011},
>          volume={13},
>          number={3},
>          pages={66-73},
>          doi={10.1109/MCSE.2011.41}}
> ,#+end_src
>
> ,#+bibliography: activedoc.bib
> ,#+print_bibliography:
>
> [cite/a:@SchulteActiveOrg]
>
> | [cite/a:@SchulteActiveOrg] |
> #+end_org
>
> When exporting to ASCII, I see this:
>
> #+begin_example
> Schulte, Eric, and Dan Davison. 2011. “Active Documents with Org-Mode.”
> /Computing in Science Engineering/ 13 (3):66–73.
>
> (Schulte and Davison 2011)
>
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
>  [cite/a:@SchulteActiveOrg]
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> #+end_example
>
> I hope that's enough to go off.


--
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


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

* Re: [BUG] Citations in tables are not exported
  2021-07-18 23:28 ` John Kitchin
@ 2021-07-27 11:52   ` Matt Price
  2021-07-29 12:30     ` Nicolas Goaziou
  2021-07-29 12:26   ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: Matt Price @ 2021-07-27 11:52 UTC (permalink / raw)
  To: John Kitchin; +Cc: Org Mode, Timothy

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

re: captions, a quick hack is to change line 1373 of oc.el to

((memq type '(nil paragraph keyword)))

This makes my life quite a bit easier.

No doubt this is a bit too broad, though I am not entirely clear on why
there are any restrictions at all on inserting cites.

On Sun, Jul 18, 2021 at 7:29 PM John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

> I also see this behavior. I think this should be considered a bug, it is
> pretty common to see citations in a table cell.
>
> Additionally, I cannot insert a citation in a caption that is above a
> table (or a figure), I get
> "user-error: Cannot insert a citation here". That should be considered a
> bug in org-cite--allowed-p  I think. It fails because in the caption the
> context is a table, and it has :post-affiliated item which causes
> org-cite--allowed-p  to return nil.
>
> If I put a citation in the caption anyway, it does seem to get exported
> correctly.
>
> I am not sure why the cites don't export inside the table cell though.
>
> Thanks,
>
> Timothy <tecosaur@gmail.com> writes:
>
> > Hi,
> >
> > I've just started playing with citations, but it seems that I've
> > stumbled across a bug where if the citation is in a table cell it will
> > be left "raw". See the following example
> >
> > #+begin_org
> > ,#+begin_src bibtex :tangle activedoc.bib
> > @article{SchulteActiveOrg,
> >          author={Schulte, Eric and Davison, Dan},
> >          journal={Computing in Science Engineering},
> >          title={Active Documents with Org-Mode},
> >          year={2011},
> >          volume={13},
> >          number={3},
> >          pages={66-73},
> >          doi={10.1109/MCSE.2011.41}}
> > ,#+end_src
> >
> > ,#+bibliography: activedoc.bib
> > ,#+print_bibliography:
> >
> > [cite/a:@SchulteActiveOrg]
> >
> > | [cite/a:@SchulteActiveOrg] |
> > #+end_org
> >
> > When exporting to ASCII, I see this:
> >
> > #+begin_example
> > Schulte, Eric, and Dan Davison. 2011. “Active Documents with Org-Mode.”
> > /Computing in Science Engineering/ 13 (3):66–73.
> >
> > (Schulte and Davison 2011)
> >
> > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> >  [cite/a:@SchulteActiveOrg]
> > ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> > #+end_example
> >
> > I hope that's enough to go off.
>
>
> --
> 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
>
>

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

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

* Re: [BUG] Citations in tables are not exported
  2021-07-18 23:28 ` John Kitchin
  2021-07-27 11:52   ` Matt Price
@ 2021-07-29 12:26   ` Nicolas Goaziou
  2021-07-29 15:34     ` John Kitchin
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2021-07-29 12:26 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode, Timothy

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I also see this behavior. I think this should be considered a bug, it is
> pretty common to see citations in a table cell.
>
> Additionally, I cannot insert a citation in a caption that is above a
> table (or a figure), I get
> "user-error: Cannot insert a citation here". That should be considered a
> bug in org-cite--allowed-p  I think. It fails because in the caption the
> context is a table, and it has :post-affiliated item which causes
> org-cite--allowed-p  to return nil.
>
> If I put a citation in the caption anyway, it does seem to get exported
> correctly.

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou


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

* Re: [BUG] Citations in tables are not exported
  2021-07-27 11:52   ` Matt Price
@ 2021-07-29 12:30     ` Nicolas Goaziou
  2021-07-30  0:49       ` Matt Price
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2021-07-29 12:30 UTC (permalink / raw)
  To: Matt Price; +Cc: Timothy, Org Mode, John Kitchin

Hello,

Matt Price <moptop99@gmail.com> writes:

> No doubt this is a bit too broad, though I am not entirely clear on why
> there are any restrictions at all on inserting cites.

There are locations which can break the structure of the document.
Obviously, we can let users shoot themselves in the foot, but, OTOH,
a decent interface should prevent the most obvious issues.

WDYT?

Regards,
-- 
Nicolas Goaziou


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

* Re: [BUG] Citations in tables are not exported
  2021-07-29 12:26   ` Nicolas Goaziou
@ 2021-07-29 15:34     ` John Kitchin
  2021-07-29 19:26       ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: John Kitchin @ 2021-07-29 15:34 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode-email, Timothy

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

It is partially fixed for me. I can put a citation in all these places in a
cell (and in a caption),

| x  |
 ^^^

but not here

| x  |
    ^

In case this doesn't render quite right, the cell has two spaces after x,
and I can insert a citation on the first space, but not the second one (or
subsequent ones if they exist).

It still looks like the citation in a table doesn't export, e.g.
in

#+caption: in a caption [cite/t:@lin-2021-exper-theor]
| X [cite/t:@lin-2021-exper-theor] | test  |


the citation in the caption is exported (in latex), but not the one in the
cell.




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 Thu, Jul 29, 2021 at 8:26 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
> > I also see this behavior. I think this should be considered a bug, it is
> > pretty common to see citations in a table cell.
> >
> > Additionally, I cannot insert a citation in a caption that is above a
> > table (or a figure), I get
> > "user-error: Cannot insert a citation here". That should be considered a
> > bug in org-cite--allowed-p  I think. It fails because in the caption the
> > context is a table, and it has :post-affiliated item which causes
> > org-cite--allowed-p  to return nil.
> >
> > If I put a citation in the caption anyway, it does seem to get exported
> > correctly.
>
> Fixed. Thank you.
>
> Regards,
> --
> Nicolas Goaziou
>

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

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

* Re: [BUG] Citations in tables are not exported
  2021-07-29 15:34     ` John Kitchin
@ 2021-07-29 19:26       ` Nicolas Goaziou
  2021-07-29 22:04         ` John Kitchin
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2021-07-29 19:26 UTC (permalink / raw)
  To: John Kitchin; +Cc: org-mode-email, Timothy

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> It is partially fixed for me. I can put a citation in all these places in a
> cell (and in a caption),
>
> | x  |
>  ^^^
>
> but not here
>
> | x  |
>     ^
>
> In case this doesn't render quite right, the cell has two spaces after x,
> and I can insert a citation on the first space, but not the second one (or
> subsequent ones if they exist).

Fixed, too. Thank you.

> It still looks like the citation in a table doesn't export, e.g.
> in
>
> #+caption: in a caption [cite/t:@lin-2021-exper-theor]
> | X [cite/t:@lin-2021-exper-theor] | test  |
>
>
> the citation in the caption is exported (in latex), but not the one in the
> cell.

I cannot reproduce it. Do you still encounter it?

Regards,
-- 
Nicolas Goaziou


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

* Re: [BUG] Citations in tables are not exported
  2021-07-29 19:26       ` Nicolas Goaziou
@ 2021-07-29 22:04         ` John Kitchin
  0 siblings, 0 replies; 9+ messages in thread
From: John Kitchin @ 2021-07-29 22:04 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode-email, Timothy

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

It all looks good now! Thanks for the quick fix.

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 Thu, Jul 29, 2021 at 3:26 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> John Kitchin <jkitchin@andrew.cmu.edu> writes:
>
> > It is partially fixed for me. I can put a citation in all these places
> in a
> > cell (and in a caption),
> >
> > | x  |
> >  ^^^
> >
> > but not here
> >
> > | x  |
> >     ^
> >
> > In case this doesn't render quite right, the cell has two spaces after x,
> > and I can insert a citation on the first space, but not the second one
> (or
> > subsequent ones if they exist).
>
> Fixed, too. Thank you.
>
> > It still looks like the citation in a table doesn't export, e.g.
> > in
> >
> > #+caption: in a caption [cite/t:@lin-2021-exper-theor]
> > | X [cite/t:@lin-2021-exper-theor] | test  |
> >
> >
> > the citation in the caption is exported (in latex), but not the one in
> the
> > cell.
>
> I cannot reproduce it. Do you still encounter it?
>
> Regards,
> --
> Nicolas Goaziou
>

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

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

* Re: [BUG] Citations in tables are not exported
  2021-07-29 12:30     ` Nicolas Goaziou
@ 2021-07-30  0:49       ` Matt Price
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Price @ 2021-07-30  0:49 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Timothy, Org Mode, John Kitchin

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

On Thu., Jul. 29, 2021, 8:30 a.m. Nicolas Goaziou, <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Matt Price <moptop99@gmail.com> writes:
>
> > No doubt this is a bit too broad, though I am not entirely clear on why
> > there are any restrictions at all on inserting cites.
>
> There are locations which can break the structure of the document.
> Obviously, we can let users shoot themselves in the foot, but, OTOH,
> a decent interface should prevent the most obvious issues.
>
> WDYT?
>

What I think is, I am far too ignorant to have an opinion. I defer entirely
to yours. Thanks so much for the caption fix, at present it's one of my
main uses for citations so the convenience win is substantial.


> Regards,
> --
> Nicolas Goaziou
>

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

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

end of thread, other threads:[~2021-07-30  0:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-15  4:38 [BUG] Citations in tables are not exported Timothy
2021-07-18 23:28 ` John Kitchin
2021-07-27 11:52   ` Matt Price
2021-07-29 12:30     ` Nicolas Goaziou
2021-07-30  0:49       ` Matt Price
2021-07-29 12:26   ` Nicolas Goaziou
2021-07-29 15:34     ` John Kitchin
2021-07-29 19:26       ` Nicolas Goaziou
2021-07-29 22:04         ` 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).