From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31628 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Niko Newsgroups: gmane.text.pandoc Subject: Re: How to center an oversized figure (md to tex to pdf)? Date: Sat, 22 Oct 2022 02:30:33 -0700 (PDT) Message-ID: <92231fef-1dff-4799-b934-eaf85de4dec8n@googlegroups.com> References: <6268051b-bc26-4c5a-a1ba-32790dbc8271n@googlegroups.com> <247E0FC5-5E0D-4EAD-8D9D-07DDD5732E02@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_7508_1693128110.1666431033994" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40109"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCP7DLV7XYJBBO7QZ2NAMGQEIWGGFVI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Oct 22 11:30:39 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f62.google.com ([209.85.161.62]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1omApz-000AGy-1P for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 22 Oct 2022 11:30:39 +0200 Original-Received: by mail-oo1-f62.google.com with SMTP id f11-20020a4a920b000000b00476997f3fa8sf2579164ooh.20 for ; Sat, 22 Oct 2022 02:30:38 -0700 (PDT) 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=w1iyIh8NQeHiJr16Vz0+R/3s2diAwHOu9jsAGrIAczw=; b=CODbZ4ORxAi6hrAlsDRkbkygESfInj2EIyWFmVFJoZ6zg4FuesdFnrSW4ThcAO9Jw1 G9vuuEaS42Q6GEFozdK+3PwjHODHyyMphTSSSsYqNGhhg2wXu1WAsbsfwB/g4G0q1CvA MbAeIaR6PVvyYGPlJe4lvLwseTBoVq/oPpxT4pYZnayXH94tuF+H9swsYZjlJD5J2blx Y24KFIWM+OZ7FjvudYoRqA34pUetTnbsptVH2vrsMRtAOFudC8gbXIZy8zGbnEfq/RU/ 4nbcOAVQ0tYrLzRwtBjk+0bKh3WYGDBknbCQIxyxVAt4+nPuR2WczHurHVYNkbHFENzq miEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pasanen-me.20210112.gappssmtp.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=w1iyIh8NQeHiJr16Vz0+R/3s2diAwHOu9jsAGrIAczw=; b=7hFPnKvf81zbgh7uVrU9NQ3hYxeMYBaP8pPhjos39yuOx1iv8aX2/R06kJecBhLCgC klH1FOvdUpJ1AHzXOiZXJBmqGLVMUOwoFqm5S6QfSLIBwgyK2GuSSZOden2Zndq9qRkx FHKORPqN+u8EmEIuUnLQHCdNoYuTPr81u+m3ercRaMxlr5ms0swGQnhU4LY0QWzOwquj n3ADHNh+beD2z6dgN3GL0V5RC4FoqGNtxtfzdKFvd9kZhRquuYm8MlVkbdnWBmrMy24E pvu7M2YSxXOO7ly5HOVHLDgYT1maCX6SYD/NCGnVAB/Ft45WJN9capd6p9cHGQXdc/nx V0vg== 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=w1iyIh8NQeHiJr16Vz0+R/3s2diAwHOu9jsAGrIAczw=; b=Cz3vd3pANgpK/o+wr0g4nxJuPAS6T4VyRfDwkdv48QVHOWgLk9Mcu1/jVEz698mtCg pO592oA9iuJjktI3Aph+bdEohTBASmdByu4JpxbGw71rnOe/X7ddLcmpiydlvZaDxBVj R/703mSU9mrBbCrktdZ50LRSgg1qdNb01tfo/Gsf/hDl4MWKrRggP1uh6O5jRlBtQdJt dbLcg05T/KCvGhtsszFmxJt4ASZnsd7TMXwkUD/+XELTyTvfqeA94hOWGg5WEQk0VBNP UAwmvkCeTaDbj53b302ViMvJVWIENfZVE/sp8b2kuw/w0JLjSR/Td/SZkL2E3HpkRmcp zFrw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf0CEx9y5BlN6RAsa//Y1mFD+r4ldC45o06L2CsSO1Si/P0EFHND gr2//6/ZsFSqhyt7DzKc0SA= X-Google-Smtp-Source: AMsMyM6otmFz6kWHqGiFk0Dqz2igCPlRpKeIzvqITIo4wJZhsQt1t3VdrCWywSFRjenY0I9xNm2Xtw== X-Received: by 2002:a05:6870:1d3:b0:132:a00e:c473 with SMTP id n19-20020a05687001d300b00132a00ec473mr15417818oad.101.1666431037688; Sat, 22 Oct 2022 02:30:37 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:1b25:0:b0:619:fa:4857 with SMTP id l34-20020a9d1b25000000b0061900fa4857ls781404otl.1.-pod-prod-gmail; Sat, 22 Oct 2022 02:30:35 -0700 (PDT) X-Received: by 2002:a05:6830:2f9:b0:661:9e22:58f9 with SMTP id r25-20020a05683002f900b006619e2258f9mr11760109ote.350.1666431035007; Sat, 22 Oct 2022 02:30:35 -0700 (PDT) In-Reply-To: <247E0FC5-5E0D-4EAD-8D9D-07DDD5732E02-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: niko-k13cyrtlpCBBDLzU/O5InQ@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:31628 Archived-At: ------=_Part_7508_1693128110.1666431033994 Content-Type: multipart/alternative; boundary="----=_Part_7509_1921184648.1666431033994" ------=_Part_7509_1921184648.1666431033994 Content-Type: text/plain; charset="UTF-8" If the figure is oversized (larger than \textwidth), it needs special handling. Otherwise, in the pdf the figure will start at the end of left margin, and only overflow to the right margin. On Friday, 21 October 2022 at 19:40:56 UTC+3 fiddlosopher wrote: > I'm confused. The code pandoc produces already contains \centering, which > should center the graphic. > Did it not do this? > > > On Oct 18, 2022, at 3:17 AM, Niko wrote: > > > > Hi all, > > > > I am trying to center figures on pdf. The main.md has: > > > > ![some text](some-figure.png){width=166% #fig:figlabel} > > > > The created .tex file has > > > > \begin{figure} > > \hypertarget{fig:figlabel}{% > > \centering > > > \includegraphics[width=1.66\textwidth,height=\textheight]{some-figure.png} > > \caption{some text}\label{fig:figlabel} > > } > > \end{figure} > > > > I read from here that a possible solution is to use > > > > \usepackage[export]{adjustbox}[2011/08/13] > > > > in latex preamble and add "center" argument to includegraphics, like so: > > > > \includegraphics[width=1.66\textwidth,height=\textheight, > center]{some-figure.png} > > > > I tested it and it works. Now, how would one add arguments to > includegraphics from within markdown? Another solution I came up with would > include redefining includegraphics in latex preamble to always have the > "center" added, but I feel that is a bit hacky. Is there a better way? > > > > Regards, > > > > Niko > > > > -- > > 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/6268051b-bc26-4c5a-a1ba-32790dbc8271n%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/92231fef-1dff-4799-b934-eaf85de4dec8n%40googlegroups.com. ------=_Part_7509_1921184648.1666431033994 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If the figure is oversized (larger than \textwidth), it needs special handl= ing. Otherwise, in the pdf the figure will start at the end of left margin,= and only overflow to the right margin. 

On Friday, 21 October 2022 at 1= 9:40:56 UTC+3 fiddlosopher wrote:
I'm confused. The code pandoc produces already co= ntains \centering, which should center the graphic.
Did it not do this?

> On Oct 18, 2022, at 3:17 AM, Niko <ni...-k13cyrtlpCBBDLzU/O5InQ@public.gmane.org> wrote:
>=20
> Hi all,=20
>=20
> I am trying to center figures on pdf. The main.md has:
>=20
> ![some text](some-figure.png){width=3D166% #fig:figlabel}
>=20
> The created .tex file has
>=20
> \begin{figure}
> \hypertarget{fig:figlabel}{%
> \centering
> \includegraphics[width=3D1.66\textwidth,height=3D\textheight]{some= -figure.png}
> \caption{some text}\label{fig:figlabel}
> }
> \end{figure}
>=20
> I read from here that a possible solution is to use
>=20
> \usepackage[export]{adjustbox}[2011/08/13]
>=20
> in latex preamble and add "center" argument to includegr= aphics, like so:
>=20
> \includegraphics[width=3D1.66\textwidth,height=3D\textheight, cen= ter]{some-figure.png}
>=20
> I tested it and it works. Now, how would one add arguments to incl= udegraphics from within markdown? Another solution I came up with would in= clude redefining includegraphics in latex preamble to always have the "= ;center" added, but I feel that is a bit hacky. Is there a better way?
>=20
> Regards,
>=20
> Niko
>=20
> --=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 email to pandoc-discus..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6268051= b-bc26-4c5a-a1ba-32790dbc8271n%40googlegroups.com.

--
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/92231fef-1dff-4799-b934-eaf85de4dec8n%40googlegroups.= com.
------=_Part_7509_1921184648.1666431033994-- ------=_Part_7508_1693128110.1666431033994--