From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17785 Path: news.gmane.org!.POSTED!not-for-mail From: Lyndon Drake Newsgroups: gmane.text.pandoc Subject: Re: Going round in circles with latex output Date: Tue, 6 Jun 2017 06:26:33 -0700 (PDT) Message-ID: References: <89122680-f883-4853-a97f-a81861395b78@googlegroups.com> <99f9330e-3a82-4a0d-8bb4-4ec2513723fe@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_265_123276912.1496755593787" X-Trace: blaine.gmane.org 1496755597 396 195.159.176.226 (6 Jun 2017 13:26:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Jun 2017 13:26:37 +0000 (UTC) Cc: bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJKJO4E2ICRBCW33LEQKGQE6TPBBKY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 06 15:26:31 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf0-f183.google.com ([209.85.192.183]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIEVB-0008B9-Vp for gtp-pandoc-discuss@m.gmane.org; Tue, 06 Jun 2017 15:26:30 +0200 Original-Received: by mail-pf0-f183.google.com with SMTP id v29sf6601252pfi.0 for ; Tue, 06 Jun 2017 06:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=jFvtOsOWmWb/w0W4pnHT1k2219DLc38HdmRSX5awH1c=; b=o9z20ZQQBL1WlpDVvYWIA1kwyiBd7rGlXEA0EMNtK8IxZ2WZzdb0NbfaoJmp/pGOlM E7FVxiuy4OuvvcR/ahy867pYVcD65K3ACtZIgIsegl4z/LBwIJdio1zBaxgp6f88/Prt VU8inWbe8kIBf7ya4XcqUP7UhJZ9PmskxOp3rvsSmHa4J0C+3q926Hl4AxS3RJCOF91m mFp22+As67qBU19Kn2B6+MNcuT6Bie+z2NPuoG88xX0yIZJwB4L5yuT+v05niK+u+yGX InNB1p6XCUlu93cLOs33CO/2JI5qp/6Hy0J1jm2RAvNaAols2TgkcSw0Jl2F2s53I7Mq kogQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arotau-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=jFvtOsOWmWb/w0W4pnHT1k2219DLc38HdmRSX5awH1c=; b=o5uKJSvC6nDgWENaT7qHlOMSUlonTuv+s6aHh3VVkeckHrEl3EVThVWNzBRkzooKjC Wss38ddDejEIUo/5adHdpq4kf6cxkbVGMt8bBRrT58QmoTbzfTLekKUHy+NbBykF62ZJ 4yMVLIP/oK1gYKlq6qQt1wJdseQUE+GxMe7s0n1nkWmCmazozvu/G9US9wAqcVJEXqyV SiFj1eIf8zuABOmEjZ/6vwfhhE0AmUtvf2KqPcifCoJurDEec/gYA61FcFjZszglyp+4 Oc+5r/LBqhH26Swt9n7SjzTWprg5AV8trcs8HJEWfaZwEf6aAuik5ww7cW2nV1/ITCAe OP7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=jFvtOsOWmWb/w0W4pnHT1k2219DLc38HdmRSX5awH1c=; b=riTaqqTzMtrDhMu+SZHo0s/DewCn8gVQR94sTMox3ZBcUDMtXkNReylQlQXdzX6dq4 YeFk0dQRiGOlKxsqLmo+OJNk0EWlSQThsoaYyAKfQI1TwLvFf3r7Go1fQQ5wVmeEXj9l RbehXQ4SxP3hcpCOkh6uah4YBW+NXJ+ojitfmTk7o/FYISA32OVaadzdjD85D6Y5e7BQ hiBBcYerUyzZ7BX+exJ+YhwuZWDNBNXh2GWrch2H/VZ5Z0NvTmq7cSHzGZyECJFaGU/5 GG5gnOX6qei/m7g1SIY8pAgCPLm2+/hpkk1jcIHWV0cPqYY1QAXdKTjXZEVyArgAuNpW 4j+Q== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AODbwcD1q2bGL2D+cjL/XlvEJhs9q3cKZbpERgYS97wsetUoWKzYTG2T sA8wqIAAS5eHQA== X-Received: by 10.157.15.157 with SMTP id d29mr591481otd.11.1496755595058; Tue, 06 Jun 2017 06:26:35 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.68.232 with SMTP id p40ls2689925otg.25.gmail; Tue, 06 Jun 2017 06:26:34 -0700 (PDT) X-Received: by 10.157.84.36 with SMTP id j36mr594313oth.9.1496755594319; Tue, 06 Jun 2017 06:26:34 -0700 (PDT) In-Reply-To: X-Original-Sender: lyndon-S8RYeTzMgQ3QT0dZR+AlfA@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.org gmane.text.pandoc:17785 Archived-At: ------=_Part_265_123276912.1496755593787 Content-Type: multipart/alternative; boundary="----=_Part_266_247053242.1496755593787" ------=_Part_266_247053242.1496755593787 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for this. I'd come to the conclusion that writing a latex file and= =20 including the fragments that pandoc generates might be the way forward, but= =20 I'm also curious to know what I've been doing wrong. No rush of course, but I'm keen to have a look at your filter and see what= =20 it does, even without docs. I've also found another filter on the list back= =20 in 2014 from Jesse Rosenthal that looks at Unicode ranges and wraps them in= =20 a latex environment, which seems like a good idea (I've done this kind of= =20 thing in InDesign grep styles and it works well for most normal bits of=20 text). I found the lang/otherlangs documentation, but couldn't figure out from the= =20 manual (might just be overlooking the correct bit) how to set a div or a=20 span for another language. Part of the problem is that if I set lang and otherlangs as follows: lang: en-GB otherlangs: [he, sy] =20 I get this: ! Package bidi Error: Oops! you have loaded package longtable after bidi=20 packag e. Please load package longtable before bidi package, and then try to run= =20 xelat ex on your document again. See the bidi package documentation for explanation. Type H for immediate help. ... =20 =20 l.72 \begin{document} pandoc: Error producing PDF which I guess means that some kind of strange interaction in the latex=20 template is producing an undesirable latex file to feed to xelatex (maybe= =20 pandoc-csv2table is doing something to the produced latex?). But it kind of= =20 put a stop to me experimenting with the spans and divs. Best, Lyndon On Tuesday, June 6, 2017 at 1:08:48 PM UTC+1, BPJ wrote: > > You need to use the lang and otherlang variables as described in the=20 > manual http://pandoc.org/MANUAL if I recall correctly. > > Alternatively/additionally write a latex file containing a preamble=20 > fragment where you load polyglossia and any languages and fonts you need= =20 > with the options you need in the usual polyglossia/fontspec way and inclu= de=20 > it with the -H option. You also need to mark spans/divs containing extra= =20 > languages with lang and dir attributes as appropriate. Use your browser's= =20 > page search function to find these terms in the manual. > > I saw your other question about font/language switching yesterday and=20 > started to write some documentation for the filter I use to make those=20 > things easier. Alas I couldn't finish and today there is a national holid= ay=20 > in Sweden. I'll get back to it tomorrow. Basically you can use spans with= a=20 > single short class like .g for greek and the filter will inject latex=20 > markup, docx custom style names or extended (html) attributes you have=20 > declared to correspond to the class in your metadata. > > I can comfort you that you are much better off than I was when I started= =20 > doing multilingual work with Pandoc. We had no filters, no native spans o= r=20 > divs and no built-in multilingual/polyglossia support back then. Everythi= ng=20 > had to be done in -H files and with raw latex in the markdown, which was = a=20 > pain because I needed to make things available in HTML as well. > > I'll also update my latex template on github which contains some stuff fo= r=20 > fontspec font loading. > > I hope this helps. I'm afraid I won't be able to check my mail for the=20 > rest of the day. > > > tis 6 juni 2017 kl. 09:02 skrev Lyndon Drake >: > >> Sorry, I probably wasn't clear: I followed the instruction from Pandoc= =20 >> and switched to xelatex. Now I'm stuck trying to configure the language= =20 >> options. >> >> >> On Tuesday, June 6, 2017 at 7:41:32 AM UTC+1, BP wrote: >> >>> You need the --latex-engine=3Dxelatex option. >>> >>> tis 6 juni 2017 kl. 07:53 skrev Lyndon Drake : >>> >> Hi all, >>>> >>>> Many apologies as I'm sure this is all obvious once one knows, but I'm= =20 >>>> a bit stuck. I've got some Pandoc Markdown files which I'm trying to= =20 >>>> convert to PDF using Pandoc. They include various non-ascii characters= , all=20 >>>> in unicode. If I run: >>>> >>>> /usr/local/bin/pandoc -f=20 >>>> markdown+pipe_tables+grid_tables+yaml_metadata_block --filter=20 >>>> pandoc-citeproc --filter pandoc-csv2table -s -o formatted/Draft3.pdf= =20 >>>> text/metadata.yaml text/1-Introduction.md >>>> >>>> I get the following: >>>> >>>> ! Package inputenc Error: Unicode char =E1=B9=A3 (U+1E63) >>>> >>>> (inputenc) not set up for use with LaTeX. >>>> >>>> >>>> See the inputenc package documentation for explanation. >>>> >>>> Type H for immediate help. >>>> >>>> ... =20 >>>> >>>> =20 >>>> >>>> l.125 Vandenhoeck \& Ruprecht, 1990), 39--62.} >>>> >>>> >>>> Try running pandoc with --latex-engine=3Dxelatex. >>>> >>>> pandoc: Error producing PDF >>>> >>>> >>>> So the next step was to switch to xelatex based on the helpful=20 >>>> suggestion from pandoc. As long as I don't try to use any babel or=20 >>>> polyglossia environments, or biblatex, this works fine. But as I want = to=20 >>>> use both, I'm a bit stuck. First thing is that it looks like the defau= lt=20 >>>> template tries to use babel rather than polyglossia if xetex is the en= gine.=20 >>>> Is there a reason for this? (I want to use the biblatex-sbl style for = my=20 >>>> bibliography, and they recommend polyglossia.) >>>> >>>> I want to use English (UK) as my main language, with Hebrew and Syriac= =20 >>>> as other languages (I've also got some ancient Greek, but the main fon= t=20 >>>> I've chosen works fine and the output looks good for that without usin= g a=20 >>>> separate language environment). >>>> >>>> As a starting point, what language options do I set in my YAML metadat= a=20 >>>> to enable those other two language environments, and how do I specify = the=20 >>>> fonts for them? >>>> >>>> Here's my YAML metadata file so far: >>>> >>>> --- >>>> author: Lyndon Drake >>>> documentclass: memoir >>>> toc: true >>>> papersize: a4 >>>> fontsize: 12pt >>>> top-level-division: chapter >>>> number-sections: true >>>> mainfont: Skolar PE Light >>>> mainfontoptions: Numbers=3DOldStyle >>>> bibliography: /Users/lyndon/Documents/Media/Bibliography/0lib.bib >>>> csl:=20 >>>> /Users/lyndon/Documents/Media/Bibliography/society-of-biblical-literat= ure-fullnote-bibliography.csl >>>> notes-after-punctuation: true >>>> --- >>>> >>>> Many thanks in advance for any help on this, >>>> Lyndon >>>> >>>> --=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 post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >>> >>>> To view this discussion on the web visit=20 >>>> https://groups.google.com/d/msgid/pandoc-discuss/89122680-f883-4853-a9= 7f-a81861395b78%40googlegroups.com=20 >>>> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> --=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . >> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 >> . >> To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/99f9330e-3a82-4a0d-8bb4= -4ec2513723fe%40googlegroups.com=20 >> >> . >> For more options, visit https://groups.google.com/d/optout. >> > --=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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/e028cdb2-2ace-4a13-8a13-3c2858f002b1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_266_247053242.1496755593787 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for this. I'd come to the conclusion that writi= ng a latex file and including the fragments that pandoc generates might be = the way forward, but I'm also curious to know what I've been doing = wrong.

