Commit graph

3149 commits

Author SHA1 Message Date
John MacFarlane
f519f0a1ad PDF: Export TeXProgram type. 2012-01-20 19:13:47 -08:00
John MacFarlane
c9c78344b1 PDF: Removed TeXError type, just return a bytestring. 2012-01-20 19:11:35 -08:00
John MacFarlane
50e16e6855 Fixed -Wall errors in PDF module. 2012-01-20 19:04:08 -08:00
John MacFarlane
9d1118ac1f Added Text.Pandoc.PDF - converts latex to PDF. 2012-01-20 18:57:16 -08:00
John MacFarlane
6c75843422 Docx: Put display math on separate line. 2012-01-20 14:05:14 -08:00
John MacFarlane
e3fd1cd108 Docx writer: Fixed styles in footnotes.
Previously a footnote in a list item would be a list item, etc.!
2012-01-20 13:32:56 -08:00
John MacFarlane
fbbff22f06 Docx: Adjusted list spacing for less cramped number markers. 2012-01-20 13:17:40 -08:00
John MacFarlane
525881ee52 Docx writer: Start bullet lists with solid bullet. 2012-01-20 13:07:14 -08:00
John MacFarlane
2a84e748a9 Docx writer: Don't indent first level of lists. 2012-01-20 13:03:47 -08:00
John MacFarlane
1a8594f907 Docx writer: Fixed bug with numbered lists.
Numbered lists were being numbered continuously, instead
of having new lists start again with 1.
2012-01-20 13:00:28 -08:00
John MacFarlane
dafd2e555f Templates: Removed vestigial remnant of openxml template.
Closes #381 (I think).
2012-01-19 23:45:39 -08:00
John MacFarlane
75a2b2fda1 Documented docx reader in README. 2012-01-19 23:26:45 -08:00
John MacFarlane
12c96fe499 Minor comment fixes. 2012-01-19 23:20:32 -08:00
John MacFarlane
325228cbfe Check for existence before opening image file.
Print warning if file doesn't exist.
2012-01-19 23:19:28 -08:00
John MacFarlane
ba81cda7f1 Added Docx writer.
* New module `Text.Pandoc.Docx`.
* New output format `docx`.
* Added reference.docx.
* New option `--reference-docx`.

