Here's some Syriac, generated from a CSV file with inline Markdown spans and emphasis:

https://www.dropbox.com/s/65s7gqghezsthfq/Screenshot%202017-06-06%2022.03.04.png?dl=0

On Tuesday, June 6, 2017 at 9:51:59 PM UTC+1, Lyndon Drake wrote:
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-/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/9eb68314-1150-42a1-bee2-5084725818a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.