From f3f64835101dc2e9ae32f4d544dbccca02c3a8a0 Mon Sep 17 00:00:00 2001
From: mb21 <mb21@users.noreply.github.com>
Date: Sun, 25 Oct 2015 18:31:35 +0100
Subject: [PATCH] LaTeX writer: \textarabic fix

---
 src/Text/Pandoc/Writers/LaTeX.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index b31497a22..979ed547b 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -800,7 +800,7 @@ inlineToLaTeX (Span (id',classes,kvs) ils) = do
      (if rtl then inCmd "RL" else id) .
      (if ltr then inCmd "LR" else id) .
      (case lookup "lang" kvs of
-        Just lng -> let (l, o) = toPolyglossiaEnv lng
+        Just lng -> let (l, o) = toPolyglossia $ splitBy (=='-') lng
                         ops = if null o then "" else brackets (text o)
                     in  \c -> char '\\' <> "text" <> text l <> ops <> braces c
         Nothing  -> id)