Commit graph

10486 commits

Author SHA1 Message Date
laptop1\Andrew
03d8696991 Docx writer: fix #3930
Fixes an issuue regarding image sizing if the same image is included more than once.

Previously, a record was kept, indexed by image source, which would include the XML for that image. For every image element in the document, this record was checked, and if the image was the same as previous examples, the same XML would be included twice. The information in this XML incudes the image description, title text, and size on the page, thus all images from the same source would always be sized the same, and have the same description. This commit fixes this by generating unique XML every time, but keeping the image ID and path if it is the same image.
2018-02-23 11:50:33 -05:00
Alexander Krotov
2eab8f4654 Muse reader: improve verse parsing
Now verse marked up with ">" (in contrast to <verse> tag) can be placed
inside lists.
2018-02-23 18:02:04 +03:00
Alexander Krotov
e810a5cc00 Export improved sepBy1 from Text.Pandoc.Parsing 2018-02-23 18:02:04 +03:00
John MacFarlane
6b388971ea Require aeson-pretty 0.8.5. Closes #4394.
`confTrailingNewline` is introduced in this version.
2018-02-22 22:23:11 -08:00
Jesse Rosenthal
9d076eb8ef MANUAL.txt: Document incremental and nonincremental divs.
Blockquoted lists are still described, but fenced divs are presented
in preference.
2018-02-22 14:41:02 -05:00
Jesse Rosenthal
69a7209930 Presentations: Use divs to set incremental/non-incremental
Currently, html and beamer presentations use a list-inside-blockquote
convention for setting incremental and all-at-once presentation of
lists (or reversing the command-line default). This allows the user to
set this on a per-case basis with divs, named `incremental` and
`nonincremental` respectively, as in:

    ::: incremental

    - snap

    - crackle

    - pop

    :::

Note that the former list-inside-blockquote convention still works so
as not to break any existing presentations.

Closes: #4381
2018-02-22 14:40:40 -05:00
Jesse Rosenthal
8b7df2d915 Docx reader: Move pandoc inline styling inside custom-style span
Previously Emph, Strong, etc were outside the custom-style span. This
moves them inside in order to make it easier to write filters that act
on the formatting in these contents.

Tests and MANUAL example are changed to match.
2018-02-22 13:41:02 -05:00
Jesse Rosenthal
87e0728b87 Docx reader: Avoid repeated spans in custom styles.
The previous commit had a bug where custom-style spans would be read
with every recurrsion. This fixes that, and changes the example given
in the manual.
2018-02-22 13:27:34 -05:00
Jesse Rosenthal
03eda213d1 MANUAL: add documentation on custom styles.
Discuss workflow of using input document as reference.docx.

We also split the "Custom styles" section into two parts: input and output.
2018-02-22 13:05:44 -05:00
Jesse Rosenthal
ffcecfacb1 Docx reader tests: test custom style extension. 2018-02-22 13:05:44 -05:00
Jesse Rosenthal
5262c0853a Docx reader: read custom styles
This will read all paragraph and character classes as divs and spans,
respectively. Dependent styles will still be resolved, but will be
wrapped with appropriate style tags. It is controlled by the `+styles`
extension (`-f docx+styles`).

This can be used in conjunction with the `custom-style` feature in the
docx writer for a pandoc-docx editing workflow. Users can convert from
an input docx, reading the custom-styles, and then use that same input
docx file as a reference-doc for producing an output docx file. Styles
will be maintained across the conversion, even if pandoc doesn't
understand them.

Without the extension:

    $ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
    This is some text.

    This is text with an *emphasized* text style. And this is text with a
    **strengthened** text style.

    > Here is a styled paragraph that inherits from Block Text.

With the extension:

    $ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
    ::: {custom-style="FirstParagraph"}
    This is some text.
    :::

    ::: {custom-style="BodyText"}
    This is text with an
    *[[emphasized]{custom-style="Emphatic"}]{custom-style="Emphatic"}* text
    style. And this is text with a
    **[[strengthened]{custom-style="Strengthened"}]{custom-style="Strengthened"}**
    text style.
    :::

    ::: {custom-style="MyBlockStyle"}

