From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28716 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: Tue, 29 Jun 2021 11:23:23 -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="8359"; mail-complaints-to="usenet@ciao.gmane.io" To: Ian Price , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBKOK5WDAMGQEIV5FGOI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 29 20:23:41 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f189.google.com ([209.85.210.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lyIOb-0001x8-8t for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 29 Jun 2021 20:23:41 +0200 Original-Received: by mail-pf1-f189.google.com with SMTP id 78-20020a6216510000b0290306fb0174a7sf21359pfw.4 for ; Tue, 29 Jun 2021 11:23:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624991019; cv=pass; d=google.com; s=arc-20160816; b=WNq8dCuu2wGoZYaaf3S1SVHIxqUyCaLaLW1id239fXC6ymyrmJ2ZFOc0b6scO2/blf EXMZR4mGiXkMZeAYWlqb6T4/8tulg6FvyO0LUJbUj+z4uIcHeYElYa3LAmQqJSWqTiUE Sw0E6V80E8pIinK461OOLWQkmVHF5VWxL6HgECuG0wvV0UkaNCwe0Hk/HhFexQjpBoGT eNphWoARxrVTAPBd5UqgoylGVnuYHJ2TXP14LUg+I1sv0+McTJjr+nQta4WUlnyd6TaC y13BXaHrTG5X8Dee/CiH5YcXr0jXbpln+89WIgCfCUmqWQfBfH357QQ8s87wtvdvQpT9 VRoQ== 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=HObQ0M0gsVLzRyYbKS0arfXvF2tIQAtt8KM4hZRN2M8=; b=jyq7YGBcKv/hschJLnBlrpzAGrF5LZjBQNy8Vhu3IVi/83uFl/6k82awhhkEFiVTdI AD/pv+MObCfplmcugZ2ubIaWnpYiEIB5x2fvLas4tgXXU4JYUpLsvv8ocEBpjVuRjvbc DXFUBvTdEedE+RFgvt6arr6TIjMGGfJ5Rf2z3LLk9dqb1iN5atqPO/2Lyfm0EWSzfVOZ Z4eFZ8f+R/bL4tfZ7AcJ/jGrVBmustIhhcjG4Aaxw7KmBUORreyBBv0VI/tiEZktudpr wV0RAa0WR6Fh7yNzL5xWcPix/zCHHg9YHest4LEXziRJ3cxpQmjRIBlbctqZ+oruSC3a 7i+w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=rUKy33dB; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1033 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=HObQ0M0gsVLzRyYbKS0arfXvF2tIQAtt8KM4hZRN2M8=; b=rv6CGKwCSnN/nT9FWnwj/SJw4njAyV7XQbHjtkQh382VQYuTomS7AhKYJw+e+yCIhB rxdbHarLgNBs1AZKFKy7ccq3gwIOFMHR9GgCqP5eiIuvBqkVdJ7BANrpOcTsl3Nw7MhZ JfyuY+1zp2tAmHu13qWl5C+Aup1zVdB8YruEnGTzDjHsB7zTlPX/TpRxqqZG94cbsClb pjCNB5bzqVDXu49niT9UIXUy+lJaINf3cNsoHxJt+kp3QX2fjdCk4q24vankf8gy3USV L1dsWUtE7AB5toq+U25UHJCefPgvDPFsYOkWXTBpuG+ywqv9MQA2KXBaG9Q7ZnDs+2np b2Ow== 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=HObQ0M0gsVLzRyYbKS0arfXvF2tIQAtt8KM4hZRN2M8=; b=HpL+f3lhMD8g2zG1sMGKxYVCA/SB6Jrc3vH0/QzHrPabO9hrPTULJXqSSj6JA5N6Jb A53gsQD/wT4UZqeAAY81EWVagEV6EM3/7zbjCL7Vo4dvS+A46X5zP7EBcL8TwIBw6UkX 8QBMLWNrct0GIza2Pe0VhOnnQ4ulQvEx+FJV3/kBCt6Mm+wwuFAeBc/zEj4xujRXVsqq kkuUkUVwEhG2D3YruihbIXmGB+Ta3NK2RD41pVBc4IhCwz846sU5hqZx94N993PmiUYP GBJBWcJEKN1heG4dgb0wkLLD+xsfnBFH9a3DQFLmWDlsiNqD1MEnoiIOpHVA4ZKslDPo b8Eg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530PoRTnMMqrgkoTOUanRJu0fYh57Xs9NZPFD48q+yQmZNzwOWCV dW5hDExD5Su3bird6Iy7Yoc= X-Google-Smtp-Source: ABdhPJyRrBKQ5sUd+gkBC43yZiTdGxhZnIfr2xrghcRCO9/rm4QjevP3mtXPhwPXH+noWXP8QGEiuw== X-Received: by 2002:a05:6a00:181d:b029:303:6dc8:62f0 with SMTP id y29-20020a056a00181db02903036dc862f0mr30806222pfa.35.1624991019714; Tue, 29 Jun 2021 11:23:39 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:1946:: with SMTP id s6ls9972891pfk.8.gmail; Tue, 29 Jun 2021 11:23:37 -0700 (PDT) X-Received: by 2002:a63:f609:: with SMTP id m9mr7634118pgh.74.1624991017313; Tue, 29 Jun 2021 11:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624991017; cv=none; d=google.com; s=arc-20160816; b=TYvYuyFI02FkDBDb9xN5x4ZsgYGvrujW/e6HF26u5oIgtl7j0xBoBog8n1kzt4bCyo d8Z09U7xtOmxWnsAT9Hf0NjjQBx+40L4b36fwGnu/5fPYHCrHXDZciiiezNHWhXYLyMO Dc2DTkQcpR2aQKEY7vKxduK3hNmHGvFQnj1jhKR6P9t9bJszkZ7qWMRUuypV2+VnTKOl 9/Tkg48nrvynJc3nnXvGAl2c3Tb+WQCdo99OAiqCZv0yrILpVkQi2cpzPhYSnnGimqWN Gj4TYMzsot4LA+u++R4X8ta/7RbpQCRo3sPS3s+XJC29AW++CmW84/a/6JC02DfjQX4w 5tRw== 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=Yk7qMkBFtbSPI4eB2AhrSxSkW6TxW+/CJTHT4TJn9mg=; b=YsBrT9JIuXKziZF5U2yasGhfGD10891vLlCcPQWKcmad6Dr+f83QUF9/K22Zww2K57 lOnyyvxlBPC3AUuiBFkjZT/fHpc9uXStp1AnST6iMzFlLlDmEmMP4TtqmymkIZtZ3yir hjj7ASCtc3Gl7jYslipkniB/6+H2bU9bvU9UHYn0VZ8cmP0GcAqT3OhE/akXF1vEyuwh xJWDGKX18bvl17adI002xgfqi9wXa2qCDhAelhxt3OFiwNyndT5GARd4tK9m7/nwb4tZ siJWB4tmL2RKAH8oaC+A1XbOS2NTT8b1EZ3kq1Y3dpB7/ktaVIEERzVweqkCYtiDxe5x U9YQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=rUKy33dB; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1033 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com. [2607:f8b0:4864:20::1033]) by gmr-mx.google.com with ESMTPS id br11si302002pjb.3.2021.06.29.11.23.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Jun 2021 11:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1033 as permitted sender) client-ip=2607:f8b0:4864:20::1033; Original-Received: by mail-pj1-x1033.google.com with SMTP id g24-20020a17090ace98b029017225d0c013so1248740pju.1 for ; Tue, 29 Jun 2021 11:23:37 -0700 (PDT) X-Received: by 2002:a17:90a:e98f:: with SMTP id v15mr35835820pjy.144.1624991016816; Tue, 29 Jun 2021 11:23:36 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id a20sm8314320pfo.190.2021.06.29.11.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:23:35 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id B4DE2A249; Tue, 29 Jun 2021 14:23:23 -0400 (EDT) In-Reply-To: <733e0d35-b1c4-4380-bf9f-7d6523c55162n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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=rUKy33dB; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::1033 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:28716 Archived-At: 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-discuss+unsubscribe-/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.