From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32160 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:27:53 -0800 (PST) Message-ID: <017f0e7b-dd57-452b-95b4-f89c655d39ben@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_18_1782871828.1675963673656" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18061"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCM37TODUUORBG62SSPQMGQET5H2ZDA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Feb 09 18:27:59 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qk1-f183.google.com ([209.85.222.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pQAiE-0004Sk-OA for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 09 Feb 2023 18:27:58 +0100 Original-Received: by mail-qk1-f183.google.com with SMTP id ay10-20020a05620a178a00b0072db6346c39sf1655026qkb.16 for ; Thu, 09 Feb 2023 09:27:58 -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=7SVITNRWFvDWCwcqFoPWKdvF4Xhzn54oqmxl+hCj4Dk=; b=WWBAqlggsPa18ZfYJCJ+3RYjqqDR5Hm9Uevga1xddqRMJGi1J7QsAhonhXdrGsBCH5 3tj8JpubvaBcDAoq6lzT25DplFlnT5QgvtCaWdvN8z9b2wxOLWYEyKFXfInZCPtopo6A RfSexfpyVNCUmYzzfEgfeaktwK0VplUhPIUrIJ2mFEUqogx2UYUWmsmcOjzVjBoA9PRx z/dWjMHUzT6N/cfFRF/lWzfmGIaG5GPTcX6vL5OgdUKKKF3A6zPIR5MQttOGZm+fHiDY XkUu48dIVDf+KG2sd7Z/a7xfE06Jk2k5jZlOomezekTAyKW0hTNp7sB+hd97B2YE+X0a VRRQ== 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=7SVITNRWFvDWCwcqFoPWKdvF4Xhzn54oqmxl+hCj4Dk=; b=LGhZyi4WE04NbNTa3LUn+ZCkF6yOp/hUsygV2IoqkeAw8mB3HvMsei3ze4/1+TqlPo wlPkJ6F/+jaPVB+jIgEcFl3sjCn1242LhOLH1eesdVfeM61h2tsufKIXTlKUKfhcAfaJ f0iOgzXLVbXWwysxi0T/Ybd/1V67ilOKXUGJ7CTA/GIFnWon3mLR7I+pRRP/YP5j2eiX TLXtxJe0n9Z736NvHgfgF8Mfwz/dEN/77EsDu1ZkE3kXE07b7dMJNpME1wTWc+Db9twM pgQzjz/vmfFvaPZUBYcVZ8ExDWoSxMwyE9fLKdOHqDdx8tUux0mTmmE8ZKXB2zdga2lQ 5fLg== 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=7SVITNRWFvDWCwcqFoPWKdvF4Xhzn54oqmxl+hCj4Dk=; b=IUOkHIX6Vytg16MS/lB0hAWZv0wJOMvUf/wDqt+eDKHtXxW+R/i0Wm4+BpacAwSqhL SywFw1ANddLWzjNv6VsiYuVpYll5eXNDByy1Zz5WrxXVrgG0E6r0Af3ef+2wa59SEBiR RaS1FUohx59Zpz/kqy75Wmjm2mmlZsPfAq1kPENeGNB9fwDGNKLiW69kZlSmzyCIZFqc 1BP4TRXzf12Ki/Ag4Dhbcy6AAjAq0H5jOSQpHv4WWXosnjQbjVbtDdjIw0tBS/AHCZ+m o/S6NUh6EQSnxKGXmM68Iy5St33rHB4ckDZLPSPwiQUBDMgKTZfKKGujQ9xec78nuItn QGJw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKWVUs8PJNUb1VN6t6xbvJn0MW4bloeRNPaKrg3tKUh/jgaIjBiV oVXvVxx1Hay0E1PDNzDx4/s= X-Google-Smtp-Source: AK7set9qYcWpSflPkZWHsV4nvpGb63uGAqv9rjHbrcOXJZE5mPbCFV4SonGvzgRlvVNEIULJ6YQxfQ== X-Received: by 2002:a37:6947:0:b0:727:11d8:4eec with SMTP id e68-20020a376947000000b0072711d84eecmr451500qkc.190.1675963677626; Thu, 09 Feb 2023 09:27:57 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ae9:ea05:0:b0:71b:3402:f9a1 with SMTP id f5-20020ae9ea05000000b0071b3402f9a1ls483133qkg.0.-pod-prod-gmail; Thu, 09 Feb 2023 09:27:54 -0800 (PST) X-Received: by 2002:a05:620a:2190:b0:71e:b4ba:6be8 with SMTP id g16-20020a05620a219000b0071eb4ba6be8mr621804qka.431.1675963674428; Thu, 09 Feb 2023 09:27:54 -0800 (PST) In-Reply-To: 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:32160 Archived-At: ------=_Part_18_1782871828.1675963673656 Content-Type: multipart/alternative; boundary="----=_Part_19_1464862859.1675963673656" ------=_Part_19_1464862859.1675963673656 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 purpose. 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. > 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" writes: > > > 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, whic= h=20 > > correctly gives HTML and epub outputs, is: > > > > ``` > > --- > > title: "Bilingual Test for LuaLaTeX and Babel: English and Tamil" > > 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{* SemiBold}]{= Noto=20 > Serif} > > \babelfont{sf}[Language=3DDefault,BoldFont=3D{* SemiBold}]{Noto Sans} > > \babelfont[tamil]{rm}[Language=3DDefault]{Noto Serif Tamil} > > \babelfont[tamil]{sf}[Language=3DDefault]{Noto Sans Tamil} > > \babelprovide[import,onchar=3Dids fonts]{tamil} > >=20 > \defaultfontfeatures{Scale=3DMatchLowercase,Ligatures=3DTeX,Renderer=3DHa= rfBuzz} > > \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-test.md > > > > I find that the generated .tex file cannot be compiled to PDF because= =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 was 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 before,= =20 > > and get the expected PDF, as shown in the attached screenshot. > > > > I realize that both pandoc and the babel package are under development,= =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 corrected 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=20 > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send= =20 > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > 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 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/017f0e7b-dd57-452b-95b4-f89c655d39ben%40googlegroups.com. ------=_Part_19_1464862859.1675963673656 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I may have found a similar bug, but fin= d it very hard to understand its exact causes.

In a rather long document, I have the following options in my YAML:

---
documentclass: scrbook
mainfo= nt: texgyretermes
mainfontoptions:
- Path=3Dfonts/
- Extensi= on=3D.otf
- UprightFont=3D*-regular
- BoldFont=3D*-bold
- It= alicFont=3D*-italic
- BoldItalicFont=3D*-BoldItalic
fontsize: 12p= t
---

Now, some combination of LaTeX packages (o= r something else?) that I load makes pandoc output, in the .tex document

\ifLuaTeX
\usepackage[bidi=3Dbasic]{babel}\else
\usepackage[bidi=3Ddefault]{babel}
\fi
\babelprovid= e[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 fon= tspec Error: The font "TeXGyreTermes" cannot be found. \babel@aux{english}{= }


If I replace


\babelfont[english]{r= m}{texgyretermes}


with


\babelfont[eng= lish]{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:=C2=A0 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 purpose.

Best,
And thanks,
Cl=C3=A9men= t.
Le mardi 8 f=C3=A9vrier 2022 =C3=A0 16:35:00 UTC-5, John MacFarlane a= =C3=A9crit=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...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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..= .@googlegroups.com.
> 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/017f0e7b-dd57-452b-95b4-f89c655d39ben%40googlegroups.= com.
------=_Part_19_1464862859.1675963673656-- ------=_Part_18_1782871828.1675963673656--