From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31956 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: playduck Newsgroups: gmane.text.pandoc Subject: Re: Jupyter Notebook to Latex Code Output Image scaling Date: Thu, 5 Jan 2023 06:48:25 -0800 (PST) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1394_1357408775.1672930105616" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5555"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD4KFGHA4MHRBOWG3OOQMGQED35RWQA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jan 05 15:48:30 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f58.google.com ([209.85.160.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pDRXh-0001Iv-R8 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 05 Jan 2023 15:48:29 +0100 Original-Received: by mail-oa1-f58.google.com with SMTP id 586e51a60fabf-14c958c18b5sf16207600fac.23 for ; Thu, 05 Jan 2023 06:48:29 -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:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=WWkqbuKsCLHI1xvuXdpan5NscmvmvAgLjZQ5d/RHLFo=; b=FUOqJHIqbkD8tfGrGpAM6f7s8JuOV8OxxI4w/3qDXq/JF+Il7sdCWdNk1v68TMXHyt 6N0BWGPGCrX/RKbjF6leL5weS9a/VK7avLBtUTbeC9i/FeJiIzRZzpHue6yvL54t5MQT obbY5UvelrpyjD/1d4JDeONM7MqAjs+r8FodbKLxnvxBGwWEe8whfGe1BY+rOTgg1832 bbozdq+4OfuHpyXwgCgxd7BKOhuWe7y8N5AJe1qI28ZyoBRdvhz93hAbfCpHxO3C/LkF BtvxvDPPFxRmbFgFwtYmxrz7jK1avaXBGurAJVydQvycB7eyFhccwAWBsXxHCk0hotPJ YXkQ== 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:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=WWkqbuKsCLHI1xvuXdpan5NscmvmvAgLjZQ5d/RHLFo=; b=GeasVRNwu/RCZvpOl1uV/Fs8U4PsXB3A3S42VBsvakMQnhIBJil0u0lMUSkZTqBXsV FWxMyDt1r/Hm64LfqMBi2rka3jh18RvHEZsOVFVN5Aja4pHGCIjfgBcIV/+YopLUi5jo MVT7o+Y2ypIGQH9bq94Mw9o0xX3TzVDJdT+OPycWSj4W95MDIkaEkqiN9GeLocuaPBYm BRNeORUkfblshjtjh68YdYYpDQlXhWK9zq6SJ64TF+eF8pGuRNIa2nyUedoCAnre0eqc +KGRj8lHihYxSiz/j4zhcMoZiYpy8NJll3ut1ipqVTN8kwmkBquMi07CYdhjrGj7YsHc VpDA== 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:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=WWkqbuKsCLHI1xvuXdpan5NscmvmvAgLjZQ5d/RHLFo=; b=LqEp3XdYl9onMOiSr/KlLK4W7qU7LWyeJftjcdFKUwS6fJhTr0yCQxKu0DfMTJr6vN UbOYGuVqAgJlCEins4+SKvGj/fATlmx3WG/hfiCMy4QOFhBU7Uc3bqiDzn2SDrBKLCEv DNn02BifPMhjOEOwUBzvI7qmjBCIlws1oa976dTgD1Lk1+LWuYef2UL/fTsIl4dUi3xr BHlPAMMT2n4WBOBnKbKWyuEWdVaAbBEMIQ2IGGU4SGKO0az4PhS4FKZbz4JTYd/bC2he 0xrGAXXFaB9t3DJmWkebpg6vEZXhI3nne1ZAEfUlLNEmvmK0skCM9bQY4lSj69SZgpE8 uivA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krSgJ6ZfIeo4cS6CiMWmTLrDr2aslVlD25VdVukbRWB+rjC8oBi qXTgtGqCyec6JYWZ+lOOb7w= X-Google-Smtp-Source: AMrXdXtE/l+LqblAIMN5rciOEwuDqv8u6+V7OgQscLS89pnIUmvYcxpBJDva49ePUhe2SSqpURAU6g== X-Received: by 2002:a05:6870:9b07:b0:150:e1b3:8c75 with SMTP id hq7-20020a0568709b0700b00150e1b38c75mr540288oab.202.1672930108660; Thu, 05 Jan 2023 06:48:28 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:40d:b0:13d:173c:e583 with SMTP id d13-20020a056871040d00b0013d173ce583ls11856419oag.0.-pod-prod-gmail; Thu, 05 Jan 2023 06:48:26 -0800 (PST) X-Received: by 2002:a05:6870:a687:b0:144:9227:7292 with SMTP id i7-20020a056870a68700b0014492277292mr4375990oam.10.1672930106293; Thu, 05 Jan 2023 06:48:26 -0800 (PST) In-Reply-To: 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:31956 Archived-At: ------=_Part_1394_1357408775.1672930105616 Content-Type: multipart/alternative; boundary="----=_Part_1395_932309988.1672930105616" ------=_Part_1395_932309988.1672930105616 Content-Type: text/plain; charset="UTF-8" Seems like the pastebin link didn't work. Here it is again: https://pastebin.com/wd4ukyKe playduck schrieb am Donnerstag, 5. Januar 2023 um 15:43:34 UTC+1: > 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/caed5c06-c20f-45cf-8455-44897ed37382n%40googlegroups.com. ------=_Part_1395_932309988.1672930105616 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Seems like the pastebin link didn't work.
p= layduck schrieb am Donnerstag, 5. Januar 2023 um 15:43:34 UTC+1:
=
Hello,

I want to convert a Jupyter Notebook to Latex.
The notebook co= ntains 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 J= upyter is defined as:
![](Ex= ample.jpg "Test Image"){ width=3D50% }
and compiled with
pandoc -f ipynb+l= ink_attributes --extract-media=3D./ -o ./notebook.tex =C2=A0./notebook.ipyn= b
which results in the expected latex code:
=
\includegraphics[width=3D0.5\textwidth= ,height=3D\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.s= how()
The notebook shows the image perfectly f= ine.
Pandoc nicely exports this as:
\includegraphics{./57d29df1312aa5fb761c415a60dea774= 44b9136b.png}
How could I define the width here?

The entire notebook.ipynb can be found here:
https://pastebin.com/3k18hJHU
<= /div>

Thanks,
robin



--
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/caed5c06-c20f-45cf-8455-44897ed37382n%40googlegroups.= com.
------=_Part_1395_932309988.1672930105616-- ------=_Part_1394_1357408775.1672930105616--