From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17787 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 13:51:59 -0700 (PDT) Message-ID: <2a8d8b0d-2740-4dfb-8718-f06432d6425f@googlegroups.com> References: <89122680-f883-4853-a97f-a81861395b78@googlegroups.com> <99f9330e-3a82-4a0d-8bb4-4ec2513723fe@googlegroups.com> <87d1ah84m4.fsf@fastmail.fm> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_802_438770621.1496782319210" X-Trace: blaine.gmane.org 1496782321 7718 195.159.176.226 (6 Jun 2017 20:52:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Jun 2017 20:52:01 +0000 (UTC) Cc: bpj-J3H7GcXPSITLoDKTGw+V6w@public.gmane.org To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJKJO4E2ICRB35L3TEQKGQEJD26K7A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jun 06 22:51:56 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot0-f186.google.com ([74.125.82.186]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dILSF-0001iF-8z for gtp-pandoc-discuss@m.gmane.org; Tue, 06 Jun 2017 22:51:55 +0200 Original-Received: by mail-ot0-f186.google.com with SMTP id i31sf3283310ota.1 for ; Tue, 06 Jun 2017 13:52:01 -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=jZ5AvfbXgZfCoaWJi2ouQ285L4HeUNYykxl1xKN9qbs=; b=iPvaxI1rRoFkAyy6dL0p4WGJzE9FkxGdxdtTSGUNFJ5ZH6gOCp58+0RiaLYv3GrD3R dj8XQv/sdxMCg9BRORNoTkSMrJv8l79ZSrLmtVHAj4Wl+UYcnU9ls9hr720bY870KkPI Ta8Dmox5SYcUG0T1wvR3OgdALIUOT+7upiX9IbpP4fs50ms26PyeXr/CSdPX2z1cFp5m XsycKlRMNp06IY3MrEUyCtpO2UySZbXqbZXCdsPsk+HwIzjvb65GP3+eGQLKFDlGV93B 2c+zlht1+ySdTJkdiXqFxc0ojKWmsuXQFvwDHqX9+dpKFRsSS45wHGIie2sILMTXHhkM zi9A== 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=jZ5AvfbXgZfCoaWJi2ouQ285L4HeUNYykxl1xKN9qbs=; b=H//ydeODoaGa+bWCgXRn4W5RObt2uYlmjTVjno7uO/815ghQYNuhNqY7LHRBrDnPT0 BUPYfP5RKuOLZ45gsmLVtxYsY95+aOezHxpkscmP7P8og2LEx4m0ieUK7Djy1S1VGAwn 42PdNFkPIyq3u+1vu4poXcI4Zh2VPcGJjtaBN7vBI1qTbp5vNzGIrKSsN+u8Sy29ynys 1EiaIH8yjENnXf48l0eTuKxSuHWv/DTZnWijhwF1sxwG0m7tFAsoKE0i82S4jlP6pXuD scLzf9bLMvFzIELcW7S6vsEoeBftc+ayUYnQjeG0ZWrzlb0ApJ5vhJ4pCgBbB4aY5IgJ rdAw== 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=jZ5AvfbXgZfCoaWJi2ouQ285L4HeUNYykxl1xKN9qbs=; b=h37WBcTzKgj8IICHll8Jv72MA80t7VfFxCjTqjMRDDp0KoBa5m2muwwLRgSOM2VMws W3rza4tigimkBMdQwS93xdCB0oHaAP42yoS8ewA6Os9cKfvE1vQa3uVWbUHRMMd4xHYn s07S8vfJ9P8SWa6QfEiLgMfzYWXKGrErzu086kDx8lf6P91FHtnGarG81+3S1CQ80fsp UqzFq9rqCc0Y8ZTTw/IcI16LiQJQbfFtgqFWWYi67ZppNRP/vcO3JvVzxLboGqJQ6fpX +LJPreO1LQN76Aqwzl/MxHEs3W4YQ77XM7i1GaHaSnF8anVyBCRITeFAMkqQL/IgMo1B blbA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AODbwcAW+BUwHoBRANa/LnnYtZSZksoMbI51cRNVQuFTBGm6IKThgTNY Qz/LYSRjajudEA== X-Received: by 10.157.52.232 with SMTP id t37mr646481otd.15.1496782320291; Tue, 06 Jun 2017 13:52:00 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.5.5 with SMTP id 5ls3523904otw.11.gmail; Tue, 06 Jun 2017 13:51:59 -0700 (PDT) X-Received: by 10.157.49.2 with SMTP id e2mr409655otc.19.1496782319731; Tue, 06 Jun 2017 13:51:59 -0700 (PDT) In-Reply-To: <87d1ah84m4.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org> 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:17787 Archived-At: ------=_Part_802_438770621.1496782319210 Content-Type: multipart/alternative; boundary="----=_Part_803_583445901.1496782319210" ------=_Part_803_583445901.1496782319210 Content-Type: text/plain; charset="UTF-8" I've got a fair way with this. Thanks to all for the help so far. 1. By reading through the template, I figured out which variables to define to control the LaTeX output. I'm seriously impressed with Pandoc's setup - I remember the awful pain of doing a LaTeX document from scratch and this gets things started so well. Thank you John & everyone else! 2. As suggested by Joost, I shifted the package load order around, retaining all the conditionals and variables in the template. I've now got something which is only different by some reordering from the default template, but which avoids the longtable/bidi conflict. Thanks Joost! I've also been playing around with a couple of filters, based on code from Jesse Rosenthal on this list a few years back. It sort of works, but not well enough to rely on. For the moment, I'm just going to tag every word and block with div/span. It did also occur to me that the proper place to do this stuff is actually in LaTeX, not Pandoc. E.g. I'm going to use biblatex, and I'd want the same rules applied to the output from biblatex. There's a package: https://github.com/Pomax/ucharclasses which does some of this. One way to do it would be to implement the Unicode bidi algorithm http://unicode.org/reports/tr9/ (+ some sensible font switching, which is actually easier than the bidi algorithm) as a LaTeX package, but that's a bit much for my current document. I might have a look at ways to do this properly in July & August though, as I'd like to have it available before I start my thesis. Anyway for the moment I'm pleased that I could get this far: https://www.dropbox.com/s/aeyvkjrox5dwtpz/Screenshot%202017-06-06%2021.37.41.png?dl=0 without having to type anything other than plain Pandoc Markdown into some text & csv files, and all the formatting has been done by Pandoc and some config. The thing that made me want to use Pandoc was the memory of my previous thesis (in computer science) where the markup made the document so cluttered I found it almost impossible to actually read the text in the editor. This is promising enough that I'm going to persevere to get a setup that will work for the upcoming thesis. Best, Lyndon PS: in case it's of use to others, the relevant bits of YAML: header-includes: - \newfontfamily\hebrewfont{Taamey David CLM} - \newfontfamily\syriacfont{Serto Jerusalem} lang: en-GB otherlangs: [he, syr] On Tuesday, June 6, 2017 at 5:26:21 PM UTC+1, Joost wrote: > > > On Tue, Jun 06 2017, Lyndon Drake wrote: > > Part of the problem is that if I set lang and otherlangs as > > follows: > > > > lang: en-GB > > otherlangs: [he, sy] > > > > I get this: > > > > ! Package bidi Error: Oops! you have loaded package longtable > > after bidi > > packag > > > > e. Please load package longtable before bidi package, and then > > try to run > > xelatex on your document again. > > > > > > 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?). > > No, the template is structured in such a way that polyglossia is > loaded before longtable, but polyglossia loads bidi in order to > deal with RTL languages such as Syriac. > > I think your best bet would be to modify the default template and > load the other languages somewhere toward the end of the preamble, > after longtable and any other packages are loaded. But you'll need > to know some LaTeX and understand how Pandoc's template language > works in order to do that. > > In actual fact, though, this may be something John needs to think > about, because the default LaTeX template obviously has a problem > here. > > HTH > > -- > Joost Kremers > Life has its moments > -- 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-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/2a8d8b0d-2740-4dfb-8718-f06432d6425f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_803_583445901.1496782319210 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I've got a fair way with this. Thanks to all for the h= elp so far.

