From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26058 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: MyriaCore Newsgroups: gmane.text.pandoc Subject: Re: Katex Date: Thu, 3 Sep 2020 14:03:18 -0700 (PDT) Message-ID: References: <3fea3a24-cdff-41a0-9c3e-ffcfadaff90en@googlegroups.com> <0e1b938d-3665-4be2-9681-c835d596aba2n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_538_1151997793.1599166998196" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7842"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCQ7HU4AQEHBBF5UYX5AKGQEQKFIIVI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 03 23:03:23 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f64.google.com ([209.85.161.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDwOA-0001vS-OL for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 03 Sep 2020 23:03:22 +0200 Original-Received: by mail-oo1-f64.google.com with SMTP id i1sf1842272ood.9 for ; Thu, 03 Sep 2020 14:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=TpZhjz4Tk+8fHioWKnghwueNxc/L72Is3giCmTKMGj8=; b=Fs7gF80JGqVnHKFY6n3T6rXsEZqgj1B3sw3pqSn2ZJP3sIsFj8TZWsQfkJvox7aerv 4WGf1Pal/bGERRXCbwlNd6vMugkkzzlDS8QfwLlUT2BvlgVQfvnVZH/2ryrK7eYKFsbI hQO2JdpCWzaBDbS9q8YCwR00vsZ/YYfUnh1kTaAJsVqrGZaZ5x8lO1gT+wMTQ5oMJMkK ZFntTgR7YLRVR+gd/cun7ql93YfknHvYmV5EEG/dC0fYHaWMwV/Zq2mMgaH7ZAY8t/Nh XZzjCm52ZKHYmgpR1cQ0VB1aJDPQ8Jnxh2moX3XPSMhmE+MUt3w11yToHzxmrs6vqtBk wB5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=TpZhjz4Tk+8fHioWKnghwueNxc/L72Is3giCmTKMGj8=; b=oDwaDVI3GtkzwRzLYEGCNYJNS5aPdscBvRMDd4KERxZr2ofqME45LolrUAxbNSyeE7 +dkFNZSQHTa5OExQjb2IP74VqH3iyMMNyQVhfWCC2F+DIn8a9BcAgOACIyEt9nM9sIyx KiuIicaCSSpuXAEWzbiwWE4Nt5JXvT/HFb9Pedd5XxfZ6y4UC4a23i9tddp3kPIS2ong 8EUju5wqgdyJ0nC7mXyNqG/y0HE9oy+QpQDUlkDXEA04Hg1W5yASPBqkXffoMDU7Kay0 TGK2waaq7Bh5WGjuEc7bAherohUzdJblTz9zhrh/6o6rRM6fqL1vDsPvAoM2idXVx6Vt u5hg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532L3OzofH9CIm6nwkIPc2ndbh50gN9oS3G26goMUjsdKSV8XZ1k Wp9nIxd/6WrCOJJUfT4kXNA= X-Google-Smtp-Source: ABdhPJypQBOr/q+jIWA5S693sgBypDiBEe9rj1M52ieAqXvISXWPZ9GVK0jfvpqPcZOgTTnICUg5RQ== X-Received: by 2002:a05:6830:1283:: with SMTP id z3mr3005915otp.51.1599167001741; Thu, 03 Sep 2020 14:03:21 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:2231:: with SMTP id o46ls1813005ota.11.gmail; Thu, 03 Sep 2020 14:03:19 -0700 (PDT) X-Received: by 2002:a9d:5d17:: with SMTP id b23mr3258924oti.54.1599166999188; Thu, 03 Sep 2020 14:03:19 -0700 (PDT) In-Reply-To: <0e1b938d-3665-4be2-9681-c835d596aba2n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: me-iMRNxolsNr8QFTY0IWPKwg@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:26058 Archived-At: ------=_Part_538_1151997793.1599166998196 Content-Type: multipart/alternative; boundary="----=_Part_539_1870537873.1599166998196" ------=_Part_539_1870537873.1599166998196 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable In the future, is there a way to support `--self-contained` (not=20 `--standalone`, I misspoke) with katex at all? This still doesn't explain= =20 why it worked on my laptop, but not on the gitlab runner.=20 On Thursday, September 3, 2020 at 4:49:07 PM UTC-4 MyriaCore wrote: > oh my god, im gonna jump off a cliff > > It was literally the `--standalone` switch breaking everything. I'm so=20 > dumb lol > > NVM, thanks guys > > On Thursday, September 3, 2020 at 4:34:22 PM UTC-4 MyriaCore wrote: > >> Alright, so the all caps README.html is the locally-generated copy, and= =20 >> the lowercase readme.html one is the one that the gitlab runner=20 >> generated.=20 >> >> I=E2=80=99ve been looking for a few differences, I=E2=80=99ve found a fe= w more: >> >> - the locally-generated copy doesn=E2=80=99t include the \[ \] bracke= ts in=20 >> the text of the math display span=20 >> - the locally-generated copy seemed to include a script that the=20 >> runner-generated one didn=E2=80=99t have (this is almost certainly a = problem): >> =20 >> >> =20 >> =20 >> Really not sure why this is happening here, and not locally on my laptop= =20 >> but >> On Thursday, September 3, 2020 at 4:15:19 PM UTC-4 MyriaCore wrote: >> >>> Hi all! >>> >>> I=E2=80=99m really struggling setting up gitlab ci/cd=20 >>> to render with my=20 >>> notes. Everything works perfectly when I generate the html locally on m= y=20 >>> laptop, but the gitlab runner / pages copy seems to have perpetual issu= es=20 >>> that my laptop really doesn=E2=80=99t seem to have.=20 >>> >>> The bug I=E2=80=99m experiencing is that my math is displaying *twice* = - once=20 >>> in a semi-formatted way, and again beneath it, without any coherent=20 >>> formatting whatsoever: >>> >>> When I took a peek into the head, I saw that katex=E2=80=99s scripts an= d styles=20 >>> *did* seem to be present, but for whatever reason, they don=E2=80=99t s= eem to=20 >>> be running. In my local copy, I have fonts and styles associated with t= he=20 >>> katex-html element that just aren=E2=80=99t even there with the katex-h= tml one=20 >>> served up by gitlab pages.=20 >>> >>> This is the command I=E2=80=99m using: >>> >>> pandoc --from markdown --to html5 \ >>> --self-contained --standalone \ >>> --filter pandoc-plantuml \ >>> --filter pandoc-mermaid \ >>> --lua-filter gitlab-math.lua \ >>> --lua-filter fix-links.lua \ >>> --katex=3Dhttps://cdn.jsdelivr.net/npm/katex@latest/dist/ \ >>> --template=3DGitHub.html5 \ >>> $(MARKDOWN) >>> >>> I=E2=80=99m not sure why this is happening on the runner, and not on my= laptop.=20 >>> This is something that I=E2=80=99d really like to have working by the e= nd of the=20 >>> week.=20 >>> >>> It=E2=80=99s clear things aren=E2=80=99t being incorrectly parsed (for = example, by some=20 >>> of the wonky filters=20 >>> =20 >>> I=E2=80=99ve setup), since the raw test output appears to be doing thin= gs=20 >>> correctly. For example, this: >>> >>> {{m+n} \choose m } =3D \frac{(m+n)!}{m!n!} >>> >>> =E2=80=A6 is translated into this, when output to stdout: >>> >>>

\[{{m+n} \choose m } =3D \frac{(m+n)!}{= m!n!}\]

>>> >>> The only big difference that I=E2=80=99ve been able to spot is that on = the pages=20 >>> copy, when viewed through a web browser, there seems to be a weird=20 >>> classless span between the math display span and the katex-display=20 >>> span. Maybe this is preventing the script from recognizing the katex=20 >>> structures? Either way, I have no clue how to prevent this from happeni= ng,=20 >>> or why it=E2=80=99s even happening at all. >>> >>> Any insight? Thanks so much! >>> >> --=20 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 e= mail 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/ba631a7b-0fc3-4964-846b-2583a707c850n%40googlegroups.com. ------=_Part_539_1870537873.1599166998196 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable In the future, is there a way to support `--self-contained` (not `--standal= one`, I misspoke) with katex at all? This still doesn't explain why it work= ed on my laptop, but not on the gitlab runner.
On Thursday, September 3, 2020 at= 4:49:07 PM UTC-4 MyriaCore wrote:
oh my god, im gonna jump off a cliff
<= br>
It was literally the `--standalone` switch breaking everythin= g. I'm so dumb lol

NVM, thanks guys
<= br>
On Thu= rsday, September 3, 2020 at 4:34:22 PM UTC-4 MyriaCore wrote:

Alright, so the all caps README.html = is the locally-generated copy, and the lowercase readme.ht= ml one is the one that the gitlab runner generated.

I=E2=80=99ve been looking for a= few differences, I=E2=80=99ve found a few more:

  • the locally-generated copy doesn=E2=80=99t i= nclude the \[ \] brackets in the text of the math display span
  • the locally-generated copy seemed to include= a script that the runner-generated one didn=E2=80=99t have (this is almost= certainly a problem):
    <script>document.addEventListener("DOMContentLoaded", function () {
       var mathElem=
    ents =3D document.getElementsBy=
    ClassName("math");
       var macros =
    =3D [];
       for (var i =3D 0; i < mathElements.length; i++) {
        var texText=
     =3D mathElements[i].firstChild;
        if (mathEle=
    ments[i].tagName =3D=3D "SPAN&quo=
    t;) {
         katex.render(texText.data, mathElements[i], {
          displayMode: mathElements[i].classList.contains('display'),
          throwOnError: false,
          macros: macros,
          fleqn: false
         });
      }}});
    </script>
    

Really not sure why this is hap= pening here, and not locally on my laptop but

=E2=80=8B
On Thursday, September 3, 2020 at 4:15:19 PM UTC-4 Myr= iaCore wrote:

Hi all!

I=E2=80=99m really struggling s= etting up gitlab ci/cd to render with my notes. Everything works pe= rfectly when I generate the html locally on my laptop, but the gitlab runne= r / pages copy seems to have perpetual issues that my laptop really doesn= =E2=80=99t seem to have.

The bug I=E2=80=99m experiencin= g is that my math is displaying twice - once in a semi-formatted w= ay, and again beneath it, without any coherent formatting whatsoever:

3D""

When I took a peek into the hea= d, I saw that katex=E2=80=99s scripts and styles did seem to be pr= esent, but for whatever reason, they don=E2=80=99t seem to be running. In m= y local copy, I have fonts and styles associated with the = katex-html element that just aren=E2=80=99t even there with the katex-html one served up by gitlab pages.

This is the command I=E2=80=99m= using:

    pandoc --from markdow=
n --to html5 \
        --self-contained --standalone \
        --filter pandoc-plantuml \
        --filter pandoc-mermaid \
        --lua-filter gitlab-math.lua \
        --lua-filter fix-links.lua \
        --katex=3Dhttps://cdn.jsdelivr.net/npm/katex@latest/dist/ \
        --template=3DGitHub.html5  \
        $(MARKDOWN)

I=E2=80=99m not su= re why this is happening on the runner, and not on my laptop. This is somet= hing that I=E2=80=99d really like to have working by the end of the week. <= /p>

It=E2=80=99s clear things aren= =E2=80=99t being incorrectly parsed (for example, by some of the wonky filters I=E2=80=99ve setup), since = the raw test output appears to be doing things correctly. For example, this= :

{{m+n} \choose m } =3D \frac{(m+n)!}{m!n!}

=E2=80=A6 is translated into th= is, when output to stdout:

<=
p><span class=3D"math displa=
y">\[{{m+n} \choose m } =3D \frac{(m+n)!}{m!n!}\]</span<=
/span>><=
/p>

The only big difference that I= =E2=80=99ve been able to spot is that on the pages copy, when viewed throug= h a web browser, there seems to be a weird classless span between the math display span and the katex-display= span. Maybe this is preventing the script from recognizing the kate= x structures? Either way, I have no clue how to prevent this from happening= , or why it=E2=80=99s even happening at all.

Any insight? Thanks so much!

=E2=80=8B

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/ba631a7b-0fc3-4964-846b-2583a707c850n%40googlegroups.= com.
------=_Part_539_1870537873.1599166998196-- ------=_Part_538_1151997793.1599166998196--