From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/17818 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: Sun, 11 Jun 2017 06:28:14 -0700 (PDT) Message-ID: References: <89122680-f883-4853-a97f-a81861395b78@googlegroups.com> <99f9330e-3a82-4a0d-8bb4-4ec2513723fe@googlegroups.com> <87d1ah84m4.fsf@fastmail.fm> <2a8d8b0d-2740-4dfb-8718-f06432d6425f@googlegroups.com> <20170611084305.GD95963@Johns-MBP.home> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2479_5210825.1497187694283" X-Trace: blaine.gmane.org 1497187695 13786 195.159.176.226 (11 Jun 2017 13:28:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Jun 2017 13:28:15 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCJKJO4E2ICRB34K6XEQKGQEGELS2OI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jun 11 15:28:10 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yw0-f190.google.com ([209.85.161.190]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK2uY-0003I7-1X for gtp-pandoc-discuss@m.gmane.org; Sun, 11 Jun 2017 15:28:10 +0200 Original-Received: by mail-yw0-f190.google.com with SMTP id z189sf8291924ywz.1 for ; Sun, 11 Jun 2017 06:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to: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=aLTK5ja85LMluZL6ostx+KOuWbEgdbcs19oyC/KgcRo=; b=g+CLxnImE9Uhj9siXzCNY2fckMB1Zpvwk5GeM/YIKijBwX0IdzXrbOEIXaJwqI/c1p +LSsl8phObHl28T9cd8Qu4uW3WTf0+ScMFEU7t22B9jtvTTRCB+hE/SCMYMyb3eY2Fll U7sS2Yk0Tc531I8NjwhibWFT1Pzjosf6ql/DA+y5I7YQ8c3tbd9M5kwLHANQwp7R+Eiz NI75UdYvF6D6ZESEVHKwCFQEijEKVXTPd7lGUZL4AsmwXvFqgt2WZYf8VMjT70mZeKbs o1vTK5VsDtGyr7EYcuf6cXUROZYSumegrOHATKat0p9+ncZLOVultAJoPNIySNeCNHKE hRsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arotau-com.20150623.gappssmtp.com; s=20150623; h=date:from:to: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=aLTK5ja85LMluZL6ostx+KOuWbEgdbcs19oyC/KgcRo=; b=C8DNlnQUwwGnmh2g6tdJrbPHPgLhzD3Z6jVoxk/YYIt3K10XF2dq1qI6AjvtHMpPmB taJIq4INBAk/4Ln9SLqewdESdh+xHAvsj43S2kL1PTUDNOgaxsOPzAvxyUhvlGNr7Sdq +jKlq4drDuT7W3mbKI0MWGQA1+1JY3df17J065nQ0N6X+l4Gg13pPmV9byAK/dt1T2Bn vNMD3vfmHcqdDimjMo8NCD0XVlgsHD7PlVnFVtlqdqMN8UxpRWFz+p42ZOLC7rHdaQpv 5rtaITxvXBwz8+Tpvkuu0HpBT3ieHvNztD5NIGSF1DjLCMvCRe586IjJHr3MZ0zWz4+I oLtg== 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: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=aLTK5ja85LMluZL6ostx+KOuWbEgdbcs19oyC/KgcRo=; b=n09Q/nmIw7Gf3YL4SMX2tz+T7sp8z6cqiIpglSGvnvPg1KUGv9DmRK1BlBVVbFO0GC IxZyiw8OSsvE3NHsZwJvOowCkG7zXkBqDuzvtyKLCdP9ZxGUZsAefTlPVe5xpfI3SzGm 18QS3xwZoW7VOLeHmm1jwq9GibXE9hGgavhQ2c512Mjnbt7lrsMndwJ7NElkF37M9Uxm kUsHUAyGqNRgmb6WtPo5dxqjfVXWiwKq2gMktHysEJV9IZIz8S+ybYd45D9t48udbX1X ZskC+Oei3/E0mDl9JbDLtA3/q/CCH4vAOPm45XTAcqjFm16E10ZnnyldhKdm9oEAAOdv ZPJw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKS2vOyWHj4p1724fQzw2qidk0aUj4aBc3VoqjOPwVP6lltsV1s11MbQ lGqAWShxZRWncg== X-Received: by 10.157.68.148 with SMTP id v20mr130663ote.0.1497187695364; Sun, 11 Jun 2017 06:28:15 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.63.52 with SMTP id m49ls7223530otc.38.gmail; Sun, 11 Jun 2017 06:28:14 -0700 (PDT) X-Received: by 10.157.46.184 with SMTP id w53mr1189038ota.20.1497187694849; Sun, 11 Jun 2017 06:28:14 -0700 (PDT) In-Reply-To: <20170611084305.GD95963-l/d5Ua9yGnxXsXJlQylH7w@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:17818 Archived-At: ------=_Part_2479_5210825.1497187694283 Content-Type: multipart/alternative; boundary="----=_Part_2480_482918476.1497187694284" ------=_Part_2480_482918476.1497187694284 Content-Type: text/plain; charset="UTF-8" Will do. I won't be for a few days as I have a writing deadline, but I'll do it after that. (I'm also trying to figure out another problem regarding footnotes and bidi that might be to do with the package load order. Bidi seems to cause quite a few of these kinds of problems! If I get a solution on that and it makes sense for the default template I'll see if that can go in too.) On Sunday, June 11, 2017 at 9:43:20 AM UTC+1, John MacFarlane wrote: > > If you've got a change to the default latex template that > seems to work better and doesn't cause problems, I suggest > you open a pull request on the jgm/pandoc repository on > github. > > We can solicit comments there from some of the people who > have contributed a lot to the LaTeX templates, to see if > they can spot any problems. > > +++ Lyndon Drake [Jun 06 17 13:51 ]: > > 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 [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To post to this group, send email to > > [2]pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > > To view this discussion on the web visit > > [3] > https://groups.google.com/d/msgid/pandoc-discuss/2a8d8b0d-2740-4dfb- > > 8718-f06432d6425f%40googlegroups.com. > > For more options, visit [4]https://groups.google.com/d/optout. > > > >References > > > > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > 3. > https://groups.google.com/d/msgid/pandoc-discuss/2a8d8b0d-2740-4dfb-8718-f06432d6425f-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer > > 4. https://groups.google.com/d/optout > > -- 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/e99efca7-e62a-4c1d-bf99-9ce4fc91718b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_2480_482918476.1497187694284 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Will do. I won't be for a few days as I have a writing= deadline, but I'll do it after that. (I'm also trying to figure ou= t another problem regarding footnotes and bidi that might be to do with the= package load order. Bidi seems to cause quite a few of these kinds of prob= lems! If I get a solution on that and it makes sense for the default templa= te I'll see if that can go in too.)

