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...@googlegroups.com.
>   To post to this group, send email to
>   [2]pandoc-...@googlegroups.com.
>   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-...@googlegroups.com
>   3. https://groups.google.com/d/msgid/pandoc-discuss/2a8d8b0d-2740-4dfb-8718-f06432d6425f@googlegroups.com?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-/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.com.
For more options, visit https://groups.google.com/d/optout.