Commit graph

3380 commits

Author SHA1 Message Date
John MacFarlane
f9202f5d39 LaTeX writer: create defaults for geometry using margin-left etc.
If `geometry` has no value, but `margin-left`, `margin-right`,
`margin-top`, and/or `-margin-bottom` are given, a default value
for `geometry` is created from these.

Note that these variables already affect PDF production via HTML5
with wkhtmltopdf.
2015-12-22 13:10:46 -08:00
John MacFarlane
35e0544977 LaTeX reader: allow blank space between braced arguments of commands.
For example

    \foo
    {bar}
    {baz}

Closes #2592.
2015-12-22 11:06:06 -08:00
John MacFarlane
46e38d0a0a Improved treatment of margins in wkhtmltopdf. 2015-12-21 23:47:03 -08:00
John MacFarlane
8b8bdca56a Allow setting margins from metadata variables for wkhtmltopdf.
Variables margin-top, margin-bottom, margin-left, margin-right.
Setting them with css inside @page doesn't seem to work, at least
with the released wkhtmltopdf.
2015-12-21 22:59:01 -08:00
John MacFarlane
0596b65a74 pdf via wkhtmltopdf: take title and page-size from metadata.
Adjusted default `page-size` to `letter`, to match current LaTeX
template.
2015-12-21 22:13:44 -08:00
John MacFarlane
0a768f1cc5 Added preliminary support for PDF creation via wkhtmltopdf.
To use this:

    pandoc -t html5 -o result.pdf

(and add `--mathjax` if you have math.)
2015-12-21 17:22:12 -08:00
John MacFarlane
28b2d86b21 LaTeX/Beamer template changes (Thomas Hodgson):
* Added `thanks` variable
* Use `parskip.sty` when `indent` isn't set (fall
  back to using `setlength` as before if `parskip.sty`
  isn't available).
* Use `biblio-style` with biblatex.
* Added `biblatexoptions` variable.
* Added `section-titles` variable (defaults to true)
  to enable/suppress section title pages in beamer
  slide shows.
* Moved beamer themes after fonts, so that themes can
  change fonts.  (Previously the fonts set were being
  clobbered by lmodern.sty.)
2015-12-19 18:50:45 -08:00
John MacFarlane
9333814254 Added needed import of FromJSON.
Fixes build failure.
2015-12-19 17:54:20 -08:00
John MacFarlane
770641f741 Fix language code for Czech (cs not cz)
Closes #2597.
2015-12-19 17:54:02 -08:00
John MacFarlane
4c103f67f9 Merge branch 'master' of https://github.com/AndreasLoow/pandoc into AndreasLoow-master 2015-12-19 00:07:28 -08:00
John MacFarlane
e20f433f38 Markdown reader: fixed parsing bug with macros.
Previously macro definitions in indented code blocks
were being parsed as macro definitions, not code.
2015-12-19 00:00:04 -08:00
mb21
1ead1f39ad ICML writer: intersperse line breaks
instead of appending them to every ParagraphStyleRange
closes #2501
2015-12-17 10:26:59 +01:00
mb21
f3a9bdafef ICML writer: added figure handling, closes #2590 2015-12-16 11:07:23 +01:00
John MacFarlane
9f43acb5d2 ICML writer: removed redundant import. 2015-12-13 22:18:23 -08:00
John MacFarlane
f3133a8e9e Merge pull request #2570 from mb21/rst-reader-imgattrs
Image attributes
2015-12-13 20:29:13 -08:00
John MacFarlane
a924a3f43d Fixed ICML image syntax for local files.
`file:filename` rather than `file://./filename`.

I think this is right; it matches what we had before
with people actually using the ICML writer, and seems
to match examples in the spec.  I don't
have a copy of InDesign I can test on, though.
@DigitalPublishingToolkit and @mb21, can you have
a look?
2015-12-13 20:19:34 -08:00
John MacFarlane
90b8024fac Use posix path separators in ICML link URIs.
Closes #2589.
2015-12-13 17:40:24 -08:00
mb21
df68f25459 ODT/OpenDocument writer: improved image attributes
- support for percentage widths/heights
- use Attr instead of title to get dimensions from ODT walker to writeOpenDocument
2015-12-13 21:40:13 +01:00
mb21
37931cb0c5 Docx reader: image attributes 2015-12-13 21:40:13 +01:00
mb21
2060f5fe83 new function to extract multiple properties at once in CSS.hs
and use it in Textile reader
2015-12-13 21:40:12 +01:00
mb21
30644b291b RST reader: image attributes 2015-12-13 21:40:12 +01:00
John MacFarlane
e4b3da6929 AsciiDoc writer: support anchors in spans with id elements. 2015-12-13 09:02:37 -08:00
John MacFarlane
3e079a25bc AsciiDoc writers: Add anchors on Div elements.
This partially addresses jgm/pandoc-citeproc#143.

It does not use the native asciidoc syntax for citations,
but it does get the links to individual citations working.
2015-12-13 08:56:22 -08:00
John MacFarlane
44120ea716 Implemented east_asian_line_breaks extension.
Text.Pandoc.Options: Added `Ext_east_asian_line_breaks` constructor to
`Extension` (API change).

This extension is like `ignore_line_breaks`, but smarter -- it
only ignores line breaks between two East Asian wide characters.
This makes it better suited for writing with a mix of East Asian
and non-East Asian scripts.

Closes #2586.
2015-12-12 17:28:52 -08:00
John MacFarlane
af7e782436 Modified readers to emit SoftBreak when appropriate. 2015-12-12 09:31:51 -08:00
John MacFarlane
47cc5ad6e0 Restore no wrapping of XML in Docx, ODT.
It's possible that wrapping causes problems; safer to
turn it off.
2015-12-12 00:28:47 -08:00
John MacFarlane
28a2f4c2a4 Fixed cite key parsing regression.
We were capturing final colons as in [@foo: bar];
the citation id was being parsed as "@foo:".

