From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32289 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: A A Newsgroups: gmane.text.pandoc Subject: Re: pandoc-crossref not playing nice with header includes Date: Tue, 7 Mar 2023 16:16:13 +0100 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000c8c4b05f650e5a7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35172"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDJ77HUDRUCBBSNKTWQAMGQEZ7HG5UY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Mar 07 16:16:30 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pf1-f183.google.com ([209.85.210.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pZZ3G-0008wD-1L for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 07 Mar 2023 16:16:30 +0100 Original-Received: by mail-pf1-f183.google.com with SMTP id w3-20020aa78583000000b005d244af158esf7435522pfn.23 for ; Tue, 07 Mar 2023 07:16:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1678202188; cv=pass; d=google.com; s=arc-20160816; b=BaMfo1+dJ9AasHjuXN1Xb9iccV+1q3/yV1VZHi/XGb+t3ZyMyJZUTqhPh79zFstZDL vpLgq3oPbuLj76tJdZkFoonY4hv5DKjsi7HbshU2nJ7AyIoKX32VKiYL9uD6DE20jN/K U6VZoz7BIwa4rJHBOUMTt+EOulKd+rKGS0OjoeXTVzE/eW0/j4kcM34tXF3wCyVXcHzK P+sjclh7t7UuxxxDWd7jl/bWqxXZZrMjnYYG/CsM8QZBaIUptnIchqB7Ju3OuYrczPQV oYp4wBfOQEnQQHGuC5vVHBDlhmzT1mAnRqLVXJvQXD+m9u7vT9GHfFVrhHvrlP4nZyeR v8tQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=+oq1k15KqhZGD0rthI6xxEZ3g2pK/v8k8h5urT4h1BI=; b=HJ/rKwYYztsYXSzP7Qw8hIz/OczlbXMVUmftGQdw/Mi/z9fUVf1epq/QPCWj9iP6Yr GnOlSoeZCxcE1VKXDsJ0j5CTbKaEiAK6zzMepuiDwIU9cslpErrHoCH4v/HBSZMiqeq5 aa+Ijbf6liDIR77c6fsDJPglOeEAEMI0wPj4WLElYiC/b5b+rtNoDYu5TEHKpX+/As+e kWLkUErb32E4nGKhV6fCfl8wSytXOrXVMUg8Rbv8FO+UGwLMDNBbpvBnWiio41KsnQq9 IIvIiap9LhdMSjT5byqnRsYXG85CLM1aAejeH5DUXlueZkMzBmFPBPo7GGbeRy+08PY9 EurQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mjtQVPVc; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::631 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1678202188; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=+oq1k15KqhZGD0rthI6xxEZ3g2pK/v8k8h5urT4h1BI=; b=smiDI7QH/Vl+6rCwcDy4xzKgSyZ1l+KgU0uhxzOZaHst34Zt+4Wquz/ZWBLSzkWHMg lQQG6KGJ7cejzBW+S2zEhe+Yz6o7zdLuiqZ7nVcAQzN4zDBGoWnXmoalxDDp6MAuvkz6 NEqz3knednMQtd2y8FSf5e9GanJSbbE61hDVQFZsMZIeUA4Qg4spZAL42RtMXB0JcPnM oxzqV4LK4vNuZ78oYXE8l33Xuqy/14n5Eq+vE8HJprOCkY2P8i1dXZ3RI3MjNZmMjjNe mTfCAexWuiJA8vxdPsUA5/WPJcdDHt3gy64axBegChrniFZ+QbfiATqy9uAvBSqTp0wb yczQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678202188; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=+oq1k15KqhZGD0rthI6xxEZ3g2pK/v8k8h5urT4h1BI=; b=RGndaaUwNcqu1QKZvptpdQNUylECiQx84hnkjHsBLNaCjElkm5RJG//ZC98rplLuul uwlLiQLjKqLcUz9poHDRvOf9niL+6PRJ8FADdoT2XhO6Diq8idKrDtizK6Zg9lIxsFFj na0VZOqLCgU2X/A0UZGpvSQ8mGOEf9YqRZ40JJEF/Wq9QgsUBsjGQE//rlu7B8IjLTjH 2MfmhaXX6tmMI15oQ+aYbgdvC1otvzi8764D5olHAw+smJYB8SMeVUDbVI7sFhcPROeA xTug5OJP6tQA+k9Ae5pyP51iDlfgzytwY2rAYgijYv/a4ldjC2E46RqC2QHZRcBR3F5m ynyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678202188; 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-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=+oq1k15KqhZGD0rthI6xxEZ3g2pK/v8k8h5urT4h1BI=; b=jin8YkF0rvFC5Q01CbroqF5haYO69zf/aqYWYSYZgxHlPMtR1guIlmFqmoY7ZsdEZK X9xHzX0ALYYv/rj9PaldWIiW/pMcGz5hluZnhn9YbWgsCy1ugaFb59BnJ9g8ub0jAea6 DMM7vi40x5uVq+BvigZfx87EUCHAuKV4aP+htV7B79IRoGH5IdAr4PNaGeowTT/+aFFg 8Qy9e8Zl0AHQPZwG9lkNPUb2M/AskXUTNCcxA+Q3KXwz9aN7rnYGL9HapyMgBN9vcaMk D7vBQnIjRfp2pbYyBQVM9i01I301F1+c Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKW0t7lgnPKUW0IONufYjWPqH8GxCROhKDp/5X2GIcKQkDxXpZB/ Il2FvHxQsyHJ+xeLKUU8pdw= X-Google-Smtp-Source: AK7set+k0eZF65CaiFS7TAMQKs3ZlsI7Z8cSxrwyK0i7l3nIFmf8eVXDLsviUu5rc920G5ESn0RkjQ== X-Received: by 2002:a17:90a:5993:b0:233:b520:1544 with SMTP id l19-20020a17090a599300b00233b5201544mr7708194pji.0.1678202188445; Tue, 07 Mar 2023 07:16:28 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:418c:b0:5dd:207:f0c3 with SMTP id ca12-20020a056a00418c00b005dd0207f0c3ls3623045pfb.8.-pod-prod-gmail; Tue, 07 Mar 2023 07:16:24 -0800 (PST) X-Received: by 2002:a62:1dd4:0:b0:5aa:6125:dbf4 with SMTP id d203-20020a621dd4000000b005aa6125dbf4mr15935047pfd.11.1678202184712; Tue, 07 Mar 2023 07:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678202184; cv=none; d=google.com; s=arc-20160816; b=tlNvUs+YHwI7KSyY1RA4mCgTM/QbZcdu4UNvxvLmfzF3y0dmlBYeTORwrW1kFZVFVl x0fDSZyb03v78y10NiMS1CxS+Ueumo8gYv/B1yN01O+xTNWGM8IjI+532K7e8+BG3PZW T/ugUingj+6EN7WiMc2wRAbWOmQGpj6gP7L26nw7OdPlwOJyOJHKc6F3crfNdXDx2AYz +6Ov4/xjIV/Vo883qtwyKyw/3vcHr3V3wzitEjA9p43UVtgfg8ytZHD8cOAM1i4WLjqR sADYfFL7qV+bZZla3wQGzPGmi/9q8J9SkvJ7AjcTBCqPZ6n2dkC0bvvYc+AayVCj3oVY vcNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HSd0wWVndG69RM96N938QSktRypGonUcjs+bZ5RNZlc=; b=UfpaweeIVORbTJZIH6modKoZEqtVMJWE9PLcPjLU0N4TvsFzLF+0OPSQwBuS9WrxCg ZgOYjTdYXWmhR56zPZzN8EFcHU+wfLku2Zf2DkkqFA+xmkXRic8LVUUP7ie3mFDNB+Uv hFh++OxUSNcvyZMZjua0/N7LAaXYui6cq9S8OS6DnVcoUZQjoPuOTRQcWnmOfeY9AXUS 9EKkJ9r8UFlhQ+5hOZfLePVgQJQGEXyPZKD4gTWwjjXx1+slkLfcMyqA/5GojRPWPI4s RJrJjCFwBthDsM1C3NCmjuhQ4flIpWBUmPkdNxGu28PSb0WA3m1w5FCVWDA/mf1aKoFg waBw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mjtQVPVc; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::631 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com. [2607:f8b0:4864:20::631]) by gmr-mx.google.com with ESMTPS id 3-20020a631143000000b00503012f9e96si499288pgr.2.2023.03.07.07.16.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Mar 2023 07:16:24 -0800 (PST) Received-SPF: pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::631 as permitted sender) client-ip=2607:f8b0:4864:20::631; Original-Received: by mail-pl1-x631.google.com with SMTP id p20so14371226plw.13 for ; Tue, 07 Mar 2023 07:16:24 -0800 (PST) X-Received: by 2002:a17:90b:504:b0:233:df5f:4778 with SMTP id r4-20020a17090b050400b00233df5f4778mr5492895pjz.6.1678202184165; Tue, 07 Mar 2023 07:16:24 -0800 (PST) In-Reply-To: X-Original-Sender: amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=mjtQVPVc; spf=pass (google.com: domain of amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::631 as permitted sender) smtp.mailfrom=amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32289 Archived-At: --0000000000000c8c4b05f650e5a7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Also, I have just tried with --metadata-file as follows: header-includes: - | ~~~{=3Dlatex} \usepackage{minted} \definecolor{bg}{rgb}{0.85, 0.85. 0.85} \setminted{breaklines=3Dtrue, bgcolor=3Dbg, breakanywhere} ~~~ When I tried compiling with the following: pandoc -s -F pandoc-crossref -L include-code-files.lua -L minted.lua --from markdown --to latex test.md -o test.tex --metadata-file header.yaml latexmk --shell-escape -pdflatex test.tex I got an error: ! LaTeX Error: Command \listoflistings already defined. Or name \end=E2=80=A6 illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. =E2=80=A6 l.89 =E2=80=A6gs{\listof{codelisting}{List of Listings}} So looks like there are problems even when specifying it in the way recommended by that link you shared. On Tue, 7 Mar 2023 at 14:06, A A wrote: > You can include it in an external metadata file referred to via the > =E2=80=94metadata-file option > > I believe that would still be a YAML file with weird syntax like this? > > header-includes: > - | > ~~~{=3Dlatex} > \let\oldsection\section > \renewcommand{\section}[1]{\clearpage\oldsection{#1}} > ~~~ > > If so then yes, I definitely prefer doing my own header.tex. But this > would have to include all the content necessary for pandoc-crossref to > work properly. Any ideas where I could find this content? I briefly skimm= ed > the pandoc-crossref repo but didn=E2=80=99t find anything obvious=E2=80= =A6 > > On Tue, 7 Mar 2023 at 12:16, Bastien DUMONT > wrote: > >> You can include it in an external metadata file referred to via the >> --metadata-file option. However, if you customize the LaTeX preamble >> heavily, it may be preferable to use a custom template including the >> content of header.tex. >> >> Le Tuesday 07 March 2023 =C3=A0 12:07:19PM, A A a =C3=A9crit : >> > That would force me to put my header content within my markdown file >> and remove >> > "header.tex" completely. I would very much prefer to keep them as >> separate >> > files. >> > >> > The header.tex for my use case ia much more involved. Including it >> inside the >> > markdowm YAML block like that would be quite ugly IMO. >> > >> > >> > >> > >> > >> > On Tue, 7 Mar 2023, 10:16 Bastien DUMONT, <[1]bastien.dumont-VwIFZPTo/vqzQB+pC5nmwQ@public.gmane.org= t> >> wrote: >> > >> > Since you don't use a custom template, you don't have to add $for >> > (header-includes)$ etc. anywhere: it is already included in the >> default >> > LaTeX template. >> > The answer for your use case is here: [2] >> https://github.com/lierdakil/ >> > pandoc-crossref/issues/47#issuecomment-614404532 >> > >> > Le Tuesday 07 March 2023 =C3=A0 10:02:38AM, A A a =C3=A9crit : >> > > Files >> > > >> > > test.py >> > > >> > > def f(x): >> > > return x >> > > >> > > test.md >> > > >> > > ~~~{ >> > > #lst:test >> > > .py >> > > include=3D"test.py" >> > > caption=3D`test.py` >> > > } >> > > ~~~ >> > > >> > > header.tex >> > > >> > > \usepackage{minted} >> > > >> > > \definecolor{bg}{rgb}{0.85, 0.85. 0.85} >> > > \setminted{breaklines=3Dtrue, bgcolor=3Dbg, breakanywhere} >> > > >> > > Compilation >> > > >> > > I=E2=80=99m compiling with: >> > > >> > > pandoc -s -F pandoc-crossref -L include-code-files.lua -L >> minted.lua -H >> > header.tex --from markdown --to latex test.md -o test.tex >> > > latexmk --shell-escape -pdflatex test.tex >> > > >> > > I get an error upon compilation, because pandoc-crossref defines >> its own >> > header >> > > include which gets overwritten by my -H header.tex. This [1]link >> provides >> > more >> > > information. >> > > >> > > I tried the solution proposed by @lierdakil in the link provided >> but get >> > an >> > > error: >> > > >> > > ! LaTeX Error: Missing \begin{document}. >> > > >> > > See the LaTeX manual or LaTeX Companion for explanation. >> > > Type H for immediate help. >> > > >> > > l.97 $ >> > > for(header-includes)$ >> > > ? >> > > >> > > So I=E2=80=99m at a bit of a loss regarding what to do here, Any= pointers >> > welcome. >> > > Thanks >> > > >> > > -- >> > > 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 [2][3]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > > To view this discussion on the web visit [3][4] >> https://groups.google.com/ >> > d/msgid/ >> > > pandoc-discuss/ >> > > CAMwawgPTeNSdJ7FDbc9tmw8ax06K7n_uGxvB-mCn2fvBzdD%3DUg%[5] >> 40mail.gmail.com >> > . >> > > >> > > References: >> > > >> > > [1] [6]https://github.com/lierdakil/pandoc-crossref/issues/47 >> > > [2] mailto:[7]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > > [3] [8]https://groups.google.com/d/msgid/pandoc-discuss/ >> > CAMwawgPTeNSdJ7FDbc9tmw8ax06K7n_uGxvB-mCn2fvBzdD%3DUg% >> 40mail.gmail.com? >> > utm_medium=3Demail&utm_source=3Dfooter >> > >> > -- >> > 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 [9]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit [10] >> https://groups.google.com/d/ >> > msgid/pandoc-discuss/ZAcA4dThsf/pAK2e%40localhost. >> > >> > -- >> > 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 [11]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit [12] >> https://groups.google.com/d/msgid/ >> > pandoc-discuss/ >> > CAMwawgNJcw9d-aMSPFStx%2BwU__GrsDVhhNrARCLf4CdHNiGCWA%40mail.gmail.com= . >> > >> > References: >> > >> > [1] mailto:bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org >> > [2] >> https://github.com/lierdakil/pandoc-crossref/issues/47#issuecomment-6144= 04532 >> > [3] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > [4] https://groups.google.com/d/msgid/ >> > [5] http://40mail.gmail.com/ >> > [6] https://github.com/lierdakil/pandoc-crossref/issues/47 >> > [7] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > [8] >> https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPTeNSdJ7FDbc9tmw= 8ax06K7n_uGxvB-mCn2fvBzdD%3DUg%40mail.gmail.com?utm_medium=3Demail&utm_sour= ce=3Dfooter >> > [9] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > [10] >> https://groups.google.com/d/msgid/pandoc-discuss/ZAcA4dThsf/pAK2e%40loca= lhost >> > [11] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > [12] >> https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgNJcw9d-aMSPFStx%= 2BwU__GrsDVhhNrARCLf4CdHNiGCWA%40mail.gmail.com?utm_medium=3Demail&utm_sour= ce=3Dfooter >> >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> 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/ZAcdDn%2Bj/f55E9xQ%40lo= calhost >> . >> > --=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/CAMwawgPfYTjvYbWgxsjGhfrNAh1WhnY_S00BKk95b4XV-FYdRQ%40mail.g= mail.com. --0000000000000c8c4b05f650e5a7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Also, I have just tried with --metadata-file as follows:

