From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26057 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 13:49:07 -0700 (PDT) Message-ID: <0e1b938d-3665-4be2-9681-c835d596aba2n@googlegroups.com> References: <3fea3a24-cdff-41a0-9c3e-ffcfadaff90en@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1024_1698216812.1599166147181" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22855"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCQ7HU4AQEHBBRFNYX5AKGQE77YMH6Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 03 22:49:11 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f62.google.com ([209.85.161.62]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kDwAR-0005md-NU for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 03 Sep 2020 22:49:11 +0200 Original-Received: by mail-oo1-f62.google.com with SMTP id z2sf1838636ooj.0 for ; Thu, 03 Sep 2020 13:49:11 -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=8kZd/3BZ6ap3MHOd+QdMIEPWS3bhIokMja2ntfhKO78=; b=YtYpxk6jHYsj13QdKBuPcc6g/jzLoidpLVLXU4Zvg7KslAReg2Rp/RxDxZA9JOyfkL fDpOXa9o91AXDiaIcsmSIuow2FptwpxNrLVRV/SdF7Jo9ryA57uzNfX+wxaBelqHYDfj n7jViBXW9//xe8yTLaxjCeknQTU6q0L9PVOglE7+NblzJqBmojOyhFK7FszWWLT3puDN /qudaQBoaSWq5Q4imkwGwCCp6BuvgjWzeMaaPeYq4Ki3oQJ/M4DXnf8GU0QjNwkB3lRG 0vyhmbIu22LLUjkuGbPCe+Hj5XdVr7RX2mj9a8iPJZ8m6bKfZ4jl2d5BznkLEllDpU0l 9PHg== 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=8kZd/3BZ6ap3MHOd+QdMIEPWS3bhIokMja2ntfhKO78=; b=Qq6LRQUMxSfNlY08V+qfJSTUNyX43c1RVrG/8PmHU3nYtbOmzWL8fOCWjh211DJfRf wgK+jhtaFfKSH6ZlSbPFZ1Y1ERZCiwIGp0NPvNmGbuXGddlgtapb0KBJQxko8PN1JajX sxbnBmfOgnN2repA7+laTumVxaXGJxd29AjkYiXyHt+MrP5hmoCHa7qmkJtIEPrc7m33 2oeZ/ytLagvYlgrr0HLlPi3xTLXbxDLuWz6m0GS1VST8MLNyCb3AP6PcwWPbUwbl83Km xIshF1cq27cV9eesblFNAZlrowT6to7Ci+OxmZcN0rdK6xkIxZQKwLqPcCHDeLgUR2zW ZxIg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532lgUxj4cNjCmZqhBazNA0LAP9/oWIYyK9eqyZBio+cNp4mrWIS /s7iTyaKtIlrOxOkhtpJkZs= X-Google-Smtp-Source: ABdhPJygNiRxD/gEqFPvA7aUzEzhzgQS34767diped9+chJoAKxLECXaAurpuo3OkS9C6f708wYNgQ== X-Received: by 2002:aca:aad0:: with SMTP id t199mr226911oie.48.1599166150692; Thu, 03 Sep 2020 13:49:10 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:2231:: with SMTP id o46ls1803395ota.11.gmail; Thu, 03 Sep 2020 13:49:08 -0700 (PDT) X-Received: by 2002:a9d:ae7:: with SMTP id 94mr3204469otq.283.1599166148054; Thu, 03 Sep 2020 13:49:08 -0700 (PDT) In-Reply-To: <3fea3a24-cdff-41a0-9c3e-ffcfadaff90en-/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:26057 Archived-At: ------=_Part_1024_1698216812.1599166147181 Content-Type: multipart/alternative; boundary="----=_Part_1025_326759630.1599166147181" ------=_Part_1025_326759630.1599166147181 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable oh my god, im gonna jump off a cliff It was literally the `--standalone` switch breaking everything. I'm so dumb= =20 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 few= more: > > - the locally-generated copy doesn=E2=80=99t include the \[ \] bracket= s in the=20 > 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 p= roblem): > =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 my= =20 >> laptop, but the gitlab runner / pages copy seems to have perpetual issue= s=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 in=20 >> a semi-formatted way, and again beneath it, without any coherent formatt= ing=20 >> whatsoever: >> >> When I took a peek into the head, I saw that katex=E2=80=99s scripts and= styles=20 >> *did* seem to be present, but for whatever reason, they don=E2=80=99t se= em to be=20 >> running. In my local copy, I have fonts and styles associated with the= =20 >> katex-html element that just aren=E2=80=99t even there with the katex-ht= ml 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 en= d of the=20 >> week.=20 >> >> It=E2=80=99s clear things aren=E2=80=99t being incorrectly parsed (for e= xample, by some=20 >> of the wonky filters=20 >> =20 >> I=E2=80=99ve setup), since the raw test output appears to be doing thing= s=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 t= he 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 span.= =20 >> Maybe this is preventing the script from recognizing the katex structure= s?=20 >> Either way, I have no clue how to prevent this from happening, or why it= =E2=80=99s=20 >> 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/0e1b938d-3665-4be2-9681-c835d596aba2n%40googlegroups.com. ------=_Part_1025_326759630.1599166147181 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
oh my god, im gonna jump off a cliff

It was l= iterally the `--standalone` switch breaking everything. I'm so dumb lol

NVM, thanks guys

On Thursday, September 3, 2020 a= t 4:34:22 PM UTC-4 MyriaCore wrote:

Alr= ight, so the all caps README.html is the locally-ge= nerated copy, and the lowercase readme.html 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/0e1b938d-3665-4be2-9681-c835d596aba2n%40googlegroups.= com.
------=_Part_1025_326759630.1599166147181-- ------=_Part_1024_1698216812.1599166147181--