Closes jgm/pandoc-citeproc#201.
2015-12-12 00:27:08 -08:00
John MacFarlane
1b0e0998fa FB2 writer: support SoftBreak.
This was omitted earlier.
2015-12-12 00:13:58 -08:00
John MacFarlane
536b6bf538 Implemented SoftBreak and new --wrap option.
Added threefold wrapping option.

* Command line option: deprecated `--no-wrap`, added
  `--wrap=[auto|none|preserve]`
* Added WrapOption, exported from Text.Pandoc.Options
* Changed type of writerWrapText in WriterOptions from
  Bool to WrapOption.
* Modified Text.Pandoc.Shared functions for SoftBreak.
* Supported SoftBreak in writers.
* Updated tests.
* Updated README.

Closes #1701.
2015-12-11 23:55:08 -08:00
John MacFarlane
63d875c6cb Markdown reader: parse soft break as SoftBreak. 2015-12-11 15:33:53 -08:00
John MacFarlane
09958d7f95 Fixed Emoji character definitions.
There were many bugs in the definitions.

Closes #2523.
2015-12-04 09:38:58 -08:00
John MacFarlane
dd8df6cfbc Markdown reader: Improved pipe table relative widths.
Previously pipe table columns got relative widths (based
on the header underscore lines) when the source of one of the rows was
greater in width than the column width.  This gave bad results in some
cases where much of the width of the row was due to nonprinting
material (e.g. link URLs).  Now pandoc only looks at printable
width (the width of a plain string version of the source), which
should give better results.

Thanks to John Muccigrosso for bringing up the issue.
2015-12-03 11:02:45 -08:00
Raniere Silva
13f74d018b Add support to GAP 2015-12-03 08:23:26 -02:00
mb21
d901a3da03 Textile Reader: image attributes
closes #2515
2015-12-03 00:06:18 +01:00
mb21
1f379da94b Parse CSS that doesn't contain the optional semicolon 2015-12-02 23:56:44 +01:00
John MacFarlane
622f09617e Docx writer: better handling of PDF images.
Previously we tried to get the image size from the image even
if an explicit size was specified.  Since we still can't get
image size for PDFs, this made it impossible to use PDF images
in docx.

Now we don't try to get the image size when a size is already
explicitly specified.
2015-12-01 00:23:03 -08:00
John MacFarlane
6d91fb2563 Markdown writer: use raw HTML for link/image attributes when
the `link_attributes` extension is unset and `raw_html` is set.

Closes #2554.
2015-11-24 23:28:52 -08:00
John MacFarlane
33d328f1cf Allow pipe tables with no body rows.
Previously this raised a runtime error.

Closes #2556.
2015-11-24 20:23:06 -08:00
John MacFarlane
c73ae81628 LaTeX reader: Improved smart quote parsing.
This fixes redering of unmatched quotes.
Closes #2555.
2015-11-24 17:20:15 -08:00
John MacFarlane
ce5583460c Improved fetchItem so that C:/Blah/Blah.jpg isn't treated as URL.
The Haskell URI parsing routines will accept "C:" as a scheme,
so we rule that out manually.

This helps with `--self-contained` and absolute Windows paths.
See
http://stackoverflow.com/questions/33899126/rchart-in-markdown-doesnt-render-due-to-invalidurlexception-from-pandoc
2015-11-24 11:05:31 -08:00
John MacFarlane
2eb5d2dc42 LaTeX reader: Use curly quotes for unmatched `.
Partially addresses #2555.

Note that there's still a problem with the code sample given.
2015-11-23 23:44:39 -08:00
John MacFarlane
2633dc2f5e Beamer writer: mark frame as fragile when it contains verbatim.
Closes #1613.
2015-11-23 23:07:56 -08:00
John MacFarlane
b20ecbedc4 AsciiDoc writer: Fixed code blocks.
Closes #1861.
2015-11-23 21:29:21 -08:00
John MacFarlane
4361dc0245 Define a meta-json variable for all writers.
This contains a JSON version of all the metadata, in the
format selected for the writer.

So, for example, to get just the YAML metadata, you can
run pandoc with the following custom template:

    $meta-json$

Closes #2019.  The intent is to make it easier for static
site generators and other tools to get at the metadata.
2015-11-23 20:40:27 -08:00
Jesse Rosenthal
07b8a456b1 Docx Reader: Remove DummyListItem type
Change 5527465c introduced a `DummyListItem` type in Docx/Parse.hs. In
retrospect, this seems like it mixes parsing and iterpretation
excessively. What's *really* going on is that we have a list item
without and associate level or numeric info. We can decide what to do
what that in Docx.hs (treat it like a list paragraph), but the parser
shouldn't make that decision.

This commit makes what is going on a bit more explicit. `LevelInfo` is
now a Maybe value in the `ListItem` type. If it's a Nothing, we treat
it as a ListParagraph. If it's a Just, it's a normal list item.
2015-11-23 11:50:49 -05:00
John MacFarlane
a008e57ddf hlint fixes 2015-11-22 07:43:48 -08:00
John MacFarlane
f7e37141e5 hlint fixes 2015-11-22 07:42:11 -08:00
John MacFarlane
bbb3d8d442 hlint changes 2015-11-22 07:40:26 -08:00
John MacFarlane
a7f6241f50 hlint fixes. 2015-11-22 07:38:51 -08:00
John MacFarlane
4b293a6a54 hlint fixes. 2015-11-22 07:37:51 -08:00