Support for display math; changed ASCIIMathML -> LaTeXMathML:
Resolves Issue #47. + Added a DisplayMath/InlineMath selector to Math inlines. + Markdown parser yields DisplayMath for $$...$$. + LaTeX parser yields DisplayMath when appropriate. Removed mathBlock parsers, since the same effect is achieved by the math inline parsers, now that they handle display math. + Writers handle DisplayMath as appropriate for the format. + Changed -m option to use LaTeXMathML rather than ASCIIMathML. LaTeXMathML is closer to LaTeX in its display of math, and supports many non-math LaTeX environments. + Modified HTML writer to print raw TeX when LaTeXMathML is being used instead of suppressing it. + Removed ASCIIMathML files from data/ and added LaTeXMathML. + Replaced ASCIIMathML with LaTeXMathML in source files. + Modified README and pandoc man page source. + Modified web page. + Added --latexmathml option (kept --asciimathml as a synonym for backwards compatibility) + Modified tests accordingly; added new tests for display math. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1409 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
aeaf5e5108
commit
f53fb554fe
44 changed files with 512 additions and 4217 deletions
6
Main.hs
6
Main.hs
|
@ -249,12 +249,12 @@ options =
|
||||||
(\opt -> return opt { optSmart = True }))
|
(\opt -> return opt { optSmart = True }))
|
||||||
"" -- "Use smart quotes, dashes, and ellipses"
|
"" -- "Use smart quotes, dashes, and ellipses"
|
||||||
|
|
||||||
, Option "m" ["asciimathml"]
|
, Option "m" ["latexmathml", "asciimathml"]
|
||||||
(OptArg
|
(OptArg
|
||||||
(\arg opt -> return opt { optHTMLMathMethod =
|
(\arg opt -> return opt { optHTMLMathMethod =
|
||||||
ASCIIMathML arg })
|
LaTeXMathML arg })
|
||||||
"URL")
|
"URL")
|
||||||
"" -- "Use ASCIIMathML script in html output"
|
"" -- "Use LaTeXMathML script in html output"
|
||||||
|
|
||||||
, Option "" ["mimetex"]
|
, Option "" ["mimetex"]
|
||||||
(OptArg
|
(OptArg
|
||||||
|
|
20
README
20
README
|
@ -310,27 +310,27 @@ For further documentation, see the `pandoc(1)` man page.
|
||||||
`markdown`. It is selected automatically when the output format is
|
`markdown`. It is selected automatically when the output format is
|
||||||
`latex` or `context`.)
|
`latex` or `context`.)
|
||||||
|
|
||||||
`-m`*[url]* or `--asciimathml`*[=url]*
|
`-m`*[url]* or `--latexmathml`*[=url]*
|
||||||
: causes `pandoc` to use Peter Jipsen's [ASCIIMathML] script to display
|
: causes `pandoc` to use the [LaTeXMathML] script to display
|
||||||
TeX math in HTML or S5. If a local copy of `ASCIIMathML.js` is
|
TeX math in HTML or S5. If a local copy of `LaTeXMathML.js` is
|
||||||
available on the webserver where the page will be viewed, provide a
|
available on the webserver where the page will be viewed, provide a
|
||||||
*url* and a link will be inserted in the generated HTML or S5. If
|
*url* and a link will be inserted in the generated HTML or S5. If
|
||||||
no *url* is provided, the contents of the script will be inserted
|
no *url* is provided, the contents of the script will be inserted
|
||||||
directly; this provides portability at the price of efficiency. If
|
directly; this provides portability at the price of efficiency. If
|
||||||
you plan to use math on several pages, it is much better to link to
|
you plan to use math on several pages, it is much better to link to
|
||||||
a copy of `ASCIIMathML.js`, which can be cached. (See `--gladtex`
|
a copy of `LaTeXMathML.js`, which can be cached. (See `--gladtex`
|
||||||
and `--mimetex` for alternative ways of dealing with math in HTML.)
|
and `--mimetex` for alternative ways of dealing with math in HTML.)
|
||||||
|
|
||||||
`--gladtex`*[=url]*
|
`--gladtex`*[=url]*
|
||||||
: causes TeX formulas to be enclosed in `<eq>` tags in HTML or S5 output.
|
: causes TeX formulas to be enclosed in `<eq>` tags in HTML or S5 output.
|
||||||
This output can then be processed by [gladTeX] to produce links to
|
This output can then be processed by [gladTeX] to produce links to
|
||||||
images with the typeset formulas. (See `--asciimathml` and
|
images with the typeset formulas. (See `--latexmathml` and
|
||||||
`--mimetex` for alternative ways of dealing with math in HTML.)
|
`--mimetex` for alternative ways of dealing with math in HTML.)
|
||||||
|
|
||||||
`--mimetex`*[=url]*
|
`--mimetex`*[=url]*
|
||||||
: causes TeX formulas to be replaced by `<img>` tags linking to the
|
: causes TeX formulas to be replaced by `<img>` tags linking to the
|
||||||
[mimeTeX] CGI script, which will produce images with the typeset
|
[mimeTeX] CGI script, which will produce images with the typeset
|
||||||
formulas. (See `--asciimathml` and `--mimetex` for alternative
|
formulas. (See `--latexmathml` and `--mimetex` for alternative
|
||||||
ways of dealing with math in HTML.)
|
ways of dealing with math in HTML.)
|
||||||
|
|
||||||
`-i` or `--incremental`
|
`-i` or `--incremental`
|
||||||
|
@ -386,7 +386,7 @@ For further documentation, see the `pandoc(1)` man page.
|
||||||
: prints a usage message to STDERR.
|
: prints a usage message to STDERR.
|
||||||
|
|
||||||
[Smartypants]: http://daringfireball.net/projects/smartypants/
|
[Smartypants]: http://daringfireball.net/projects/smartypants/
|
||||||
[ASCIIMathML]: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
|
[LaTeXMathML]: http://math.etsu.edu/LaTeXMathML/
|
||||||
[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
|
[gladTeX]: http://www.math.uio.no/~martingu/gladtex/index.html
|
||||||
[mimeTeX]: http://www.forkosh.com/mimetex.html
|
[mimeTeX]: http://www.forkosh.com/mimetex.html
|
||||||
|
|
||||||
|
@ -930,11 +930,11 @@ command-line options selected:
|
||||||
are put inside a `span` with `class="math"`, so that they may be
|
are put inside a `span` with `class="math"`, so that they may be
|
||||||
styled differently from the surrounding text if needed.
|
styled differently from the surrounding text if needed.
|
||||||
|
|
||||||
2. If the `--asciimathml` option is used, TeX math will be displayed
|
2. If the `--latexmathml` option is used, TeX math will be displayed
|
||||||
between $ characters, as in LaTeX, and the [ASCIIMathML] script will
|
between $ characters, as in LaTeX, and the [LaTeXMathML] script will
|
||||||
be used to render it as formulas. (This trick does not work in all
|
be used to render it as formulas. (This trick does not work in all
|
||||||
browsers, but it works in Firefox. In browsers that do not support
|
browsers, but it works in Firefox. In browsers that do not support
|
||||||
ASCIIMathML, TeX math will appear verbatim between $ characters.)
|
LaTeXMathML, TeX math will appear verbatim between $ characters.)
|
||||||
|
|
||||||
3. If the `--mimetex` option is used, the [mimeTeX] CGI script will
|
3. If the `--mimetex` option is used, the [mimeTeX] CGI script will
|
||||||
be called to generate images for each TeX formula. This should
|
be called to generate images for each TeX formula. This should
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
{-# LANGUAGE CPP, TemplateHaskell #-}
|
|
||||||
-- | Definitions for use of ASCIIMathML in HTML.
|
|
||||||
-- (See <http://www1.chapman.edu/~jipsen/mathml/asciimath.html>.)
|
|
||||||
module Text.Pandoc.ASCIIMathML ( asciiMathMLScript ) where
|
|
||||||
import Text.Pandoc.TH ( contentsOf )
|
|
||||||
import System.FilePath ( (</>) )
|
|
||||||
|
|
||||||
-- | String containing ASCIIMathML javascript.
|
|
||||||
asciiMathMLScript :: String
|
|
||||||
#ifndef __HADDOCK__
|
|
||||||
asciiMathMLScript = "<script type=\"text/javascript\">\n" ++
|
|
||||||
$(contentsOf $ "data" </> "ASCIIMathML.js.comment") ++
|
|
||||||
$(contentsOf $ "data" </> "ASCIIMathML.js.packed") ++ "</script>\n"
|
|
||||||
#endif
|
|
|
@ -98,6 +98,9 @@ data QuoteType = SingleQuote | DoubleQuote deriving (Show, Eq, Read, Typeable, D
|
||||||
-- | Link target (URL, title).
|
-- | Link target (URL, title).
|
||||||
type Target = (String, String)
|
type Target = (String, String)
|
||||||
|
|
||||||
|
-- | Type of math element (display or inline).
|
||||||
|
data MathType = DisplayMath | InlineMath deriving (Show, Eq, Read, Typeable, Data)
|
||||||
|
|
||||||
-- | Inline elements.
|
-- | Inline elements.
|
||||||
data Inline
|
data Inline
|
||||||
= Str String -- ^ Text (string)
|
= Str String -- ^ Text (string)
|
||||||
|
@ -116,7 +119,7 @@ data Inline
|
||||||
| Apostrophe -- ^ Apostrophe
|
| Apostrophe -- ^ Apostrophe
|
||||||
| Ellipses -- ^ Ellipses
|
| Ellipses -- ^ Ellipses
|
||||||
| LineBreak -- ^ Hard line break
|
| LineBreak -- ^ Hard line break
|
||||||
| Math String -- ^ TeX math (literal)
|
| Math MathType String -- ^ TeX math (literal)
|
||||||
| TeX String -- ^ LaTeX code (literal)
|
| TeX String -- ^ LaTeX code (literal)
|
||||||
| HtmlInline String -- ^ HTML code (literal)
|
| HtmlInline String -- ^ HTML code (literal)
|
||||||
| Link [Inline] Target -- ^ Hyperlink: text (list of inlines), target
|
| Link [Inline] Target -- ^ Hyperlink: text (list of inlines), target
|
||||||
|
|
14
Text/Pandoc/LaTeXMathML.hs
Normal file
14
Text/Pandoc/LaTeXMathML.hs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{-# LANGUAGE CPP, TemplateHaskell #-}
|
||||||
|
-- | Definitions for use of LaTeXMathML in HTML.
|
||||||
|
-- (See http://math.etsu.edu/LaTeXMathML/)
|
||||||
|
module Text.Pandoc.LaTeXMathML ( latexMathMLScript ) where
|
||||||
|
import Text.Pandoc.TH ( contentsOf )
|
||||||
|
import System.FilePath ( (</>) )
|
||||||
|
|
||||||
|
-- | String containing LaTeXMathML javascript.
|
||||||
|
latexMathMLScript :: String
|
||||||
|
#ifndef __HADDOCK__
|
||||||
|
latexMathMLScript = "<script type=\"text/javascript\">\n" ++
|
||||||
|
$(contentsOf $ "data" </> "LaTeXMathML.js.comment") ++
|
||||||
|
$(contentsOf $ "data" </> "LaTeXMathML.js.packed") ++ "</script>\n"
|
||||||
|
#endif
|
|
@ -153,7 +153,6 @@ block = choice [ hrule
|
||||||
, header
|
, header
|
||||||
, list
|
, list
|
||||||
, blockQuote
|
, blockQuote
|
||||||
, mathBlock
|
|
||||||
, comment
|
, comment
|
||||||
, bibliographic
|
, bibliographic
|
||||||
, para
|
, para
|
||||||
|
@ -218,26 +217,6 @@ blockQuote :: GenParser Char ParserState Block
|
||||||
blockQuote = (environment "quote" <|> environment "quotation") >>~ spaces >>=
|
blockQuote = (environment "quote" <|> environment "quotation") >>~ spaces >>=
|
||||||
return . BlockQuote
|
return . BlockQuote
|
||||||
|
|
||||||
--
|
|
||||||
-- math block
|
|
||||||
--
|
|
||||||
|
|
||||||
mathBlock :: GenParser Char st Block
|
|
||||||
mathBlock = mathBlockWith (begin "equation") (end "equation") <|>
|
|
||||||
mathBlockWith (begin "displaymath") (end "displaymath") <|>
|
|
||||||
mathBlockWith (try $ string "\\[") (try $ string "\\]") <?>
|
|
||||||
"math block"
|
|
||||||
|
|
||||||
mathBlockWith :: GenParser Char st t
|
|
||||||
-> GenParser Char st end
|
|
||||||
-> GenParser Char st Block
|
|
||||||
mathBlockWith start end' = try $ do
|
|
||||||
start
|
|
||||||
spaces
|
|
||||||
result <- manyTill anyChar end'
|
|
||||||
spaces
|
|
||||||
return $ BlockQuote [Para [Math result]]
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- list blocks
|
-- list blocks
|
||||||
--
|
--
|
||||||
|
@ -683,21 +662,31 @@ endline = try $ newline >> notFollowedBy blankline >> return Space
|
||||||
|
|
||||||
-- math
|
-- math
|
||||||
math :: GenParser Char st Inline
|
math :: GenParser Char st Inline
|
||||||
math = math1 <|> math2 <?> "math"
|
math = (math3 >>= return . Math DisplayMath)
|
||||||
|
<|> (math1 >>= return . Math InlineMath)
|
||||||
|
<|> (math2 >>= return . Math InlineMath)
|
||||||
|
<|> (math4 >>= return . Math DisplayMath)
|
||||||
|
<|> (math5 >>= return . Math DisplayMath)
|
||||||
|
<|> (math6 >>= return . Math DisplayMath)
|
||||||
|
<?> "math"
|
||||||
|
|
||||||
math1 :: GenParser Char st Inline
|
math1 :: GenParser Char st String
|
||||||
math1 = try $ do
|
math1 = try $ char '$' >> manyTill anyChar (char '$')
|
||||||
char '$'
|
|
||||||
result <- many (noneOf "$")
|
|
||||||
char '$'
|
|
||||||
return $ Math result
|
|
||||||
|
|
||||||
math2 :: GenParser Char st Inline
|
math2 :: GenParser Char st String
|
||||||
math2 = try $ do
|
math2 = try $ string "\\(" >> manyTill anyChar (try $ string "\\)")
|
||||||
string "\\("
|
|
||||||
result <- many (noneOf "$")
|
math3 :: GenParser Char st String
|
||||||
string "\\)"
|
math3 = try $ char '$' >> math1 >>~ char '$'
|
||||||
return $ Math result
|
|
||||||
|
math4 :: GenParser Char st String
|
||||||
|
math4 = try $ (begin "equation") >> spaces >> manyTill anyChar (end "equation")
|
||||||
|
|
||||||
|
math5 :: GenParser Char st String
|
||||||
|
math5 = try $ (begin "displaymath") >> spaces >> manyTill anyChar (end "displaymath")
|
||||||
|
|
||||||
|
math6 :: GenParser Char st String
|
||||||
|
math6 = try $ (string "\\[") >> spaces >> manyTill anyChar (try $ string "\\]")
|
||||||
|
|
||||||
--
|
--
|
||||||
-- links and images
|
-- links and images
|
||||||
|
|
|
@ -870,14 +870,21 @@ mathWord = many1 ((noneOf " \t\n\\$") <|>
|
||||||
(try (char '\\') >>~ notFollowedBy (char '$')))
|
(try (char '\\') >>~ notFollowedBy (char '$')))
|
||||||
|
|
||||||
math :: GenParser Char ParserState Inline
|
math :: GenParser Char ParserState Inline
|
||||||
math = try $ do
|
math = (mathDisplay >>= return . Math DisplayMath)
|
||||||
|
<|> (mathInline >>= return . Math InlineMath)
|
||||||
|
|
||||||
|
mathDisplay :: GenParser Char ParserState String
|
||||||
|
mathDisplay = try $ char '$' >> mathInline >>~ char '$' >>~ notFollowedBy digit
|
||||||
|
|
||||||
|
mathInline :: GenParser Char ParserState String
|
||||||
|
mathInline = try $ do
|
||||||
failIfStrict
|
failIfStrict
|
||||||
char '$'
|
char '$'
|
||||||
notFollowedBy space
|
notFollowedBy space
|
||||||
words' <- sepBy1 mathWord (many1 (spaceChar <|> (newline >>~ notFollowedBy' blankline)))
|
words' <- sepBy1 mathWord (many1 (spaceChar <|> (newline >>~ notFollowedBy' blankline)))
|
||||||
char '$'
|
char '$'
|
||||||
notFollowedBy digit
|
notFollowedBy digit
|
||||||
return $ Math $ joinWithSep " " words'
|
return $ joinWithSep " " words'
|
||||||
|
|
||||||
emph :: GenParser Char ParserState Inline
|
emph :: GenParser Char ParserState Inline
|
||||||
emph = ((enclosed (char '*') (notFollowedBy' strong >> char '*') inline) <|>
|
emph = ((enclosed (char '*') (notFollowedBy' strong >> char '*') inline) <|>
|
||||||
|
|
|
@ -715,8 +715,8 @@ refsMatch ((Quoted t x):restx) ((Quoted u y):resty) =
|
||||||
t == u && refsMatch x y && refsMatch restx resty
|
t == u && refsMatch x y && refsMatch restx resty
|
||||||
refsMatch ((Code x):restx) ((Code y):resty) =
|
refsMatch ((Code x):restx) ((Code y):resty) =
|
||||||
((map toLower x) == (map toLower y)) && refsMatch restx resty
|
((map toLower x) == (map toLower y)) && refsMatch restx resty
|
||||||
refsMatch ((Math x):restx) ((Math y):resty) =
|
refsMatch ((Math t x):restx) ((Math u y):resty) =
|
||||||
((map toLower x) == (map toLower y)) && refsMatch restx resty
|
((map toLower x) == (map toLower y)) && t == u && refsMatch restx resty
|
||||||
refsMatch ((TeX x):restx) ((TeX y):resty) =
|
refsMatch ((TeX x):restx) ((TeX y):resty) =
|
||||||
((map toLower x) == (map toLower y)) && refsMatch restx resty
|
((map toLower x) == (map toLower y)) && refsMatch restx resty
|
||||||
refsMatch ((HtmlInline x):restx) ((HtmlInline y):resty) =
|
refsMatch ((HtmlInline x):restx) ((HtmlInline y):resty) =
|
||||||
|
@ -876,7 +876,7 @@ isHeaderBlock _ = False
|
||||||
--
|
--
|
||||||
|
|
||||||
data HTMLMathMethod = PlainMath
|
data HTMLMathMethod = PlainMath
|
||||||
| ASCIIMathML (Maybe String) -- url of ASCIIMathML.js
|
| LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
|
||||||
| GladTeX
|
| GladTeX
|
||||||
| MimeTeX String -- url of mimetex.cgi
|
| MimeTeX String -- url of mimetex.cgi
|
||||||
deriving (Show, Read, Eq)
|
deriving (Show, Read, Eq)
|
||||||
|
|
|
@ -272,7 +272,8 @@ inlineToConTeXt EmDash = return $ text "---"
|
||||||
inlineToConTeXt EnDash = return $ text "--"
|
inlineToConTeXt EnDash = return $ text "--"
|
||||||
inlineToConTeXt Ellipses = return $ text "\\ldots{}"
|
inlineToConTeXt Ellipses = return $ text "\\ldots{}"
|
||||||
inlineToConTeXt (Str str) = return $ text $ stringToConTeXt str
|
inlineToConTeXt (Str str) = return $ text $ stringToConTeXt str
|
||||||
inlineToConTeXt (Math str) = return $ char '$' <> text str <> char '$'
|
inlineToConTeXt (Math InlineMath str) = return $ char '$' <> text str <> char '$'
|
||||||
|
inlineToConTeXt (Math DisplayMath str) = return $ text "\\startformula " <> text str <> text " \\stopformula"
|
||||||
inlineToConTeXt (TeX str) = return $ text str
|
inlineToConTeXt (TeX str) = return $ text str
|
||||||
inlineToConTeXt (HtmlInline _) = return empty
|
inlineToConTeXt (HtmlInline _) = return empty
|
||||||
inlineToConTeXt (LineBreak) = return $ text "\\crlf\n"
|
inlineToConTeXt (LineBreak) = return $ text "\\crlf\n"
|
||||||
|
|
|
@ -236,7 +236,7 @@ inlineToDocbook _ EmDash = text "—"
|
||||||
inlineToDocbook _ EnDash = text "–"
|
inlineToDocbook _ EnDash = text "–"
|
||||||
inlineToDocbook _ (Code str) =
|
inlineToDocbook _ (Code str) =
|
||||||
inTagsSimple "literal" $ text (escapeStringForXML str)
|
inTagsSimple "literal" $ text (escapeStringForXML str)
|
||||||
inlineToDocbook opts (Math str) = inlinesToDocbook opts $ readTeXMath str
|
inlineToDocbook opts (Math _ str) = inlinesToDocbook opts $ readTeXMath str
|
||||||
inlineToDocbook _ (TeX _) = empty
|
inlineToDocbook _ (TeX _) = empty
|
||||||
inlineToDocbook _ (HtmlInline _) = empty
|
inlineToDocbook _ (HtmlInline _) = empty
|
||||||
inlineToDocbook _ LineBreak = text $ "<literallayout></literallayout>"
|
inlineToDocbook _ LineBreak = text $ "<literallayout></literallayout>"
|
||||||
|
|
|
@ -30,7 +30,7 @@ Conversion of 'Pandoc' documents to HTML.
|
||||||
-}
|
-}
|
||||||
module Text.Pandoc.Writers.HTML ( writeHtml , writeHtmlString ) where
|
module Text.Pandoc.Writers.HTML ( writeHtml , writeHtmlString ) where
|
||||||
import Text.Pandoc.Definition
|
import Text.Pandoc.Definition
|
||||||
import Text.Pandoc.ASCIIMathML
|
import Text.Pandoc.LaTeXMathML
|
||||||
import Text.Pandoc.CharacterReferences ( decodeCharacterReferences )
|
import Text.Pandoc.CharacterReferences ( decodeCharacterReferences )
|
||||||
import Text.Pandoc.Shared
|
import Text.Pandoc.Shared
|
||||||
import Text.Pandoc.Readers.TeXMath
|
import Text.Pandoc.Readers.TeXMath
|
||||||
|
@ -123,9 +123,9 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
|
||||||
'\n':(unlines $ S.toList cssLines)
|
'\n':(unlines $ S.toList cssLines)
|
||||||
math = if stMath newstate
|
math = if stMath newstate
|
||||||
then case writerHTMLMathMethod opts of
|
then case writerHTMLMathMethod opts of
|
||||||
ASCIIMathML Nothing ->
|
LaTeXMathML Nothing ->
|
||||||
primHtml asciiMathMLScript
|
primHtml latexMathMLScript
|
||||||
ASCIIMathML (Just url) ->
|
LaTeXMathML (Just url) ->
|
||||||
script !
|
script !
|
||||||
[src url, thetype "text/javascript"] $
|
[src url, thetype "text/javascript"] $
|
||||||
noHtml
|
noHtml
|
||||||
|
@ -268,7 +268,7 @@ inlineListToIdentifier' (x:xs) =
|
||||||
Apostrophe -> ""
|
Apostrophe -> ""
|
||||||
Ellipses -> ""
|
Ellipses -> ""
|
||||||
LineBreak -> "-"
|
LineBreak -> "-"
|
||||||
Math _ -> ""
|
Math _ _ -> ""
|
||||||
TeX _ -> ""
|
TeX _ -> ""
|
||||||
HtmlInline _ -> ""
|
HtmlInline _ -> ""
|
||||||
Link lst _ -> inlineListToIdentifier' lst
|
Link lst _ -> inlineListToIdentifier' lst
|
||||||
|
@ -455,10 +455,13 @@ inlineToHtml opts inline =
|
||||||
primHtmlChar "rdquo")
|
primHtmlChar "rdquo")
|
||||||
in do contents <- inlineListToHtml opts lst
|
in do contents <- inlineListToHtml opts lst
|
||||||
return $ leftQuote +++ contents +++ rightQuote
|
return $ leftQuote +++ contents +++ rightQuote
|
||||||
(Math str) -> modify (\st -> st {stMath = True}) >>
|
(Math t str) ->
|
||||||
|
modify (\st -> st {stMath = True}) >>
|
||||||
(case writerHTMLMathMethod opts of
|
(case writerHTMLMathMethod opts of
|
||||||
ASCIIMathML _ ->
|
LaTeXMathML _ ->
|
||||||
return $ stringToHtml ("$" ++ str ++ "$")
|
return $ if t == InlineMath
|
||||||
|
then primHtml ("$" ++ str ++ "$")
|
||||||
|
else primHtml ("$$" ++ str ++ "$$")
|
||||||
MimeTeX url ->
|
MimeTeX url ->
|
||||||
return $ image ! [src (url ++ "?" ++ str),
|
return $ image ! [src (url ++ "?" ++ str),
|
||||||
alt str, title str]
|
alt str, title str]
|
||||||
|
@ -467,7 +470,10 @@ inlineToHtml opts inline =
|
||||||
PlainMath ->
|
PlainMath ->
|
||||||
inlineListToHtml opts (readTeXMath str) >>=
|
inlineListToHtml opts (readTeXMath str) >>=
|
||||||
return . (thespan ! [theclass "math"]))
|
return . (thespan ! [theclass "math"]))
|
||||||
(TeX _) -> return noHtml
|
(TeX str) -> case writerHTMLMathMethod opts of
|
||||||
|
LaTeXMathML _ -> do modify (\st -> st {stMath = True})
|
||||||
|
return $ primHtml str
|
||||||
|
_ -> return noHtml
|
||||||
(HtmlInline str) -> return $ primHtml str
|
(HtmlInline str) -> return $ primHtml str
|
||||||
(Link [Code str] (s,_)) | "mailto:" `isPrefixOf` s ->
|
(Link [Code str] (s,_)) | "mailto:" `isPrefixOf` s ->
|
||||||
return $ obfuscateLink opts str s
|
return $ obfuscateLink opts str s
|
||||||
|
|
|
@ -299,7 +299,8 @@ inlineToLaTeX EmDash = return $ text "---"
|
||||||
inlineToLaTeX EnDash = return $ text "--"
|
inlineToLaTeX EnDash = return $ text "--"
|
||||||
inlineToLaTeX Ellipses = return $ text "\\ldots{}"
|
inlineToLaTeX Ellipses = return $ text "\\ldots{}"
|
||||||
inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str
|
inlineToLaTeX (Str str) = return $ text $ stringToLaTeX str
|
||||||
inlineToLaTeX (Math str) = return $ char '$' <> text str <> char '$'
|
inlineToLaTeX (Math InlineMath str) = return $ char '$' <> text str <> char '$'
|
||||||
|
inlineToLaTeX (Math DisplayMath str) = return $ text "\\[" <> text str <> text "\\]"
|
||||||
inlineToLaTeX (TeX str) = return $ text str
|
inlineToLaTeX (TeX str) = return $ text str
|
||||||
inlineToLaTeX (HtmlInline _) = return empty
|
inlineToLaTeX (HtmlInline _) = return empty
|
||||||
inlineToLaTeX (LineBreak) = return $ text "\\\\"
|
inlineToLaTeX (LineBreak) = return $ text "\\\\"
|
||||||
|
|
|
@ -272,7 +272,10 @@ inlineToMan _ Ellipses = return $ text "\\&..."
|
||||||
inlineToMan _ (Code str) =
|
inlineToMan _ (Code str) =
|
||||||
return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
|
return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
|
||||||
inlineToMan _ (Str str) = return $ text $ escapeString str
|
inlineToMan _ (Str str) = return $ text $ escapeString str
|
||||||
inlineToMan opts (Math str) = inlineToMan opts (Code str)
|
inlineToMan opts (Math InlineMath str) = inlineToMan opts (Code str)
|
||||||
|
inlineToMan opts (Math DisplayMath str) = do
|
||||||
|
contents <- inlineToMan opts (Code str)
|
||||||
|
return $ text ".RS" $$ contents $$ text ".RE"
|
||||||
inlineToMan _ (TeX _) = return empty
|
inlineToMan _ (TeX _) = return empty
|
||||||
inlineToMan _ (HtmlInline str) = return $ text $ escapeCode str
|
inlineToMan _ (HtmlInline str) = return $ text $ escapeCode str
|
||||||
inlineToMan _ (LineBreak) = return $ text "\n.PD 0\n.P\n.PD\n"
|
inlineToMan _ (LineBreak) = return $ text "\n.PD 0\n.P\n.PD\n"
|
||||||
|
|
|
@ -337,7 +337,8 @@ inlineToMarkdown _ (Code str) =
|
||||||
spacer = if (longest == 0) then "" else " " in
|
spacer = if (longest == 0) then "" else " " in
|
||||||
return $ text (marker ++ spacer ++ str ++ spacer ++ marker)
|
return $ text (marker ++ spacer ++ str ++ spacer ++ marker)
|
||||||
inlineToMarkdown _ (Str str) = return $ text $ escapeString str
|
inlineToMarkdown _ (Str str) = return $ text $ escapeString str
|
||||||
inlineToMarkdown _ (Math str) = return $ char '$' <> text str <> char '$'
|
inlineToMarkdown _ (Math InlineMath str) = return $ char '$' <> text str <> char '$'
|
||||||
|
inlineToMarkdown _ (Math DisplayMath str) = return $ text "$$" <> text str <> text "$$"
|
||||||
inlineToMarkdown _ (TeX str) = return $ text str
|
inlineToMarkdown _ (TeX str) = return $ text str
|
||||||
inlineToMarkdown _ (HtmlInline str) = return $ text str
|
inlineToMarkdown _ (HtmlInline str) = return $ text str
|
||||||
inlineToMarkdown _ (LineBreak) = return $ text " \n"
|
inlineToMarkdown _ (LineBreak) = return $ text " \n"
|
||||||
|
|
|
@ -357,7 +357,7 @@ inlineToMediaWiki _ (Code str) =
|
||||||
|
|
||||||
inlineToMediaWiki _ (Str str) = return $ escapeString str
|
inlineToMediaWiki _ (Str str) = return $ escapeString str
|
||||||
|
|
||||||
inlineToMediaWiki _ (Math str) = return $ "<math>" ++ str ++ "</math>"
|
inlineToMediaWiki _ (Math _ str) = return $ "<math>" ++ str ++ "</math>"
|
||||||
-- note: str should NOT be escaped
|
-- note: str should NOT be escaped
|
||||||
|
|
||||||
inlineToMediaWiki _ (TeX _) = return ""
|
inlineToMediaWiki _ (TeX _) = return ""
|
||||||
|
|
|
@ -379,7 +379,7 @@ inlineToOpenDocument o ils
|
||||||
| SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
|
| SmallCaps l <- ils = withTextStyle SmallC $ inlinesToOpenDocument o l
|
||||||
| Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
|
| Quoted t l <- ils = inQuotes t <$> inlinesToOpenDocument o l
|
||||||
| Code s <- ils = preformatted s
|
| Code s <- ils = preformatted s
|
||||||
| Math s <- ils = inlinesToOpenDocument o (readTeXMath s)
|
| Math _ s <- ils = inlinesToOpenDocument o (readTeXMath s)
|
||||||
| Cite _ l <- ils = inlinesToOpenDocument o l
|
| Cite _ l <- ils = inlinesToOpenDocument o l
|
||||||
| TeX s <- ils = preformatted s
|
| TeX s <- ils = preformatted s
|
||||||
| HtmlInline s <- ils = preformatted s
|
| HtmlInline s <- ils = preformatted s
|
||||||
|
|
|
@ -291,14 +291,16 @@ inlineToRST Apostrophe = return $ char '\''
|
||||||
inlineToRST Ellipses = return $ text "..."
|
inlineToRST Ellipses = return $ text "..."
|
||||||
inlineToRST (Code str) = return $ text $ "``" ++ str ++ "``"
|
inlineToRST (Code str) = return $ text $ "``" ++ str ++ "``"
|
||||||
inlineToRST (Str str) = return $ text $ escapeString str
|
inlineToRST (Str str) = return $ text $ escapeString str
|
||||||
inlineToRST (Math str) = do
|
inlineToRST (Math t str) = do
|
||||||
includes <- get >>= (return . stIncludes)
|
includes <- get >>= (return . stIncludes)
|
||||||
let rawMathRole = ".. role:: math(raw)\n" ++
|
let rawMathRole = ".. role:: math(raw)\n" ++
|
||||||
" :format: html latex\n"
|
" :format: html latex\n"
|
||||||
if not (rawMathRole `elem` includes)
|
if not (rawMathRole `elem` includes)
|
||||||
then modify $ \st -> st { stIncludes = rawMathRole : includes }
|
then modify $ \st -> st { stIncludes = rawMathRole : includes }
|
||||||
else return ()
|
else return ()
|
||||||
return $ text $ ":math:`$" ++ str ++ "$`"
|
return $ if t == InlineMath
|
||||||
|
then text $ ":math:`$" ++ str ++ "$`"
|
||||||
|
else text $ ":math:`$$" ++ str ++ "$$`"
|
||||||
inlineToRST (TeX _) = return empty
|
inlineToRST (TeX _) = return empty
|
||||||
inlineToRST (HtmlInline _) = return empty
|
inlineToRST (HtmlInline _) = return empty
|
||||||
inlineToRST (LineBreak) = do
|
inlineToRST (LineBreak) = do
|
||||||
|
|
|
@ -275,7 +275,7 @@ inlineToRTF EmDash = "\\u8212-"
|
||||||
inlineToRTF EnDash = "\\u8211-"
|
inlineToRTF EnDash = "\\u8211-"
|
||||||
inlineToRTF (Code str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}"
|
inlineToRTF (Code str) = "{\\f1 " ++ (codeStringToRTF str) ++ "}"
|
||||||
inlineToRTF (Str str) = stringToRTF str
|
inlineToRTF (Str str) = stringToRTF str
|
||||||
inlineToRTF (Math str) = inlineListToRTF $ readTeXMath str
|
inlineToRTF (Math _ str) = inlineListToRTF $ readTeXMath str
|
||||||
inlineToRTF (Cite _ lst) = inlineListToRTF lst
|
inlineToRTF (Cite _ lst) = inlineListToRTF lst
|
||||||
inlineToRTF (TeX _) = ""
|
inlineToRTF (TeX _) = ""
|
||||||
inlineToRTF (HtmlInline _) = ""
|
inlineToRTF (HtmlInline _) = ""
|
||||||
|
|
|
@ -30,6 +30,7 @@ Conversion of 'Pandoc' format into Texinfo.
|
||||||
module Text.Pandoc.Writers.Texinfo ( writeTexinfo ) where
|
module Text.Pandoc.Writers.Texinfo ( writeTexinfo ) where
|
||||||
import Text.Pandoc.Definition
|
import Text.Pandoc.Definition
|
||||||
import Text.Pandoc.Shared
|
import Text.Pandoc.Shared
|
||||||
|
import Text.Pandoc.Readers.TeXMath
|
||||||
import Text.Printf ( printf )
|
import Text.Printf ( printf )
|
||||||
import Data.List ( isSuffixOf )
|
import Data.List ( isSuffixOf )
|
||||||
import Data.Char ( chr, ord )
|
import Data.Char ( chr, ord )
|
||||||
|
@ -364,7 +365,7 @@ inlineForNode EnDash = return $ text "--"
|
||||||
inlineForNode Apostrophe = return $ char '\''
|
inlineForNode Apostrophe = return $ char '\''
|
||||||
inlineForNode Ellipses = return $ text "..."
|
inlineForNode Ellipses = return $ text "..."
|
||||||
inlineForNode LineBreak = return empty
|
inlineForNode LineBreak = return empty
|
||||||
inlineForNode (Math _) = return empty
|
inlineForNode (Math _ str) = inlineListForNode $ readTeXMath str
|
||||||
inlineForNode (TeX _) = return empty
|
inlineForNode (TeX _) = return empty
|
||||||
inlineForNode (HtmlInline _) = return empty
|
inlineForNode (HtmlInline _) = return empty
|
||||||
inlineForNode (Link lst _) = inlineListForNode lst
|
inlineForNode (Link lst _) = inlineListForNode lst
|
||||||
|
@ -437,7 +438,7 @@ inlineToTexinfo EmDash = return $ text "---"
|
||||||
inlineToTexinfo EnDash = return $ text "--"
|
inlineToTexinfo EnDash = return $ text "--"
|
||||||
inlineToTexinfo Ellipses = return $ text "@dots{}"
|
inlineToTexinfo Ellipses = return $ text "@dots{}"
|
||||||
inlineToTexinfo (Str str) = return $ text (stringToTexinfo str)
|
inlineToTexinfo (Str str) = return $ text (stringToTexinfo str)
|
||||||
inlineToTexinfo (Math str) = return $ inCmd "math" $ text str
|
inlineToTexinfo (Math _ str) = return $ inCmd "math" $ text str
|
||||||
inlineToTexinfo (TeX str) = return $ text "@tex" $$ text str $$ text "@end tex"
|
inlineToTexinfo (TeX str) = return $ text "@tex" $$ text str $$ text "@end tex"
|
||||||
inlineToTexinfo (HtmlInline _) = return empty
|
inlineToTexinfo (HtmlInline _) = return empty
|
||||||
inlineToTexinfo (LineBreak) = return $ text "@*"
|
inlineToTexinfo (LineBreak) = return $ text "@*"
|
||||||
|
|
3363
data/ASCIIMathML.js
3363
data/ASCIIMathML.js
File diff suppressed because it is too large
Load diff
|
@ -1,2 +0,0 @@
|
||||||
/* ASCIIMathML.js - copyright Peter Jipsen, released under the GPL
|
|
||||||
See http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ */
|
|
File diff suppressed because one or more lines are too long
16
data/LaTeXMathML.js.comment
Normal file
16
data/LaTeXMathML.js.comment
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
LaTeXMathML.js from http://math.etsu.edu/LaTeXMathML/
|
||||||
|
Adapted by Jeff Knisely and Douglas Woodall from ASCIIMathML.js v. 1.4.7,
|
||||||
|
(c) 2005 Peter Jipsen http://www.chapman.edu/~jipsen.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or (at
|
||||||
|
your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
General Public License (at http://www.gnu.org/copyleft/gpl.html)
|
||||||
|
for more details.
|
||||||
|
*/
|
191
data/LaTeXMathML.js.packed
Normal file
191
data/LaTeXMathML.js.packed
Normal file
File diff suppressed because one or more lines are too long
|
@ -107,9 +107,9 @@ to Pandoc. Or use `html2markdown`(1), a wrapper around `pandoc`.
|
||||||
only when the input format is `markdown`. It is selected automatically
|
only when the input format is `markdown`. It is selected automatically
|
||||||
when the output format is `latex` or `context`.)
|
when the output format is `latex` or `context`.)
|
||||||
|
|
||||||
-m*URL*, \--asciimathml=*URL*
|
-m*URL*, \--latexmathml=*URL*
|
||||||
: Use ASCIIMathML to display embedded TeX math in HTML output.
|
: Use LaTeXMathML to display embedded TeX math in HTML output.
|
||||||
To insert a link to a local copy of the `ASCIIMathML.js` script,
|
To insert a link to a local copy of the `LaTeXMathML.js` script,
|
||||||
provide a *URL*. If no *URL* is provided, the contents of the
|
provide a *URL*. If no *URL* is provided, the contents of the
|
||||||
script will be inserted directly into the HTML header.
|
script will be inserted directly into the HTML header.
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,9 @@ Extra-Source-Files:
|
||||||
data/headers/OpenDocument.header,
|
data/headers/OpenDocument.header,
|
||||||
data/headers/RTF.header,
|
data/headers/RTF.header,
|
||||||
data/headers/S5.header,
|
data/headers/S5.header,
|
||||||
-- data for ASCIIMathML writer
|
-- data for LaTeXMathML writer
|
||||||
data/ASCIIMathML.js.comment,
|
data/LaTeXMathML.js.comment,
|
||||||
data/ASCIIMathML.js.packed,
|
data/LaTeXMathML.js.packed,
|
||||||
-- data for S5 writer
|
-- data for S5 writer
|
||||||
data/ui/default/slides.js.comment,
|
data/ui/default/slides.js.comment,
|
||||||
data/ui/default/slides.js.packed,
|
data/ui/default/slides.js.packed,
|
||||||
|
@ -168,7 +168,7 @@ Library
|
||||||
Text.Pandoc.Shared,
|
Text.Pandoc.Shared,
|
||||||
Text.Pandoc.ODT,
|
Text.Pandoc.ODT,
|
||||||
Text.Pandoc.PDF,
|
Text.Pandoc.PDF,
|
||||||
Text.Pandoc.ASCIIMathML,
|
Text.Pandoc.LaTeXMathML,
|
||||||
Text.Pandoc.DefaultHeaders,
|
Text.Pandoc.DefaultHeaders,
|
||||||
Text.Pandoc.Highlighting,
|
Text.Pandoc.Highlighting,
|
||||||
Text.Pandoc.Readers.HTML,
|
Text.Pandoc.Readers.HTML,
|
||||||
|
|
|
@ -274,13 +274,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Para [TeX "\\cite[22-23]{smith.1899}"] ]
|
[ [ Para [TeX "\\cite[22-23]{smith.1899}"] ]
|
||||||
, [ Para [TeX "\\doublespacing"] ]
|
, [ Para [TeX "\\doublespacing"] ]
|
||||||
, [ Para [Math "2+2=4"] ]
|
, [ Para [Math InlineMath "2+2=4"] ]
|
||||||
, [ Para [Math "x \\in y"] ]
|
, [ Para [Math InlineMath "x \\in y"] ]
|
||||||
, [ Para [Math "\\alpha \\wedge \\omega"] ]
|
, [ Para [Math InlineMath "\\alpha \\wedge \\omega"] ]
|
||||||
, [ Para [Math "223"] ]
|
, [ Para [Math InlineMath "223"] ]
|
||||||
, [ Para [Math "p",Str "-",Str "Tree"] ]
|
, [ Para [Math InlineMath "p",Str "-",Str "Tree"] ]
|
||||||
, [ Para [Math "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
, [ Para [Math InlineMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
||||||
, [ Para [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
, [ Para [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
||||||
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Para [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
[ [ Para [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -5,5 +5,5 @@ Pandoc (Meta [Str "My",Space,Str "S5",Space,Str "Document"] ["Sam Smith","Jen Jo
|
||||||
, [ Plain [Str "second",Space,Str "bullet"] ] ]
|
, [ Plain [Str "second",Space,Str "bullet"] ] ]
|
||||||
, Header 1 [Str "Math"]
|
, Header 1 [Str "Math"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Plain [Math "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
[ [ Plain [Math InlineMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
||||||
] ]
|
] ]
|
||||||
|
|
|
@ -282,14 +282,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
|
||||||
, Header 1 [Str "LaTeX"]
|
, Header 1 [Str "LaTeX"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Plain [TeX "\\cite[22-23]{smith.1899}"] ]
|
[ [ Plain [TeX "\\cite[22-23]{smith.1899}"] ]
|
||||||
, [ Plain [TeX "\\doublespacing"] ]
|
, [ Plain [Math InlineMath "2+2=4"] ]
|
||||||
, [ Plain [Math "2+2=4"] ]
|
, [ Plain [Math InlineMath "x \\in y"] ]
|
||||||
, [ Plain [Math "x \\in y"] ]
|
, [ Plain [Math InlineMath "\\alpha \\wedge \\omega"] ]
|
||||||
, [ Plain [Math "\\alpha \\wedge \\omega"] ]
|
, [ Plain [Math InlineMath "223"] ]
|
||||||
, [ Plain [Math "223"] ]
|
, [ Plain [Math InlineMath "p",Str "-",Str "Tree"] ]
|
||||||
, [ Plain [Math "p",Str "-",Str "Tree"] ]
|
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "some",Space,Str "display",Space,Str "math:",Space,Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
||||||
, [ Plain [Math "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
||||||
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
|
||||||
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
[ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
||||||
|
|
|
@ -467,13 +467,13 @@ Ellipses...and. . .and . . . .
|
||||||
# LaTeX
|
# LaTeX
|
||||||
|
|
||||||
- \cite[22-23]{smith.1899}
|
- \cite[22-23]{smith.1899}
|
||||||
- \doublespacing
|
|
||||||
- $2+2=4$
|
- $2+2=4$
|
||||||
- $x \in y$
|
- $x \in y$
|
||||||
- $\alpha \wedge \omega$
|
- $\alpha \wedge \omega$
|
||||||
- $223$
|
- $223$
|
||||||
- $p$-Tree
|
- $p$-Tree
|
||||||
- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
|
- Here's some display math:
|
||||||
|
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
|
||||||
- Here's one that has a line break in it: $\alpha + \omega \times
|
- Here's one that has a line break in it: $\alpha + \omega \times
|
||||||
x^2$.
|
x^2$.
|
||||||
|
|
||||||
|
|
|
@ -629,8 +629,6 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
|
||||||
\startitemize
|
\startitemize
|
||||||
\item
|
\item
|
||||||
\cite[22-23]{smith.1899}
|
\cite[22-23]{smith.1899}
|
||||||
\item
|
|
||||||
\doublespacing
|
|
||||||
\item
|
\item
|
||||||
$2+2=4$
|
$2+2=4$
|
||||||
\item
|
\item
|
||||||
|
@ -642,7 +640,8 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
|
||||||
\item
|
\item
|
||||||
$p$-Tree
|
$p$-Tree
|
||||||
\item
|
\item
|
||||||
$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
|
Here's some display math:
|
||||||
|
\startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
|
||||||
\item
|
\item
|
||||||
Here's one that has a line break in it:
|
Here's one that has a line break in it:
|
||||||
$\alpha + \omega \times x^2$.
|
$\alpha + \omega \times x^2$.
|
||||||
|
|
|
@ -975,10 +975,6 @@ Blah
|
||||||
<para>
|
<para>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
2+2=4
|
2+2=4
|
||||||
|
@ -1006,6 +1002,7 @@ Blah
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
|
Here's some display math:
|
||||||
\frac{<emphasis>d</emphasis>}{<emphasis>dx</emphasis>}<emphasis>f</emphasis>(<emphasis>x</emphasis>)=\lim<subscript><emphasis>h</emphasis> → 0</subscript>\frac{<emphasis>f</emphasis>(<emphasis>x</emphasis>+<emphasis>h</emphasis>)-<emphasis>f</emphasis>(<emphasis>x</emphasis>)}{<emphasis>h</emphasis>}
|
\frac{<emphasis>d</emphasis>}{<emphasis>dx</emphasis>}<emphasis>f</emphasis>(<emphasis>x</emphasis>)=\lim<subscript><emphasis>h</emphasis> → 0</subscript>\frac{<emphasis>f</emphasis>(<emphasis>x</emphasis>+<emphasis>h</emphasis>)-<emphasis>f</emphasis>(<emphasis>x</emphasis>)}{<emphasis>h</emphasis>}
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
|
@ -717,8 +717,6 @@ Blah
|
||||||
/><h1 id="latex"
|
/><h1 id="latex"
|
||||||
>LaTeX</h1
|
>LaTeX</h1
|
||||||
><ul
|
><ul
|
||||||
><li
|
|
||||||
></li
|
|
||||||
><li
|
><li
|
||||||
></li
|
></li
|
||||||
><li
|
><li
|
||||||
|
@ -748,7 +746,7 @@ Blah
|
||||||
></span
|
></span
|
||||||
>-Tree</li
|
>-Tree</li
|
||||||
><li
|
><li
|
||||||
><span class="math"
|
>Here’s some display math: <span class="math"
|
||||||
>\frac{<em
|
>\frac{<em
|
||||||
>d</em
|
>d</em
|
||||||
>}{<em
|
>}{<em
|
||||||
|
|
|
@ -564,8 +564,6 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item
|
\item
|
||||||
\cite[22-23]{smith.1899}
|
\cite[22-23]{smith.1899}
|
||||||
\item
|
|
||||||
\doublespacing
|
|
||||||
\item
|
\item
|
||||||
$2+2=4$
|
$2+2=4$
|
||||||
\item
|
\item
|
||||||
|
@ -577,7 +575,8 @@ Ellipses\ldots{}and\ldots{}and\ldots{}.
|
||||||
\item
|
\item
|
||||||
$p$-Tree
|
$p$-Tree
|
||||||
\item
|
\item
|
||||||
$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
|
Here's some display math:
|
||||||
|
\[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
|
||||||
\item
|
\item
|
||||||
Here's one that has a line break in it:
|
Here's one that has a line break in it:
|
||||||
$\alpha + \omega \times x^2$.
|
$\alpha + \omega \times x^2$.
|
||||||
|
|
|
@ -547,7 +547,6 @@ Ellipses\&...and\&...and\&...\.
|
||||||
.SH LaTeX
|
.SH LaTeX
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
.IP \[bu] 2
|
|
||||||
\f[B]2+2=4\f[]
|
\f[B]2+2=4\f[]
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
\f[B]x\ \\in\ y\f[]
|
\f[B]x\ \\in\ y\f[]
|
||||||
|
@ -558,7 +557,10 @@ Ellipses\&...and\&...and\&...\.
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
\f[B]p\f[]-Tree
|
\f[B]p\f[]-Tree
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
|
Here's some display math:
|
||||||
|
.RS
|
||||||
\f[B]\\frac{d}{dx}f(x)=\\lim_{h\\to\ 0}\\frac{f(x+h)-f(x)}{h}\f[]
|
\f[B]\\frac{d}{dx}f(x)=\\lim_{h\\to\ 0}\\frac{f(x+h)-f(x)}{h}\f[]
|
||||||
|
.RE
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
Here's one that has a line break in it:
|
Here's one that has a line break in it:
|
||||||
\f[B]\\alpha\ +\ \\omega\ \\times\ x^2\f[]\.
|
\f[B]\\alpha\ +\ \\omega\ \\times\ x^2\f[]\.
|
||||||
|
|
|
@ -492,13 +492,13 @@ Ellipses...and...and....
|
||||||
# LaTeX
|
# LaTeX
|
||||||
|
|
||||||
- \cite[22-23]{smith.1899}
|
- \cite[22-23]{smith.1899}
|
||||||
- \doublespacing
|
|
||||||
- $2+2=4$
|
- $2+2=4$
|
||||||
- $x \in y$
|
- $x \in y$
|
||||||
- $\alpha \wedge \omega$
|
- $\alpha \wedge \omega$
|
||||||
- $223$
|
- $223$
|
||||||
- $p$-Tree
|
- $p$-Tree
|
||||||
- $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
|
- Here's some display math:
|
||||||
|
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
|
||||||
- Here's one that has a line break in it:
|
- Here's one that has a line break in it:
|
||||||
$\alpha + \omega \times x^2$.
|
$\alpha + \omega \times x^2$.
|
||||||
|
|
||||||
|
|
|
@ -422,14 +422,13 @@ Ellipses…and…and….
|
||||||
|
|
||||||
== LaTeX ==
|
== LaTeX ==
|
||||||
|
|
||||||
*
|
|
||||||
*
|
*
|
||||||
* <math>2+2=4</math>
|
* <math>2+2=4</math>
|
||||||
* <math>x \in y</math>
|
* <math>x \in y</math>
|
||||||
* <math>\alpha \wedge \omega</math>
|
* <math>\alpha \wedge \omega</math>
|
||||||
* <math>223</math>
|
* <math>223</math>
|
||||||
* <math>p</math>-Tree
|
* <math>p</math>-Tree
|
||||||
* <math>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
|
* Here’s some display math: <math>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
|
||||||
* Here’s one that has a line break in it: <math>\alpha + \omega \times x^2</math>.
|
* Here’s one that has a line break in it: <math>\alpha + \omega \times x^2</math>.
|
||||||
These shouldn’t be math:
|
These shouldn’t be math:
|
||||||
|
|
||||||
|
|
|
@ -282,14 +282,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
|
||||||
, Header 1 [Str "LaTeX"]
|
, Header 1 [Str "LaTeX"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Plain [TeX "\\cite[22-23]{smith.1899}"] ]
|
[ [ Plain [TeX "\\cite[22-23]{smith.1899}"] ]
|
||||||
, [ Plain [TeX "\\doublespacing"] ]
|
, [ Plain [Math InlineMath "2+2=4"] ]
|
||||||
, [ Plain [Math "2+2=4"] ]
|
, [ Plain [Math InlineMath "x \\in y"] ]
|
||||||
, [ Plain [Math "x \\in y"] ]
|
, [ Plain [Math InlineMath "\\alpha \\wedge \\omega"] ]
|
||||||
, [ Plain [Math "\\alpha \\wedge \\omega"] ]
|
, [ Plain [Math InlineMath "223"] ]
|
||||||
, [ Plain [Math "223"] ]
|
, [ Plain [Math InlineMath "p",Str "-",Str "Tree"] ]
|
||||||
, [ Plain [Math "p",Str "-",Str "Tree"] ]
|
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "some",Space,Str "display",Space,Str "math:",Space,Math DisplayMath "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
||||||
, [ Plain [Math "\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}"] ]
|
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math InlineMath "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
||||||
, [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,Math "\\alpha + \\omega \\times x^2",Str "."] ] ]
|
|
||||||
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
|
||||||
, BulletList
|
, BulletList
|
||||||
[ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
[ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
|
||||||
|
|
|
@ -1366,9 +1366,6 @@
|
||||||
<text:list-item>
|
<text:list-item>
|
||||||
<text:p text:style-name="P50"><text:span text:style-name="Teletype">\cite[22-23]{smith.1899}</text:span></text:p>
|
<text:p text:style-name="P50"><text:span text:style-name="Teletype">\cite[22-23]{smith.1899}</text:span></text:p>
|
||||||
</text:list-item>
|
</text:list-item>
|
||||||
<text:list-item>
|
|
||||||
<text:p text:style-name="P50"><text:span text:style-name="Teletype">\doublespacing</text:span></text:p>
|
|
||||||
</text:list-item>
|
|
||||||
<text:list-item>
|
<text:list-item>
|
||||||
<text:p text:style-name="P50">2+2=4</text:p>
|
<text:p text:style-name="P50">2+2=4</text:p>
|
||||||
</text:list-item>
|
</text:list-item>
|
||||||
|
@ -1385,7 +1382,7 @@
|
||||||
<text:p text:style-name="P50"><text:span text:style-name="T60">p</text:span>-Tree</text:p>
|
<text:p text:style-name="P50"><text:span text:style-name="T60">p</text:span>-Tree</text:p>
|
||||||
</text:list-item>
|
</text:list-item>
|
||||||
<text:list-item>
|
<text:list-item>
|
||||||
<text:p text:style-name="P50">\frac{<text:span text:style-name="T61">d</text:span>}{<text:span text:style-name="T62">dx</text:span>}<text:span text:style-name="T63">f</text:span>(<text:span text:style-name="T64">x</text:span>)=\lim<text:span text:style-name="T65">h</text:span><text:span text:style-name="T66"> → </text:span><text:span text:style-name="T67">0</text:span>\frac{<text:span text:style-name="T68">f</text:span>(<text:span text:style-name="T69">x</text:span>+<text:span text:style-name="T70">h</text:span>)-<text:span text:style-name="T71">f</text:span>(<text:span text:style-name="T72">x</text:span>)}{<text:span text:style-name="T73">h</text:span>}</text:p>
|
<text:p text:style-name="P50">Here’s some display math: \frac{<text:span text:style-name="T61">d</text:span>}{<text:span text:style-name="T62">dx</text:span>}<text:span text:style-name="T63">f</text:span>(<text:span text:style-name="T64">x</text:span>)=\lim<text:span text:style-name="T65">h</text:span><text:span text:style-name="T66"> → </text:span><text:span text:style-name="T67">0</text:span>\frac{<text:span text:style-name="T68">f</text:span>(<text:span text:style-name="T69">x</text:span>+<text:span text:style-name="T70">h</text:span>)-<text:span text:style-name="T71">f</text:span>(<text:span text:style-name="T72">x</text:span>)}{<text:span text:style-name="T73">h</text:span>}</text:p>
|
||||||
</text:list-item>
|
</text:list-item>
|
||||||
<text:list-item>
|
<text:list-item>
|
||||||
<text:p text:style-name="P50">Here’s one that has a line break in it: α+ω × <text:span text:style-name="T74">x</text:span><text:span text:style-name="T75">2</text:span>.</text:p>
|
<text:p text:style-name="P50">Here’s one that has a line break in it: α+ω × <text:span text:style-name="T74">x</text:span><text:span text:style-name="T75">2</text:span>.</text:p>
|
||||||
|
|
|
@ -621,14 +621,14 @@ LaTeX
|
||||||
=====
|
=====
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
-
|
-
|
||||||
- :math:`$2+2=4$`
|
- :math:`$2+2=4$`
|
||||||
- :math:`$x \in y$`
|
- :math:`$x \in y$`
|
||||||
- :math:`$\alpha \wedge \omega$`
|
- :math:`$\alpha \wedge \omega$`
|
||||||
- :math:`$223$`
|
- :math:`$223$`
|
||||||
- :math:`$p$`-Tree
|
- :math:`$p$`-Tree
|
||||||
- :math:`$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$`
|
- Here's some display math:
|
||||||
|
:math:`$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$`
|
||||||
- Here's one that has a line break in it:
|
- Here's one that has a line break in it:
|
||||||
:math:`$\alpha + \omega \times x^2$`.
|
:math:`$\alpha + \omega \times x^2$`.
|
||||||
|
|
||||||
|
|
|
@ -241,13 +241,12 @@ quoted link
|
||||||
{\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par}
|
{\pard \qc \f0 \sa180 \li0 \fi0 \emdash\emdash\emdash\emdash\emdash\par}
|
||||||
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 LaTeX\par}
|
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs36 LaTeX\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \par}
|
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab 2+2=4\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab 2+2=4\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\i x}\u8201?\u8712?\u8201?{\i y}\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\i x}\u8201?\u8712?\u8201?{\i y}\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \u945?\u8201?\u8743?\u8201?\u969?\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \u945?\u8201?\u8743?\u8201?\u969?\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab 223\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab 223\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\i p}-Tree\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\i p}-Tree\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab \\frac\{{\i d}\}\{{\i dx}\}{\i f}({\i x})=\\lim{\sub {\i h}\u8201?\u8594?\u8201?0}\\frac\{{\i f}({\i x}+{\i h})-{\i f}({\i x})\}\{{\i h}\}\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Here\u8217's some display math: \\frac\{{\i d}\}\{{\i dx}\}{\i f}({\i x})=\\lim{\sub {\i h}\u8201?\u8594?\u8201?0}\\frac\{{\i f}({\i x}+{\i h})-{\i f}({\i x})\}\{{\i h}\}\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Here\u8217's one that has a line break in it: \u945?+\u969?\u8201?\u215?\u8201?{\i x}{\super 2}.\sa180\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Here\u8217's one that has a line break in it: \u945?+\u969?\u8201?\u215?\u8201?{\i x}{\super 2}.\sa180\par}
|
||||||
{\pard \ql \f0 \sa180 \li0 \fi0 These shouldn\u8217't be math:\par}
|
{\pard \ql \f0 \sa180 \li0 \fi0 These shouldn\u8217't be math:\par}
|
||||||
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab To get the famous equation, write {\f1 $e = mc^2$}.\par}
|
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab To get the famous equation, write {\f1 $e = mc^2$}.\par}
|
||||||
|
|
|
@ -709,10 +709,6 @@ Ellipses@dots{}and@dots{}and@dots{}.
|
||||||
\cite[22-23]{smith.1899}
|
\cite[22-23]{smith.1899}
|
||||||
@end tex
|
@end tex
|
||||||
@item
|
@item
|
||||||
@tex
|
|
||||||
\doublespacing
|
|
||||||
@end tex
|
|
||||||
@item
|
|
||||||
@math{2+2=4}
|
@math{2+2=4}
|
||||||
@item
|
@item
|
||||||
@math{x \in y}
|
@math{x \in y}
|
||||||
|
@ -723,7 +719,7 @@ Ellipses@dots{}and@dots{}and@dots{}.
|
||||||
@item
|
@item
|
||||||
@math{p}-Tree
|
@math{p}-Tree
|
||||||
@item
|
@item
|
||||||
@math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
|
Here's some display math: @math{\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}}
|
||||||
@item
|
@item
|
||||||
Here's one that has a line break in it: @math{\alpha + \omega \times x^2}.
|
Here's one that has a line break in it: @math{\alpha + \omega \times x^2}.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
|
@ -155,7 +155,6 @@ kind.
|
||||||
|
|
||||||
[More accurate]: http://code.google.com/p/pandoc/wiki/PandocVsMarkdownPl
|
[More accurate]: http://code.google.com/p/pandoc/wiki/PandocVsMarkdownPl
|
||||||
[much faster]: http://code.google.com/p/pandoc/wiki/Benchmarks
|
[much faster]: http://code.google.com/p/pandoc/wiki/Benchmarks
|
||||||
[ASCIIMathML]: http://www1.chapman.edu/~jipsen/mathml/asciimath.html
|
|
||||||
|
|
||||||
[John MacFarlane]: http://johnmacfarlane.net/
|
[John MacFarlane]: http://johnmacfarlane.net/
|
||||||
[markdown]: http://daringfireball.net/projects/markdown/
|
[markdown]: http://daringfireball.net/projects/markdown/
|
||||||
|
|
Loading…
Add table
Reference in a new issue