From 526762bf222dbab199f6ff90c925fe18535c698f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 22 Nov 2013 19:51:07 -0800 Subject: ConTeXt writer: Use setupcaption to separate style from content. Instead of adding 'nunumber' every time we place a figure... Closes #1067. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index 4bdebc73b..8cadd4f20 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 4bdebc73b0b2025cf01704e7e564088c34d8f86c +Subproject commit 8cadd4f2044c0c25842eeb5a2370a6e3384f4bd4 -- cgit v1.2.3 From bb0f299165de22e119675aa6ceed0192a80c78e8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 30 Nov 2013 16:16:35 -0800 Subject: ConTeXt writer: Don't hardcode figure/table placement. Instead, let this be set in the template, using `\setupfloat`. Thanks to Aditya Mahajan for the suggestion. --- data/templates | 2 +- src/Text/Pandoc/Writers/ConTeXt.hs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'data') diff --git a/data/templates b/data/templates index 8cadd4f20..713a8f63d 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 8cadd4f2044c0c25842eeb5a2370a6e3384f4bd4 +Subproject commit 713a8f63d5589ab9313869e47b03cf7f49e00e98 diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index 179d9bc5b..3095cf508 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -130,7 +130,7 @@ blockToConTeXt (Plain lst) = inlineListToConTeXt lst -- title beginning with fig: indicates that the image is a figure blockToConTeXt (Para [Image txt (src,'f':'i':'g':':':_)]) = do capt <- inlineListToConTeXt txt - return $ blankline $$ "\\placefigure[here]" <> braces capt <> + return $ blankline $$ "\\placefigure" <> braces capt <> braces ("\\externalfigure" <> brackets (text src)) <> blankline blockToConTeXt (Para lst) = do contents <- inlineListToConTeXt lst @@ -205,9 +205,9 @@ blockToConTeXt (Table caption aligns widths heads rows) = do else liftM ($$ "\\HL") $ tableRowToConTeXt heads captionText <- inlineListToConTeXt caption rows' <- mapM tableRowToConTeXt rows - return $ "\\placetable" <> brackets ("here" <> if null caption - then ",none" - else "") + return $ "\\placetable" <> (if null caption + then brackets "none" + else empty) <> braces captionText $$ "\\starttable" <> brackets (text colDescriptors) $$ "\\HL" $$ headers $$ -- cgit v1.2.3 From fdaeec0c48d742489ddf0ec0c0261ca9c53f989b Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Mon, 2 Dec 2013 09:55:58 +0000 Subject: Add booktabs package for LaTeX tables [ci skip] --- README | 2 +- data/templates | 2 +- src/Text/Pandoc/Writers/LaTeX.hs | 10 ++--- tests/tables.latex | 90 ++++++++++++++++++++-------------------- 4 files changed, 52 insertions(+), 52 deletions(-) (limited to 'data') diff --git a/README b/README index 2a5ecc6ad..3ba1e364e 100644 --- a/README +++ b/README @@ -108,7 +108,7 @@ to PDF: Production of a PDF requires that a LaTeX engine be installed (see `--latex-engine`, below), and assumes that the following LaTeX packages are available: `amssymb`, `amsmath`, `ifxetex`, `ifluatex`, `listings` (if the -`--listings` option is used), `fancyvrb`, `longtable`, `url`, +`--listings` option is used), `fancyvrb`, `longtable`, `booktabs`, `url`, `graphicx`, `hyperref`, `ulem`, `babel` (if the `lang` variable is set), `fontspec` (if `xelatex` or `lualatex` is used as the LaTeX engine), `xltxtra` and `xunicode` (if `xelatex` is used). diff --git a/data/templates b/data/templates index 713a8f63d..f643a076d 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 713a8f63d5589ab9313869e47b03cf7f49e00e98 +Subproject commit f643a076d8c2b0b21391fd6aa1dedb2dd84c7e63 diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f3cbcf19f..a2e0b016f 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -453,12 +453,12 @@ blockToLaTeX (Header level (id',classes,_) lst) = blockToLaTeX (Table caption aligns widths heads rows) = do headers <- if all null heads then return empty - else ($$ "\\hline\\noalign{\\medskip}") `fmap` + else ($$ "\\midrule\\endhead") `fmap` (tableRowToLaTeX True aligns widths) heads captionText <- inlineListToLaTeX caption let capt = if isEmpty captionText then empty - else text "\\noalign{\\medskip}" + else text "\\addlinespace" $$ text "\\caption" <> braces captionText rows' <- mapM (tableRowToLaTeX False aligns widths) rows let colDescriptors = text $ concat $ map toColDescriptor aligns @@ -466,10 +466,10 @@ blockToLaTeX (Table caption aligns widths heads rows) = do return $ "\\begin{longtable}[c]" <> braces ("@{}" <> colDescriptors <> "@{}") -- the @{} removes extra space at beginning and end - $$ "\\hline\\noalign{\\medskip}" + $$ "\\toprule\\addlinespace" $$ headers $$ vcat rows' - $$ "\\hline" + $$ "\\bottomrule" $$ capt $$ "\\end{longtable}" @@ -506,7 +506,7 @@ tableRowToLaTeX header aligns widths cols = do (w * scaleFactor))) <> (halign a <> cr <> c <> cr) <> "\\end{minipage}" let cells = zipWith3 toCell widths aligns renderedCells - return $ hsep (intersperse "&" cells) $$ "\\\\\\noalign{\\medskip}" + return $ hsep (intersperse "&" cells) $$ "\\\\\\addlinespace" listItemToLaTeX :: [Block] -> State WriterState Doc listItemToLaTeX lst = blockListToLaTeX lst >>= return . (text "\\item" $$) . diff --git a/tests/tables.latex b/tests/tables.latex index c27e10461..1a87c4f71 100644 --- a/tests/tables.latex +++ b/tests/tables.latex @@ -1,59 +1,59 @@ Simple table with caption: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Demonstration of simple table syntax.} \end{longtable} Simple table without caption: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Simple table indented two spaces: \begin{longtable}[c]{@{}rlcl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace Right & Left & Center & Default -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Demonstration of simple table syntax.} \end{longtable} Multiline table with caption: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[b]{0.13\columnwidth}\centering Centered Header \end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright @@ -63,8 +63,8 @@ Right Aligned \end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned \end{minipage} -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -74,7 +74,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -84,16 +84,16 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline -\noalign{\medskip} +\\\addlinespace +\bottomrule +\addlinespace \caption{Here's the caption. It may span multiple lines.} \end{longtable} Multiline table without caption: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[b]{0.13\columnwidth}\centering Centered Header \end{minipage} & \begin{minipage}[b]{0.12\columnwidth}\raggedright @@ -103,8 +103,8 @@ Right Aligned \end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright Default aligned \end{minipage} -\\\noalign{\medskip} -\hline\noalign{\medskip} +\\\addlinespace +\midrule\endhead \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -114,7 +114,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -124,27 +124,27 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Table without column headers: \begin{longtable}[c]{@{}rlcr@{}} -\hline\noalign{\medskip} +\toprule\addlinespace 12 & 12 & 12 & 12 -\\\noalign{\medskip} +\\\addlinespace 123 & 123 & 123 & 123 -\\\noalign{\medskip} +\\\addlinespace 1 & 1 & 1 & 1 -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} Multiline table without column headers: \begin{longtable}[c]{@{}clrl@{}} -\hline\noalign{\medskip} +\toprule\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering First \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -154,7 +154,7 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Example of a row that spans multiple lines. \end{minipage} -\\\noalign{\medskip} +\\\addlinespace \begin{minipage}[t]{0.13\columnwidth}\centering Second \end{minipage} & \begin{minipage}[t]{0.12\columnwidth}\raggedright @@ -164,6 +164,6 @@ row \end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright Here's another one. Note the blank line between rows. \end{minipage} -\\\noalign{\medskip} -\hline +\\\addlinespace +\bottomrule \end{longtable} -- cgit v1.2.3 From eebb15ba1d135169495641748bbe83cb6899441b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 3 Dec 2013 20:56:11 -0800 Subject: Use latest pandoc-templates. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index f643a076d..93d667c0b 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit f643a076d8c2b0b21391fd6aa1dedb2dd84c7e63 +Subproject commit 93d667c0be8f7ad48f85e1144de922cd48a7d757 -- cgit v1.2.3 From 571480eb4a864bcca250a210a3c137633f32c93e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 9 Dec 2013 19:45:51 -0800 Subject: Updated beamer template for booktabs. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index 93d667c0b..e3c8bae0b 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit 93d667c0be8f7ad48f85e1144de922cd48a7d757 +Subproject commit e3c8bae0b1fb8995c784a457fde73b486f9b6fda -- cgit v1.2.3 From 225bd8d599dc745b3e211fd15e7b8415fa35e3af Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Dec 2013 22:05:59 -0800 Subject: default latex template: added abstract variable. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index e3c8bae0b..dd178889f 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit e3c8bae0b1fb8995c784a457fde73b486f9b6fda +Subproject commit dd178889f642f47fc74aaeeb1d8368f32a7cc258 -- cgit v1.2.3 From 46b37b4ddcd83fbb813b55fb3b253b0fed1f69e3 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 11 Dec 2013 22:35:33 -0800 Subject: latex template: Put header-includes after title. Closes #908. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index dd178889f..dd1d63742 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit dd178889f642f47fc74aaeeb1d8368f32a7cc258 +Subproject commit dd1d6374208359e2e2b4e2da2aafced917a172c9 -- cgit v1.2.3 From b2aae73f14cbcb57b72886565e8bbef9a477b5d5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Dec 2013 11:19:49 -0800 Subject: Added Cite function to sample.lua. --- data/sample.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'data') diff --git a/data/sample.lua b/data/sample.lua index a7e9d6337..a0c3c29a2 100644 --- a/data/sample.lua +++ b/data/sample.lua @@ -181,6 +181,10 @@ function Span(s, attr) return "" .. s .. "" end +function Cite(s) + return "" .. s .. "" +end + function Plain(s) return s end -- cgit v1.2.3 From 3b79246c85417f0936607422c5baf8d0a7544454 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Dec 2013 21:42:53 -0800 Subject: Allow use of `\includegraphics[size]` in beamer. This just required porting a macro definition from the default latex template to the default beamer template. --- data/templates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data') diff --git a/data/templates b/data/templates index dd1d63742..50ca8c85d 160000 --- a/data/templates +++ b/data/templates @@ -1 +1 @@ -Subproject commit dd1d6374208359e2e2b4e2da2aafced917a172c9 +Subproject commit 50ca8c85d9abfb7918cb78015bcc6d6fec02ce75 -- cgit v1.2.3 From 073b3576d03fb62469ec15dd1fa42d0e33dca6bf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 27 Dec 2013 13:53:43 -0800 Subject: reference.docx: Include 'FootnoteText' style. Otherwise Word ignores the style, even when specified in the pPr element. I believe this should help with issue #901. You should now get 'FootnoteText' as the style of the footnote. You'll have to adjust the style yourself; it's currently just the same as Normal. --- data/reference.docx | Bin 9782 -> 9797 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'data') diff --git a/data/reference.docx b/data/reference.docx index 42c14a906..a9c268b9f 100644 Binary files a/data/reference.docx and b/data/reference.docx differ -- cgit v1.2.3 From bb0f94246381ec5d7a4ded4aed526d786a66d743 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 2 Jan 2014 12:54:33 -0800 Subject: reference.odt: Tidied styles.xml. --- data/reference.odt | Bin 10595 -> 10890 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'data') diff --git a/data/reference.odt b/data/reference.odt index 08385dd4c..c01345612 100644 Binary files a/data/reference.odt and b/data/reference.odt differ -- cgit v1.2.3