On Sunday, June 11, 2017 at = 9:43:20 AM UTC+1, John MacFarlane wrote:
If you've got a change to the default latex template that
seems to work better and doesn't cause problems, I suggest
you open a pull request on the jgm/pandoc repository on
github.

We can solicit comments there from some of the people who
have contributed a lot to the LaTeX templates, to see if
they can spot any problems.

+++ Lyndon Drake [Jun 06 17 13:51 ]:
> =C2=A0 I've got a fair way with this. Thanks to all for the he= lp so far.
> =C2=A0 1. By reading through the template, I figured out which var= iables to
> =C2=A0 define to control the LaTeX output. I'm seriously impre= ssed with
> =C2=A0 Pandoc's setup - I remember the awful pain of doing a L= aTeX document
> =C2=A0 from scratch and this gets things started so well. Thank yo= u John &
> =C2=A0 everyone else!
> =C2=A0 2. As suggested by Joost, I shifted the package load order = around,
> =C2=A0 retaining all the conditionals and variables in the templat= e. I've now
> =C2=A0 got something which is only different by some reordering fr= om the
> =C2=A0 default template, but which avoids the longtable/bidi confl= ict. Thanks
> =C2=A0 Joost!
> =C2=A0 I've also been playing around with a couple of filters,= based on code
> =C2=A0 from Jesse Rosenthal on this list a few years back. It sort= of works,
> =C2=A0 but not well enough to rely on. For the moment, I'm jus= t going to tag
> =C2=A0 every word and block with div/span.
> =C2=A0 It did also occur to me that the proper place to do this st= uff is
> =C2=A0 actually in LaTeX, not Pandoc. E.g. I'm going to use bi= blatex, and I'd
> =C2=A0 want the same rules applied to the output from biblatex. Th= ere's a
> =C2=A0 package:
> =C2=A0 https://github.com/Pomax/ucharclasses
> =C2=A0 which does some of this. One way to do it would be to imple= ment the
> =C2=A0 Unicode bidi algorithm http://unicode.org/re= ports/tr9/ (+ some sensible
> =C2=A0 font switching, which is actually easier than the bidi algo= rithm) as a
> =C2=A0 LaTeX package, but that's a bit much for my current doc= ument. I might
> =C2=A0 have a look at ways to do this properly in July & Augus= t though, as I'd
> =C2=A0 like to have it available before I start my thesis.
> =C2=A0 Anyway for the moment I'm pleased that I could get this= far:
> =C2=A0 https://www.dropbox.com/s/aeyvkjrox5dwtpz/Screenshot%2020= 17-06-06%2021.
> =C2=A0 37.41.png?dl=3D0
> =C2=A0 without having to type anything other than plain Pandoc Mar= kdown into
> =C2=A0 some text & csv files, and all the formatting has been = done by Pandoc
> =C2=A0 and some config. The thing that made me want to use Pandoc = was the
> =C2=A0 memory of my previous thesis (in computer science) where th= e markup
> =C2=A0 made the document so cluttered I found it almost impossible= to actually
> =C2=A0 read the text in the editor. This is promising enough that = I'm going to
> =C2=A0 persevere to get a setup that will work for the upcoming th= esis.
> =C2=A0 Best,
> =C2=A0 Lyndon
> =C2=A0 PS: in case it's of use to others, the relevant bits of= YAML:
> =C2=A0 =C2=A0 header-includes:
> =C2=A0 =C2=A0 =C2=A0 - \newfontfamily\hebrewfont{Taamey David= CLM}
> =C2=A0 =C2=A0 =C2=A0 - \newfontfamily\syriacfont{Serto Jerusa= lem}
> =C2=A0 =C2=A0 lang: en-GB
> =C2=A0 =C2=A0 otherlangs: [he, syr]
> =C2=A0 On Tuesday, June 6, 2017 at 5:26:21 PM UTC+1, Joost wrote:
>
> =C2=A0 =C2=A0 On Tue, Jun 06 2017, Lyndon Drake wrote:
> =C2=A0 =C2=A0 > Part of the problem is that if I set lang and o= therlangs as
> =C2=A0 =C2=A0 > follows:
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > =C2=A0 lang: en-GB
> =C2=A0 =C2=A0 > =C2=A0 otherlangs: [he, sy]
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > I get this:
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > ! Package bidi Error: Oops! you have loaded pac= kage longtable
> =C2=A0 =C2=A0 > after bidi
> =C2=A0 =C2=A0 > packag
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > e. Please load package longtable before bidi pa= ckage, and then
> =C2=A0 =C2=A0 > try to run
> =C2=A0 =C2=A0 > xelatex on your document again.
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 >
> =C2=A0 =C2=A0 > which I guess means that some kind of strange i= nteraction in the
> =C2=A0 =C2=A0 > latex
> =C2=A0 =C2=A0 > template is producing an undesirable latex file= to feed to
> =C2=A0 =C2=A0 > xelatex (maybe
> =C2=A0 =C2=A0 > pandoc-csv2table is doing something to the prod= uced latex?).
> =C2=A0 =C2=A0 No, the template is structured in such a way that po= lyglossia is
> =C2=A0 =C2=A0 loaded before longtable, but polyglossia loads bidi = in order to
> =C2=A0 =C2=A0 deal with RTL languages such as Syriac.
> =C2=A0 =C2=A0 I think your best bet would be to modify the default= template and
> =C2=A0 =C2=A0 load the other languages somewhere toward the end of= the preamble,
> =C2=A0 =C2=A0 after longtable and any other packages are loaded. B= ut you'll need
> =C2=A0 =C2=A0 to know some LaTeX and understand how Pandoc's t= emplate language
> =C2=A0 =C2=A0 works in order to do that.
> =C2=A0 =C2=A0 In actual fact, though, this may be something John n= eeds to think
> =C2=A0 =C2=A0 about, because the default LaTeX template obviously = has a problem
> =C2=A0 =C2=A0 here.
> =C2=A0 =C2=A0 HTH
> =C2=A0 =C2=A0 --
> =C2=A0 =C2=A0 Joost Kremers
> =C2=A0 =C2=A0 Life has its moments
>
> =C2=A0 --
> =C2=A0 You received this message because you are subscribed to the= Google
> =C2=A0 Groups "pandoc-discuss" group.
> =C2=A0 To unsubscribe from this group and stop receiving emails fr= om it, send
> =C2=A0 an email to [1]pandoc-discus...@googlegroups.com.
> =C2=A0 To post to this group, send email to
> =C2=A0 [2]pandoc-...@googlegroups.com.
> =C2=A0 To view this discussion on the web visit
> =C2=A0 [3]http= s://groups.google.com/d/msgid/pandoc-discuss/2a8d8b0d-2740-4dfb-<= /a>
> =C2=A0 8718-f06432d6425f%
40googlegroups.com.
> =C2=A0 For more options, visit [4]https:= //groups.google.com/d/optout.
>
>References
>
> =C2=A0 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> =C2=A0 2. mailto:pandoc-...@googlegroups.com
> =C2=A0 3. https://groups.google.com/d/msgid/pandoc-discuss/2a8d8b0d-2= 740-4dfb-8718-f06432d6425f@googlegroups.com?utm_medium=3Demail&am= p;utm_source=3Dfooter
> =C2=A0 4. 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/e99efca7-e62a-4c1d-bf99-9ce4fc91718b%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_2480_482918476.1497187694284-- ------=_Part_2479_5210825.1497187694283--