From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31968 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Amy_de_Buitl=C3=A9ir?= Newsgroups: gmane.text.pandoc Subject: Re: images in templates Date: Sun, 8 Jan 2023 07:17:52 -0800 (PST) Message-ID: <26856790-deed-4cd4-8862-181c6b74cafdn@googlegroups.com> References: <83ac7dc5-5669-45b9-bfcf-2ffa3b32c512n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2064_1507237209.1673191072094" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30073"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDR454V73YMRBIN55OOQMGQEFCAYNNQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jan 08 16:17:57 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f55.google.com ([209.85.210.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pEXQr-0007be-BA for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 08 Jan 2023 16:17:57 +0100 Original-Received: by mail-ot1-f55.google.com with SMTP id f8-20020a9d7b48000000b0066f2d64da41sf3093542oto.12 for ; Sun, 08 Jan 2023 07:17:57 -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=NO2Ps94bb4COsGOeDH/Do8VcZrYr0PYmoJxoCig29bc=; b=L3HmDDU+ngM8toHEiZZWQh42GmN5JA1e0BJ+qAxo47Kgr9I+DgL+seGw7jXohy7zdA xwpiPVmGqYanwxhr88dKJcdAmKn1KIjtm2syaegBE5V+WLB4noEY+GJKQfIXNaVm5B/m WbmngPn+kS7EK6bwQbdAx5WaIptLw7TFP7Z+X1LGtbYqGwpPEGM88WZyXxrlGwSOwgp0 um7an8NDn2AegKIjZWH6+XdMEEbR+0Cl35GENVXpRpqlC+0FDzWGU6+T4xh0inxrWhAE BmnE6ybYrgF46S+0CkZ/JLu2rMaED7rD9nToQr/HfIgnYB4LWllIR9ZCPDOn0CzFiALI xqzQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nualeargais-ie.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=NO2Ps94bb4COsGOeDH/Do8VcZrYr0PYmoJxoCig29bc=; b=h+qiR1ycDgyMntPut5iJ+yPuBEBUnSt32Q+tRxHkSFJfU3HEPseAVXUa38gl/8euzg dG48PbSjigM0V0437xlNa8fWlNYyjH2WBKUrMhllU9GOwi9OobXYSmph4ALM9IC/FLG8 u2DpZXIgTW4pjmxteVMx0Uz6EsF5bYA92/cTkk7+KtPLIUHEGUo6naOCNBFRA19y645V hdzXkWdjxoibpL8hxANw/P6O2c7f3Qh5fhEZxEy0vpE7KeRaF8swIuhKuppAlMlzgAPI lJ+7JlTwNm1/wYWSjZjUaruRXvpHIGEtdiwYhakqRiRE5Ev677PVdDxPzhXLQ5Vuo8Em lgTw== 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=NO2Ps94bb4COsGOeDH/Do8VcZrYr0PYmoJxoCig29bc=; b=IXMGoFE96oBR3Ph9gIRrNWleJoa2XU6Bok6wtay+ydN9j61+aDIVIl+MFWDxKWi4TQ Wdf2CZouqHX+tppD4+J5ySxO+Br/tDyJ6gFSuejgD114DWmwOZMnrjdWH7DPef78YDi+ aWdP2rXSvUOSMLeWMTn+FjEdBuphenHmv76GEP0p4IzI7NhXMOAnINBXars1QaL0Lgke IhF+ukzuXqVMRovv+WdSGSZYrcYdfLNn6FpmtiRoQjTb5PrEVpnfCKAcoGe5nNzsOe7z C7qPv9ky/hWTHcY0D6bg8bXLnbczcocrvuve4qMXKoKxnp+6n/baaO1wjlpEFlclFPAO C0Hg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krb474dE2M2RrKFHPmAY4Lasaba8BaX3a0pSfWn4a00DRsXJ/OX VGHylBT+9ZC1Zp6W7aPiDyI= X-Google-Smtp-Source: AMrXdXsjbiLQRlBgX59R6BqkpEtb57MuYEwSjRLcUFsPljJQY1ZpUUVK9x3ccUToC/VZzfuCJqRFhA== X-Received: by 2002:a05:6870:3127:b0:158:fb59:b8a0 with SMTP id v39-20020a056870312700b00158fb59b8a0mr179277oaa.14.1673191076066; Sun, 08 Jan 2023 07:17:56 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:d644:0:b0:4a3:3f3b:df28 with SMTP id y4-20020a4ad644000000b004a33f3bdf28ls304942oos.2.-pod-prod-gmail; Sun, 08 Jan 2023 07:17:53 -0800 (PST) X-Received: by 2002:a4a:88ec:0:b0:4cb:6451:45f4 with SMTP id q41-20020a4a88ec000000b004cb645145f4mr2331215ooh.41.1673191072843; Sun, 08 Jan 2023 07:17:52 -0800 (PST) In-Reply-To: <83ac7dc5-5669-45b9-bfcf-2ffa3b32c512n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: amy-x92Y4IBCQKU6Cx7ujrKbww@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:31968 Archived-At: ------=_Part_2064_1507237209.1673191072094 Content-Type: multipart/alternative; boundary="----=_Part_2065_342561986.1673191072094" ------=_Part_2065_342561986.1673191072094 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Apparently this is an open issue . On Saturday, 7 January 2023 at 17:18:07 UTC Amy de Buitl=C3=A9ir wrote: > I'm writing Pandoc LaTeX and Beamer templates that need to include images= =20 > for corporate branding. So I want to insert an includegraphics command=20 > into the template, using the include-before-body option, or even=20 > modifying the default template if necessary. > > The problem is that at the time pandoc is invoked, *we don't know the=20 > path to the images*, > but we do know their location relative to the "user data directory" (e.g.= =20 > /home/amy/.local/share/pandoc) and the location of the YAML defaults file= . > > Here's the directory structure I'm using for testing. > > . > =E2=94=9C=E2=94=80=E2=94=80 example.md > =E2=94=94=E2=94=80=E2=94=80 templates > =E2=94=94=E2=94=80=E2=94=80 defaults <-- Ultimately = this will live in the=20 > user data directory > =E2=94=9C=E2=94=80=E2=94=80 test.yaml > =E2=94=9C=E2=94=80=E2=94=80 body-include.tex <-- Contains "\= includegraphics{test.png}" > =E2=94=9C=E2=94=80=E2=94=80 header-include.tex <-- Contains "\= usepackage{graphicx}" > =E2=94=94=E2=94=80=E2=94=80 test.png > > I have tried two approaches. > > 1. Using --resource-path. This option can be used to specify locations to= =20 > look for images. That works fine for images that are included in the main= =20 > document, but not for images included in the template. > > 2. Passing some location information to body-include.tex (or the default= =20 > template if I need to modify that), so it can construct a path to the=20 > image. The only way I know of to accomplish this is to use ${.}, but that= =20 > only works in fields that expect file paths, not in variables that LaTeX = or=20 > Beamer templates can use, as far as I know. > --=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/26856790-deed-4cd4-8862-181c6b74cafdn%40googlegroups.com. ------=_Part_2065_342561986.1673191072094 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Apparently this is an open issue.

On Saturday, 7 January 2023 at 17:18:07 UTC Amy de Buitl=C3= =A9ir wrote:
= I'm writing Pandoc LaTeX and Beamer templates that need to include imag= es for corporate branding. So I want to insert an includegraphics command into the template, using the = include-before-body option, = or even modifying the default template if necessary.

The problem is = that at the time pandoc is invoked, we don't know the path to the im= ages,
but we do know their location relative to the "user data = directory" (e.g. /home/amy/.lo= cal/share/pandoc) and the location of the YAML defaults file.
Here's the directory structure I'm using for testing.

.
=E2=94=9C=E2=94= =80=E2=94=80 example.md
=E2=94=94=E2=94=80=E2=94=80 templates
=C2=A0 = =C2=A0 =E2=94=94=E2=94=80=E2=94=80 defaults =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<-- Ultimately this will live in the user= data directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 = test.yaml
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 body-i= nclude.tex =C2=A0 =C2=A0 =C2=A0<-- Contains "\includegraphics{test.= png}"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=94=9C=E2=94=80=E2=94=80 heade= r-include.tex =C2=A0 =C2=A0<-- Contains "\usepackage{graphicx}"= ;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =E2=94=94=E2=94=80=E2=94=80 test.png

I have tried two approaches.

1. Using --resource-path. This option can be used to speci= fy locations to look for images. That works fine for images that are includ= ed in the main document, but not for images included in the template.
2. Passing some location information to body-include.tex (or the default template if I need to modify= that), so it can construct a path to the image. The only way I know of to = accomplish this is to use ${.}, but that only works in fields that expect file paths, not in variables = that LaTeX or Beamer templates can use, as far as I know.
<= /div>

--
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/26856790-deed-4cd4-8862-181c6b74cafdn%40googlegroups.= com.
------=_Part_2065_342561986.1673191072094-- ------=_Part_2064_1507237209.1673191072094--