From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32161 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=C3=A9ment_Aubert?= Newsgroups: gmane.text.pandoc Subject: Re: Possible bugs in the markdown to PDF via lualatex conversion process for bilingual documents Date: Thu, 9 Feb 2023 09:55:04 -0800 (PST) Message-ID: References: <017f0e7b-dd57-452b-95b4-f89c655d39ben@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_22_1654697643.1675965304978" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37229"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCM37TODUUORB6XGSSPQMGQEZ5KJE7A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Feb 09 18:55:11 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qk1-f184.google.com ([209.85.222.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pQB8Y-0009TP-J3 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 09 Feb 2023 18:55:10 +0100 Original-Received: by mail-qk1-f184.google.com with SMTP id j29-20020a05620a001d00b00724fd33cb3esf1718030qki.14 for ; Thu, 09 Feb 2023 09:55:10 -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=6MumubE0yQrI2EHg6Jo6FSjR8Tn1ZvmyjBTDMT2gdOE=; b=Au00+W86vo4LRGyJj1agDeh2tBbAudJ50TVYYoADvSjQtGljEZQh5TGOuTrVK/Or56 Y478z6FcjcjXygrgA/TnQco6NoMvMZfFxJfUqMYiJuqNXPUuWdiKKeYlM9ZK+ZpqvVxW ldrH9as/aBKUxCBXzJAXtG+UuHMzuK3wDHwp/54+KrzbJ4RcxrDlMFOpYxr3WKnaZMXE rkuhcl18OCWwFAvlBc8HReENixVeUTu63cBLxhEaYJxyya5T85f62QGJqafq8GDsH/Zf sFnoGMeM/A3yTumY18gB5giDwl0KBk/vdizB6LJ4pStzmBEdXZAWJ6VHXBRqu/QiDily lUMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=6MumubE0yQrI2EHg6Jo6FSjR8Tn1ZvmyjBTDMT2gdOE=; b=a/SfDgsytnL9B6kJZvUZTHV0iUyptd3AjNUBqAkMnD8d2np7Y0TQqu7w7I62h27nxj /BzXswuh6LQyIiunJmjosCO9aEgWTwPJThPAWcJWKtFsZcpDAuYeWbQwFOjg1RNyGWPb xdSPoR+BhSRatVeg9ofy/LcJ0Sp6+FvNwoBL9Tl02ShGD/goRLCT0mgLkd/RnXZIG/6f yn7K2QNORjYVp1We/h/+btE2ySVfggbZO1xNLnJrK71IbmFXGrFD2SUVmo+Oh5mXCyo1 BMCtAYm96z/djBsN+vi2iqsUHmbJ6mdLfiCTJavo+uyi6/dEvQ53iFX3EFmcM5//Kuru zVBA== 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=6MumubE0yQrI2EHg6Jo6FSjR8Tn1ZvmyjBTDMT2gdOE=; b=Suxcm6P30N1c2m8/lWec0kXyJ+kqCCXwe+qvpRMs6TaGeK60YLxBS3TgrxjE0sL87i OywafW8Viw1AsV3syVJYsoDkzQqoAUZFg29joKxWY/fJvLhYNpOl+xzgcAaLR+KvOvd7 Ub/O5VsdiXx8drbiySd6wsbARVsb1NW3k5HT+DKXR+sqzPI5OMl1aWfWa1U6cCzW784q RFNHw6Oz4JqAtrEl8JbCTEkpm9oH4g/WDBjPXr0JativgisrW3z3Cf/pqzyW3dSaG4JL Ucg9yqt4ofZdsGAItsDp05gOCDH0L7vr9LOavCQzFIqJVPoJhfRwwW8mq3/nexe+uR+s 5Okw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKXVNWT7jBa6gCSbKJFomh//7tcH07L6m0XQGkQO1hSqR+CLowbF IUW6mS3LN8uj/9wvcemmN80= X-Google-Smtp-Source: AK7set8vwV0z9he8NaC14MN5zTM+Sc2qpH46/SbX7tswxipNN9ao4BH9IgQO3QYBZkJBr9AqDtb6Mw== X-Received: by 2002:ae9:ef85:0:b0:71b:43e0:981c with SMTP id d127-20020ae9ef85000000b0071b43e0981cmr1469907qkg.362.1675965309176; Thu, 09 Feb 2023 09:55:09 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac8:68b:0:b0:3b8:130d:4473 with SMTP id f11-20020ac8068b000000b003b8130d4473ls3126363qth.10.-pod-prod-gmail; Thu, 09 Feb 2023 09:55:06 -0800 (PST) X-Received: by 2002:a05:622a:1492:b0:3b6:310c:824b with SMTP id t18-20020a05622a149200b003b6310c824bmr2160187qtx.53.1675965305818; Thu, 09 Feb 2023 09:55:05 -0800 (PST) In-Reply-To: <017f0e7b-dd57-452b-95b4-f89c655d39ben-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: aubert.clement-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:32161 Archived-At: ------=_Part_22_1654697643.1675965304978 Content-Type: multipart/alternative; boundary="----=_Part_23_860222761.1675965304978" ------=_Part_23_860222761.1675965304978 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ok, we could also use=20 \babelfont[english]{rm}[Path=3Dfonts/,Extension=3D.otf,UprightFont=3D*-regu= lar,BoldFont=3D*-bold,ItalicFont=3D*-italic,BoldItalicFont=3D*-BoldItalic]{= texgyretermes} instead of=20 \babelfont[english]{rm}{fonts/texgyretermes-regular.otf} This could make everything easier=E2=80=A6 Le jeudi 9 f=C3=A9vrier 2023 =C3=A0 12:27:53 UTC-5, Cl=C3=A9ment Aubert a = =C3=A9crit : > Hi, > > I may have found a similar bug, but find it *very hard* to understand its= =20 > exact causes. > > In a rather long document, I have the following options in my YAML: > > --- > documentclass: scrbook > mainfont: texgyretermes > mainfontoptions: > - Path=3Dfonts/ > - Extension=3D.otf > - UprightFont=3D*-regular > - BoldFont=3D*-bold > - ItalicFont=3D*-italic > - BoldItalicFont=3D*-BoldItalic > fontsize: 12pt > --- > > Now, some combination of LaTeX packages (or something else?) that I load= =20 > makes pandoc output, in the .tex document > > \ifLuaTeX > \usepackage[bidi=3Dbasic]{babel} > \else > \usepackage[bidi=3Ddefault]{babel} > \fi > \babelprovide[main,import]{english} > \ifPDFTeX > \else > \babelfont[english]{rm}{texgyretermes} > \fi > > When I compile said document with XeLaTeX, I get > > kpathsea: Running mktextfm TeXGyreTermes/OT > > > but that font is not found, and hence I get the error > > > Package fontspec Error: The font "TeXGyreTermes" cannot be found.=20 > \babel@aux{english}{} > > > If I replace=20 > > > \babelfont[english]{rm}{texgyretermes} > > > with > > > \babelfont[english]{rm}{fonts/texgyretermes-regular.otf} > > then the document can be compiled. > > Is this a bug? > > I am using the latest version, > pandoc 3.0.1 > Features: +server +lua > Scripting engine: Lua 5.4 > User data directory: /home/caubert/.local/share/pandoc > Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org > This is free software; see the source for copying conditions. There is no > warranty, not even for merchantability or fitness for a particular purpos= e. > > Best, > And thanks, > Cl=C3=A9ment. > Le mardi 8 f=C3=A9vrier 2022 =C3=A0 16:35:00 UTC-5, John MacFarlane a =C3= =A9crit : > >> >> Let us know what version of pandoc you're using.=20 >> There have been extensive changes recently that might be=20 >> relevant (we no longer use polyglossia, but of course=20 >> it's possible that something relating to our old polyglossia=20 >> support was left in the template...).=20 >> >> "R (Chandra) Chandrasekhar" writes:=20 >> >> > I am writing a bilingual test file for English and Tamil in the same= =20 >> > markdown document to yield a PDF via lualatex and babel. The file,=20 >> which=20 >> > correctly gives HTML and epub outputs, is:=20 >> >=20 >> > ```=20 >> > ---=20 >> > title: "Bilingual Test for LuaLaTeX and Babel: English and Tamil"=20 >> > lang: en-GB=20 >> > ---=20 >> >=20 >> > This is English.=20 >> >=20 >> > {\sffamily This is also English.}=20 >> >=20 >> > =E0=AE=87=E0=AE=A4=E0=AF=81 =E0=AE=A4=E0=AE=AE=E0=AE=BF=E0=AE=B4=E0=AF= =8D.=20 >> >=20 >> > {\sffamily =E0=AE=87=E0=AE=A4=E0=AF=81=E0=AE=B5=E0=AF=81=E0=AE=AE=E0= =AF=8D =E0=AE=A4=E0=AE=AE=E0=AE=BF=E0=AE=B4=E0=AF=8D.}=20 >> >=20 >> > :::{lang=3Dta}=20 >> > =E0=AE=87=E0=AE=A4=E0=AF=81 =E0=AE=95=E0=AF=82=E0=AE=9F =E0=AE=A4=E0= =AE=AE=E0=AE=BF=E0=AE=B4=E0=AF=8D =E0=AE=A4=E0=AE=BE=E0=AE=A9=E0=AF=8D.=20 >> > :::=20 >> >=20 >> > Back to English and EOF.=20 >> > ```=20 >> >=20 >> > The included `babel-in-header.tex` file is:=20 >> >=20 >> > ```=20 >> > % babel-in-header.textsf=20 >> > \babelfont{rm}[Scale=3D1.0,Language=3DDefault,BoldFont=3D{* SemiBold}]= {Noto=20 >> Serif}=20 >> > \babelfont{sf}[Language=3DDefault,BoldFont=3D{* SemiBold}]{Noto Sans}= =20 >> > \babelfont[tamil]{rm}[Language=3DDefault]{Noto Serif Tamil}=20 >> > \babelfont[tamil]{sf}[Language=3DDefault]{Noto Sans Tamil}=20 >> > \babelprovide[import,onchar=3Dids fonts]{tamil}=20 >> >=20 >> \defaultfontfeatures{Scale=3DMatchLowercase,Ligatures=3DTeX,Renderer=3DH= arfBuzz}=20 >> > \thispagestyle{empty}=20 >> > ```=20 >> >=20 >> > The compilation command is:=20 >> >=20 >> > pandoc --from markdown --to latex --include-in-header=20 >> > babel-in-header.tex --standalone --output en-ta-test.tex en-ta-test.md= =20 >> >=20 >> > I find that the generated .tex file cannot be compiled to PDF because= =20 >> > there appear to be two errors, which might be bugs:=20 >> >=20 >> > 1. The \babelfont commands appear _before_ the \usepackage{babel}=20 >> > invocation in the .tex file because of a commented requirement for=20 >> > polyglossia, which I am not using. As a result, I get an=20 >> >=20 >> > ```=20 >> > ! Undefined control sequence.=20 >> > l.59 \babelfont=20 >> > {rm}[Scale=3D1.0,Language=3DDefault,BoldFont=3D{*=20 >> > SemiBold}]{Noto Serif}=20 >> > ```=20 >> >=20 >> > error with lualatex.=20 >> >=20 >> > 2. If I manually transpose the \babelfont commands inserted by the=20 >> > `babel-in-header.tex` file to appear _after_ the babel invocation but= =20 >> > before \title in the .tex file, I get this error:=20 >> >=20 >> > ```=20 >> > ! Package babel Error: Unknown option 'tamil'. Either you misspelled i= t=20 >> > (babel) or the language definition file tamil.ldf was not=20 >> > found.=20 >> >=20 >> >=20 >> > See the babel package documentation for explanation.=20 >> > ```=20 >> >=20 >> > 3. If I remove `tamil,` from the babel invocation,=20 >> >=20 >> > ```=20 >> > \usepackage[tamil,main=3Dbritish]{babel}=20 >> > ```=20 >> >=20 >> > I am able to compile with lualatex, using the same command as before,= =20 >> > and get the expected PDF, as shown in the attached screenshot.=20 >> >=20 >> > I realize that both pandoc and the babel package are under development= ,=20 >> > and are therefore moving targets.=20 >> >=20 >> > Nevertheless, I believe these are bugs in the markdown to latex=20 >> > conversion process and point them out so that they may be corrected or= =20 >> > circumvented, automatically rather than manually, from the pandoc end.= =20 >> >=20 >> > Thanks.=20 >> >=20 >> > Chandra=20 >> >=20 >> > --=20 >> > You received this message because you are subscribed to the Google=20 >> Groups "pandoc-discuss" group.=20 >> > To unsubscribe from this group and stop receiving emails from it, send= =20 >> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> > To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/b865ce6f-aa23-a1f0-b5f7= -35601791d215%40gmail.com.=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 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/d2d6d890-37d5-4309-b792-a833de39cc5fn%40googlegroups.com. ------=_Part_23_860222761.1675965304978 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok, we could also use

\babelfont[eng= lish]{rm}[Path=3Dfonts/,Extension=3D.otf,UprightFont=3D*-regular,BoldFont= =3D*-bold,ItalicFont=3D*-italic,BoldItalicFont=3D*-BoldItalic]{texgyreterme= s}

instead of

= \babelfont[english]{rm}{fonts/texgyretermes-regular.otf}

This could make everything easier=E2=80=A6
Le jeudi 9 f=C3=A9v= rier 2023 =C3=A0 12:27:53 UTC-5, Cl=C3=A9ment Aubert a =C3=A9crit=C2=A0:
Hi,
<= div>
I may have found a similar bug, but find it very hard= to understand its exact causes.

In a rather l= ong document, I have the following options in my YAML:

---
documentclass: scrbook
mainfont: texgyretermes
mainfo= ntoptions:
- Path=3Dfonts/
- Extension=3D.otf
- UprightFont=3D*-re= gular
- BoldFont=3D*-bold
- ItalicFont=3D*-italic
- BoldItalicFont= =3D*-BoldItalic
fontsize: 12pt
---

Now, some combin= ation of LaTeX packages (or something else?) that I load makes pandoc outpu= t, in the .tex document

\ifLuaTeX
\usepackage[b= idi=3Dbasic]{babel}
\else
\usepackage[bidi=3Ddefault]{babel}
\fi\babelprovide[main,import]{english}
\ifPDFTeX
\else
\babelfont[e= nglish]{rm}{texgyretermes}
\fi

When I compile s= aid document with XeLaTeX, I get

kpathsea: Running mktextfm TeXGyreTermes/OT


but that fo= nt is not found, and hence I get the error


Package fontspe= c Error: The font "TeXGyreTermes" cannot be found. \babel@aux{eng= lish}{}


If I replace


\babelfont[english]= {rm}{texgyretermes}


with


\babelfont[engli= sh]{rm}{fonts/texgyretermes-regular.otf}


t= hen the document can be compiled.

Is this a bug?

I am using the latest version,
pandoc 3.0= .1
Features: +server +lua
Scripting engine: Lua 5.4
User data dire= ctory: /home/caubert/.local/share/pandoc
Copyright (C) 2006-2023 John Ma= cFarlane. Web:=C2=A0 https://pandoc.org
This is free = software; see the source for copying conditions. There is no
warranty, n= ot even for merchantability or fitness for a particular purpose.
<= div>
Best,
And thanks,
Cl=C3=A9ment.
=
Le = mardi 8 f=C3=A9vrier 2022 =C3=A0 16:35:00 UTC-5, John MacFarlane a =C3=A9cr= it=C2=A0:

Let us know what version of pandoc you're using.
There have been extensive changes recently that might be
relevant (we no longer use polyglossia, but of course
it's possible that something relating to our old polyglossia
support was left in the template...).

"R (Chandra) Chandrasekhar" <chya...@g= mail.com> writes:

> I am writing a bilingual test file for English and Tamil in the sa= me=20
> markdown document to yield a PDF via lualatex and babel. The file,= which=20
> correctly gives HTML and epub outputs, is:
>
> ```
> ---
> title: "Bilingual Test for LuaLaTeX and Babel: English and Ta= mil"
> lang: en-GB
> ---
>
> This is English.
>
> {\sffamily This is also English.}
>
> =E0=AE=87=E0=AE=A4=E0=AF=81 =E0=AE=A4=E0=AE=AE=E0=AE=BF=E0=AE=B4= =E0=AF=8D.
>
> {\sffamily =E0=AE=87=E0=AE=A4=E0=AF=81=E0=AE=B5=E0=AF=81=E0=AE=AE= =E0=AF=8D =E0=AE=A4=E0=AE=AE=E0=AE=BF=E0=AE=B4=E0=AF=8D.}
>
> :::{lang=3Dta}
> =E0=AE=87=E0=AE=A4=E0=AF=81 =E0=AE=95=E0=AF=82=E0=AE=9F =E0=AE=A4= =E0=AE=AE=E0=AE=BF=E0=AE=B4=E0=AF=8D =E0=AE=A4=E0=AE=BE=E0=AE=A9=E0=AF=8D.
> :::
>
> Back to English and EOF.
> ```
>
> The included `babel-in-header.tex` file is:
>
> ```
> % babel-in-header.textsf
> \babelfont{rm}[Scale=3D1.0,Language=3DDefault,BoldFont=3D{* SemiBo= ld}]{Noto Serif}
> \babelfont{sf}[Language=3DDefault,BoldFont=3D{* SemiBold}]{Noto Sa= ns}
> \babelfont[tamil]{rm}[Language=3DDefault]{Noto Serif Tamil}
> \babelfont[tamil]{sf}[Language=3DDefault]{Noto Sans Tamil}
> \babelprovide[import,onchar=3Dids fonts]{tamil}
> \defaultfontfeatures{Scale=3DMatchLowercase,Ligatures=3DTeX,Render= er=3DHarfBuzz}
> \thispagestyle{empty}
> ```
>
> The compilation command is:
>
> pandoc --from markdown --to latex --include-in-header=20
> babel-in-header.tex --standalone --output en-ta-test.tex en-ta-tes= t.md
>
> I find that the generated .tex file cannot be compiled to PDF beca= use=20
> there appear to be two errors, which might be bugs:
>
> 1. The \babelfont commands appear _before_ the \usepackage{babel}= =20
> invocation in the .tex file because of a commented requirement for= =20
> polyglossia, which I am not using. As a result, I get an
>
> ```
> ! Undefined control sequence.
> l.59 \babelfont
> {rm}[Scale=3D1.0,Language=3DDefault,BoldFont=3D{*=20
> SemiBold}]{Noto Serif}
> ```
>
> error with lualatex.
>
> 2. If I manually transpose the \babelfont commands inserted by the= =20
> `babel-in-header.tex` file to appear _after_ the babel invocation = but=20
> before \title in the .tex file, I get this error:
>
> ```
> ! Package babel Error: Unknown option 'tamil'. Either you = misspelled it
> (babel) or the language definition file tamil.ldf w= as not=20
> found.
>
>
> See the babel package documentation for explanation.
> ```
>
> 3. If I remove `tamil,` from the babel invocation,
>
> ```
> \usepackage[tamil,main=3Dbritish]{babel}
> ```
>
> I am able to compile with lualatex, using the same command as befo= re,=20
> and get the expected PDF, as shown in the attached screenshot.
>
> I realize that both pandoc and the babel package are under develop= ment,=20
> and are therefore moving targets.
>
> Nevertheless, I believe these are bugs in the markdown to latex=20
> conversion process and point them out so that they may be correcte= d or=20
> circumvented, automatically rather than manually, from the pandoc = end.
>
> Thanks.
>
> Chandra
>
> --=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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit ht= tps://groups.google.com/d/msgid/pandoc-discuss/b865ce6f-aa23-a1f0-b5f7-3560= 1791d215%40gmail.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/d2d6d890-37d5-4309-b792-a833de39cc5fn%40googlegroups.= com.
------=_Part_23_860222761.1675965304978-- ------=_Part_22_1654697643.1675965304978--