header-includes:
- |
  ~~~{=3Dlatex}
  \usepackage{minted}

  \definecolor{bg}{rgb}{0.85, 0.85. 0.85}
  \setminted{breaklines=3Dtrue, bgcolor=3Dbg, breakanywhere}
  ~~~

When I tried compi= ling with the following:

pandoc -s -F pandoc-cross=
ref -L include-code-files.lua -L minted.lua --from markdown --to latex test=
.md -o test.tex --metadata-file header.yaml
latexmk --shell-escape -pdflatex test.tex

I got an error:

! LaTeX Error: Command \listofl= istings already defined.
Or name \end=E2=80=A6 illegal, s= ee p.192 of the manual.

See the LaTeX manual or LaTeX C= ompanion for explanation.
Type H for immediate help.
=E2=80=A6

l.89 =E2=80=A6gs{\listof{codeli= sting}{List of Listings}}

So looks like there are problem= s even when specifying it in the way recommended by that link you shared.


On Tue, 7 Mar 2023 at 14:06, A A <amine.aboufirass-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:=

You can include it in an external metad= ata file referred to via the =E2=80=94metadata-file option

I believe that would still be a YAML file= with weird syntax like this?

hea=
der-includes:
- |
  ~~~{=3Dlatex}
  \let\oldsection\section
  \renewcommand{\section}[1]{\clearpage\oldsection{#1}}
  ~~~

If so then yes, I definitely= prefer doing my own header.tex. But this would have to include all the con= tent necessary for pandoc-crossref to work properly= . Any ideas where I could find this content? I briefly skimmed the pandoc-crossref repo but didn=E2=80=99t find anything obvio= us=E2=80=A6


On Tue, 7 Mar 2023 at 12:16, Bastien DUMO= NT <basti= en.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org> wrote:
You can include it in an external metadata file referre= d to via the --metadata-file option. However, if you customize the LaTeX pr= eamble heavily, it may be preferable to use a custom template including the= content of header.tex.

Le Tuesday 07 March 2023 =C3=A0 12:07:19PM, A A a =C3=A9crit :
> That would force me to put my header content within my markdown file a= nd remove
> "header.tex" completely. I would very much prefer to keep th= em as separate
> files.=C2=A0
>
> The header.tex for my use case ia much more involved. Including it ins= ide the
> markdowm YAML block like that would be quite ugly IMO.
>
>
>
>
>
> On Tue, 7 Mar 2023, 10:16 Bastien DUMONT, <[1]bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>= wrote:
>
>=C2=A0 =C2=A0 =C2=A0Since you don't use a custom template, you don&= #39;t have to add $for
>=C2=A0 =C2=A0 =C2=A0(header-includes)$ etc. anywhere: it is already inc= luded in the default
>=C2=A0 =C2=A0 =C2=A0LaTeX template.
>=C2=A0 =C2=A0 =C2=A0The answer for your use case is here: [2]https:= //github.com/lierdakil/
>=C2=A0 =C2=A0 =C2=A0pandoc-crossref/issues/47#issuecomment-614404532 >
>=C2=A0 =C2=A0 =C2=A0Le Tuesday 07 March 2023 =C3=A0 10:02:38AM, A A a = =C3=A9crit :
>=C2=A0 =C2=A0 =C2=A0> Files
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> test.py
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> def f(x):
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0return x
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> test.md
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> ~~~{
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0#lst:test
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0.py
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0include=3D"test.py"
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0caption=3D`test.py`
>=C2=A0 =C2=A0 =C2=A0> }
>=C2=A0 =C2=A0 =C2=A0> ~~~
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> header.tex
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> \usepackage{minted}
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> \definecolor{bg}{rgb}{0.85, 0.85. 0.85}
>=C2=A0 =C2=A0 =C2=A0> \setminted{breaklines=3Dtrue, bgcolor=3Dbg, br= eakanywhere}
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> Compilation
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> I=E2=80=99m compiling with:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> pandoc -s -F pandoc-crossref -L include-code-f= iles.lua -L minted.lua -H
>=C2=A0 =C2=A0 =C2=A0header.tex --from markdown --to latex test.md -o te= st.tex
>=C2=A0 =C2=A0 =C2=A0> latexmk --shell-escape -pdflatex test.tex
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> I get an error upon compilation, because pando= c-crossref defines its own
>=C2=A0 =C2=A0 =C2=A0header
>=C2=A0 =C2=A0 =C2=A0> include which gets overwritten by my -H header= .tex. This [1]link provides
>=C2=A0 =C2=A0 =C2=A0more
>=C2=A0 =C2=A0 =C2=A0> information.
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> I tried the solution proposed by @lierdakil in= the link provided but get
>=C2=A0 =C2=A0 =C2=A0an
>=C2=A0 =C2=A0 =C2=A0> error:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0! LaTeX Error: Missing \beg= in{document}.
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0See the LaTeX manual or LaT= eX Companion for explanation.
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0Type H for immediate help.<= br> >=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0l.97 $
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0for(header-includes)$
>=C2=A0 =C2=A0 =C2=A0>=C2=A0 =C2=A0 =C2=A0?
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> So I=E2=80=99m at a bit of a loss regarding wh= at to do here, Any pointers
>=C2=A0 =C2=A0 =C2=A0welcome.
>=C2=A0 =C2=A0 =C2=A0> Thanks
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> --
>=C2=A0 =C2=A0 =C2=A0> You received this message because you are subs= cribed to the Google Groups
>=C2=A0 =C2=A0 =C2=A0> "pandoc-discuss" group.
>=C2=A0 =C2=A0 =C2=A0> To unsubscribe from this group and stop receiv= ing emails from it, send an
>=C2=A0 =C2=A0 =C2=A0email
>=C2=A0 =C2=A0 =C2=A0> to [2][3]pandoc-discuss+unsubscribe@go= oglegroups.com.
>=C2=A0 =C2=A0 =C2=A0> To view this discussion on the web visit [3][4= ]https://groups.google.com/
>=C2=A0 =C2=A0 =C2=A0d/msgid/
>=C2=A0 =C2=A0 =C2=A0> pandoc-discuss/
>=C2=A0 =C2=A0 =C2=A0> CAMwawgPTeNSdJ7FDbc9tmw8ax06K7n_uGxvB-mCn2fvBz= dD%3DUg%[5]40mail.gmail.com
>=C2=A0 =C2=A0 =C2=A0.
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> References:
>=C2=A0 =C2=A0 =C2=A0>
>=C2=A0 =C2=A0 =C2=A0> [1] [6]https://gi= thub.com/lierdakil/pandoc-crossref/issues/47
>=C2=A0 =C2=A0 =C2=A0> [2] mailto:[7]pandoc-discuss+unsubscri= be-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
>=C2=A0 =C2=A0 =C2=A0> [3] [8]https://groups.= google.com/d/msgid/pandoc-discuss/
>=C2=A0 =C2=A0 =C2=A0CAMwawgPTeNSdJ7FDbc9tmw8ax06K7n_uGxvB-mCn2fvBzdD%3D= Ug%40mail.gmail.com?
>=C2=A0 =C2=A0 =C2=A0utm_medium=3Demail&utm_source=3Dfooter
>
>=C2=A0 =C2=A0 =C2=A0--
>=C2=A0 =C2=A0 =C2=A0You received this message because you are subscribe= d to the Google Groups
>=C2=A0 =C2=A0 =C2=A0"pandoc-discuss" group.
>=C2=A0 =C2=A0 =C2=A0To unsubscribe from this group and stop receiving e= mails from it, send an
>=C2=A0 =C2=A0 =C2=A0email to [9]pandoc-discuss+unsubscribe@goog= legroups.com.
>=C2=A0 =C2=A0 =C2=A0To view this discussion on the web visit [10]htt= ps://groups.google.com/d/
>=C2=A0 =C2=A0 =C2=A0msgid/pandoc-discuss/ZAcA4dThsf/pAK2e%40localhost.<= br> >
> --
> You received this message because you are subscribed to the Google Gro= ups
> "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email
> to [11]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit [12]https://groups.g= oogle.com/d/msgid/
> pandoc-discuss/
> CAMwawgNJcw9d-aMSPFStx%2BwU__GrsDVhhNrARCLf4CdHNiGCWA%40mail.gmail.com.
>
> References:
>
> [1] mailto:
bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org
> [2] https://github= .com/lierdakil/pandoc-crossref/issues/47#issuecomment-614404532
> [3] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=
> [4] https://groups.google.com/d/msgid/
> [5] http://40mail.gmail.com/
> [6] https://github.com/lierdakil/pandoc-c= rossref/issues/47
> [7] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=
> [8] http= s://groups.google.com/d/msgid/pandoc-discuss/CAMwawgPTeNSdJ7FDbc9tmw8ax06K7= n_uGxvB-mCn2fvBzdD%3DUg%40mail.gmail.com?utm_medium=3Demail&utm_source= =3Dfooter
> [9] mailto:pandoc-discuss%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=
> [10] https://group= s.google.com/d/msgid/pandoc-discuss/ZAcA4dThsf/pAK2e%40localhost
> [11] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [12] htt= ps://groups.google.com/d/msgid/pandoc-discuss/CAMwawgNJcw9d-aMSPFStx%2BwU__= GrsDVhhNrARCLf4CdHNiGCWA%40mail.gmail.com?utm_medium=3Demail&utm_source= =3Dfooter

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ZAcdDn= %2Bj/f55E9xQ%40localhost.

--
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/CAMwawgPfYTjvYbWgxsjGhfrNAh1WhnY_S00BKk95= b4XV-FYdRQ%40mail.gmail.com.
--0000000000000c8c4b05f650e5a7--