From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17795 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: Thu, 8 Jun 2017 03:13:49 -0700 (PDT) Message-ID: <5cd094b1-ccba-4c6c-a83b-d0fa2ebf39ba@googlegroups.com> 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_342_1139266.1496916829582" X-Trace: blaine.gmane.org 1496916831 862 195.159.176.226 (8 Jun 2017 10:13:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Jun 2017 10:13:51 +0000 (UTC) Cc: lyndon-S8RYeTzMgQ3QT0dZR+AlfA@public.gmane.org To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJKJO4E2ICRBXWG4TEQKGQELKY22GI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 08 12:13:46 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ua0-f184.google.com ([209.85.217.184]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIuRl-0008Ni-JF for gtp-pandoc-discuss@m.gmane.org; Thu, 08 Jun 2017 12:13:45 +0200 Original-Received: by mail-ua0-f184.google.com with SMTP id n38sf2658195uai.1 for ; Thu, 08 Jun 2017 03:13:51 -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=hYN57+J5rBFHs1Ux98HvxP3Qmc474vebqg2pCicHpvg=; b=P0WCJy5e5A9OOgRrflTquJhWgc9Kno3xTvdWdqHYoclVYc3uVMfYSOMgih17KA7Wnm LuvoFBKlvVUpR35RKkYWlK+RyRGg75W+fGIW7csWkIOfjjcXRH7pEz6Qcwar0We4FpjS mj/o5oOQhq+p3993ZumDoEqnWxtKSfl4GZaKjfUDG3DurIYwvrEUUCu5a7wSlXamhk/v BTA7GIe6I7dEloCDwm8lAtHCvU9IqYj3ut7DaGpYTYhs/bYPJYsUMb8psoDZK0KMDb3S A4n1K6BOCQOd4NKbzYmJA2fPb/45pfXo7M2XzjbqzYr1qNQNZBlPTdPFeli26eX2y16G W/OA== 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=hYN57+J5rBFHs1Ux98HvxP3Qmc474vebqg2pCicHpvg=; b=b0O/cvctTaPhtDWOL0QawMc7iomm2oakTN3mWVVjsWzhpyOjf0sGmhaBMVlH3ZZHWQ 8ryvzOwUYmo7kFjFpriwmZJgsL+FXumuWMoJBiOWIRzH8wivheATfyoJdmttofRghwSG dDFovZQ0ZBv7M7EtJbd0xLJepXve6pileEHkzmKUsMs98RlObLv9f+qDZ+U8KnXbSeWJ /smd8wxyFqZRutnBS4c20y0ruY7kHrbJ98Owsf4ZzTtBKaDjT+2RyP8TBdRqBhtXBbe4 Kh+j8fahspy7JYd4APT3zSKLjHubWyiOPzDHvcTvnIibDB1JlbZ1zSri6LbXAM5JsPLh C6tQ== 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=hYN57+J5rBFHs1Ux98HvxP3Qmc474vebqg2pCicHpvg=; b=RJw/jqHVkXwAmQA0Vaj/tR4fyIsT/jKhrlsRHrT4TzjMx+2jfRKm1g/BasaGUblEun qvBbJ7A5SO3vhU+JkNxduKuIE5Up73REZXwRe14H0a5PLG/sVp3HCPovduftHyMEzURs fgZTrSccBd2rMehjS7pa/OwMHp2HFr2D87YD45d4x8cXPgtzX1hokMzhj/fr6236xrHv JeKI3dTQ5VfM4WWBx+XhuMmMmFm3nuNTAqZqvRKlOBhvL9arhVnNvlTjtHfeemMdX98u ATOflKEhnWyQeUeC79nYXVFdxw4Fr4Fgu8ESJrzwp9p1MFpk6vcNUFRSArXPz9JRI/uJ 4Ucg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AODbwcDQeHgP515EZuDCTYSnj/easKLmwtMAnGNc4IgZKyobDDP7wOV8 HPLBrMieITu2Lw== X-Received: by 10.157.15.157 with SMTP id d29mr850894otd.11.1496916830795; Thu, 08 Jun 2017 03:13:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.48.130 with SMTP id s2ls7568131otc.47.gmail; Thu, 08 Jun 2017 03:13:50 -0700 (PDT) X-Received: by 10.157.52.232 with SMTP id t37mr852380otd.15.1496916830069; Thu, 08 Jun 2017 03:13:50 -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:17795 Archived-At: ------=_Part_342_1139266.1496916829582 Content-Type: multipart/alternative; boundary="----=_Part_343_984563496.1496916829583" ------=_Part_343_984563496.1496916829583 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That's very helpful, thank you! I haven't actually rewritten the LaTeX template preamble, just moved things= =20 around a bit, retaining all the Pandoc variables but making the package=20 load order robust. I think I'll probably slightly update the template, for= =20 two more things: 1. it's nice to have access to two places for header insertions, one near= =20 the start and the other near the end of the header material once all the=20 packages have been loaded; 2. the memoir class works best for books when there are \frontmatter,=20 \mainmatter, and \endmatter calls in the document, so I will add options=20 and a test to allow those. I like the span syntax you've got, though in the medium term I want to work= =20 on an automatic filter for setting the language based on Unicode ranges and= =20 just use spans to cover unusual cases (although in fact, there is almost no= =20 case that cannot be covered by the use of Unicode direction-breaking marks= =20 or spaces, which have the advantage of working without any markup in HTML= =20 in modern browsers with font fallback mechanisms). On Wednesday, June 7, 2017 at 5:23:54 PM UTC+1, BP Jonsson wrote: > > Den 2017-06-06 kl. 15:26, skrev Lyndon Drake:=20 > > Thanks for this. I'd come to the conclusion that writing a latex file= =20 > and=20 > > including the fragments that pandoc generates might be the way forward,= =20 > but=20 > > I'm also curious to know what I've been doing wrong.=20 > > You don't need to write the whole preamble by hand, just the part=20 > where you load and configure polyglossia and define the fonts=20 > needed for polyglossia.=20 > put them in a file called for example `poly.ltx` and then run=20 > Pandoc with=20 > > ````=20 > pandoc -H poly.ltx --latex-engine=3Dxelatex=20 > ````=20 > > I *think* this will also make the bidi bug go away. The=20 > polyglossia package loads the bidi package if needed, but bidi=20 > wants to be loaded after a lot of other packages which it performs=20 > keyhole surgery on, including longtable and even hyperref. However=20 > Pandoc's latex template, loads polyglossia quite early,=20 > alternatively to loading babel. There may be no other way to fix=20 > that than to use a custom template where polyglossia is loaded=20 > quite late, perhaps even after the header-includes, lest the=20 > latter also load some package which bidi wants to be loaded before=20 > itself. I have made such a template=20 > ()=20 > If it solves the problem please let me know and I'll make a pull=20 > request for the change.=20 > > My custom template also includes my fontspec hack which lets you=20 > declare font families in your metadata like this:=20 > > ````=20 > font-families:=20 > - name: '\font'=20 > font: =20 > options:=20 > - =3D''=20 > - name: '\greekfont'=20 > font: GFS Neohellenic=20 > options:=20 > - Language=3DGreek=20 > - Script=3DGreek=20 > - Scale=3DMatchLowercase=20 > - Ligatures=3DTeX=20 > - name: '\sanskritfont'=20 > font: Sahadeva=20 > options:=20 > - Language=3DSanskrit=20 > - Script=3DDevanagari=20 > - name: '\myfancyfont'=20 > font: My Fancy=20 > ````=20 > > > >=20 > > No rush of course, but I'm keen to have a look at your filter and see= =20 > what=20 > > it does,=20 > > It is now documented and uploaded:=20 > > =20 > > (Scroll down for the rendered documentation. The first code block=20 > should suffice to understand how it works.)=20 > > It takes some initial configuration but that should be reusable by=20 > including a separate YAML file on the command line with the actual=20 > document.=20 > > > > > 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 the= m=20 > in=20 > > a latex environment, which seems like a good idea (I've done this kind= =20 > of=20 > > thing in InDesign grep styles and it works well for most normal bits of= =20 > > text).=20 > >=20 > > I found the lang/otherlangs documentation, but couldn't figure out from= =20 > the=20 > > manual (might just be overlooking the correct bit) how to set a div or = a=20 > > span for another language.=20 > >=20 > > Part of the problem is that if I set lang and otherlangs as follows:=20 > >=20 > > lang: en-GB=20 > > otherlangs: [he, sy]=20 > > =20 > > I get this:=20 > >=20 > > ! Package bidi Error: Oops! you have loaded package longtable after bid= i=20 > > packag=20 > >=20 > > e. Please load package longtable before bidi package, and then try to= =20 > run=20 > > xelat=20 > >=20 > > ex on your document again.=20 > >=20 > >=20 > > See the bidi package documentation for explanation.=20 > >=20 > > Type H for immediate help.=20 > >=20 > > ...=20 > >=20 > > =20 > >=20 > > l.72 \begin{document}=20 > >=20 > >=20 > > pandoc: Error producing PDF=20 > >=20 > >=20 > > 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=20 > (maybe=20 > > pandoc-csv2table is doing something to the produced latex?). But it kin= d=20 > of=20 > > put a stop to me experimenting with the spans and divs.=20 > >=20 > > Best,=20 > > Lyndon=20 > >=20 > > On Tuesday, June 6, 2017 at 1:08:48 PM UTC+1, BPJ wrote:=20 > >>=20 > >> You need to use the lang and otherlang variables as described in the= =20 > >> manual http://pandoc.org/MANUAL if I recall correctly.=20 > >>=20 > >> Alternatively/additionally write a latex file containing a preamble=20 > >> fragment where you load polyglossia and any languages and fonts you=20 > need=20 > >> with the options you need in the usual polyglossia/fontspec way and=20 > include=20 > >> it with the -H option. You also need to mark spans/divs containing=20 > extra=20 > >> languages with lang and dir attributes as appropriate. Use your=20 > browser's=20 > >> page search function to find these terms in the manual.=20 > >>=20 > >> 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=20 > holiday=20 > >> in Sweden. I'll get back to it tomorrow. Basically you can use spans= =20 > 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.=20 > >>=20 > >> I can comfort you that you are much better off than I was when I=20 > started=20 > >> doing multilingual work with Pandoc. We had no filters, no native span= s=20 > or=20 > >> divs and no built-in multilingual/polyglossia support back then.=20 > Everything=20 > >> had to be done in -H files and with raw latex in the markdown, which= =20 > was a=20 > >> pain because I needed to make things available in HTML as well.=20 > >>=20 > >> I'll also update my latex template on github which contains some stuff= =20 > for=20 > >> fontspec font loading.=20 > >>=20 > >> I hope this helps. I'm afraid I won't be able to check my mail for the= =20 > >> rest of the day.=20 > >>=20 > >>=20 > >> tis 6 juni 2017 kl. 09:02 skrev Lyndon Drake >> >:=20 > >>=20 > >>> Sorry, I probably wasn't clear: I followed the instruction from Pando= c=20 > >>> and switched to xelatex. Now I'm stuck trying to configure the=20 > language=20 > >>> options.=20 > >>>=20 > >>>=20 > >>> On Tuesday, June 6, 2017 at 7:41:32 AM UTC+1, BP wrote:=20 > >>>=20 > >>>> You need the --latex-engine=3Dxelatex option.=20 > >>>>=20 > >>>> tis 6 juni 2017 kl. 07:53 skrev Lyndon Drake :=20 > >>>>=20 > >>> Hi all,=20 > >>>>>=20 > >>>>> Many apologies as I'm sure this is all obvious once one knows, but= =20 > I'm=20 > >>>>> a bit stuck. I've got some Pandoc Markdown files which I'm trying t= o=20 > >>>>> convert to PDF using Pandoc. They include various non-ascii=20 > characters, all=20 > >>>>> in unicode. If I run:=20 > >>>>>=20 > >>>>> /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.pd= f=20 > >>>>> text/metadata.yaml text/1-Introduction.md=20 > >>>>>=20 > >>>>> I get the following:=20 > >>>>>=20 > >>>>> ! Package inputenc Error: Unicode char =E1=B9=A3 (U+1E63)=20 > >>>>>=20 > >>>>> (inputenc) not set up for use with LaTeX.=20 > >>>>>=20 > >>>>>=20 > >>>>> See the inputenc package documentation for explanation.=20 > >>>>>=20 > >>>>> Type H for immediate help.=20 > >>>>>=20 > >>>>> ...=20 > >>>>>=20 > >>>>> =20 > >>>>>=20 > >>>>> l.125 Vandenhoeck \& Ruprecht, 1990), 39--62.}=20 > >>>>>=20 > >>>>>=20 > >>>>> Try running pandoc with --latex-engine=3Dxelatex.=20 > >>>>>=20 > >>>>> pandoc: Error producing PDF=20 > >>>>>=20 > >>>>>=20 > >>>>> 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=20 > want to=20 > >>>>> use both, I'm a bit stuck. First thing is that it looks like the=20 > default=20 > >>>>> template tries to use babel rather than polyglossia if xetex is the= =20 > engine.=20 > >>>>> Is there a reason for this? (I want to use the biblatex-sbl style= =20 > for my=20 > >>>>> bibliography, and they recommend polyglossia.)=20 > >>>>>=20 > >>>>> I want to use English (UK) as my main language, with Hebrew and=20 > Syriac=20 > >>>>> as other languages (I've also got some ancient Greek, but the main= =20 > font=20 > >>>>> I've chosen works fine and the output looks good for that without= =20 > using a=20 > >>>>> separate language environment).=20 > >>>>>=20 > >>>>> As a starting point, what language options do I set in my YAML=20 > metadata=20 > >>>>> to enable those other two language environments, and how do I=20 > specify the=20 > >>>>> fonts for them?=20 > >>>>>=20 > >>>>> Here's my YAML metadata file so far:=20 > >>>>>=20 > >>>>> ---=20 > >>>>> author: Lyndon Drake=20 > >>>>> documentclass: memoir=20 > >>>>> toc: true=20 > >>>>> papersize: a4=20 > >>>>> fontsize: 12pt=20 > >>>>> top-level-division: chapter=20 > >>>>> number-sections: true=20 > >>>>> mainfont: Skolar PE Light=20 > >>>>> mainfontoptions: Numbers=3DOldStyle=20 > >>>>> bibliography: /Users/lyndon/Documents/Media/Bibliography/0lib.bi= b=20 > >>>>> csl:=20 > >>>>>=20 > /Users/lyndon/Documents/Media/Bibliography/society-of-biblical-literature= -fullnote-bibliography.csl=20 > > >>>>> notes-after-punctuation: true=20 > >>>>> ---=20 > >>>>>=20 > >>>>> Many thanks in advance for any help on this,=20 > >>>>> Lyndon=20 > >>>>>=20 > >>>>> --=20 > >>>>> You received this message because you are subscribed to the Google= =20 > >>>>> Groups "pandoc-discuss" group.=20 > >>>>>=20 > >>>> To unsubscribe from this group and stop receiving emails from it,=20 > send=20 > >>>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 > >>>>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org= =20 > >>>>=20 > >>>>=20 > >>>>> To view this discussion on the web visit=20 > >>>>>=20 > https://groups.google.com/d/msgid/pandoc-discuss/89122680-f883-4853-a97f-= a81861395b78%40googlegroups.com=20 > >>>>> < > https://groups.google.com/d/msgid/pandoc-discuss/89122680-f883-4853-a97f-= a81861395b78%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>=20 > > >>>>> .=20 > >>>>> For more options, visit https://groups.google.com/d/optout.=20 > >>>>>=20 > >>>> --=20 > >>> You received this message because you are subscribed to the Google=20 > Groups=20 > >>> "pandoc-discuss" group.=20 > >>> To unsubscribe from this group and stop receiving emails from it, sen= d=20 > an=20 > >>> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org .=20 > >>> To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org=20 > >>> .=20 > >>> To view this discussion on the web visit=20 > >>>=20 > https://groups.google.com/d/msgid/pandoc-discuss/99f9330e-3a82-4a0d-8bb4-= 4ec2513723fe%40googlegroups.com=20 > >>> < > https://groups.google.com/d/msgid/pandoc-discuss/99f9330e-3a82-4a0d-8bb4-= 4ec2513723fe%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>=20 > > >>> .=20 > >>> For more options, visit https://groups.google.com/d/optout.=20 > >>>=20 > >>=20 > >=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 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/5cd094b1-ccba-4c6c-a83b-d0fa2ebf39ba%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_343_984563496.1496916829583 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That's very helpful, thank you!

