public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Guillaume Dehaene <guillaume.dehaene-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Show-and-tell: equation annotation for MathJax
Date: Thu, 23 Nov 2023 09:53:47 +0100	[thread overview]
Message-ID: <CAKOoOVUh=seSfpScCGywuvuTRxG1Tk4p00dSHCFacagw5DqXtw@mail.gmail.com> (raw)
In-Reply-To: <57a7749f-72bf-4d76-9422-296e57e80e42n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

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

That was fast: I was in the middle of brainstorming some ideas to help you
out!

I love how your solution is super terse, compared to my own super heavy
code.
Maybe I can find some improvement ideas.

Have you checked that your alignments are correct with a wide variety of
test cases?
What happens for me is that, when my JS function runs, the mathjax elements
do not necessarily have their final size, producing misalignment.
If that's the case, an easy solution is to simply repeat the alignment code
after a small delay.

Do you mind if I add this as an annotation style to my extension?

Cheers
Guillaume


Le jeu. 23 nov. 2023 à 09:41, Hypatia <knight.of.lambda.calculus@gmail.com>
a écrit :

> Hacked it:
> https://github.com/quarto-dev/quarto-cli/discussions/7679#discussioncomment-7649554
> !
>
> On Thursday, November 23, 2023 at 12:04:36 AM UTC-5 Hypatia wrote:
>
>> *I can
>>
>> Sorry for the misleading typo... I didn't mean you to do that... lol
>>
>> On Thursday, November 23, 2023 at 12:03:51 AM UTC-5 Hypatia wrote:
>>
>>> I just asked about a similar thing:
>>> https://github.com/quarto-dev/quarto-cli/discussions/7679.
>>>
>>> I'm going to see if you can hack up something based on your code. Thanks
>>> a lot!
>>>
>>> On Tuesday, November 14, 2023 at 3:27:53 AM UTC-5 Guillaume Dehaene
>>> wrote:
>>>
>>>> Yes, that's correct. This is a smart-margin feature.
>>>>
>>>> It wouldn't be too hard technically and probably desirable to annotate
>>>> individual elements of an equation block
>>>> (for example, consider highlighting a term being moved from one side of
>>>> the equal side to the other in two successive equations)
>>>> However, I've run into two design / UX issues when considering this
>>>> case:
>>>> - in the final HTML, how would the user interact with the annotation:
>>>>   - to see that an element is annotated (needs to work with nested
>>>> annotations, with multiple annotations, etc)
>>>>   - to see which elements are concerned by the currently-displayed
>>>> annotation (without interfering with the "is annotated" styling of the
>>>> other elements of the equation block)
>>>>   etc
>>>> - how would the writer specify the annotation, in a way that isn't too
>>>> disruptive of their normal workflow?
>>>>   - this is the bigger issue for me. without a rich-text editor which
>>>> supports highlighting of individual math elements, I don't know how to
>>>> handle this
>>>>
>>>> even If I had a great answer, there remains the issue of hacking it
>>>> inside of MathJax.
>>>> At this point, it might be better to actually fork their code, instead
>>>> of writing something a posteriori
>>>>
>>>> I'd love to have it as a feature someday, but it's in the distant
>>>> future.
>>>>
>>>> Le lun. 13 nov. 2023 à 17:32, Gwern Branwen <gw...-v26ZT+9V8bxeoWH0uzbU5w@public.gmane.org> a écrit :
>>>>
>>>>> So this does not let you annotate individual elements of the equation
>>>>> to provide popups/links or color them, but is only whole-equation level and
>>>>> basically a way to a margin-note/sidenote that aligns nicely with the
>>>>> equation?
>>>>>
>>>>> --
>>>>> gwern
>>>>> https://gwern.net <https://www.gwern.net>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "pandoc-discuss" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/pandoc-discuss/CAMwO0gzAOVy1QkYuR1MRwnGix%2BKsJJKfSMdFQka97jTUabQLQg%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/CAMwO0gzAOVy1QkYuR1MRwnGix%2BKsJJKfSMdFQka97jTUabQLQg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
> You received this message because you are subscribed to the Google Groups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/57a7749f-72bf-4d76-9422-296e57e80e42n%40googlegroups.com
> <https://groups.google.com/d/msgid/pandoc-discuss/57a7749f-72bf-4d76-9422-296e57e80e42n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAKOoOVUh%3DseSfpScCGywuvuTRxG1Tk4p00dSHCFacagw5DqXtw%40mail.gmail.com.

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

      parent reply	other threads:[~2023-11-23  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 14:16 Guillaume Dehaene
     [not found] ` <CAKOoOVVRAzpb7BDJXzR7NG8VUMASoXzBvFqJe-gAGpxiuMAwrw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-13 16:32   ` Gwern Branwen
     [not found]     ` <CAMwO0gzAOVy1QkYuR1MRwnGix+KsJJKfSMdFQka97jTUabQLQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-14  8:27       ` Guillaume Dehaene
     [not found]         ` <CAKOoOVUVuWVjcX7UkvgJTCErekjDarzFCeSRU7_=ZyNNqgCVUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-23  5:03           ` Hypatia
     [not found]             ` <4704092c-08bc-4755-a676-2f403166a3e3n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-23  5:04               ` Hypatia
     [not found]                 ` <c0cc24db-dcf7-4b6d-8d4f-a15a27fa2f82n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-23  8:41                   ` Hypatia
     [not found]                     ` <57a7749f-72bf-4d76-9422-296e57e80e42n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-23  8:53                       ` Guillaume Dehaene [this message]

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='CAKOoOVUh=seSfpScCGywuvuTRxG1Tk4p00dSHCFacagw5DqXtw@mail.gmail.com' \
    --to=guillaume.dehaene-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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.
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 NNTP newsgroup(s).