No rush of course, but I'm keen to have a loo= k at your filter and see what it does, even without docs. I've also fou= nd another filter on the list back in 2014 from Jesse Rosenthal that looks = at Unicode ranges and wraps them in a latex environment, which seems like a= good idea (I've done this kind of thing in InDesign grep styles and it= works well for most normal bits of text).

I found= the lang/otherlangs documentation, but couldn't figure out from the ma= nual (might just be overlooking the correct bit) how to set a div or a span= for another language.

Part of the problem is that= if I set lang and otherlangs as follows:

=C2=A0 la= ng: en-GB
=C2=A0 otherlangs: [he, sy]
=C2=A0=C2=A0
I get this:

! Package bidi Error: Oo= ps! you have loaded package longtable after bidi packag


=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0




which I guess means that some k= ind of strange interaction in the latex template is producing an undesirabl= e latex file to feed to xelatex (maybe pandoc-csv2table is doing something = to the produced latex?). But it kind of put a stop to me experimenting with= the spans and divs.

Best,
Lyndon

On Tuesday, Ju= ne 6, 2017 at 1:08:48 PM UTC+1, BPJ wrote:
You need to use the lang and otherlang variables as descri= bed in the manual http://pandoc.org/MANUAL if I recall correctly.

Alternatively/additionally write a latex file containing a preamble f= ragment where you load polyglossia and any languages and fonts you need wit= h the options you need in the usual polyglossia/fontspec way and include it= with the -H option. You also need to mark spans/divs containing extra lang= uages with lang and dir attributes as appropriate. Use your browser's p= age search function to find these terms in the manual.

=
I saw your other question about font/language switching yesterday and = started to write some documentation for the filter I use to make those thin= gs easier. Alas I couldn't finish and today there is a national holiday= in Sweden. I'll get back to it tomorrow. Basically you can use spans w= ith a single short class like .g for greek and the filter will inject =C2= =A0latex markup, docx custom style names or extended (html) attributes you = have declared to correspond to the class in your metadata.

I can comfort you that you are much better off than I was when I s= tarted doing multilingual work with Pandoc. We had no filters, no native sp= ans or divs and no built-in multilingual/polyglossia support back then. Eve= rything had to be done in -H files and with raw latex in the markdown, whic= h was a pain because I needed to make things available in HTML as well.

I'll also update my latex template on github whic= h contains some stuff for fontspec font loading.

I= hope this helps. I'm afraid I won't be able to check my mail for t= he rest of the day.


tis 6 juni 2017 kl. 09:02 skrev Lyndon Drake <lyn...-S8RYeTzMgQ3QT0dZR+AlfA@public.gmane.org&g= t;:
Sorry, I probably wasn'= ;t clear: I followed the instruction from Pandoc and switched to xelatex. N= ow I'm stuck trying to configure the language options.

On Tuesday, June 6, 2017 at 7:41:32 AM UTC+1, BP wrote:
You need =C2=A0the --latex-engine=3Dx= elatex option.

tis 6 juni 201= 7 kl. 07:53 skrev Lyndon Drake <lyn...-S8RYeTzMgQ3QT0dZR+AlfA@public.gmane.org>:

/usr/local/bin/pandoc -f markdown+pipe_tables+= grid_tables+yaml_metadata_block --filter pandoc-citeproc --filter pand= oc-csv2table -s -o formatted/Draft3.pdf text/metadata.yaml text/1-Introduct= ion.md



! Package inputenc Error: Unicode char =E1=B9=A3 (U+1E= 63)

(inputenc)=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 not set up for use with LaTeX.


See the inputenc package documentation for explanation.=

Type=C2=A0 H <return>=C2=A0 for immediate help.

=C2=A0... =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0

l.125 =C2=A0 Vandenhoeck \& Ruprecht, 1990), 39--62.}