Closes: #1843
2018-02-22 13:05:25 -05:00
Jesse Rosenthal
88d17c6c66 Extensions: Add Ext_styles
This will be used in the docx reader (defaulting to off) to read
pargraph and character styles not understood by pandoc (as divs and
spans, respectively).
2018-02-22 12:54:57 -05:00
John MacFarlane
b8f0d15a72 LaTeX writer: Put hypertarget inside figure environment.
Previously it surrounded the figure.

This works around a problem with the endfloat package and
makes pandoc's output compatible with it.

Closes #4388.
2018-02-21 17:30:28 -08:00
John MacFarlane
0690df507b LaTeX writer: Fix image height with percentage.
This previously caused the image to be resized to
a percentage of textwidth, rather than textheight.

Closes #4389.
2018-02-21 17:18:06 -08:00
Albert Krewinkel
00d20ccd09
Org reader: allow changing emphasis syntax
The characters allowed before and after emphasis can be configured via
`#+pandoc-emphasis-pre` and `#+pandoc-emphasis-post`, respectively. This
allows to change which strings are recognized as emphasized text on a
per-document or even per-paragraph basis. The allowed characters must be
given as (Haskell) string.

    #+pandoc-emphasis-pre: "-\t ('\"{"
    #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}["

If the argument cannot be read as a string, the default value is
restored.

Closes: #4378
2018-02-21 22:43:18 +01:00
Alexander Krotov
84db7e492a Muse reader: replace setState with updateState where possible 2018-02-21 12:40:37 +03:00
Jesse Rosenthal
aae362f634 MANUAL.txt: fix typo. 2018-02-20 09:58:07 -05:00
Jesse Rosenthal
b4401165dd MANUAL.txt: A bit of clarification on speaker notes.
Make it clear that pressing `s` is just for reveal.js.
2018-02-20 09:42:31 -05:00
Jesse Rosenthal
c46e796491 MANUAL.txt: Add instructions for using pptx reference-docs 2018-02-20 09:40:43 -05:00
Jesse Rosenthal
705145956d Muse reader: fix compiler warning
lambda variable `st` shadowed an existing variable.
2018-02-20 09:17:52 -05:00
Jesse Rosenthal
b9b66d3b29 Powerpoint writer: Use ph name and idx for getting layout shapes
Internal change: when we take shapes from the layout for title,
content, etc, we should use the attributes of the "ph" (placeholder)
tag -- idx and name. This is what powerpoint uses internally, and
therefore seems more dependable across reference-docs than using the
shape names, as we had previously done.

There should be no output changes as a result of this commit.
2018-02-20 06:46:45 -05:00
Alexander Krotov
a16382b06b Muse reader: use updateState instead of setState to restore museInLink 2018-02-20 14:37:02 +03:00
Jesse Rosenthal
f6eac1ad7e Powerpoint writer tests: Test everything with template as well
Modify the PowerPoint tests to run all the tests with
template (--reference-doc) as well. Because there are so many
interlocking pieces, bugs can pop up in weird places when using
templates, since it changes how the writer builds its output
file.

For example, I recently discovered a bug in which speaker notes worked
fine and templating worked fine elsewhere, but templating with speaker
notes produced a file that would crash MS PowerPoint. That particular
bug was fixed, but this will forces us to check for that with each new
change.
2018-02-19 20:04:39 -05:00
Jesse Rosenthal
b3f2efd35a Powerpoint writer: Update.golden tests.
Checked with Office 2013. No corruption and output as expected.
2018-02-19 15:31:20 -05:00
Jesse Rosenthal
f1146cd7ee Powerpoint writer: Add notesMaster to presentation.xml if necessary
In previous version, we only modified the notesMaster entry in the
presentation.xml file, and removed it if necessary. But if using a
template, it might not be available. So we always delete it, and then
add it back in if necessary.