The writer includes support for highlighted code blocks
and math (which is converted from TeX to OMML using
texmath's new OMML module).
2012-01-19 12:10:49 -08:00
John MacFarlane
9ce3e2bf85 ImageSize: Fixed implementation of sizeInPoints. 2012-01-15 16:01:46 -08:00
John MacFarlane
b4e2d69cda Fixed whitespace bug in comments. 2012-01-15 15:43:52 -08:00
John MacFarlane
691b7bdc66 ImageSize: extract dpi information from PNG and JPEG.
* ImageSize record now includes dpiX, dpiY, pxX, pxY.
* New functions sizeInPixels and sizeInPoints.
2012-01-15 15:40:26 -08:00
John MacFarlane
28a043fe44 ODT writer now sizes images appropriately.
OpenDocument writer:  a title like "123x467" is interpreted
as size in *points*.

ODT writer:  while adding images to the archive, computes their
sizes and inserts a title attribute with the size before
calling opendocument writer.

Size is computed as follows:

size in points = size in pixels * 96 / 72
2012-01-14 12:38:14 -08:00
John MacFarlane
0d1740ea08 Export ImageType(..) from ImageSize. 2012-01-14 11:46:41 -08:00
John MacFarlane
51365b3b36 Added Text.Pandoc.ImageSize.
This is intened for use in docx and odt writers, so the size
of image boxes can be calculated.
2012-01-14 11:42:35 -08:00
John MacFarlane
0299ae6c29 OpenDocument writer: treat image title of form "dddxddd" as size in px.
Later we'll modify the ODT writer to insert such titles, so image
sizes will be correct in the ODT.
2012-01-14 11:39:20 -08:00
John MacFarlane
d0582b912b SelfContained: Use getMimeType from Text.Pandoc.MIME. 2012-01-14 10:27:29 -08:00
John MacFarlane
09fe08b452 Added 'layout-cache' to getMimeType.
This ensures that the META-INF/manifest.xml for ODT files will
have everything it needs.  Fixes a bug using modified ODT
files as `--reference-odt`.
2012-01-14 10:18:37 -08:00
John MacFarlane
ceb8357b41 EPUB writer: Allow raw HTML. 2012-01-13 23:54:37 -08:00
John MacFarlane
83bb1de3f5 Improved citation tests. 2012-01-13 00:02:38 -08:00
John MacFarlane
a3988d89c8 Added "title" to list of docbook block-level tags. 2012-01-12 21:13:52 -08:00
John MacFarlane
4daf471920 Split html template into html, html5 templates. 2012-01-11 12:53:43 -08:00
John MacFarlane
63918a03b9 HTML writer: Don't use self-closing img, br, hr tags. 2012-01-11 12:25:49 -08:00
John MacFarlane
5b49c47414 Markdown reader: fixed bug in table/hrule parsing.
Top line of table must not be followed by a blank line.
This bug caused slowdown on some files with hrules and tables,
and pandoc tried to interpret the hrules as the tops of
multiline tables.
2012-01-10 12:45:19 -08:00
John MacFarlane
0ee49911f6 Markdown reader: Allow links in image captions.
This change also means that

[link with [link](/url)](/url)

will turn into

<p><a href="/url">link with link</a></p>

instead of

<p><a href="/url">link with [link](/url)</a></p>
2012-01-08 09:52:39 -08:00
John MacFarlane
d850712f99 Templates: Tell pandoc where to find default "html5" template. 2012-01-08 09:45:03 -08:00
John MacFarlane
6f69abf4a9 Allow markdown2pdf to use --old-dashes and --citatation-abbreviations. 2012-01-04 09:09:49 -08:00
John MacFarlane
5b7c209373 Markdown reader: Fix parsing of consecutive lists.
Pandoc previously behaved like Markdown.pl for consecutive
lists of different styles. Thus, the following would be parsed
as a single ordered list, rather than an ordered list followed
by an unordered list:

    1. one
    2. two

    - one
    - two

This patch makes pandoc behave more sensibly, parsing this as
two lists.  Any change in list type (ordered/unordered) or in
list number style will trigger a new list. Thus, the following
will also be parsed as two lists:

    1. one
    2. two

    a. one
    b. two

Since we regard this as a bug in Markdown.pl, and not something
anyone would ever rely on, we do not preserve the old behavior
even when `--strict` is selected.
2012-01-02 17:04:59 -08:00
John MacFarlane
9001506f33 README: Added note on proper date format. 2012-01-01 14:54:41 -08:00
John MacFarlane
4e30f24974 EPUB writer: Allow lang variable to set language in metadata.
Defaults to locale language if `lang` is not set.
2012-01-01 14:32:27 -08:00
John MacFarlane
da8425598a New treatment of dashes in --smart mode.
* `---` is always em-dash, `--` is always en-dash.
* pandoc no longer tries to guess when `-` should be en-dash.
* A new option, `--old-dashes`, is provided for legacy documents.

Rationale: The rules for en-dash are too complex and
language-dependent for a guesser to work reliably.  This
change gives users greater control.  The alternative of
using unicode isn't very good, since unicode em- and en-
dashes are barely distinguishable in a monospace font.
2012-01-01 13:48:28 -08:00
John MacFarlane
3cf60c7306 Support for math in RST reader and writer.
Inline math uses the :math:`...` construct.

Display math uses

  .. math:: ...

or if multilin

  .. math::

     ...

These seem to be supported now by rst2latex.py.
2011-12-31 11:40:47 -08:00
John MacFarlane
c264dc4f5b Pretty: Added beforeNonBreak combinator.
This allows you to include something conditionally on it being
before a nonblank.  Used for RST inline math.
2011-12-31 11:39:33 -08:00
John MacFarlane
c7f6f77908 Support Sphinx-style math in RST writer.
http://sphinx.pocoo.org/latest/ext/math.html
2011-12-30 23:51:49 -08:00
John MacFarlane
d8272d0356 Support Sphinx style math in RST reader.
Inline:  :math:`E=mc^2`

Block:

.. math: E = mc^2

.. math::

   E = mc^2

   a = b^2

(This latter will turn into a paragraph with two
display math elements.)

Closes #117.
2011-12-30 23:46:43 -08:00
John MacFarlane
661d0646d0 Updated context tests. 2011-12-30 18:22:09 -08:00
John MacFarlane
da6c25a7d9 Removed header 1 property from ConTeXt tests.
It didn't work with new ids.
2011-12-30 18:21:54 -08:00
John MacFarlane
3e526918f8 Fixed layout bug in ConTeXt and LaTeX writers.
This was a regression introduced by the recent internal
links changes.
2011-12-30 16:28:44 -08:00
John MacFarlane
3f981022a6 Updated latex tests. 2011-12-30 16:28:33 -08:00
John MacFarlane
506a5b07d1 LaTeX writer: only use hyperdef on section if there's a link to it. 2011-12-30 16:14:35 -08:00
John MacFarlane
a561135386 README: header identifiers now work in LaTeX, ConTeXt as well as HTML.
Patch from B. Scott Michel.
2011-12-30 14:34:54 -08:00
John MacFarlane
2c1569a0da Added support for internal links in ConTeXt writer.
Based on a patch by B. Scott Michel.

Also simplified use of \hyphenateurl. We no longer try to go within
an Inline list to find URLs.  This is resource-heavy, and the main
use case is autolinks, which can be readily recognized.
2011-12-30 14:32:49 -08:00
John MacFarlane
e3dfb2646d Add support for internal links to LaTeX writer.
Based on a patch by B. Scott Michel.
2011-12-30 14:30:45 -08:00
John MacFarlane
209ba0fa6c LaTeX template: color links blue. 2011-12-30 14:29:48 -08:00