emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [oc] provide style/citation preview?
@ 2022-03-24 13:46 Bruce D'Arcus
       [not found] ` <CALtzAB3Wh9dp_5ik3wN5JA2WmYb-cOoJ7AEKKkUfTXRuKC_5qQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce D'Arcus @ 2022-03-24 13:46 UTC (permalink / raw)
  To: org-mode-email

This is an idea related to an issue John Kitchin and I were trying to
sort out a few months back, that he mentioned in another thread.

https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00274.html

The question is how to help users understand the relation between oc
styles and target output.

There are two places where this matters:

1. selecting the style (say in a completion list)
2. previewing the citation after the fact (for example, hovering over
it in the buffer)

On 2, right now in oc-basic, if one hovers over a key, one gets a
tooltip preview of the rendered bibliographic entry, which is very
handy.

Picking up an idea that John mentioned in the above message, would it
be feasible when hovering over the prefix (the part before the colon)
to get a preview of the citation? By "feasible" I mean a good idea
from a UX POV, and without any obvious performance penalties.

As for the point he raises about which export backend to preview,
perhaps that should just be via a "citation-preview" defcustom?

So if one selected, say, natbib, one would see something like "\textt"
in the tooltip.

On 1, in citar I currently have a UI with a grouped list of
style/variants, and a user-defined static preview for each, something
like this:

--------- default ------------
/                         (de Ville, 2020)
...
----------- text --------------
/text                   de Ville (2020)
/text/caps           De Ville (2020)
...

So I'm just wondering how best to dynamically generate those previews,
perhaps even just using a pre-selected reference*, and if maybe oc
could make that easier?

* One wrinkle in general here is that in the LaTeX intermediate export
targets, you really don't care about the reference data, or even the
key; you just care about what the command is. With the CSL rendered
output, you do care about that.

Bruce


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

* Fwd: [oc] provide style/citation preview?
       [not found] ` <CALtzAB3Wh9dp_5ik3wN5JA2WmYb-cOoJ7AEKKkUfTXRuKC_5qQ@mail.gmail.com>
@ 2022-03-24 16:32   ` Vikas Rawal
  2022-03-24 16:49     ` Bruce D'Arcus
  0 siblings, 1 reply; 6+ messages in thread
From: Vikas Rawal @ 2022-03-24 16:32 UTC (permalink / raw)
  To: org-mode mailing list

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

> So I'm just wondering how best to dynamically generate those previews,
> perhaps even just using a pre-selected reference*, and if maybe oc
> could make that easier?
>
>
Some kind of overlay that shows citations as they would (at least as close
as possible) look in the export?

Vikas

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

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

* Re: [oc] provide style/citation preview?
  2022-03-24 16:32   ` Fwd: " Vikas Rawal
@ 2022-03-24 16:49     ` Bruce D'Arcus
  2022-03-24 23:25       ` Vikas Rawal
  2022-03-25 12:43       ` John Kitchin
  0 siblings, 2 replies; 6+ messages in thread
From: Bruce D'Arcus @ 2022-03-24 16:49 UTC (permalink / raw)
  To: Vikas Rawal; +Cc: org-mode mailing list

On Thu, Mar 24, 2022 at 12:33 PM Vikas Rawal <vikasrawal@gmail.com> wrote:

>> So I'm just wondering how best to dynamically generate those previews,
>> perhaps even just using a pre-selected reference*, and if maybe oc
>> could make that easier?
>>
>
> Some kind of overlay that shows citations as they would (at least as close as possible) look in the export?

Something like this?

https://github.com/andras-simonyi/org-cite-csl-activate

I think he was hoping to incorporate that into the oc-csl processor at
some point, and that would indeed be another approach to in-buffer
previewing.

The issue I have is more just generating the preview content for
incorporation into the completion annotations.

Bruce


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

