From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31955 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: playduck Newsgroups: gmane.text.pandoc Subject: Jupyter Notebook to Latex Code Output Image scaling Date: Thu, 5 Jan 2023 06:43:34 -0800 (PST) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1864_1371235984.1672929814500" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19912"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD4KFGHA4MHRBF6E3OOQMGQES55SV5A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 05 15:43:39 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f60.google.com ([209.85.161.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pDRT1-00050C-3g for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 05 Jan 2023 15:43:39 +0100 Original-Received: by mail-oo1-f60.google.com with SMTP id y19-20020a4a9c13000000b004e3c9193e5esf5240248ooj.11 for ; Thu, 05 Jan 2023 06:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=WXZ6AnGMG0rPQ2UKTPgcdlBYjA49jH8BNCiYa8qhm0o=; b=q30JDr5RwSQ8A80UsaPnISi9lJaMLxSUh7ZEW5kgIxCXQu0i8yLINgQQrIm+c69FPz 1P0c1ygoKWfST7wEURWhibAt5PIC37ErEflrEiRYHrPl0N+F0X2GH92pbSyamOHaazfr fiChNwyZv/HRN0eBGQywezsk5Se/PKg48D0ZR/GnonansxW03/wlWDklxBUTPb5BV6rg 3+EXa/42W/MHwjcyhdlf3PrRP4OIGzEPcMc4x9UwXFYHlab18IehQDiAkFFKShP0o25O /BjQSfcMpaM285yTgEqXon6+MYASgq3hWjtQgSO9PALmXCYuMGtmsqg73B4PgNGvFgok HGug== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=WXZ6AnGMG0rPQ2UKTPgcdlBYjA49jH8BNCiYa8qhm0o=; b=D/gYyXrWbZYXLp+g2hD9KevTdMfZ1hhnJ+/MznjB8GLuKimTcCMMCo+86dYzRUizhW zJ2Splv54k9AHXPyScEmfvwayoQc8Zw0n6Hpoxhk7e/TXrfaAmEl6KoQvC7clVmbId+D 1swpV5kHs2/3TRTU5N80qNS53hYLaCGf0+giw6fzZGjGR5pbt12/hYxaNkYEWXcnNkQn NxDkX9SHyeqHGAaV1z3zDxYEOwYmpyICGwuKt4wmSGKzGrPesfiuDfopV6sqatUU9vft yevtEsSSogurclXUdOLPw2/dseLlZSnI1ZrvrgP4kBBlyuc/pGF1KrUxoEgcqCVD3EmF VtFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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-sender:mime-version:subject:message-id:to:from:date :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=WXZ6AnGMG0rPQ2UKTPgcdlBYjA49jH8BNCiYa8qhm0o=; b=fa8KRUFaOgJdw0NW/mNVqYqAdZzVTkme43D/cVIz+Z6ukccSHDX9CzitC+JwJuQHYC akJeVi/iUNbgrRqIreDpxTM5C0cb7mw9YJoNGAVnJkRXv9jzuHjIphEWkzrodVOFVW7Z MDOWyoZ7i1RY8hqrehCA+7dZrfyE4aOOrURecf2wWXTl0IBAYzIYleoo0ymUT1PgMfm2 QHFTO4BNlnJaeHIj1nkoMwnvNlkDo6pYjkdK3xphqDJfb7u7qtCVGHfAPfAMvJkYQskN GV1sFUPMPgn4mB/yzjXbVQcXO+Rl9JkJqQXdxGKe6PfI4jOXkfCf0KoDEL8QXk5IfVLA 6aVQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krnQy6fQOLUCMAdG7QC73U1dyhZRu+IfENx70DoiT3nLGRCmv1c gsFz/k7lwvZTRlnh4bqcm1c= X-Google-Smtp-Source: AMrXdXsoX/AS725lkBQH5UQY/J0D2MNGwFsqsK1DVRzFI13idmFltdDh/9j2fQmvEA46ZcnE3UG3lw== X-Received: by 2002:a05:6870:7999:b0:144:7c7a:9f09 with SMTP id he25-20020a056870799900b001447c7a9f09mr4251311oab.246.1672929817996; Thu, 05 Jan 2023 06:43:37 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:4e6:0:b0:66e:aed3:654a with SMTP id 93-20020a9d04e6000000b0066eaed3654als5938718otm.4.-pod-prod-gmail; Thu, 05 Jan 2023 06:43:35 -0800 (PST) X-Received: by 2002:a9d:62ca:0:b0:671:2d60:6329 with SMTP id z10-20020a9d62ca000000b006712d606329mr2748961otk.318.1672929815223; Thu, 05 Jan 2023 06:43:35 -0800 (PST) X-Original-Sender: robin.prillwitz-Re5JQEeQqe8AvxtiuMwx3w@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:31955 Archived-At: ------=_Part_1864_1371235984.1672929814500 Content-Type: multipart/alternative; boundary="----=_Part_1865_1525073225.1672929814500" ------=_Part_1865_1525073225.1672929814500 Content-Type: text/plain; charset="UTF-8" Hello, I want to convert a Jupyter Notebook to Latex. The notebook contains code which outputs images (through matplotlib in my case). How do I scale these output images like I can regular markdown images? Example: A normal image in Jupyter is defined as: ![](Example.jpg "Test Image"){ width=50% } and compiled with pandoc -f ipynb+link_attributes --extract-media=./ -o ./notebook.tex ./notebook.ipynb which results in the expected latex code: \includegraphics[width=0.5\textwidth,height=\textheight]{./Example.jpg} This works as expected. I want to apply the same scaling to the output of a (python) code block: import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.show() The notebook shows the image perfectly fine. Pandoc nicely exports this as: \includegraphics{./57d29df1312aa5fb761c415a60dea77444b9136b.png} How could I define the width here? The entire notebook.ipynb can be found here: https://pastebin.com/3k18hJHU Thanks, robin -- 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/f00976c4-8dc9-465b-8856-a608b1d52b43n%40googlegroups.com. ------=_Part_1865_1525073225.1672929814500 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello,

I want to convert a Jupyter Notebook to Latex.
The notebook contains code which outputs images (through matplotlib= in my case).
How do I scale these output images like I can regul= ar markdown images?

Example:

<= div>A normal image in Jupyter is defined as:
![](Example.jpg "Test Image"){ width=3D50% }
<= /div>
and compiled with
pand= oc -f ipynb+link_attributes --extract-media=3D./ -o ./notebook.tex  ./= notebook.ipynb
which results in the expected latex cod= e:
\includegraphics[width=3D= 0.5\textwidth,height=3D\textheight]{./Example.jpg}
T= his works as expected.

I want to apply the same sc= aling to the output of a (python) code block:
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.show()
The notebook shows the imag= e perfectly fine.
Pandoc nicely exports this as:
=
\includegraphics{./57d29df1312aa5fb761= c415a60dea77444b9136b.png}
How could I define the wi= dth here?

The entire notebook.ipynb can be found h= ere:

Thanks,
robin
<= br>


--
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/f00976c4-8dc9-465b-8856-a608b1d52b43n%40googlegroups.= com.
------=_Part_1865_1525073225.1672929814500-- ------=_Part_1864_1371235984.1672929814500--