mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
Adjusted writers to use "tex".
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user