I h= aven't actually rewritten the LaTeX template preamble, just moved thing= s around a bit, retaining all the Pandoc variables but making the package l= oad order robust. I think I'll probably slightly update the template, f= or two more things:

1. it's nice to have access to t= wo places for header insertions, one near the start and the other near the = end of the header material once all the packages have been loaded;

2. the memoir class works best for books when there are \f= rontmatter, \mainmatter, and \endmatter calls in the document, so I will ad= d options and a test to allow those.

I like the sp= an syntax you've got, though in the medium term I want to work on an au= tomatic filter for setting the language based on Unicode ranges and just us= e spans to cover unusual cases (although in fact, there is almost no case t= hat cannot be covered by the use of Unicode direction-breaking marks or spa= ces, which have the advantage of working without any markup in HTML in mode= rn browsers with font fallback mechanisms).

On Wednesday, June 7, 20= 17 at 5:23:54 PM UTC+1, BP Jonsson wrote:
Den 2017-06-06 kl. 15:26, skrev Lyndon Drake:
> Thanks for this. I'd come to the conclusion that writing a lat= ex file and
> including the fragments that pandoc generates might be the way for= ward, but
> I'm also curious to know what I've been doing wrong.

You don't need to write the whole preamble by hand, just the part= =20
where you load and configure polyglossia and define the fonts=20
needed for polyglossia.
put them in a file called for example `poly.ltx` and then run=20
Pandoc with

