git.iko.soy/typeable/pandoc
on master help sign in
Adjusted writers to use "tex".
commit0cc7625d98e018d7ff01de14ee1fdd44639d27f7 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 24 Jan 2011, 22:13 (16 years ago) parentd3667f9
5 files changed+9−8
src/Text/Pandoc/Writers/ConTeXt.hs+1−2 src/Text/Pandoc/Writers/LaTeX.hs+1 src/Text/Pandoc/Writers/Markdown.hs+3−2 src/Text/Pandoc/Writers/Org.hs+3−3 src/Text/Pandoc/Writers/Texinfo.hs+1−1
src/Text/Pandoc/Writers/ConTeXt.hs+1−2
@@ -266,8 +266,7 @@ inlineToConTeXt (Math InlineMath str) =
266266inlineToConTeXt (Math DisplayMath str) =
267267 return $ text "\\startformula " <> text str <> text " \\stopformula"
268268inlineToConTeXt (RawInline "context" str) = return $ text str
269−-- backwards compatibility, allow latex too
270−inlineToConTeXt (RawInline "latex" str) = return $ text str
269+inlineToConTeXt (RawInline "tex" str) = return $ text str
271270inlineToConTeXt (RawInline _ _) = return empty
272271inlineToConTeXt (LineBreak) = return $ text "\\crlf" <> cr
273272inlineToConTeXt Space = return space
src/Text/Pandoc/Writers/LaTeX.hs+1
@@ -362,6 +362,7 @@ inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str
362362inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$'
363363inlineToLaTeX (Math DisplayMath str) = return $ "\\[" <> text str <> "\\]"
364364inlineToLaTeX (RawInline "latex" str) = return $ text str
365+inlineToLaTeX (RawInline "tex" str) = return $ text str
365366inlineToLaTeX (RawInline _ _) = return empty
366367inlineToLaTeX (LineBreak) = return "\\\\"
367368inlineToLaTeX Space = return space
src/Text/Pandoc/Writers/Markdown.hs+3−2
@@ -206,7 +206,7 @@ blockToMarkdown opts (Para inlines) = do
206206 else empty
207207 return $ esc <> contents <> blankline
208208blockToMarkdown _ (RawBlock f str)
209− | f == "html" || f == "latex" || f == "markdown" = do
209+ | f == "html" || f == "latex" || f == "tex" || f == "markdown" = do
210210 st <- get
211211 if stPlain st
212212 then return empty
@@ -441,7 +441,8 @@ inlineToMarkdown _ (Math InlineMath str) =
441441inlineToMarkdown _ (Math DisplayMath str) =
442442 return $ "$$" <> text str <> "$$"
443443inlineToMarkdown _ (RawInline f str)
444− | f == "html" || f == "latex" || f == "markdown" = return $ text str
444+ | f == "html" || f == "latex" || f == "tex" || f == "markdown" =
445+ return $ text str
445446inlineToMarkdown _ (RawInline _ _) = return empty
446447inlineToMarkdown opts (LineBreak) = return $
447448 if writerStrictMarkdown opts
src/Text/Pandoc/Writers/Org.hs+3−3
@@ -118,8 +118,8 @@ blockToOrg (Para inlines) = do
118118blockToOrg (RawBlock "html" str) =
119119 return $ blankline $$ "#+BEGIN_HTML" $$
120120 nest 2 (text str) $$ "#+END_HTML" $$ blankline
121−blockToOrg (RawBlock "latex" str) = return $ text str
122−blockToOrg (RawBlock "org" str) = return $ text str
121+blockToOrg (RawBlock f str) | f == "org" || f == "latex" || f == "tex" =
122+ return $ text str
123123blockToOrg (RawBlock _ _) = return empty
124124blockToOrg HorizontalRule = return $ blankline $$ "--------------" $$ blankline
125125blockToOrg (Header level inlines) = do
@@ -260,7 +260,7 @@ inlineToOrg (Math t str) = do
260260 return $ if t == InlineMath
261261 then "$" <> text str <> "$"
262262 else "$$" <> text str <> "$$"
263−inlineToOrg (RawInline "latex" str) = return $ text str
263+inlineToOrg (RawInline f str) | f == "tex" || f == "latex" = return $ text str
264264inlineToOrg (RawInline _ _) = return empty
265265inlineToOrg (LineBreak) = return cr -- there's no line break in Org
266266inlineToOrg Space = return space
src/Text/Pandoc/Writers/Texinfo.hs+1−1
@@ -391,7 +391,7 @@ inlineToTexinfo EnDash = return $ text "--"
391391inlineToTexinfo Ellipses = return $ text "@dots{}"
392392inlineToTexinfo (Str str) = return $ text (stringToTexinfo str)
393393inlineToTexinfo (Math _ str) = return $ inCmd "math" $ text str
394−inlineToTexinfo (RawInline "latex" str) =
394+inlineToTexinfo (RawInline f str) | f == "latex" || f == "tex" =
395395 return $ text "@tex" $$ text str $$ text "@end tex"
396396inlineToTexinfo (RawInline "texinfo" str) = return $ text str
397397inlineToTexinfo (RawInline _ _) = return empty