1. By reading through the template, I figure= d out which variables to define to control the LaTeX output. I'm seriou= sly impressed with Pandoc's setup - I remember the awful pain of doing = a LaTeX document from scratch and this gets things started so well. Thank y= ou John & everyone else!

2. As suggested by Jo= ost, I shifted the package load order around, retaining all the conditional= s and variables in the template. I've now got something which is only d= ifferent by some reordering from the default template, but which avoids the= longtable/bidi conflict. Thanks Joost!

I've a= lso been playing around with a couple of filters, based on code from Jesse = Rosenthal on this list a few years back. It sort of works, but not well eno= ugh to rely on. For the moment, I'm just going to tag every word and bl= ock with div/span.

It did also occur to me that th= e proper place to do this stuff is actually in LaTeX, not Pandoc. E.g. I= 9;m going to use biblatex, and I'd want the same rules applied to the o= utput from biblatex. There's a package:

https:= //github.com/Pomax/ucharclasses

which does some of= this. One way to do it would be to implement the Unicode bidi algorithm ht= tp://unicode.org/reports/tr9/=C2=A0(+ some sensible font switching, which i= s actually easier than the bidi algorithm) as a LaTeX package, but that'= ;s a bit much for my current document. I might have a look at ways to do th= is properly in July & August though, as I'd like to have it availab= le before I start my thesis.

