From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32280 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: A A Newsgroups: gmane.text.pandoc Subject: Re: Including SVGs with LaTeX math in Pandoc? Date: Mon, 6 Mar 2023 16:53:34 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c7a5ff05f63d4c50" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36195"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDJ77HUDRUCBBCUZTCQAMGQENSYU3WY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Mar 06 16:53:49 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qv1-f59.google.com ([209.85.219.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pZD9p-0009FX-OK for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 06 Mar 2023 16:53:49 +0100 Original-Received: by mail-qv1-f59.google.com with SMTP id z3-20020ad44143000000b005771ea56ab6sf5760720qvp.1 for ; Mon, 06 Mar 2023 07:53:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678118028; cv=pass; d=google.com; s=arc-20160816; b=OtxkoFc45yGheTCCNTNABFAWKf6uctGLwFglxvnjeKmxzaxeS441LVzJgCFNpFWux7 aiIbAnPM6bF/Byc9wkcw2hnTiBYtgFV+1/JmlXIR8xkrOcho3wZekAT2pMxrEakYSqx0 QuCWb0lag20UKXe3SM+bhBPKjyrhoOaVF1D0flddp42CumK1H12XpIdXk4viTpwpUDU2 mOHLgiuSnW3AdRU9wRQ0+Ln7a2l3/rnuSbgcXmSjjRiiwPOEdFh+jGEzdA8psDqRbSgc 5lhobapuIr5M/p2BOrepPQLZKbxScM0sw6H3mxqAkxu2g9eRCb2FfCSeRgrhVe2XtGnJ Jc4Q== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=URTa9iwGJaMr3/kfhJ3Wuc898mMjnWSTkAVGLvtOwl4=; b=J2mUQfbJ3hWpQvcyCIkw+Lm+BdHMWZ77P7if8U0J8RSxK1PopS1finRlCn7XuvtPNB 5yAUGP4XKA+izXeowzZhQFiso7emxt+lSnifoGUGcDWhQB69tACXyXxNocifZcRh1xEp W9x0CTFLIzL9l9f1IifcXxrTsytoc5ur4R4KMQp3xQEnqOavt+mpylauQdF1HyAguva3 X4x+X3PJgc/hwTOJKCU4MmYHgHugOitVxpWLSvXVSILYuGziOjhnV4CbMaW0jYUdL/Yh nd//x3IN1ZPAO5VIg+MHycbSi8P9zCbgZFrpTsL3ZbSxk6SlU07EosbBjKIGmaNolg4S KoAA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YQddJWj7; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1678118028; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=URTa9iwGJaMr3/kfhJ3Wuc898mMjnWSTkAVGLvtOwl4=; b=Fl5YqqJQMox3SdxekK8Ral0rh1d7m1UNgO4dn3yDpyzy2otBmJZCeT7c/6CqtnyZMt FP7FsxVm0YsT/22L9xAL4AmdUpQ+P6QT7eY0oCHRgpcy6iS5prwuOeL1FB2vRTsSgKfo ZBrcd0Fe+7/dPRWnF42omIhyd41OdGwIReo3rDHx77pY+doRZVHLIdeM1o1EQtwqZ4XY 2OR9eCVoyGxOXkkVxukzcvV5HIVHEJue8HKFl8fIlefWpYSO5N98/2YfBXOrTG9b3SoN qR/SPGrnXv8X11NfLzcRT/OkjOxV0XrTg2pr5J/GHDVu9NpykHD+3prRSrDormGG773t AsEg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678118028; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=URTa9iwGJaMr3/kfhJ3Wuc898mMjnWSTkAVGLvtOwl4=; b=UB/921PD5/dfpeWp73jD/hKr+aD7IsHQn5ip7SJfuxOsSHN0htsN0nAGGcr44wbwWw 7yy68N2kC8aiUMqYvq7Xf0i1Wp43DO5qk/kOjV+4wDyJ7CgtFgpMXy8PNgoBh813hAfP 3/aqqhmzjShBkF947H8JmgEnYGFT+zjz0cnOSNVHltR17s5W1uPaYdKerk+wR0c6iNHl SYmWnoYnZuZDpRvBLN2E5XzIlsjxQ55xFOwJWpO9oKQFPj7n+7zzDKBLuK4a2FN6q0jI bq7x2yEK/DhoxylGkhUJhnqD8vFyBMzz9xg+iTcv60Vto/1EvhCV19RuorvJ1RrAFOGc Sotg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678118028; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=URTa9iwGJaMr3/kfhJ3Wuc898mMjnWSTkAVGLvtOwl4=; b=SccASf5UZdI1fywoDHBiBMpKTmSUFrw/QMERrk2DA76RdNObtBwYiEpixFRmfKSTJK yDQrP7S+VSFzHmasLYm8+JLHP26cHooW0/pnwlZ12TJB8N+nLoO9lHr523/tiZuII9Gd uUkZLLrnaOWo9OgVlEYOwJFkF1KdRu6KF5BzM4JtoLQOn9eZ7FkpTuHs8EHzIUqDqGYo y4TU72eT3rpnIyqAZHbqgOXbjNQCMyudVjT8Ygk0eKQJUYdoDbunNNPvBNr5K65cVi2w T2tq9WAgvKJ8z2FnyzI6TeEZ3i9pgV22 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKW8ntKNQ9YrWWSjsVV9ppq73Wpvls0a2DqQaqI6d/NEUY7moo7X C0CnhX8ZPH+0rSfmpWHB1XQ= X-Google-Smtp-Source: AK7set8yD3p56oDt/iGVvTTyds4tTnzkCCUyObHnHOLYJhegM2NOMdtDFO5YGcC1a4sDvK+u1pPRNg== X-Received: by 2002:ac8:159:0:b0:3bd:f8:f6f3 with SMTP id f25-20020ac80159000000b003bd00f8f6f3mr2981036qtg.7.1678118028716; Mon, 06 Mar 2023 07:53:48 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac8:1199:0:b0:3ac:c6f0:fe49 with SMTP id d25-20020ac81199000000b003acc6f0fe49ls10437673qtj.7.-pod-prod-gmail; Mon, 06 Mar 2023 07:53:46 -0800 (PST) X-Received: by 2002:a05:622a:1a8c:b0:3b9:bc8c:c1fb with SMTP id s12-20020a05622a1a8c00b003b9bc8cc1fbmr24350703qtc.6.1678118026174; Mon, 06 Mar 2023 07:53:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678118026; cv=none; d=google.com; s=arc-20160816; b=hO1HWXEapvtVU3eHdX6hZQJR7HYvM1kQyLpRcl5RaGTMeZLAoS4tTn8YsS1cWGrYMz bpJ4yKC9mVG/UKy+aUNjfNy7y9NzRPRnBeyMFvau15ATe9cblMoWp5EE8VnFP/tVWv9w K2wzr8SG0v00KJEX9HBIprDv3iUO+tUjXnKOfoddzy5brFPf7TKPnCXexe4RTPX8RKAo VEY8QAr5GbgszzQtsr2WnHxYccptiO0J/fKo1Qy+z6ls6e/D7OfIUgFflLacjuwVQ83L Cymwb7kqArtu/wAYVuMJdriXD5qKrdeXsWQUIoQVw9gRvluyN6ib1A7L9ewD5EYjTcVs 2CeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nehFK/OV4lM1colh6VskpJOyMXZR8Fbqxl13+Aiw1zY=; b=bAp2Z4AlsA8P5T5c+Qc3BE5NcZ9u9C3r+LpU9cJoUdbl2+MAXv31gArK18EY76PE9D LWX2Kzy9p4Mj4YH037+i7BZdJLWc5b7yUJwvMjNwPHVXB1YK9+oIuRmF8OqDKz+xlC0e 5ZHmXRzVIWnfSnzNtI5wPp/Bi/jHnp/2x1JvjJBYE4tayYEgdkmov60CXdMiEe6PviDo MkCAVK8wZ5A/KMvZzZAL89tltj5d5rQMrRMeqFAgnzbvTHZLJcqrrJDpN/uxA5fwS1cN 30vCkfFwPTuLf3VKu3NzsGDGlfkkcptbJ7o/kwyb73q3TMTA6LM7i3V4m+10VsZLgUwW XWRA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YQddJWj7; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com. [2607:f8b0:4864:20::102d]) by gmr-mx.google.com with ESMTPS id 9-20020ac85909000000b003b83629a0a2si669552qty.5.2023.03.06.07.53.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Mar 2023 07:53:46 -0800 (PST) Received-SPF: pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) client-ip=2607:f8b0:4864:20::102d; Original-Received: by mail-pj1-x102d.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so13566947pjg.4 for ; Mon, 06 Mar 2023 07:53:46 -0800 (PST) X-Received: by 2002:a17:902:f812:b0:19a:f153:b73e with SMTP id ix18-20020a170902f81200b0019af153b73emr4368036plb.4.1678118025142; Mon, 06 Mar 2023 07:53:45 -0800 (PST) In-Reply-To: X-Original-Sender: amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YQddJWj7; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32280 Archived-At: --000000000000c7a5ff05f63d4c50 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'd rather not write any filters for this, and convert to PDF or another format externally, then embed in markdown. Is there perhaps a way to do that? On Mon, 6 Mar 2023 at 16:46, Bastien DUMONT wrote: > You can include the command directly in the resulting LaTeX document. Thi= s > filter should do the job: > > ``` > function Image(image) > local file =3D image.src > if FORMAT =3D=3D 'latex' and string.match(file, '%.svg$') then > return pandoc.RawInline('latex', '\\includesvg[scale=3D1.0]{' .. file= .. > '}') > end > end > ``` > > > Le Monday 06 March 2023 =C3=A0 04:11:37PM, A A a =C3=A9crit : > > I=E2=80=99d like to include SVG graphics in my LaTeX document using pan= doc. I > > understand this is currently [1]not supported so I have resorted to the > idea of > > performing the SVG to PDF conversion externally and then including in m= y > > markdown using something like this: > > > > ![whee](foo.pdf) > > > > I would prefer not to do this conversion using raw inkscape because the > svg > > package in LaTeX has the added advantage of rendering LaTeX math within > the > > figure if it encounters LaTeX math in the SVG. This won=E2=80=99t happe= n if I > only use > > inkscape. > > > > Unfortunately, I haven=E2=80=99t found a way to ensure that the resulti= ng PDF is > > cropped to the extents of the image after doing a LaTeX compilation. Fo= r > > example: > > > > \documentclass{article} > > > > \usepackage{svg} > > > > \begin{document} > > \includesvg[scale=3D1.0]{idea.svg} > > > > \end{document} > > > > will compile as a full A4 sized page with page number. If I then includ= e > it in > > my markdown as ![idea](idea.pdf) I=E2=80=99d get the whole page as my = =E2=80=9Cfigure=E2=80=9D > and not > > only the SVG. > > > > How can include SVGs with LaTeX math in Pandoc ? > > > > -- > > You received this message because you are subscribed to the Google Grou= ps > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email > > to [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [3] > https://groups.google.com/d/msgid/ > > pandoc-discuss/ > > CAMwawgPKcXu-CapB6d_vSWc7%3DvfA_sQSzFnnv4nGBurq6%2BMkEw%40mail.gmail.co= m > . > > > > References: > > > > [1] https://github.com/jgm/pandoc/issues/265 > > [2] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [3] > https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPKcXu-CapB6d_vSWc= 7%3DvfA_sQSzFnnv4nGBurq6%2BMkEw%40mail.gmail.com?utm_medium=3Demail&utm_sou= rce=3Dfooter > > -- > 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/ZAYK7Z%2BjpC9LlcAc%40loc= alhost > . > --=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/CAMwawgNE1b%2BLzo6edzZsOX_PA-Z9TDPVFKecb-CEFuy2cK0LXw%40mail= .gmail.com. --000000000000c7a5ff05f63d4c50 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'd rather not write any filters for this, and convert= to PDF or another format externally, then embed in markdown. Is there perh= aps a way to do that?

On Mon, 6 Mar 2023 at 16:46, Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> wr= ote:
You can inc= lude the command directly in the resulting LaTeX document. This filter shou= ld do the job:

```
function Image(image)
=C2=A0 local file =3D image.src
=C2=A0 if FORMAT =3D=3D 'latex' and string.match(file, '%.svg$&= #39;) then
=C2=A0 =C2=A0 return pandoc.RawInline('latex', '\\includesvg[sc= ale=3D1.0]{' .. file .. '}')
=C2=A0 end
end
```


Le Monday 06 March 2023 =C3=A0 04:11:37PM, A A a =C3=A9crit :
> I=E2=80=99d like to include SVG graphics in my LaTeX document using pa= ndoc. I
> understand this is currently [1]not supported so I have resorted to th= e idea of
> performing the SVG to PDF conversion externally and then including in = my
> markdown using something like this:
>
> ![whee](foo.pdf)
>
> I would prefer not to do this conversion using raw inkscape because th= e svg
> package in LaTeX has the added advantage of rendering LaTeX math withi= n the
> figure if it encounters LaTeX math in the SVG. This won=E2=80=99t happ= en if I only use
> inkscape.
>
> Unfortunately, I haven=E2=80=99t found a way to ensure that the result= ing PDF is
> cropped to the extents of the image after doing a LaTeX compilation. F= or
> example:
>
> \documentclass{article}
>
> \usepackage{svg}
>
> \begin{document}
>=C2=A0 =C2=A0 =C2=A0\includesvg[scale=3D1.0]{idea.svg}
>
> \end{document}
>
> will compile as a full A4 sized page with page number. If I then inclu= de it in
> my markdown as ![idea](idea.pdf) I=E2=80=99d get the whole page as my = =E2=80=9Cfigure=E2=80=9D and not
> only the SVG.
>
> How can include SVGs with LaTeX math in Pandoc ?
>
> --
> You received this message because you are subscribed to the Google Gro= ups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email
> to [2]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [3]https://groups.go= ogle.com/d/msgid/
> pandoc-discuss/
> CAMwawgPKcXu-CapB6d_vSWc7%3DvfA_sQSzFnnv4nGBurq6%2BMkEw%40mail.gmail.com= .
>
> References:
>
> [1] https://github.com/jgm/pandoc/issues/265
> [2] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [3] ht= tps://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPKcXu-CapB6d_vSWc7%3D= vfA_sQSzFnnv4nGBurq6%2BMkEw%40mail.gmail.com?utm_medium=3Demail&utm_sou= rce=3Dfooter

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ZAYK7Z= %2BjpC9LlcAc%40localhost.

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAMwawgNE1b%2BLzo6edzZsOX_PA-Z9TDPVFKec= b-CEFuy2cK0LXw%40mail.gmail.com.
--000000000000c7a5ff05f63d4c50--