Commit graph

7304 commits

Author SHA1 Message Date
Jesse Rosenthal
2893b0055a Docx reader: Let headers use exisiting id.
Previously we always generated an id for headers (since they wouldn't
bring one from Docx). Now we let it use an existing one if
possible. This should allow us to recurs through anchor spans.
2016-08-28 18:09:27 -04:00
Jesse Rosenthal
62882f976d Docx reader: Handle anchor spans with content in headers.
Previously, we would only be able to figure out internal links to a
header in a docx if the anchor span was empty. We change that to read
the inlines out of the first anchor span in a header.

This still leaves another problem: what to do if there are multiple
anchor spans in a header. That will be addressed in a future commit.
2016-08-28 18:03:09 -04:00
Vaclav Zeman
1053677f49 Translate NARROW NO-BREAK SPACE into LaTeX.
Translate NARROW NO-BREAK SPACE into LaTeX' `\,`.
2016-08-27 22:17:39 +02:00
John MacFarlane
d29a623896 Man writer: allow section numbers that are not a single digit.
Closes #3089.
2016-08-27 22:00:42 +02:00
Albert Krewinkel
500de5e979
Org writer: translate language identifiers
Pandoc and Org-mode use different programming language identifiers.  An
additional translation between those identifiers is added to avoid
unexpected behavior.  This fixes a problem where language specific
source code would sometimes be output as example code.
2016-08-20 23:42:36 +02:00
John MacFarlane
b7b5458450 Allow aeson 1.0.*. 2016-08-20 22:56:27 +02:00
John MacFarlane
f59dfb8d17 Note in MANUAL that --katex works best with html5.
Closes #3077.
2016-08-20 22:47:12 +02:00
Jesse Rosenthal
84a99af24e MANUAL: fix up custom-style documentation.
* Remove nitty-gritty details about custom-style filters (it won't make
  sense to readers unfamiliar with filters, and would be obvious to
  users already familiar with them).

* Fix a capitalization.
2016-08-20 09:38:15 -04:00
John MacFarlane
2c9f17d5d7 Merge pull request #3074 from waldyrious/patch-1
synchronize spacing of footnotes in help output
2016-08-20 15:11:54 +02:00
Albert Krewinkel
29ac4ae813
Merge branch 'org-figure-fix' 2016-08-18 14:34:07 +02:00
Albert Krewinkel
dbf4d77091
Org writer: ensure link targets are paths or URLs
Org-mode treats links as document internal searches unless the link
target looks like a URL or file path, either relative or absolute.  This
change ensures that this is always the case.
2016-08-18 14:32:59 +02:00
Albert Krewinkel
d669425640
Org writer: ensure blank line after figure
An Org-mode figure should be surrounded by blank lines.  The figure
would be recognized regardless, but images in the following line would
unintentionally be treated as figures as well.
2016-08-18 14:32:59 +02:00
Albert Krewinkel
91afa513ad
Org writer: remove blank line after figure caption
Org-mode only treats an image as a figure if it is directly preceded by
a caption.
2016-08-18 14:32:59 +02:00
Waldir Pimenta
35e1d6d9f7 synchronize spacing of footnotes in help output
- remove a space between `[` and `*` in the list of input formats, to match the list of output formats
- add space after the `*`s, for improved readability
2016-08-16 15:54:24 +01:00
Jesse Rosenthal
3a44ee62c0 MANUAL: fix some whitespace issues. 2016-08-15 19:50:40 -04:00
Jesse Rosenthal
972286c034 Docx writer test: comment out function to make compiler happy. 2016-08-15 15:39:34 -04:00
Jesse Rosenthal
d416f62410 Docx writer: test for custom styles.
This just tests whether a custom style with a recognizable
style (italic etc, defined in a reference.docx) will roundtrip back to
that format (i.e., whether `<span custom-style="Emphasized">` will
roundtrip to `Emph`). The custom styles are defined in the
`custom-style-reference.docx` included in the docx dir.
2016-08-15 15:33:06 -04:00
Jesse Rosenthal
663f689fa4 Docx writer tests: allow for altered round trip
Sometimes we will want to get back something different than we started
with in a round-trip test. This allows for that, and makes the perfect
roundtrip a special case.
2016-08-15 15:23:25 -04:00
Jesse Rosenthal
b512573805 Add discussion of custom styles to MANUAL.txt. 2016-08-15 14:22:55 -04:00
Jesse Rosenthal
b784ce8866 Docx Writer: change dynamic style key
Use "custom-style" instead of "docx-style." This allows it to be used in
other formats like ODT in the future.
2016-08-15 13:58:56 -04:00
Jesse Rosenthal
2870c9be00 Docx writer: Inject text properties as well. 2016-08-15 13:56:45 -04:00
Jesse Rosenthal
66d393ae7a Docx Writer: Keep track of dynamic text props too. 2016-08-15 12:41:31 -04:00
Jesse Rosenthal
d6b60558e3 Docx writer: Allow dynamic styles on spans.
This enables dynamic styling on spans. It uses the same prefix as we
used on divs ("docx-style" for the moment). It does not yet inject the
style into styles.xml.
2016-08-15 12:35:11 -04:00
Jesse Rosenthal
59bc1e68aa Docx writer: Inject new paragraph properties
This injects new dynamic paragraph properties to be into the style
file. Nothing occurs if the prop already exists in the style file.
2016-08-15 12:19:24 -04:00
Jesse Rosenthal
9999db2e6c StyleMap: export functions on StyleMap instances
We're going to want `getMap` in the Docx Writer.
2016-08-15 12:04:20 -04:00
Jesse Rosenthal
6c6860d076 Docx Writer: Have state keep track of dynamic styles.
We want to be able to inject these into our styles.xml.
2016-08-15 10:27:01 -04:00
Albert Krewinkel
5c4adf9270 Put note on structured vars in separate paragraph
Make it clearer that structured author variables require a custom
template.

