From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32863 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jianhua Liu Newsgroups: gmane.text.pandoc Subject: How to deal with the code listing issue with pandoc-crossref when using header file Date: Thu, 22 Jun 2023 05:39:36 -0700 (PDT) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2206_174250988.1687437576004" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21717"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDG33VVRUIMBBCMC2GSAMGQEMDAIO5Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 22 14:39:40 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f63.google.com ([209.85.210.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qCJbA-0005US-Bj for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 22 Jun 2023 14:39:40 +0200 Original-Received: by mail-ot1-f63.google.com with SMTP id 46e09a7af769-6b5d654cd9dsf1584441a34.3 for ; Thu, 22 Jun 2023 05:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1687437579; x=1690029579; 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=H6FjZniBWm7MEEER8Xrr6xo5DfPQACdXl65nWXERWVc=; b=hpvv7EHY2urVspGvCX8e6ifi2nr+6GzJFAmrXsMnbMubD9PPYEXr8QJe/vM3burAK3 n3vrFBL/A7A9CYUY2FASKC8piPT13C8kWoyCrd15tQ76P5lDiOJfdA41apUp8ibqcTzV dl5Xdky/yI2ad28C9ShO4S6iN2rlcZArKsusVrSH2spfFiiEdCpjozz9LosayF61gRSY /j8upS4/OpGc+zVQ5BcbEaaEPVZtcETn1FmPjIKnmmsS1mAMfh+Usn0WJdMfdnmEGEiX NtU3nY03FuHDbNs9QOLncGwQ5Xgd5rj8uf2SHT8oNtHT5BvHvTBUDqRb1i8b4Q1OMyHz CKlg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687437579; x=1690029579; 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=H6FjZniBWm7MEEER8Xrr6xo5DfPQACdXl65nWXERWVc=; b=bZrCsNgAU404yYQrCTtW/lcSNHuLlyKziPjqA0q+Fa/MQvqeJ8mt7SovnZOUHL13nk B1P0k36Tre7qzPN4/xX69QidVDQTMMCiAaBsvLncD9oBKjFpuk9+tgzgOWxHNWz40vpT tofb1kf9DbbhHgM6MGrj8XbKpKjnaSJi0OlM3mWJgTk+W59hVRpWWRz9GutGOUMFwJjx iL4wNRU1zTuQe5OlvhwdqNt2+9ZbesOz7jAnM25BxdeLssWzVwvaPUhZ9/uyjCNj8svD jo+GBMgobn37w1zKfxV9x2znk0uAlcJZG7Y0oFsXB73k8CzQOoSidINan7322acegztp LEAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687437579; x=1690029579; 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-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=H6FjZniBWm7MEEER8Xrr6xo5DfPQACdXl65nWXERWVc=; b=RBvwk09N60lmMSXfjj3elRBP98gBslm7hcQqzPtanO0q50W8sLj4GQs8irrDRL9k8X J+JUm9aa/x6AkWyaW9CmavKeQnNxqyMkKCFFN6EPwxB8Mqu9cWkw+eUwwmIxvJaymZKy nTVF8P1G/LydweGQ3XIhA3Qp+lpkstvEIJ7cunt3Il8G3R7DOkenrDSG5WNnT/0ChI3y gSrBje+7hngH9mFunSaDCOuAZomdHw5Xc/zZDjWZt8qSPHx3VBa+jSs2BloQ4oTHj5va 38mj+Wq6Mge54QrbCq3iWBfXvX5v2twCIQvwhxXBcNlZcVCagXQIS7n/AScvGFN8ejEP Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDyiMFsihg+MFq2OuVpNmifLqLokTPMa/QCoSrZDuCYsbnI+qARx 2jTH25AOp/+9R8CYeQmNNIU= X-Google-Smtp-Source: ACHHUZ7kDSqZc039wRrqTfznqnWYiZciS0cgsWxBAXjKLcKstlzYU0OZTXWYdfOEnyR7XDr/8RKmbQ== X-Received: by 2002:a05:6870:b0e4:b0:1aa:84dd:109a with SMTP id u36-20020a056870b0e400b001aa84dd109amr8246240oag.58.1687437579240; Thu, 22 Jun 2023 05:39:39 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:a11e:b0:1ad:11bf:5da6 with SMTP id m30-20020a056870a11e00b001ad11bf5da6ls389867oae.2.-pod-prod-07-us; Thu, 22 Jun 2023 05:39:36 -0700 (PDT) X-Received: by 2002:aca:de43:0:b0:39c:bfd3:7e with SMTP id v64-20020acade43000000b0039cbfd3007emr4394580oig.10.1687437576640; Thu, 22 Jun 2023 05:39:36 -0700 (PDT) X-Original-Sender: jianhua.liu.88-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:32863 Archived-At: ------=_Part_2206_174250988.1687437576004 Content-Type: multipart/alternative; boundary="----=_Part_2207_1058599707.1687437576004" ------=_Part_2207_1058599707.1687437576004 Content-Type: text/plain; charset="UTF-8" I am trying to use the syntax of https://lierdakil.github.io/pandoc-crossref/#code-block-labels to create a code block that I can reference elsewhere in the same file: ```{#lst:code .haskell caption="Listing caption"} main :: IO () main = putStrLn "Hello World!" ``` The output is pdf. Here is what I see: - It works well with the eisvogel template without any issues. - It works somehow with the default template. The cross reference works, with some warnings, such as "[WARNING] Citeproc: citation lst:code1 not found". I can live with the warnings. - It has issues when I use the default template and a latex header file to customize the format of the pdf output. It complains "! LaTeX Error: Environment codelisting undefined." I am not at the stage where I can modify the template yet to change the output format due to the steep learning curve, so I need to stay with the default template plus the local header .tex file. I know that this is a known issue with pandoc-crossref and solutions have been suggested at https://lierdakil.github.io/pandoc-crossref/#caveats. Again, due to the learning curve, I am not able to comprehend them. A simple solution in https://mickey-happygolucky.hatenablog.com/entry/2022/04/05/012146 suggests using "-M listings" in the command line, and it works for me to suppress the above LaTeX Error. However, the code block does not have a list caption, and the cross-reference defaults to the section number. Could anyone provide a straightforward solution or explanation with enough details so that I can adapt to my case? I know enough LaTeX to make it work one way or another, but I don't have enough knowledge of the configuration of Pandoc and pandoc-crossref; so detailed instruction is needed. Many thanks, JH -- 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/ccb7f2ab-98bc-4c2d-a11c-6f7ff0eea66cn%40googlegroups.com. ------=_Part_2207_1058599707.1687437576004 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am trying to use the syntax of=C2=A0https://lierdakil.github.io/pand= oc-crossref/#code-block-labels to create a code block that I can reference = elsewhere in the same file:

```{#lst:code .haske= ll caption=3D"Listing caption"}
main :: IO ()
main =3D putStrLn "= Hello World!"
```

The output is pdf. = Here is what I see:

-=C2=A0 =C2=A0It works well = with the=C2=A0eisvogel template without any issues.=C2=A0
-=C2=A0= =C2=A0It works somehow with the default template. The cross reference work= s, with some warnings, such as "[WARNING] Citeproc: citation lst:code1 not = found". I can live with the warnings.
-=C2=A0 =C2=A0It has issues= when I use the default template and a latex header file to customize the f= ormat of the pdf output. It complains "! LaTeX Error: Environment codelisti= ng undefined."=C2=A0

I am not at the stage where= I can modify the template yet to change the output format due to the steep= learning curve, so I need to stay with the default template plus the local= header .tex file. I know that this is a known issue with pandoc-crossref a= nd solutions have been suggested at https://lierdakil.github.io/pandoc-cros= sref/#caveats. Again, due to the learning curve, I am not able to comprehen= d them.=C2=A0A simple solution in https://mickey-happygolucky.hatenablog.co= m/entry/2022/04/05/012146 suggests using "-M listings" in the command line,= and it works for me to suppress the above LaTeX Error. However, the code b= lock does not have a list caption, and the cross-reference defaults to the = section number.=C2=A0

Could anyone provide a str= aightforward solution or explanation with enough details so that I can adap= t to my case? I know enough LaTeX to make it work one way or another, but I= don't have enough knowledge of the configuration of Pandoc and pandoc-cros= sref; so detailed instruction is needed.

Many th= anks,
JH

--
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/ccb7f2ab-98bc-4c2d-a11c-6f7ff0eea66cn%40googlegroups.= com.
------=_Part_2207_1058599707.1687437576004-- ------=_Part_2206_174250988.1687437576004--