Try running pandoc with --latex-engine=3Dxelatex.

pandoc: Error producing PDF



So the next step was to sw= itch to xelatex based on the helpful suggestion from pandoc. As long as I d= on't try to use any babel or polyglossia environments, or biblatex, thi= s works fine. But as I want to use both, I'm a bit stuck. First thing i= s that it looks like the default template tries to use babel rather than po= lyglossia if xetex is the engine. Is there a reason for this? (I want to us= e the biblatex-sbl style for my bibliography, and they recommend polyglossi= a.)

I want to use Englis= h (UK) as my main language, with Hebrew and Syriac as other languages (I= 9;ve also got some ancient Greek, but the main font I've chosen works f= ine and the output looks good for that without using a separate language en= vironment).

As a startin= g point, what language options do I set in my YAML metadata to enable those= other two language environments, and how do I specify the fonts for them?<= /span>

Here's my YAML metad= ata file so far:

=C2=A0 fontsize: 12pt
=
=C2=A0 number-sections: true
=C2=A0 mainfont: Skolar PE Ligh= t
=C2=A0 mainfontoptions: Numbers=3DOldStyle
=C2=A0 bib= liography: /Users/lyndon/Documents/Media/Bibliography/0lib.bib
=C2=A0 csl: /Users/lyndon/Documents/Media/Bibliography/society-of-<= wbr>biblical-literature-fullnote-bibliography.csl


--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
<= /div>

--
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-discus...@googlegroups.com.
To post to this group, send email to pandoc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pand= oc-discuss/99f9330e-3a82-4a0d-8bb4-4ec2513723fe%40googlegroups.co= m.
For more options, visit https://groups.google.com/= d/optout.

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/e028cdb2-2ace-4a13-8a13-3c2858f002b1%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_266_247053242.1496755593787-- ------=_Part_265_123276912.1496755593787--