mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-27 18:56:34 +00:00
More work on smallcaps support.
+ Added to refsMatch in Shared. + Supported all writers to the extent possible. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1328 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
@@ -103,8 +103,8 @@ data Inline
|
||||
| Strikeout [Inline] -- ^ Strikeout text (list of inlines)
|
||||
| Superscript [Inline] -- ^ Superscripted text (list of inlines)
|
||||
| Subscript [Inline] -- ^ Subscripted text (list of inlines)
|
||||
| Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
|
||||
| SmallCaps [Inline] -- ^ Small caps text (list of inlines)
|
||||
| Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
|
||||
| Code String -- ^ Inline code (literal)
|
||||
| Space -- ^ Inter-word space
|
||||
| EmDash -- ^ Em dash
|
||||
|
||||
@@ -690,6 +690,8 @@ refsMatch ((Superscript x):restx) ((Superscript y):resty) =
|
||||
refsMatch x y && refsMatch restx resty
|
||||
refsMatch ((Subscript x):restx) ((Subscript y):resty) =
|
||||
refsMatch x y && refsMatch restx resty
|
||||
refsMatch ((SmallCaps x):restx) ((SmallCaps y):resty) =
|
||||
refsMatch x y && refsMatch restx resty
|
||||
refsMatch ((Quoted t x):restx) ((Quoted u y):resty) =
|
||||
t == u && refsMatch x y && refsMatch restx resty
|
||||
refsMatch ((Code x):restx) ((Code y):resty) =
|
||||
|
||||
@@ -256,6 +256,9 @@ inlineToConTeXt (Superscript lst) = do
|
||||
inlineToConTeXt (Subscript lst) = do
|
||||
contents <- inlineListToConTeXt lst
|
||||
return $ text "\\low{" <> contents <> char '}'
|
||||
inlineToConTeXt (SmallCaps lst) = do
|
||||
contents <- inlineListToConTeXt lst
|
||||
return $ text "{\\sc " <> contents <> char '}'
|
||||
inlineToConTeXt (Code str) = return $ text $ "\\type{" ++ str ++ "}"
|
||||
inlineToConTeXt (Quoted SingleQuote lst) = do
|
||||
contents <- inlineListToConTeXt lst
|
||||
@@ -263,7 +266,6 @@ inlineToConTeXt (Quoted SingleQuote lst) = do
|
||||
inlineToConTeXt (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToConTeXt lst
|
||||
return $ text "\\quotation{" <> contents <> char '}'
|
||||
inlineToConTeXt (SmallCaps lst) = inlineListToConTeXt lst
|
||||
inlineToConTeXt Apostrophe = return $ char '\''
|
||||
inlineToConTeXt EmDash = return $ text "---"
|
||||
inlineToConTeXt EnDash = return $ text "--"
|
||||
|
||||
@@ -223,9 +223,11 @@ inlineToDocbook opts (Superscript lst) =
|
||||
inTagsSimple "superscript" $ inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (Subscript lst) =
|
||||
inTagsSimple "subscript" $ inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (SmallCaps lst) =
|
||||
inTags False "emphasis" [("role", "smallcaps")] $
|
||||
inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (Quoted _ lst) =
|
||||
inTagsSimple "quote" $ inlinesToDocbook opts lst
|
||||
inlineToDocbook opts (SmallCaps lst) = inlinesToDocbook opts lst
|
||||
inlineToDocbook _ Apostrophe = char '\''
|
||||
inlineToDocbook _ Ellipses = text "…"
|
||||
inlineToDocbook _ EmDash = text "—"
|
||||
|
||||
@@ -265,6 +265,8 @@ inlineToLaTeX (Subscript lst) = do
|
||||
-- so we have to define it (using a different name so as not to conflict with memoir class):
|
||||
addToHeader "\\newcommand{\\textsubscr}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}}"
|
||||
return $ inCmd "textsubscr" contents
|
||||
inlineToLaTeX (SmallCaps lst) =
|
||||
inlineListToLaTeX (deVerb lst) >>= return . inCmd "textsc"
|
||||
inlineToLaTeX (Code str) = do
|
||||
st <- get
|
||||
if stInNote st
|
||||
@@ -290,7 +292,6 @@ inlineToLaTeX (Quoted DoubleQuote lst) = do
|
||||
then text "\\,"
|
||||
else empty
|
||||
return $ text "``" <> s1 <> contents <> s2 <> text "''"
|
||||
inlineToLaTeX (SmallCaps lst) = inlineListToLaTeX lst
|
||||
inlineToLaTeX Apostrophe = return $ char '\''
|
||||
inlineToLaTeX EmDash = return $ text "---"
|
||||
inlineToLaTeX EnDash = return $ text "--"
|
||||
|
||||
@@ -256,13 +256,13 @@ inlineToMan opts (Superscript lst) = do
|
||||
inlineToMan opts (Subscript lst) = do
|
||||
contents <- inlineListToMan opts lst
|
||||
return $ char '~' <> contents <> char '~'
|
||||
inlineToMan opts (SmallCaps lst) = inlineListToMan opts lst -- not supported
|
||||
inlineToMan opts (Quoted SingleQuote lst) = do
|
||||
contents <- inlineListToMan opts lst
|
||||
return $ char '`' <> contents <> char '\''
|
||||
inlineToMan opts (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToMan opts lst
|
||||
return $ text "\\[lq]" <> contents <> text "\\[rq]"
|
||||
inlineToMan opts (SmallCaps lst) = inlineListToMan opts lst
|
||||
inlineToMan _ EmDash = return $ text "\\[em]"
|
||||
inlineToMan _ EnDash = return $ text "\\[en]"
|
||||
inlineToMan _ Apostrophe = return $ char '\''
|
||||
|
||||
@@ -317,13 +317,13 @@ inlineToMarkdown opts (Subscript lst) = do
|
||||
contents <- inlineListToMarkdown opts lst
|
||||
let contents' = text $ substitute " " "\\ " $ render contents
|
||||
return $ char '~' <> contents' <> char '~'
|
||||
inlineToMarkdown opts (SmallCaps lst) = inlineListToMarkdown opts lst
|
||||
inlineToMarkdown opts (Quoted SingleQuote lst) = do
|
||||
contents <- inlineListToMarkdown opts lst
|
||||
return $ char '\'' <> contents <> char '\''
|
||||
inlineToMarkdown opts (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToMarkdown opts lst
|
||||
return $ char '"' <> contents <> char '"'
|
||||
inlineToMarkdown opts (SmallCaps lst) = inlineListToMarkdown opts lst
|
||||
inlineToMarkdown _ EmDash = return $ text "--"
|
||||
inlineToMarkdown _ EnDash = return $ char '-'
|
||||
inlineToMarkdown _ Apostrophe = return $ char '\''
|
||||
|
||||
@@ -276,13 +276,13 @@ inlineToRST (Superscript lst) = do
|
||||
inlineToRST (Subscript lst) = do
|
||||
contents <- inlineListToRST lst
|
||||
return $ text "\\ :sub:`" <> contents <> text "`\\ "
|
||||
inlineToRST (SmallCaps lst) = inlineListToRST lst
|
||||
inlineToRST (Quoted SingleQuote lst) = do
|
||||
contents <- inlineListToRST lst
|
||||
return $ char '\'' <> contents <> char '\''
|
||||
inlineToRST (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToRST lst
|
||||
return $ char '"' <> contents <> char '"'
|
||||
inlineToRST (SmallCaps lst) = inlineListToRST lst
|
||||
inlineToRST EmDash = return $ text "--"
|
||||
inlineToRST EnDash = return $ char '-'
|
||||
inlineToRST Apostrophe = return $ char '\''
|
||||
|
||||
@@ -264,11 +264,11 @@ inlineToRTF (Strong lst) = "{\\b " ++ (inlineListToRTF lst) ++ "}"
|
||||
inlineToRTF (Strikeout lst) = "{\\strike " ++ (inlineListToRTF lst) ++ "}"
|
||||
inlineToRTF (Superscript lst) = "{\\super " ++ (inlineListToRTF lst) ++ "}"
|
||||
inlineToRTF (Subscript lst) = "{\\sub " ++ (inlineListToRTF lst) ++ "}"
|
||||
inlineToRTF (SmallCaps lst) = "{\\scaps " ++ (inlineListToRTF lst) ++ "}"
|
||||
inlineToRTF (Quoted SingleQuote lst) =
|
||||
"\\u8216'" ++ (inlineListToRTF lst) ++ "\\u8217'"
|
||||
inlineToRTF (Quoted DoubleQuote lst) =
|
||||
"\\u8220\"" ++ (inlineListToRTF lst) ++ "\\u8221\""
|
||||
inlineToRTF (SmallCaps lst) = inlineListToRTF lst
|
||||
inlineToRTF Apostrophe = "\\u8217'"
|
||||
inlineToRTF Ellipses = "\\u8230?"
|
||||
inlineToRTF EmDash = "\\u8212-"
|
||||
|
||||
@@ -354,9 +354,9 @@ inlineForNode (Strong lst) = inlineListForNode lst
|
||||
inlineForNode (Strikeout lst) = inlineListForNode lst
|
||||
inlineForNode (Superscript lst) = inlineListForNode lst
|
||||
inlineForNode (Subscript lst) = inlineListForNode lst
|
||||
inlineForNode (SmallCaps lst) = inlineListForNode lst
|
||||
inlineForNode (Quoted _ lst) = inlineListForNode lst
|
||||
inlineForNode (Code str) = inlineForNode (Str str)
|
||||
inlineForNode (SmallCaps lst) = inlineListForNode lst
|
||||
inlineForNode Space = return $ char ' '
|
||||
inlineForNode EmDash = return $ text "---"
|
||||
inlineForNode EnDash = return $ text "--"
|
||||
@@ -415,6 +415,9 @@ inlineToTexinfo (Subscript lst) = do
|
||||
contents <- inlineListToTexinfo lst
|
||||
return $ text "@textsubscript{" <> contents <> char '}'
|
||||
|
||||
inlineToTexinfo (SmallCaps lst) =
|
||||
inlineListToTexinfo lst >>= return . inCmd "sc"
|
||||
|
||||
inlineToTexinfo (Code str) = do
|
||||
return $ text $ "@code{" ++ stringToTexinfo str ++ "}"
|
||||
|
||||
@@ -426,7 +429,6 @@ inlineToTexinfo (Quoted DoubleQuote lst) = do
|
||||
contents <- inlineListToTexinfo lst
|
||||
return $ text "``" <> contents <> text "''"
|
||||
|
||||
inlineToTexinfo (SmallCaps lst) = inlineListToTexinfo lst
|
||||
inlineToTexinfo Apostrophe = return $ char '\''
|
||||
inlineToTexinfo EmDash = return $ text "---"
|
||||
inlineToTexinfo EnDash = return $ text "--"
|
||||
|
||||
Reference in New Issue
Block a user