Anyway for the moment= I'm pleased that I could get this far:

https:= //www.dropbox.com/s/aeyvkjrox5dwtpz/Screenshot%202017-06-06%2021.37.41.png?= dl=3D0

without having to type anything other than = plain Pandoc Markdown into some text & csv files, and all the formattin= g has been done by Pandoc and some config. The thing that made me want to u= se Pandoc was the memory of my previous thesis (in computer science) where = the markup made the document so cluttered I found it almost impossible to a= ctually read the text in the editor. This is promising enough that I'm = going to persevere to get a setup that will work for the upcoming thesis.

Best,
Lyndon

PS:= in case it's of use to others, the relevant bits of YAML:
=C2=A0 header-includes:
=C2=A0 =C2=A0 - \newfon= tfamily\hebrewfont{Taamey David CLM}
=C2=A0 =C2=A0 - \newfont= family\syriacfont{Serto Jerusalem}
=C2=A0 lang: en-GB
=C2=A0 otherlangs: [he, syr]


On Tuesday, June 6,= 2017 at 5:26:21 PM UTC+1, Joost wrote:

On Tue, Jun 06 2017, Lyndon Drake wrote:
> Part of the problem is that if I set lang and otherlangs as=20
> follows:
>
> =C2=A0 lang: en-GB
> =C2=A0 otherlangs: [he, sy]
> =C2=A0=20
> I get this:
>
> ! Package bidi Error: Oops! you have loaded package longtable=20
> after bidi=20
> packag
>
> e. Please load package longtable before bidi package, and then=20
> try to run=20
> xelatex on your document again.
>
>
> which I guess means that some kind of strange interaction in the= =20
> latex=20
> template is producing an undesirable latex file to feed to=20
> xelatex (maybe=20
> pandoc-csv2table is doing something to the produced latex?).

No, the template is structured in such a way that polyglossia is=20
loaded before longtable, but polyglossia loads bidi in order to=20
deal with RTL languages such as Syriac.

I think your best bet would be to modify the default template and=20
load the other languages somewhere toward the end of the preamble,=20
after longtable and any other packages are loaded. But you'll need= =20
to know some LaTeX and understand how Pandoc's template language=20
works in order to do that.

In actual fact, though, this may be something John needs to think=20
about, because the default LaTeX template obviously has a problem=20
here.

HTH

--=20
Joost Kremers
Life has its moments

--
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/2a8d8b0d-2740-4dfb-8718-f06432d6425f%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_803_583445901.1496782319210-- ------=_Part_802_438770621.1496782319210--