* Re: [oc] provide style/citation preview?
  2022-03-24 16:49     ` Bruce D'Arcus
@ 2022-03-24 23:25       ` Vikas Rawal
  2022-03-25 12:43       ` John Kitchin
  1 sibling, 0 replies; 6+ messages in thread
From: Vikas Rawal @ 2022-03-24 23:25 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: org-mode mailing list

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

>
>
> >
> > Some kind of overlay that shows citations as they would (at least as
> close as possible) look in the export?
>
> Something like this?
>
> https://github.com/andras-simonyi/org-cite-csl-activate
>
> I think he was hoping to incorporate that into the oc-csl processor at
> some point, and that would indeed be another approach to in-buffer
> previewing.
>
> This is very nice. I hope someday somebody will also do something like
this for biblatex/bibtex.

Vikas

>
>

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

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

* Re: [oc] provide style/citation preview?
  2022-03-24 16:49     ` Bruce D'Arcus
  2022-03-24 23:25       ` Vikas Rawal
@ 2022-03-25 12:43       ` John Kitchin
  2022-03-25 17:48         ` Bruce D'Arcus
  1 sibling, 1 reply; 6+ messages in thread
From: John Kitchin @ 2022-03-25 12:43 UTC (permalink / raw)
  To: Bruce D'Arcus; +Cc: Vikas Rawal, emacs-orgmode

I think this kind of preview is well-suited for external packages.

There is a subtle point I ran into with this preview approach though,
and that is what is the backend export you want to see? People expect
one source (org) to export to different backends, and even use one
source to make a PDF and HTML (and maybe others). Now it also possible
to use different citation styles for different backends, and the
backends may use different citation processors (e.g. bib(la)tex or CSL).
I felt this was too complex to try to get right in one package. External
packages could provide any subset of these they want, e.g. the way
https://github.com/andras-simonyi/org-cite-csl-activate does. My opinion
of course.

I think the basic CSL styled citation tooltip that is independent of the
final state is a good compromise. The point is to give enough context
about the key to tell you what it is without visiting the source, and if
you need more, you go visit the source (bibtex file, org file, etc.).




"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> On Thu, Mar 24, 2022 at 12:33 PM Vikas Rawal <vikasrawal@gmail.com> wrote:
>
>>> So I'm just wondering how best to dynamically generate those previews,
>>> perhaps even just using a pre-selected reference*, and if maybe oc
>>> could make that easier?
>>>
>>
>> Some kind of overlay that shows citations as they would (at least as close as possible) look in the export?
>
> Something like this?
>
> https://github.com/andras-simonyi/org-cite-csl-activate
>
> I think he was hoping to incorporate that into the oc-csl processor at
> some point, and that would indeed be another approach to in-buffer
> previewing.
>
> The issue I have is more just generating the preview content for
> incorporation into the completion annotations.
>
> Bruce


-- 
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] 6+ messages in thread

* Re: [oc] provide style/citation preview?
  2022-03-25 12:43       ` John Kitchin
@ 2022-03-25 17:48         ` Bruce D'Arcus
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce D'Arcus @ 2022-03-25 17:48 UTC (permalink / raw)
  To: John Kitchin; +Cc: Vikas Rawal, org-mode-email

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

On Fri, Mar 25, 2022 at 8:55 AM John Kitchin <jkitchin@andrew.cmu.edu>
wrote:

> I think this kind of preview is well-suited for external packages.

You may be right.

> There is a subtle point I ran into with this preview approach though,
> and that is what is the backend export you want to see? People expect
> one source (org) to export to different backends, and even use one
> source to make a PDF and HTML (and maybe others). Now it also possible
> to use different citation styles for different backends, and the
> backends may use different citation processors (e.g. bib(la)tex or CSL).
> I felt this was too complex to try to get right in one package. External
> packages could provide any subset of these they want, e.g. the way
> https://github.com/andras-simonyi/org-cite-csl-activate does. My opinion
> of course.

oc-csl-activate uses org-cite-csl--fallback-style-file for the preview
style, but also has a org-cite-csl-activate-use-document-style defcustom to
optionally override that. A LaTeX preview wouldn't need this.

Seems more generally a user would need to be able to specify what the
export target is.

But I guess per your point, one could do configuration by simply selecting
whatever preferred activate processor. So, for example, we could have one
for latex preview.

> I think the basic CSL styled citation tooltip that is independent of the
> final state is a good compromise. The point is to give enough context
> about the key to tell you what it is without visiting the source, and if
> you need more, you go visit the source (bibtex file, org file, etc.).

Indeed.

Bruce

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

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

end of thread, other threads:[~2022-03-25 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 13:46 [oc] provide style/citation preview? Bruce D'Arcus
     [not found] ` <CALtzAB3Wh9dp_5ik3wN5JA2WmYb-cOoJ7AEKKkUfTXRuKC_5qQ@mail.gmail.com>
2022-03-24 16:32   ` Fwd: " Vikas Rawal
2022-03-24 16:49     ` Bruce D'Arcus
2022-03-24 23:25       ` Vikas Rawal
2022-03-25 12:43       ` John Kitchin
2022-03-25 17:48         ` Bruce D'Arcus

Code repositories for project(s) associated with this 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).