From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17793 Path: news.gmane.org!.POSTED!not-for-mail From: BP Jonsson Newsgroups: gmane.text.pandoc Subject: Re: Going round in circles with latex output Date: Wed, 7 Jun 2017 18:23:44 +0200 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: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1496852632 12098 195.159.176.226 (7 Jun 2017 16:23:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Jun 2017 16:23:52 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 To: Lyndon Drake , pandoc-discuss Original-X-From: pandoc-discuss+bncBDIY76M674FRBFWR4DEQKGQESFLYTJQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Jun 07 18:23:47 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-io0-f187.google.com ([209.85.223.187]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dIdkI-0002sc-As for gtp-pandoc-discuss@m.gmane.org; Wed, 07 Jun 2017 18:23:46 +0200 Original-Received: by mail-io0-f187.google.com with SMTP id f79sf1347529ioi.1 for ; Wed, 07 Jun 2017 09:23:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1496852631; cv=pass; d=google.com; s=arc-20160816; b=Jw4PSyzMGARr4vk1tLwdwQABX2nYdijlUPGfJsitPyevpFRW3WChAZWk7hwTrDguoF bHsGwt335YsTI0TP8wGpDs/cymQ39tB6fCgLY7WHSdHPvqlwG6aIRYuYWbWKgOA03eXM zGr+MWGHpdK6nHWVxns5QthaVGDN/X+KlPniVXeK5fwcvGN0NoUx/JgC4Gw8+tvwlnCP 675kTBGY5wvsIaKbVoly00kKI3lcNKie2BKQVoEM4B6CfiFpTjl6yZ5MpL4/QMWP5yhx rlyT78rDjOjJEGRecZxSlOm+xUkJ1Q5Mojr/HoKLnfTN1b/7t8SyNjJ2oOMpGVrNZQn0 bJPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results :arc-message-signature:sender:dkim-signature :arc-authentication-results; bh=ObbvqDu1wxq5RkYt5J2vTXhS8UDUeD0LsyE0RlG7hUI=; b=JSxTON2VD23bos+I5nQGjzELVkmhXUKprqL5w4IZc/L/cCFNXPE9rFzAD8amtNAvjT JyorUD2bH2zV6+n7vjaPElVGJpSRiZGGlBCaGpKGHlIE7jHRhuCCqNQuOUtW18itrT2m jWfEmVX/Yf1r3AeXHetTKjQZL+gmnmIl46On2eIdK7zAOSU89lRZf9znTA4GyxI3WfjO MpECEv7oKnzt+Mri73acL3hYIb6iBhX/KzADw3tESSGOlZH7BCcJMRt/rK0YeGMVPy3X 7VI60iVZwxDnIVPtzLN3qtOt/cEanY2uVx4U4k3BEEbsv ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org does not designate 138.128.164.243 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=ObbvqDu1wxq5RkYt5J2vTXhS8UDUeD0LsyE0RlG7hUI=; b=htD2rJzY+z3X5Y6f2vFm/wClYrQL0Le6bSJ2fCO5eWWZtOq3Exu2FlmF+wXZFtT6pS Yn2SOEk0axt4j5owUfIegKdREHagjG5gojp/ONJrbxgBVY2TzczZUJat3Up3uap72vwN +HcqmE5h8n+C9XjxpG9TeEYOV/iurwu7yY93TBi67haGrfKq4eBflaHGJB4SIXtmRuWE Ctdbp8UjhXz0WkV5ghjh+hA9428gkiagESgYhU/e2UuFWqEGGJz/BLPTThlQdygFKp+k YEoWNXv+7RuPiOvkBrGWNE1dRRnshi4ENpr1x/SnBcpWYqk4Z1EPXMZp/DYC9g0SUIN X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=ObbvqDu1wxq5RkYt5J2vTXhS8UDUeD0LsyE0RlG7hUI=; b=krHxEVQYvrhvBo6CERWhdo50vQDa0wGJaSBh7+8xt/UCS4gGBh+EFoUS0FXXIDFy/v Qvqw0gPMC4sAY7A/ykCUbSwaODArx/DkmEJRtapKie493QkezJF6DTMK30Rz1soJaUla NPfeNY+iaZN7xtWvF/SeOXrw6/kQ1VDhFEj6spxPeA3HxIZB2wN4g6HjT1Wv4O/2aPaN Vr5Qn2znBiA0XIqRvJ9wENkyU0ItKSW8ztI0JNgaOBiCTz48B0v5iVkDXixvJqqtfFaQ 8yFPFKXu6+6VhZHMUEzaOOhsHK3qHh+Hz87G Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AODbwcBVqBDeFMp5UUiQFx64dcUQ/9uWODbhLl7frTBflTsDgIYwKZxn eN3ub4aymtHtdg== X-Received: by 10.36.76.142 with SMTP id a136mr3850itb.3.1496852631588; Wed, 07 Jun 2017 09:23:51 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.9.146 with SMTP id 18ls1636675ioj.26.gmail; Wed, 07 Jun 2017 09:23:50 -0700 (PDT) X-Received: by 10.99.174.79 with SMTP id e15mr9955638pgp.43.1496852630030; Wed, 07 Jun 2017 09:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496852629; cv=none; d=google.com; s=arc-20160816; b=0eiwV7A5jtK8mdbwfi4sv8u8uE/s4tmWsRVa+ak5++oLNtOL66X8xNU+hiHXFmbHTa gWlJGCEeNed49n0R7HK+0/4K++wvZwfnxuRXQ69bHeh+xwj37zyXvZ0HPx1qUBAjl/Rk XkdO1QZ6oNdiElos6C2FMWmK2AmX8mem3uqiAks3jFoQAAQFdNIU1eNLg1rmW2LVVXtc D/B1Y4xCGnv6k2byWAc1CKesGWn+tVbBTP9GeC3sdhW88JScOaTbXQQNq/bkurPqJ+ju e4x/GERpe9o3HsWWI6IuaMa6WHfBOf0mODJeO1zjHJMe1rOhlKrLG0TuIZEsb9RdX2bA i2EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=yxfzw8Q3L0LsCV9/M96n9Y1KjpLOQSH0CIHrx7Emgd4=; b=zguSvnOZUvl/hCRo/u8MXU3/gJnFMp14dtbURWPn4fKX+lhelswmNM2Qmt+4jgGgBS euq6InmyyhJkdoX0MRfNdWWrJ/yMGj0ByJ9A/Z9qdhQSH+4tIqQrIvamECmRKjT2OCPt WmudKxfH7cTA+E+jYqUnnfbWye3kA7UM0+xP277N6CUltYFL6SzcWlZ1O9CV93hyEKZt OBBqBkV3ZOrRmARk8iZJkXEd6RHe07ZkqnT4wieB+pSYREFovn52LOx75moiSKjxrMGx 5Bz8nvWF+m+8VBXg6COi3TS3Y7nU6B7ODTSE0yvLHup9DlPe0lMmzV/2sYNus/T0RAqX Eg/Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=softfail (google.com: domain of transitioning bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org does not designate 138.128.164.243 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Original-Received: from manu6.manufrog.com (ns11.manufrog.com. [138.128.164.243]) by gmr-mx.google.com with ESMTPS id u207si72716vke.1.2017.06.07.09.23.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 09:23:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org does not designate 138.128.164.243 as permitted sender) client-ip=138.128.164.243; Original-Received: from [178.249.150.162] (port=37216 helo=[192.168.1.3]) by manu6.manufrog.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1dIdkL-002d1p-8A; Wed, 07 Jun 2017 18:23:49 +0200 In-Reply-To: Content-Language: sv-SE X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - manu6.manufrog.com X-AntiAbuse: Original Domain - googlegroups.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gmail.com X-Get-Message-Sender-Via: manu6.manufrog.com: authenticated_id: bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org X-Authenticated-Sender: manu6.manufrog.com: bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org X-Source: X-Source-Args: X-Source-Dir: X-Original-Sender: bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=softfail (google.com: domain of transitioning bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org does not designate 138.128.164.243 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com 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:17793 Archived-At: Den 2017-06-06 kl. 15:26, skrev Lyndon Drake: > Thanks for this. I'd come to the conclusion that writing a latex file and > including the fragments that pandoc generates might be the way forward, b= ut > 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 ()=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: - name: '\font' font: options: - =3D'' - name: '\greekfont' font: GFS Neohellenic options: - Language=3DGreek - Script=3DGreek - Scale=3DMatchLowercase - Ligatures=3DTeX - name: '\sanskritfont' font: Sahadeva options: - Language=3DSanskrit - Script=3DDevanagari - name: '\myfancyfont' font: My Fancy ```` >=20 > No rush of course, but I'm keen to have a look at your filter and see wha= t > it does,=20 It is now documented and uploaded: (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 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). >=20 > I found the lang/otherlangs documentation, but couldn't figure out from t= he > manual (might just be overlooking the correct bit) how to set a div or a > span for another language. >=20 > Part of the problem is that if I set lang and otherlangs as follows: >=20 > lang: en-GB > otherlangs: [he, sy] > =20 > I get this: >=20 > ! Package bidi Error: Oops! you have loaded package longtable after 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 H for immediate help. >=20 > ... >=20 > =20 >=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 latex > template is producing an undesirable 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. >=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 preamble >> fragment where you load polyglossia and any languages and fonts you need >> with the options you need in the usual polyglossia/fontspec way and incl= ude >> it with the -H option. You also need to mark spans/divs containing extra >> languages with lang and dir attributes as appropriate. Use your browser'= s >> page 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 >> things easier. Alas I couldn't finish and today there is a national holi= day >> in Sweden. I'll get back to it tomorrow. Basically you can use spans wit= h a >> single short class like .g for greek and the filter will inject latex >> 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 native spans = or >> divs and no built-in multilingual/polyglossia support back then. Everyth= ing >> 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 contains some stuff f= or >> 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 > >: >> >>> Sorry, I probably wasn't clear: I followed the instruction from Pandoc >>> and switched to xelatex. Now 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 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 >>>>> a bit stuck. I've got some Pandoc Markdown files which I'm trying to >>>>> convert to PDF using Pandoc. They include various non-ascii character= s, all >>>>> in unicode. If I run: >>>>> >>>>> /usr/local/bin/pandoc -f >>>>> markdown+pipe_tables+grid_tables+yaml_metadata_block --filter >>>>> pandoc-citeproc --filter pandoc-csv2table -s -o formatted/Draft3.pdf >>>>> 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 >>>>> >>>>> 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 >>>>> 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 defa= ult >>>>> template tries to use babel rather than polyglossia if xetex is the e= ngine. >>>>> Is there a reason for this? (I want to use the biblatex-sbl style for= my >>>>> bibliography, and they recommend polyglossia.) >>>>> >>>>> I want to use English (UK) as my main language, with Hebrew and Syria= c >>>>> as other languages (I've also got some ancient Greek, but the main fo= nt >>>>> I've chosen works fine and the output looks good for that without usi= ng a >>>>> separate language environment). >>>>> >>>>> As a starting point, what language options do I set in my YAML metada= ta >>>>> to enable those other two language environments, and how do I specify= the >>>>> 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: >>>>> /Users/lyndon/Documents/Media/Bibliography/society-of-biblical-litera= ture-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 >>>>> Groups "pandoc-discuss" group. >>>>> >>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> 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 >>>>> https://groups.google.com/d/msgid/pandoc-discuss/89122680-f883-4853-a= 97f-a81861395b78%40googlegroups.com >>>>> >>>>> . >>>>> For more options, visit https://groups.google.com/d/optout. >>>>> >>>> --=20 >>> You received this message because you are subscribed to the Google Grou= ps >>> "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 post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >>> . >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/99f9330e-3a82-4a0d-8bb= 4-4ec2513723fe%40googlegroups.com >>> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >=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/ad97e931-ac10-0204-d03e-c646e32e4ba1%40gmail.com. For more options, visit https://groups.google.com/d/optout.