aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-24 22:13:27 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-26 17:23:56 -0800
commit0cc7625d98e018d7ff01de14ee1fdd44639d27f7 (patch)
treee78ddb6522547e23a5159e85df69573a97e3cb59 /src/Text/Pandoc/Writers
parentd3667f9aac2e8436f9446f4200fd9c7c13da50dd (diff)
downloadpandoc-0cc7625d98e018d7ff01de14ee1fdd44639d27f7.tar.gz
Adjusted writers to use "tex".
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs3
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs1
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs5
-rw-r--r--src/Text/Pandoc/Writers/Org.hs6
-rw-r--r--src/Text/Pandoc/Writers/Texinfo.hs2
5 files changed, 9 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 2951486ce..b6f5352c6 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -266,8 +266,7 @@ inlineToConTeXt (Math InlineMath str) =
inlineToConTeXt (Math DisplayMath str) =
return $ text "\\startformula " <> text str <> text " \\stopformula"
inlineToConTeXt (RawInline "context" str) = return $ text str
--- backwards compatibility, allow latex too
-inlineToConTeXt (RawInline "latex" str) = return $ text str
+inlineToConTeXt (RawInline "tex" str) = return $ text str
inlineToConTeXt (RawInline _ _) = return empty
inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
inlineToConTeXt Space = return space
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 131aaddfc..101ae628a 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -362,6 +362,7 @@ inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str
inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$'
inlineToLaTeX (Math DisplayMath str) = return $ "\\[" <> text str <> "\\]"
inlineToLaTeX (RawInline "latex" str) = return $ text str
+inlineToLaTeX (RawInline "tex" str) = return $ text str
inlineToLaTeX (RawInline _ _) = return empty
inlineToLaTeX (LineBreak) = return "\\\\"
inlineToLaTeX Space = return space
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index c2a3a730c..d1b16b34e 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -206,7 +206,7 @@ blockToMarkdown opts (Para inlines) = do
else empty
return $ esc <> contents <> blankline
blockToMarkdown _ (RawBlock f str)
- | f == "html" || f == "latex" || f == "markdown" = do
+ | f == "html" || f == "latex" || f == "tex" || f == "markdown" = do
st <- get
if stPlain st
then return empty
@@ -441,7 +441,8 @@ inlineToMarkdown _ (Math InlineMath str) =
inlineToMarkdown _ (Math DisplayMath str) =
return $ "$$" <> text str <> "$$"
inlineToMarkdown _ (RawInline f str)
- | f == "html" || f == "latex" || f == "markdown" = return $ text str
+ | f == "html" || f == "latex" || f == "tex" || f == "markdown" =
+ return $ text str
inlineToMarkdown _ (RawInline _ _) = return empty
inlineToMarkdown opts (LineBreak) = return $
if writerStrictMarkdown opts
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index af4070696..8f3ff6f3e 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -118,8 +118,8 @@ blockToOrg (Para inlines) = do
blockToOrg (RawBlock "html" str) =
return $ blankline $$ "#+BEGIN_HTML" $$
nest 2 (text str) $$ "#+END_HTML" $$ blankline
-blockToOrg (RawBlock "latex" str) = return $ text str
-blockToOrg (RawBlock "org" str) = return $ text str
+blockToOrg (RawBlock f str) | f == "org" || f == "latex" || f == "tex" =
+ return $ text str
blockToOrg (RawBlock _ _) = return empty
blockToOrg HorizontalRule = return $ blankline $$ "--------------" $$ blankline
blockToOrg (Header level inlines) = do
@@ -260,7 +260,7 @@ inlineToOrg (Math t str) = do
return $ if t == InlineMath
then "$" <> text str <> "$"
else "$$" <> text str <> "$$"
-inlineToOrg (RawInline "latex" str) = return $ text str
+inlineToOrg (RawInline f str) | f == "tex" || f == "latex" = return $ text str
inlineToOrg (RawInline _ _) = return empty
inlineToOrg (LineBreak) = return cr -- there's no line break in Org
inlineToOrg Space = return space
diff --git a/src/Text/Pandoc/Writers/Texinfo.hs b/src/Text/Pandoc/Writers/Texinfo.hs
index 9869e67b6..037d7bdbe 100644
--- a/src/Text/Pandoc/Writers/Texinfo.hs
+++ b/src/Text/Pandoc/Writers/Texinfo.hs
@@ -391,7 +391,7 @@ inlineToTexinfo EnDash = return $ text "--"
inlineToTexinfo Ellipses = return $ text "@dots{}"
inlineToTexinfo (Str str) = return $ text (stringToTexinfo str)
inlineToTexinfo (Math _ str) = return $ inCmd "math" $ text str
-inlineToTexinfo (RawInline "latex" str) =
+inlineToTexinfo (RawInline f str) | f == "latex" || f == "tex" =
return $ text "@tex" $$ text str $$ text "@end tex"
inlineToTexinfo (RawInline "texinfo" str) = return $ text str
inlineToTexinfo (RawInline _ _) = return empty