aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-04-21 21:38:19 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-04-21 21:38:19 +0000
commit7742301c0921048afb97ba3ea5b55ecaf997298a (patch)
tree7381746f4da797270832e365cba10e5243c74c10
parentffd7248af80280fb05c57e86cb2349a9060f3c81 (diff)
downloadpandoc-7742301c0921048afb97ba3ea5b55ecaf997298a.tar.gz
Support for definition lists in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@586 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 8a9cacba3..1cf9fe116 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -110,6 +110,12 @@ blockToLaTeX (BulletList lst) = "\\begin{itemize}\n" ++
(concatMap listItemToLaTeX lst) ++ "\\end{itemize}\n"
blockToLaTeX (OrderedList lst) = "\\begin{enumerate}\n" ++
(concatMap listItemToLaTeX lst) ++ "\\end{enumerate}\n"
+blockToLaTeX (DefinitionList lst) =
+ let defListItemToLaTeX (term, def) = "\\item[" ++
+ substitute "]" "\\]" (inlineListToLaTeX term) ++ "] " ++
+ concatMap blockToLaTeX def
+ in "\\begin{description}\n" ++ concatMap defListItemToLaTeX lst ++
+ "\\end{description}\n"
blockToLaTeX HorizontalRule =
"\\begin{center}\\rule{3in}{0.4pt}\\end{center}\n\n"
blockToLaTeX (Header level lst) =
@@ -140,7 +146,6 @@ blockToLaTeX (Table caption aligns widths heads rows) =
then centered tableBody ++ "\n"
else "\\begin{table}[h]\n" ++ centered tableBody ++ "\\caption{" ++
captionText ++ "}\n" ++ "\\end{table}\n\n"
-
printDecimal :: Float -> String
printDecimal = printf "%.2f"