Many thanks to John Muccigrosso (@Jmuccigr) for his help in addressing
this issue.

This supersedes and closes #2148.
2016-08-15 16:26:14 +02:00
Jesse Rosenthal
a362a62abe Docx Writer: Implement user-defined styles.
Divs with a "docx-style" key in the attributes will apply the
corresponding key to the contained blocks.
2016-08-13 21:52:50 -04:00
Jesse Rosenthal
347d716826 Docx parser: Use xml convenience functions
The functions `isElem` and `elemName` (defined in Docx/Util.hs) make the
code a lot cleaner than the original XML.Light functions, but they had
been used inconsistently. This puts them in wherever applicable.
2016-08-13 13:46:21 -04:00
John MacFarlane
1955ee9c72 Merge pull request #3048 from tarleb/latex-mini-fix
LaTeX reader: drop duplicate `*` in bibtexKeyChars
2016-08-11 21:15:27 +02:00
John MacFarlane
81311a7deb Added themeoptions variable to beamer template (Carsten Gips). 2016-08-11 21:14:26 +02:00
John MacFarlane
cfbee76e66 Tell where to get tarball in INSTALL.
See #3062.
2016-08-10 08:21:35 +02:00
John MacFarlane
13424a2bd7 Merge pull request #3065 from tarleb/org-verse-indent
Org reader: preserve indentation of verse lines
2016-08-09 21:33:24 +02:00
John MacFarlane
3a6e15a313 Merge pull request #3067 from tarleb/org-figure-bugfix
Org reader: ensure image sources are proper links
2016-08-09 21:31:52 +02:00
Albert Krewinkel
ba5b426ded Org reader: ensure image sources are proper links
Image sources as those in plain images, image links, or figures, must be
proper URIs or relative file paths to be recognized as images.  This
restriction is now enforced for all image sources.

This also fixes the reader's usage of uncleaned image sources, leading
to `file:` prefixes not being deleted from figure
images (e.g. `[[file:image.jpg]]` leading to a broken image `<img
src="file:image.jpg"/>)

Thanks to @bsag for noticing this bug.
2016-08-09 20:27:08 +02:00
Albert Krewinkel
13280a8112 Org reader: preserve indentation of verse lines
Leading spaces in verse lines are converted to non-breaking spaces, so
indentation is preserved.

This fixes #3064.
2016-08-08 09:40:50 +02:00
John MacFarlane
0fbb676c81 MediaWiki reader: properly interpret XML tags in pre environments.
They are meant to be interpreted as literal text in textile.
Closes #3042.
2016-08-06 23:57:42 +02:00
John MacFarlane
124679fd63 Improved mediawiki reader's treatment of verbatim constructions.
Previously these yielded strings of alternating Code and Space
elements; we now incorporate the spaces into the Code.  Emphasis
etc. is still possible inside these.

Closes #3055.
2016-08-06 23:41:03 +02:00
John MacFarlane
3a49439202 Fix for unquoted attribute values in mediawiki tables.
Previously an unquoted attribute value in a table row
could cause parsing problems.

Fixes #3053 (well, proper rowspans and colspans aren't
created, but that's a bigger limitation with the current
Pandoc document model for tables).
2016-08-06 23:22:03 +02:00
Matthew Pickering
be4783109c Fix out of index error in handleError
In the latex parser when includes are processed, the text of the
included file is directly included into the parse stream. This caused
problems when there was an error in the included file (and the included
file was longer than the original file) as the error would be reported
at this position.

The error handling tries to display the line and position where the
error occured. It works by including a copy of the input and finding the
place in the input when given the position of the error. In the
previously described scenario, the input file would be the original
source file but the error position would be the position of the error in
the included file.

The fix is to not try to show the exact line when it would cause an
out-of-bounds error.
2016-08-06 22:06:37 +01:00
John MacFarlane
cde1f00813 Added beamerarticle variable.
This causes the `beamerarticle` package to be loaded
in beamer, to produce an article from beamer slides.
(Carsten Gips)
2016-08-06 22:43:51 +02:00
John MacFarlane
a480293b3c LaTeX writer: don't use * for unnumbered paragraph, subparagraph.
The starred variants don't exist.

This helps with part of #3058...it gets rid of the spurious *s.
But we still have numbers on the 4th and 5th level headers.
2016-08-06 22:37:11 +02:00
Albert Krewinkel
f9afc0d378 LaTeX reader: drop duplicate * in bibtexKeyChars 2016-07-29 20:53:43 +02:00
John MacFarlane
7af8bfd8c8 Merge pull request #3045 from mortonfox/patch-1
Fix the LaTeX and EPUB links
2016-07-28 21:44:40 -07:00
Morton Fox
d6507d6393 Fix the LaTeX and EPUB links
Parenthesized items following [ ] links need to be escaped. Otherwise, those will be turned into the URLs for those links.
2016-07-29 00:34:20 -04:00
John MacFarlane
08bef01d99 Added texmath 0.8.6.5. 2016-07-26 10:13:57 -07:00
John MacFarlane
d2464de2af Use texmath 0.8.6.5. Closes #3040. 2016-07-24 10:56:19 -07:00
John MacFarlane
7f414f3e4d Fixed stack.full.yaml. 2016-07-23 16:34:38 -07:00
John MacFarlane
6489be800a Merge pull request #3038 from tarleb/patch-1
Use http to access online documentation
2016-07-23 16:06:54 -07:00
Albert Krewinkel
49f44602d2 Use http to access online documentation
The link to the online manual used the `https` schema, which doesn't work for this resource.  Changed to `http`.
2016-07-23 10:14:18 +02:00