````
pandoc -H poly.ltx --latex-engine=3Dxelatex
````

I *think* this will also make the bidi bug go away. The=20
polyglossia package loads the bidi package if needed, but bidi=20
wants to be loaded after a lot of other packages which it performs=20
keyhole surgery on, including longtable and even hyperref. However=20
Pandoc's latex template, loads polyglossia quite early,=20
alternatively to loading babel. There may be no other way to fix=20
that than to use a custom template where polyglossia is loaded=20
quite late, perhaps even after the header-includes, lest the=20
latter also load some package which bidi wants to be loaded before=20
itself. I have made such a template=20
(<https://gist.github.com/bpj/5cebc975= 685134145cd74ca8670b1ccc>)=20
If it solves the problem please let me know and I'll make a pull=20
request for the change.

My custom template also includes my fontspec hack which lets you=20
declare font families in your metadata like this:

````
font-families:
=C2=A0 =C2=A0- name: '\<language>font'
=C2=A0 =C2=A0 =C2=A0font: =C2=A0 =C2=A0<Font Name>
=C2=A0 =C2=A0 =C2=A0options:
=C2=A0 =C2=A0 =C2=A0 =C2=A0- <key>=3D'<value>'
=C2=A0 =C2=A0- name: '\greekfont'
=C2=A0 =C2=A0 =C2=A0font: =C2=A0 =C2=A0GFS Neohellenic
=C2=A0 =C2=A0 =C2=A0options:
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Language=3DGreek
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Script=3DGreek
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Scale=3DMatchLowercase
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Ligatures=3DTeX
=C2=A0 =C2=A0- name: '\sanskritfont'
=C2=A0 =C2=A0 =C2=A0font: =C2=A0 =C2=A0Sahadeva
=C2=A0 =C2=A0 =C2=A0options:
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Language=3DSanskrit
=C2=A0 =C2=A0 =C2=A0 =C2=A0- Script=3DDevanagari
=C2=A0 =C2=A0- name: '\myfancyfont'
=C2=A0 =C2=A0 =C2=A0font: My Fancy
````


>=20
> No rush of course, but I'm keen to have a look at your filter = and see what
> it does,=20

It is now documented and uploaded:

<https://gist.github.com/bpj/02de1ed87= ff8f8d0c31a43b9dcac1c80>

(Scroll down for the rendered documentation. The first code block=20
should suffice to understand how it works.)

It takes some initial configuration but that should be reusable by=20
including a separate YAML file on the command line with the actual=20
document.




even without docs. I've also found another filter on the list back
> in 2014 from Jesse Rosenthal that looks at Unicode ranges and wrap= s them in
> a latex environment, which seems like a good idea (I've done t= his kind of
> thing in InDesign grep styles and it works well for most normal bi= ts of
> text).
>=20
> I found the lang/otherlangs documentation, but couldn't figure= out from the
> manual (might just be overlooking the correct bit) how to set a di= v or a
> span for another language.
>=20
> Part of the problem is that if I set lang and otherlangs as follow= s:
>=20
> =C2=A0 =C2=A0lang: en-GB
> =C2=A0 =C2=A0otherlangs: [he, sy]
> =C2=A0 =C2=A0
> I get this:
>=20
> ! Package bidi Error: Oops! you have loaded package longtable afte= r bidi
> packag
>=20
> e. Please load package longtable before bidi package, and then try= to run
> xelat
>=20
> ex on your document again.
>=20
>=20
> See the bidi package documentation for explanation.
>=20
> Type =C2=A0H <return> =C2=A0for immediate help.
>=20
> =C2=A0 ...
>=20
> =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
>=20
> l.72 \begin{document}
>=20
>=20
> pandoc: Error producing PDF
>=20
>=20
> which I guess means that some kind of strange interaction in the l= atex
> template is producing an undesirable latex file to feed to xelatex= (maybe
> pandoc-csv2table is doing something to the produced latex?). But i= t kind of
> put a stop to me experimenting with the spans and divs.
>=20
> Best,
> Lyndon
>=20
> 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
>> manual http://pandoc.org/MANUAL if I recall correctly.
>>
>> Alternatively/additionally write a latex file containing a pre= amble
>> fragment where you load polyglossia and any languages and font= s you need
>> with the options you need in the usual polyglossia/fontspec wa= y and include
>> it with the -H option. You also need to mark spans/divs contai= ning extra
>> languages with lang and dir attributes as appropriate. Use you= r browser's
>> page search function to find these terms in the manual.
>>
>> I saw your other question about font/language switching yester= day and
>> started to write some documentation for the filter I use to ma= ke those
>> things 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 with a
>> single short class like .g for greek and the filter will injec= t =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 started
>> doing multilingual work with Pandoc. We had no filters, no nat= ive spans or
>> divs and no built-in multilingual/polyglossia support back the= n. Everything
>> had to be done in -H files and with raw latex in the markdown,= which was a
>> pain because I needed to make things available in HTML as well= .
>>
>> I'll also update my latex template on github which contain= s some stuff for
>> fontspec font loading.
>>
>> I hope this helps. I'm afraid I won't be able to check= my mail for the
>> rest of the day.
>>
>>
>> tis 6 juni 2017 kl. 09:02 skrev Lyndon Drake <lyn...@aro= tau.com
>> <javascript:>>:
>>
>>> Sorry, I probably wasn't clear: I followed the instruc= tion from Pandoc
>>> and switched to xelatex. Now I'm stuck trying to confi= gure the language
>>> options.
>>>
>>>
>>> On Tuesday, June 6, 2017 at 7:41:32 AM UTC+1, BP wrote:
>>>
>>>> You need =C2=A0the --latex-engine=3Dxelatex option.
>>>>
>>>> tis 6 juni 2017 kl. 07:53 skrev Lyndon Drake <ly= n...-S8RYeTzMgQ3QT0dZR+AlfA@public.gmane.org>:
>>>>
>>> Hi all,
>>>>>
>>>>> Many apologies as I'm sure this is all obvious= once one knows, but I'm
>>>>> a bit stuck. I've got some Pandoc Markdown fil= es which I'm trying to
>>>>> convert to PDF using Pandoc. They include various = non-ascii characters, all
>>>>> in unicode. If I run:
>>>>>
>>>>> /usr/local/bin/pandoc -f
>>>>> markdown+pipe_tables+grid_tables+yaml_metadat= a_block --filter
>>>>> pandoc-citeproc --filter pandoc-csv2table -s -o fo= rmatted/Draft3.pdf
>>>>> text/metadata.yaml text/1-Introduction.md
>>>>>
>>>>> I get the following:
>>>>>
>>>>> ! Package inputenc Error: Unicode char =E1=B9=A3 (= U+1E63)
>>>>>
>>>>> (inputenc) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0not set up for use with LaTeX.
>>>>>
>>>>>
>>>>> See the inputenc package documentation for explana= tion.
>>>>>
>>>>> Type =C2=A0H <return> =C2=A0for immediate he= lp.
>>>>>
>>>>> =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), 3= 9--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
>>>>> suggestion from pandoc. As long as I don't try= to use any babel or
>>>>> polyglossia environments, or biblatex, this works = fine. But as I want to
>>>>> use both, I'm a bit stuck. First thing is that= it looks like the default
>>>>> template tries to use babel rather than polyglossi= a if xetex is the engine.
>>>>> Is there a reason for this? (I want to use the bib= latex-sbl style for my
>>>>> bibliography, and they recommend polyglossia.)
>>>>>
>>>>> I want to use English (UK) as my main language, wi= th Hebrew and Syriac
>>>>> as other languages (I've also got some ancient= Greek, but the main font
>>>>> I've chosen works fine and the output looks go= od for that without using a
>>>>> separate language environment).
>>>>>
>>>>> As a starting point, what language options do I se= t in my YAML metadata
>>>>> to enable those other two language environments, a= nd how do I specify the
>>>>> fonts for them?
>>>>>
>>>>> Here's my YAML metadata file so far:
>>>>>
>>>>> ---
>>>>> =C2=A0 =C2=A0author: Lyndon Drake
>>>>> =C2=A0 =C2=A0documentclass: memoir
>>>>> =C2=A0 =C2=A0toc: true
>>>>> =C2=A0 =C2=A0papersize: a4
>>>>> =C2=A0 =C2=A0fontsize: 12pt
>>>>> =C2=A0 =C2=A0top-level-division: chapter
>>>>> =C2=A0 =C2=A0number-sections: true
>>>>> =C2=A0 =C2=A0mainfont: Skolar PE Light
>>>>> =C2=A0 =C2=A0mainfontoptions: Numbers=3DOldStyle
>>>>> =C2=A0 =C2=A0bibliography: /Users/lyndon/Documents= /Media/Bibliography/0lib.bib
>>>>> =C2=A0 =C2=A0csl:
>>>>> /Users/lyndon/Documents/Media/Bibliography/so= ciety-of-biblical-literature-fullnote-bibliography.csl
>>>>> =C2=A0 =C2=A0notes-after-punctuation: true
>>>>> ---
>>>>>
>>>>> Many thanks in advance for any help on this,
>>>>> Lyndon
>>>>>
>>>>> --=20
>>>>> You received this message because you are subscrib= ed to the Google
>>>>> Groups "pandoc-discuss" group.
>>>>>
>>>> To unsubscribe from this group and stop receiving emai= ls from it, send
>>>>> an email 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= /pandoc-discuss/89122680-f883-4853-a97f-a81861395b78%40googlegrou= ps.com
>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/8= 9122680-f883-4853-a97f-a81861395b78%40googlegroups.com?utm_medium= =3Demail&utm_source=3Dfooter>
>>>>> .
>>>>> For more options, visit = https://groups.google.com/d/optout.
>>>>>
>>>> --=20
>>> You received this message because you are subscribed to th= e Google Groups
>>> "pandoc-discuss" group.
>>> To unsubscribe from this group and stop receiving emails f= rom it, send an
>>> email to pandoc-discus...@googlegroups.com <= ;javascript:>.
>>> To post to this group, send email to pandoc-...@googleg= roups.com
>>> <javascript:>.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pandoc-di= scuss/99f9330e-3a82-4a0d-8bb4-4ec2513723fe%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pandoc-discuss/99f9330e-= 3a82-4a0d-8bb4-4ec2513723fe%40googlegroups.com?utm_medium=3D= email&utm_source=3Dfooter>
>>> .
>>> For more options, visit https://g= roups.google.com/d/optout.
>>>
>>
>=20

--
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/5cd094b1-ccba-4c6c-a83b-d0fa2ebf39ba%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_343_984563496.1496916829583-- ------=_Part_342_1139266.1496916829582--