We also have to make sure that we add it appropriately the .rels file
associated with presentation.xml.
2018-02-19 15:31:20 -05:00
Alexander Krotov
5a9d7d20dd Move manyUntil to Text.Pandoc.Parsing and use it in Txt2Tags reader 2018-02-19 19:23:30 +03:00
Jesse Rosenthal
574104861f Powerpoint writer: Another attempt at avoiding compiler warnings. 2018-02-18 18:54:16 -05:00
Jesse Rosenthal
b4f43f8799 Powerpoint writer: fix compiler complaints. 2018-02-18 17:44:09 -05:00
Jesse Rosenthal
4a6000c7d0 MANUAL: add reference to pptx support for speaker notes. 2018-02-18 16:31:32 -05:00
Jesse Rosenthal
32e6ae4347 Powerpoint writer: Add tests for speaker notes. 2018-02-18 16:31:32 -05:00
Jesse Rosenthal
6562863ef1 Powerpoint writer: separate SpeakerNotes paragraphs with empy par
This will add a space between notes paragraphs, which seems more like
what most users would do by hand (press "enter" twice).
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
07f3aa178b Powerpoint writer: Ignore links and (end)notes in speaker notes.
MS PowerPoint does not offer a way to insert links into speaker notes
text, so we match that behavior, and make our lives easier.

As for (end)notes, there is no clear solution to the question of wat
that would *mean*. The default behavior would be to add it to the
endnote slide, but that would put speaker note content into the public
presentation. The best solution would be to put the content at the
bottom of the notes page, but that would take some doing, and can be
added to the speaker notes feature later.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
112602232c Powerpoint writer: update golden test files
Since the template changed, some small elements of these test files
changed as well.

All of these were checked with Powerpoint 2013 on Windows
10 (VirtualBox). All had expected outcomes and no corruption.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
575a360c6c Powerpoint writer: Output speaker notes.
There are a number of interlocking parts here. The main thing to note
is that, to match the MSPowerPoint-generated pptx files, we only
include the notesMaster and notesSlide files if there are notes. This
means we have to be careful with the rIds, and build a number of files
conditionally.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
47a399303d Powerpoint writer: modify speaker notes in presentation.xml
We remove the `notesMasterIdLst` entry in `presentation.xml` if there
no speaker notes in the presentation.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
eace2357dd Powerpoint writer: Read speaker note templates conditionally
If there are speaker notes in the presentation, we read in the
notesMasters templates from the reference pptx file.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
6c6ac9f22e Powerpoint writer: Move notes slides into data tree. 2018-02-18 16:31:32 -05:00
Jesse Rosenthal
d9e179d6fd Powerpoint writer: Read notes into powerpoint Presentatation type.
We record notes in a map in state while processing.
2018-02-18 16:31:32 -05:00
Jesse Rosenthal
6fa6b6a5f2 Powerpoint writer: Change references to Notes to SpeakerNotes
This is to avoid confusion with {foot,end}notes.
2018-02-18 16:31:32 -05:00
Andrew Pritchard
bb7681a85a EMF Image size support (#4375) 2018-02-18 11:12:58 -08:00
John MacFarlane
377640402f LaTeX reader: Fixed comments inside citations. Closes #4374. 2018-02-17 23:06:54 -08:00
John MacFarlane
3535af0197 Markdown writer: properly escape @ to avoid capture as citation.
Closes #4366.
2018-02-16 15:59:03 -08:00
John MacFarlane
c75740e22c Make image size detection for PDFs more robust.
See #4322.
2018-02-16 13:45:15 -08:00
John MacFarlane
5a56819894 Travis: ensure nightly builds can fail. 2018-02-16 11:04:50 -08:00
John MacFarlane
036767ea80 TEI writer: more attribute fixes.
- Ensure that id prefix is always used.
- Don't emit `role` attribute; that was a leftover from the
  Docbook writer.
2018-02-16 10:47:46 -08:00
John MacFarlane
ded2e211ca TEI writer: Use 'xml:id', not 'id' attribute.
Closes #4371.
2018-02-16 10:41:22 -08:00
Alexander Krotov
0e4b8ae362 Muse reader: prioritize lists with roman numerals over alphabetical lists
This is to make sure "i." starts a roman numbered list,
instead of a list with letter "i" (followed by "j", "k", ...").
2018-02-16 12:53:41 +03:00
danse
e6ff7f7986 Docx reader: Pick table width from the longest row or header
This change is intended to preserve as much of the table content as
possible

Closes #4360
2018-02-15 15:06:01 -05:00
Alexander Krotov
82a0ceaf18 Muse reader: fix directive parsing
This fixes bugs introduced in commit 4bfab8f04c.
2018-02-15 18:17:24 +03:00
Alexander Krotov
9131d62c9b Muse writer: use unicode quotes for quoted text 2018-02-15 14:33:25 +03:00