From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31965 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: images in templates Date: Sat, 7 Jan 2023 09:18:07 -0800 (PST) Message-ID: <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_2332_2124717301.1673111887143" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16323"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDR454V73YMRBUGS42OQMGQEGZMSGYA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 07 18:18:14 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f57.google.com ([209.85.161.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pECpg-000404-61 for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 07 Jan 2023 18:18:12 +0100 Original-Received: by mail-oo1-f57.google.com with SMTP id n30-20020a4a345e000000b004ac99b461b5sf1917154oof.19 for ; Sat, 07 Jan 2023 09:18:12 -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=qryRpBqTpJva449K39wvLLYtHKgxgbwRbvbh/C1l/eM=; b=PWWpUSvvoukwSfhxbNYJQZOVUeub1xzIahafpTwhJm71LF5g+f17y7M0xafn78QZRP jz7K1vAUr8e1sKkSfshmRzmbkvYcFk4WkjYSCQTHwtlv/N9ThundD9cEQkc3hng8ETzJ EVfJNChshTvlZj82ZJFucmbJrv1O2dexsLyCknZGeAIDkFzieNAZ2WDhAkZxNQ3wLqrR erz6gCBVPVWyrH68I5p4OQXmhxE8OjLo0Q7pqPHGXodiKFj5x+mlXnG1C+LbJbB1dJZ5 F2oyXmuFXb77+q0VI07zmjagSDC1+Ub8JcEMA7HGH1prZO7Vng/os9uwBlWXXAv98pr+ luQA== 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:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=qryRpBqTpJva449K39wvLLYtHKgxgbwRbvbh/C1l/eM=; b=TIljcXCLSU/4grPuGeolVZeg+7arjbcYsJzuDJDbxBLpEHPALu7+htZxv2+Qj/fWRp uz/RRvmGsWnQ73Rb/9fRw23/OvGJJ8Dz+ujNjMUJ0KuPbYMLnLe20uUEMVq54F84Jvs1 QE/kjoYvggNq2eNQ0Kvy4aY5+llrjnSaGWJyUsXpesEnyByfSCYIUg1t7JAWM5NEkbpF SwCWebeZ4KzpW4Hhr66Cp9TFGosnRWzT67gKe65ghfRKTK2AzTu7+T8rEoDAweX6I9Fz 20Yg0Z2X0oJCZs3/Zz0sodcaATM6gptD6s/PfEY07EBlX6UeEltGFfG3Jp8BzxwmyZAB WqEA== 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=qryRpBqTpJva449K39wvLLYtHKgxgbwRbvbh/C1l/eM=; b=zgvF2I1zCKNVm3FyTLOohdhrLVMoDmn7pdPKRUEC+/npGQQnFeDJ/XqFYu7RvJzg/O y5CihgfMP5O1wW9HhCvjv/UTrbaYld9SpKmHy5nKNpjXwjZH/r3PJfAUY2aRqYY/SVLP 3OmTlwI8SFU1aAGmt6LHe3+iwhD7ZQEpABEefgkk3vZjV4adhdv6+6dpe0N+gGOvkKAN HFU+qHJlCOFnV8Rq/BnXnaLB05ECDIFI1tEW4nRNHLCZtOI7k7SJXkOCPKpiXXlTb+uc xtOo9/CpRg2+8rGG+kajIh6fI5HsU2aRO6BJA2eeRBevA0CqEbceXr+an1DVmyHG4qa9 lcpw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2kouU7ZDsOUzJX+eCA+Cp0d1FqC8bgVF1essxXVJsK5Kxl5uEZpV OdefIBvXn1BUSVdvSvwg5tE= X-Google-Smtp-Source: AMrXdXuQEhaTSewtXSeYz+Wp934F7qd9zMLHsZMl9w6qBWeXPpforxQ6YQggjLCO/MSSG6Y44W4/Kg== X-Received: by 2002:a05:6870:6719:b0:150:6b6f:a23e with SMTP id gb25-20020a056870671900b001506b6fa23emr2044247oab.149.1673111890947; Sat, 07 Jan 2023 09:18:10 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:506:0:b0:35a:6687:ef26 with SMTP id 6-20020aca0506000000b0035a6687ef26ls593883oif.4.-pod-prod-gmail; Sat, 07 Jan 2023 09:18:08 -0800 (PST) X-Received: by 2002:a05:6808:2991:b0:35a:ce21:ecf0 with SMTP id ex17-20020a056808299100b0035ace21ecf0mr4207541oib.10.1673111887795; Sat, 07 Jan 2023 09:18:07 -0800 (PST) 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:31965 Archived-At: ------=_Part_2332_2124717301.1673111887143 Content-Type: multipart/alternative; boundary="----=_Part_2333_2026381813.1673111887144" ------=_Part_2333_2026381813.1673111887144 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 into= =20 the template, using the include-before-body option, or even modifying the= =20 default template if necessary. The problem is that at the time pandoc is invoked, *we don't know the path= =20 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 th= is will live in the user=20 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 "\in= cludegraphics{test.png}" =E2=94=9C=E2=94=80=E2=94=80 header-include.tex <-- Contains "\us= epackage{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/83ac7dc5-5669-45b9-bfcf-2ffa3b32c512n%40googlegroups.com. ------=_Part_2333_2026381813.1673111887144 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm writing Pandoc LaTeX and Beamer templates that need to include images f= or 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 images= ,
but we do know their location relative to the "user data directory= " (e.g. /home/amy/.local/share/pa= ndoc) 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               &= nbsp;  <-- Ultimately this will live in the 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   &= nbsp;  <-- Contains "\includegraphics{test.png}"
    &= nbsp;   =E2=94=9C=E2=94=80=E2=94=80 header-include.tex    &l= t;-- 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 look for images. That= works fine for images that are included in the main document, but not for = images included in the template.

2. Passing some location informatio= n 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 ca= n use, as far as I know.

--
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/83ac7dc5-5669-45b9-bfcf-2ffa3b32c512n%40googlegroups.= com.
------=_Part_2333_2026381813.1673111887144-- ------=_Part_2332_2124717301.1673111887143--