From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28891 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Equation labels/references when converting from latex to markdown/other Date: Wed, 21 Jul 2021 22:24:32 -0700 Message-ID: References: <733e0d35-b1c4-4380-bf9f-7d6523c55162n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7367"; mail-complaints-to="usenet@ciao.gmane.io" To: Leena Murgai , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBHMC4SDQMGQENOCZSIY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jul 22 07:24:49 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f190.google.com ([209.85.167.190]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m6RCS-0001j3-JV for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 22 Jul 2021 07:24:48 +0200 Original-Received: by mail-oi1-f190.google.com with SMTP id l189-20020acabbc60000b02901f566a77bb8sf3266239oif.7 for ; Wed, 21 Jul 2021 22:24:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626931487; cv=pass; d=google.com; s=arc-20160816; b=EDiybFqjtHzsQc/4BZ5tZZEyKN4sm4Z8siTeNbN/wYnHKWWdV8IjA/ZkPfV1zHm+tw NBtMM1vbY/9WaneRu+C2QZ7SdmWaCTYXZzVO0XaSjF/eDHBcsBEeeN3U96jMoci4LUYR lYCxhlklEQgqHzBlwR1ZLtVWGeiLa/UUgeIiCtjcLArL/4OPg8coe6xunuKBqxOyPCOt 799d9F6pm4mjbgy0IjaKkfDNaDmkCWFjuoAxRimSqAH5wpeKTbW1TwzAj9Ui5cmD/BSr Pn0yzwJ5YmNSH0r3l6/1lvLtnr/PVzwhUnM2dCKKBTca6W8XI8+7ti3LY3d57bywGvz/ cidA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=fAWfdeeh7ZpIWiV46fXSx5mytJUv0M/DUz2OZYwbczQ=; b=qdKjWsukWhg0PBD1z0+XwZ1SzafM+zC0H2jgCvvjNEpDMM7Si3FN/oVot5Ef37WoKd NaGiUY+62meBnrCeEv8AaJdvN1xAJVY7P9wGc7hK+G33ECNquGxqlIYQu/Zf+ffuWV5C e4n7GBq/sk2r8+oJ7iikwogSkuQW6qWj/j1wecIy74SWznaCdAerkm5dj5tnLJh76ChK 5HmT9V+6+uIeeG1Tue4UACwVLWSjfFuOqI2grBqm8Vx89fMRkqXCA4+0bDUlYqwRskpo bfbzmo0wWZoLnFj9RJQ0klhF/8vUfW/8sx1UAVCtfm/3Rczc9XfOwY1EMzNucWqz5arq eHtA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=2FpHnUqr; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1031 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=fAWfdeeh7ZpIWiV46fXSx5mytJUv0M/DUz2OZYwbczQ=; b=ia9WIV0CUnwMElhJsaBTXHrEB++PX1vKrL5XBarcHBg8Dogm6ruqXWt6UU/qN8BJqI 3gETFwDib4Z2JQ17PZzf+ZpEVJowVi3Ke4pw5HqO1XSxmoSoZnCZN9Z6mKdUjh7565zs ARFTCoMFkHUoaNs+mP+dhf+eLztsgV4G8h8v1fSEcRdOFBkFraUfB5PI4KjWDRzH9xqX lv/sKWkItsPSMZhxUwRO0NK07vkYYX78s18UTbs6v2beuGFNDEx9pTVrS4r8vVZIF19S bsITnP7CKOZzWvhi7EDO5LPzmN1UWHoGE62Q7cwY7Uz2xEXVfZ37Fh7ecyhRBEAvVRoZ qb6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=fAWfdeeh7ZpIWiV46fXSx5mytJUv0M/DUz2OZYwbczQ=; b=aS9q+T9wZki1wWOw5wOHjr+pJQKvbdD9BYBhwRniqmkwh1ZmnJaEClpGVxr4AnIdjr TTG1f/ZWPMwC5G1LKsOvQjw9iO0JF9AmchexyGFonorno0VW0lFkvB9+nmRijK43zw5u KEQzukoCuEC8TWUvHpfChe9SE24SC/7Bmq7mL1xOWC7v5SDS+ASOCvWnDyRGa0/3Wt6d N8WQg9cGUvq+nLYSm/BKCWEVl877w6A0RSowPX5nVV6fW1P9YJm6XnMkMR65zBCinRbf v0wbmZuOkJNWWOEYVyb9Oap7OsOuB5rUXMcG7IkIWhKhi19/g/bk1CCMMqnTRVfb3qjW RWBw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532PfzfSUZzvTCgFsb0uWfwybhDsSJumtWHqukF9DuMiQkCkCbaa k/i32DDZMqRCe5SK9O2aGGI= X-Google-Smtp-Source: ABdhPJwJYs2U9lPzpVMH3raWrKtp0qx+nST2Nt5Dz9tPCbjO9MEYFzMbQyLVHqK0H6PtM5a+2yXveQ== X-Received: by 2002:a9d:6ad2:: with SMTP id m18mr28588206otq.0.1626931486927; Wed, 21 Jul 2021 22:24:46 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:2a05:: with SMTP id y5ls1431411otu.2.gmail; Wed, 21 Jul 2021 22:24:45 -0700 (PDT) X-Received: by 2002:a05:6830:1dfc:: with SMTP id b28mr28225840otj.282.1626931485450; Wed, 21 Jul 2021 22:24:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626931485; cv=none; d=google.com; s=arc-20160816; b=XjGVqBkOeMOky6rzfPJdzJ9qxijWBUvx5t5g74Vvi67+y1SWacvY/eXdg2qKmy++tV xO6dOZF5kVpnQuytUeoWtGgpiTAFc9mkaZLUsS/RUKwLO7z4R1/W+YkOZRNv9lKHJaa0 eYAdqTFpFBUz2SIb1Pw0QQZwtT3/Ig4CscquFpNBLBGtecsGbWLGByzrYYQZLcD81QM+ lH0fVYF4yYbIuyPXHsEMPhn/2HQb89eOHgNhvM7s5FqSpfxGATKc+kqX3gcA8RLtkh7J asLxYK+28qB9vTpk7uC+H7rzKIF1/sgzTmk896u57WF2ZcBP6uWx2PLZoYukkXrkcjW6 T+Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=J++Mz42K6tWMNnFSUUCmWjIK/SqFnqX80YSE2lX/a0Y=; b=tf9ej3E/W8K0/TEGWz5lMyt+KzjeAueG04BzSRDnImLlqHLwkktvPda7q/rty/GzhF pmcPYYr+4ZqdV+nkghdtE4OCfFeKmM6fLBuePuUtWOTAx7kqqS29cKEZdybIgVKlVlUZ co9puxZ1dKyDLXyFlLdD6IH3HRoZZA24VhXWSjoQjAkKd81UiZWWJVQStwVRMEH4wgX+ RqNGBpxgiv6iCPaOnHByuTyXoLLijEfiXFSB4Utm1KKgxIaAOGL/nKwlrTtLico7FtrR pbh8qilgshPRWtf8regt/rL9LxDJeVl1A2nC/0KrHQKw0nHa671zs+z8JDgtVIgD7nCL 0Mqg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=2FpHnUqr; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1031 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com. [2607:f8b0:4864:20::1031]) by gmr-mx.google.com with ESMTPS id j26si4120361ooj.0.2021.07.21.22.24.45 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jul 2021 22:24:45 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1031 as permitted sender) client-ip=2607:f8b0:4864:20::1031; Original-Received: by mail-pj1-x1031.google.com with SMTP id k4-20020a17090a5144b02901731c776526so2610179pjm.4 for ; Wed, 21 Jul 2021 22:24:45 -0700 (PDT) X-Received: by 2002:a17:90a:1109:: with SMTP id d9mr38805424pja.183.1626931484353; Wed, 21 Jul 2021 22:24:44 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id i18sm29620369pfa.149.2021.07.21.22.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 22:24:43 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id C3623A249; Thu, 22 Jul 2021 01:24:32 -0400 (EDT) In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=2FpHnUqr; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1031 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:28891 Archived-At: As I said: Just let us know what you want to appear in the HTML, and we can show you how to do it. Leena Murgai writes: > Hi John, > > Can you clarify your work around here? I wasn't able to follow. > > I have a similar problem converting from LaTeX to HTML5 - \label and \ref > for equations don't work. I'd be super grateful for any advice you could > offer. > > Thanks! > Leena > > On Tuesday, 29 June 2021 at 11:23:40 UTC-7 John MacFarlane wrote: > >> >> This isn't yet supported, really. But you might be able to >> work around it. >> >> Note: >> >> % pandoc -f latex -t native >> \ref{foo} >> ^D >> [Para [Link ("",[],[("reference-type","ref"),("reference","foo")]) [Str >> "[foo]"] ("#foo","")]] >> >> So when pandoc parses \ref{foo}, it doesn't just create a string >> [foo]; it creates a link with attributes. You could use a lua >> filter to turn this into something that mathjax can consume >> (raw tex, I would imagine). >> >> Just let us know what you want to appear in the HTML, and we can >> show you how to do it. >> >> Ian Price writes: >> >> > Hello, >> > My university is looking into the options for converting various notes, >> > exercises sheets, presentations, etc. from latex generated pdf into a >> more >> > accessible format. This basically means converting to html + mathjax >> > because this tends to work better for screen readers. Converting beamer >> > seems to be impossible, but for notes pandoc (and some others like >> latexml) >> > is generally giving good output, however the major issue is cross >> > referencing between text and maths blocks. >> > >> > In short, mathjax can handle internal links from maths blocks to other >> > maths blocks, and pandoc can handle links to other parts of pandoc >> > documents, except when a document makes specific reference to an >> equation. >> > For example, suppose we have the following mwe.tex cut out from some >> > electromagnetism notes >> > --- >> > \documentclass[12pt]{article} >> > \begin{document} >> > \begin{equation} >> > J \equiv \frac{dI}{da_{\perp}} = \rho v. >> > \label{volume-current-density} >> > \end{equation} >> > The total current crossing a surface $S$ can be calculated by >> integrating >> > Eq. (\ref{volume-current-density}): >> > \end{document} >> > --- >> > When converted to markdown, we get the following >> > --- >> > $$J \equiv \frac{dI}{da_{\perp}} = \rho v. >> > \label{volume-current-density}$$ >> > >> > The total current crossing a surface $S$ can be calculated by >> > integrating Eq. >> > >> ([\[volume-current-density\]](#volume-current-density){reference-type="ref" >> > reference="volume-current-density"}): >> > --- >> > The link to the label volume-current-density is clearly broken and when >> I >> > get my html file it does nothing in particular. >> > >> > One solution I've seen is to convert the label references to the syntax >> > used by, e.g., pandoc-crossref, but this involves me editing the >> markdown >> > by hand. Is there an automatic way to convert these? >> > >> > -- >> > 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/733e0d35-b1c4-4380-bf9f-7d6523c55162n%40googlegroups.com >> . >> > > -- > 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/d3a1fa02-147c-45c2-8ee1-462db48baa44n%40googlegroups.com.