aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/PDF.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-04-23Allow use of -output-directory in --pdf-engine-opt.John MacFarlane1-4/+6
This is currently possible with `mklatex` and `-outdir`, but was not yet possible with xelatex and `-output-directory`. Closes #5462.
2019-04-16Text.Pandoc.PDF: replace `</>` with literal "/".John MacFarlane1-2/+2
We use forward-slash for a directory separator in tmpDir, even on Windows (because that's what tex likes). So we should not put a backslash between the tmpDir and the filename on Windows. This is harmless enough in normal Windows setups, but it breaks on Cygwin. Closes #5451. Thanks to @cc2x for noticing and diagnosing the problem.
2019-03-27Drop support for ghc < 8.John MacFarlane1-4/+0
2019-03-07Add tectonic as an option for --pdf-engine. (#5346)Cormac Relf1-29/+81
Closes #5345 Runs tectonic on STDIN instead of a temporary .tex file, so that it looks in the working directory for `\include` and `\input` like the rest of the engines. Allows overriding the output directory without messing up the args with `--pdf-engine-opt=--outdir --pdf-engine-opt="$DIR"`.
2019-03-01PDF: change types of subsidiary functions to PandocIO,...John MacFarlane1-70/+70
...to allow warnings to be threaded through. Additional fix for #5343.
2019-03-01Make `--fail-if-warnings` work for PDF output.John MacFarlane1-4/+10
Closes #5343.
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-27Add latexmk as an option for --pdf-engine.John MacFarlane1-79/+72
Closes #3195. Note that you can use --pdf-engine-opt=-outdir=bar to specify a persistent temp dir.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2019-02-02PDF: More conservative solution to #777.John MacFarlane1-2/+11
Now, instead of always creating temp dirs in the home directory on Windows, we only do it if the system tempdir name contains tildes. (This will be the case for longer usernames only.) Closes #1192.
2019-02-02PDF: use system temp dir and set TEXMFOUTPUT.John MacFarlane1-8/+5
Previously the temp directory was created inside the working directory, so that programs like epstopdf.pl would be allowed to run in restricted mode. However, setting TEXMFOUTPUT allows these programs to run in the tmpdir inside the system temp directory. This is a better solution than cd51983. Using the system temp dir prevents problems when pandoc is run inside a synced directory (e.g. dropbox). Partially addresses #1192.
2018-08-24PDF: fix reference to rsvg-convert (#4855)Antonio Terceiro1-1/+1
When rsvg-convert is not available, pandoc would tell the user to check for rsvg2pdf instead
2018-07-06PDF: revert fix for #4484 (only compress images on last run).John MacFarlane1-6/+1
Closes #4755. This will mean some increase in the time it takes to produce an image-heavy PDF with xelatex, but it will make tables of contents correct, which is more important. Note that the production time should also be decreased by the previous commit, which fixed a logic error affecting the number of runs. That change might mitigate the effect of this one.
2018-07-06PDF: Fix logic error in runTeXProgram.John MacFarlane1-1/+1
We were running the tex program one more time than requested. This should speed up pdf production.
2018-06-03Regression: make --pdf-engine work with full paths (#4682)Mauro Bieg1-51/+60
Fixes #4681.
2018-05-05Revert piping html to pdf-engine (#4628)Mauro Bieg1-50/+46
* Revert "PDF: Use withTempDir in html2pdf." We're going back to using tmpFile instead of piping * Revert "html2pdf: inject base tag wih current working directory (#4443)" Fixes #4413
2018-04-21makePDF: Don't try to convert eps files.John MacFarlane1-0/+2
pdflatex converts them itself, and JuicyPixels can't do it. See #2067.
2018-04-21makePDF: For pdflatex, use a temp dir in the working directory.John MacFarlane1-3/+5
Otherwise we can have problems with things like epstopdf.pl, which pdflatex runs to convert eps files and which won't run on a file above the working directory in restricted mode.
2018-04-09PDF: Use withTempDir in html2pdf.John MacFarlane1-38/+39
This is intended to help with #4524, a problem on Windows where using weasyprint led to a blank PDF.
2018-03-23PDF: with xelatex, don't compress images til the last run.John MacFarlane1-1/+6
This saves time for image-heavy documents. Closes #4484.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-16Monoid/Semiground cleanup relying on custom Prelude.John MacFarlane1-1/+0
2018-03-11html2pdf: inject base tag wih current working directory (#4443)Mauro Bieg1-1/+9
fixes #4413
2018-01-10Add header and footer parametersnewmana1-0/+4
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-10-27hlint suggestions.John MacFarlane1-1/+0
2017-10-27hlint changes.John MacFarlane1-5/+3
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-8/+7
2017-10-26makePDF: add argument for pdf options, remove writerPdfArgs.John MacFarlane1-14/+11
- Removed writerPdfArgs from WriterOptions (API change). - Added parameter for pdf args to makePDF.
2017-09-30Removed Verbosity and MediaBag params from makePDF.John MacFarlane1-33/+27
They can be obtained from CommonState since we're in PandocIO.
2017-09-30Removed writerSourceURL, add source URL to common state.John MacFarlane1-4/+3
Removed `writerSourceURL` from `WriterOptions` (API change). Added `stSourceURL` to `CommonState`. It is set automatically by `setInputFiles`. Text.Pandoc.Class now exports `setInputFiles`, `setOutputFile`. The type of `getInputFiles` has changed; it now returns `[FilePath]` instead of `Maybe [FilePath]`. Functions in Class that formerly took the source URL as a parameter now have one fewer parameter (`fetchItem`, `downloadOrRead`, `setMediaResource`, `fillMediaBag`). Removed `WriterOptions` parameter from `makeSelfContained` in `SelfContained`.
2017-09-11Support for PDF generation via `weasyprint` and `prince` (#3909)Mauro Bieg1-18/+28
* Rename --latex-engine to --pdf-engine * In `Text.Pandoc.Options.WriterOptions`, rename `writerLaTeXEngine` to `writerPdfEngine` and `writerLaTeXArgs` to `writerPdfArgs`. * Add support for `weasyprint` and `prince`, in addition to `wkhtmltopdf`, for PDF generation via HTML (closes #3906). * `Text.Pandoc.PDF.html2pdf`: use stdin instead of intermediate HTML file
2017-08-16Fix import in PDF.John MacFarlane1-0/+4
2017-08-15Remove initial check for pdf creating program.John MacFarlane1-5/+27
Instead, just try running it and raise the exception if it isn't found at that point. This improves things for users of Cygwin on Windows, where the executable won't be found by `findExecutable` unless `.exe` is added. The same exception is raised as before, but at a later point. Closes #3819.
2017-08-09Support svg in PDF output, converting with rsvg2pdf.John MacFarlane1-3/+12
Closes #1793.
2017-06-18In producing PDFs, warn if the font is missing some characters.John MacFarlane1-13/+34
* Added `MissingCharacter` to `LogMessage` in Text.Pandoc.Logging. * Parse the (xe)latex log for missing character warnings and issue the warning. Closes #3742.
2017-06-11Switched Writer types to use Text.John MacFarlane1-13/+14
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-05-20PDF: Got --resource-path working with pdf output.John MacFarlane1-4/+7
See #852.
2017-05-20PDF: better error message for non-converted svg images.John MacFarlane1-0/+1
2017-05-20PDF: Refactoring, makePDF is now in PandocIO [API change].John MacFarlane1-13/+8
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-07Rename fillMedia -> fillMediaBag.John MacFarlane1-2/+3
2017-05-07PDF: use fillMedia and extractMedia to extract media to tmp dir.John MacFarlane1-39/+11
This reduces code duplication. We should be able to do something similar in ODT, Docx, EPUB writers.
2017-03-26PDF: when running pdfroff, don't do second pass to relocate toc.John MacFarlane1-1/+2
2017-03-25Ms writer: Implement header identifiers and internal links.John MacFarlane1-1/+1
2017-03-24PDF via groff ms: use -t and -KUTF-8 options to pdfroff.John MacFarlane1-1/+1
2017-03-23Allow creation of pdf via groff ms and pdfroff.John MacFarlane1-1/+32
pandoc -t ms -o output.pdf input.txt
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-20/+22
2017-02-25Fetch images when generating PDF via context.John MacFarlane1-3/+6
To do this, we create the temp directory as a subdirectory of the working directory. Since context mk IV by default looks for images in the parent directory, this works. Closes #3380.
2017-02-24Removed unnecessary import.John MacFarlane1-1/+0