aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-12-02LaTeX writer: escape `_` in code with --listings.John MacFarlane1-1/+1
2017-12-01LaTeX writer: allow specifying just width or height for image size.John MacFarlane1-1/+6
Previously both needed to be specified (unless the image was being resized to be smaller than its original size). If height but not width is specified, we now set width to textwidth (and similarly if width but not height is specified). Since we have keepaspectratio, this yields the desired result.
2017-12-01LaTeX writer: escape ~ in code with --listings.John MacFarlane1-1/+1
Closes #4111.
2017-12-01Revert "LaTeX writer: Add keepaspectratio to includegraphics..."John MacFarlane1-6/+1
This reverts commit 171187a4527497701b3c77bd56cea2d770d4e3b0.
2017-11-30LaTeX writer: Add keepaspectratio to includegraphics...John MacFarlane1-1/+6
...if only one of height/width is given.
2017-11-29Let papersizes a0, a1, a2, ... be case-insensitive in LaTeX and ConTeXt.John MacFarlane1-2/+4
2017-11-01hlintAlexander Krotov1-1/+1
2017-10-31LaTeX/Beamer writer: support "blocks" inside columns and other Divs.John MacFarlane1-0/+4
Example: ``` <div class="columns"> <div class="column" width="40%"> - Item </div> <div class="column" width="60%"> - Item </div> </div> ``` Closes #4016.
2017-10-29Source code reformatting.John MacFarlane1-2/+2
2017-10-29hlint suggestions.John MacFarlane1-49/+53
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-2/+2
2017-09-08Write euro symbol directly in LaTeXAndrew Dunning1-6/+0
The textcomp package allows pdfLaTeX to parse `€` directly, making the \euro command unneeded. Closes #3801.
2017-09-07LaTeX writer: use proper code for list enumerators.John MacFarlane1-2/+13
This should fix problems with lists that don't use arabic numerals. Closes #3891.
2017-08-14Implement multicolumn support for slide formats.John MacFarlane1-2/+21
The structure expected is: <div class="columns"> <div class="column" width="40%"> contents... </div> <div class="column" width="60%"> contents... </div> </div> Support has been added for beamer and all HTML slide formats. Closes #1710. Note: later we could add a more elegant way to create this structure in Markdown than to use raw HTML div elements. This would come for free with a "native div syntax" (#168). Or we could devise something specific to slides
2017-08-11Added support for translations (localization) (see #3559).John MacFarlane1-2/+2
* readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
2017-08-06LaTeX writer: Don't use figure inside table cell.John MacFarlane1-2/+4
Closes #3836.
2017-06-28Make `papersize: a4` work regardless of the case of `a4`.John MacFarlane1-0/+4
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
2017-06-28LaTeX writer: fixed detection of otherlangs.John MacFarlane1-3/+3
We weren't recursing into inline contexts. Closes #3770.
2017-06-26LaTeX writer: use BCP47 parser.John MacFarlane1-89/+105
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-3/+3
Now we raise a proper error on template failure.
2017-06-20Fixed footnotes in table captions.John MacFarlane1-16/+18
Note that if the table has a first page header and a continuation page header, the notes will appear only on the first occurrence of the header. Closes #2378.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-11Switched Writer types to use Text.John MacFarlane1-7/+10
* 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-23Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel1-1/+1
We also export the set of known `schemes`. The new function replaces the function of the same name from `Network.URI`, as the latter did not check whether a scheme is well-known. E.g. MediaWiki wikis frequently feature pages with names like `User:John`. These links were interpreted as URIs, thus turning internal links into global links. This is prevented by also checking whether the scheme of a URI is frequently used (i.e. is IANA registered or an otherwise well-known scheme). Fixes: #2713 Update set of well-known URIs from IANA list All official IANA schemes (as of 2017-05-22) are included in the set of known schemes. The four non-official schemes doi, isbn, javascript, and pmid are kept.
2017-05-18Don't render LaTeX images with data: URIs.John MacFarlane1-0/+3
LaTeX can't handle these. Note that --extract-media can be used when the input contains data: URIs. Closes #3636.
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-04-29LaTeX writer: Fix problem with escaping in lstinline.John MacFarlane1-1/+6
Previously the LaTeX writer created invalid LaTeX when `--listings` was specified and a code span occured inside emphasis or another construction. This is because the characters `%{}\` must be escaped in lstinline when the listinline occurs in another command, otherwise they must not be escaped. To deal with this, adoping Michael Kofler's suggestion, we always wrap lstinline in a dummy command `\passthrough`, now defined in the default template if `--listings` is specified. This way we can consistently escape the special characters. Closes #1629.
2017-04-28LaTeX writer: don't use lstinline it \item[..].John MacFarlane1-1/+7
If you do, the contents of item disappear or are misplaced. Use `\texttt` instead. Closes #645.
2017-04-25LaTeX writer: fix error with line breaks after empty content.John MacFarlane1-19/+28
LaTeX requires something before a line break, so we insert a `~` if no printable content has yet been emitted. Closes #2874.
2017-04-03Include \VerbatimFootnotes for highlighted code blocksTimm Albers1-2/+5
Updated the LaTeX writer to also include \VerbatimFootnotes in the preamble for highlighted code blocks. Previously this was only done for raw code blocks.
2017-03-30Allow dynamic loading of syntax definitions.John MacFarlane1-22/+24
See #3334. * Add writerSyntaxMap to WriterOptions. * Highlighting: added parameter for SyntaxMap to highlight. * Implemented --syntax-definition option. TODO: [ ] Figure out whether we want to have the xml parsing depend on the dtd (it currently does, and fails unless the language.dtd is found in the same directory). [ ] Add an option to read a KDE syntax highlighting theme as a custom style. [ ] Add tests.
2017-03-16LaTeX/Beamer writer: allow hyperlinks to frames.John MacFarlane1-4/+13
Previously you could link to a header above or below slide level but not TO slide level. This commit changes that. Hypertargets are inserted inside frame titles; technically the reference is to just after the title, but in normal use (where slides are viewed full screen in a slide show), this does not matter. Closes #3220.
2017-03-13Highlighting: highlighting now returns an Either rather than Maybe.John MacFarlane1-4/+9
This allows us to display error information returned by the skylighting library. Display a warning if the highlighting library throws an error.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-62/+62
2017-03-02LaTeX writer: add `\leavevmode` before hypertarget at start of paragraph.John MacFarlane1-1/+8
Closes #2704 (formatting problems in beamer citations). See http://tex.stackexchange.com/questions/22852/function-and-usage-of-leavevmode
2017-03-02LaTeX writer: use % after hypertarget before code blockJohn MacFarlane1-1/+4
2017-03-02LaTeX writer: minor tweak to hypertarget (semantically irrelevant).John MacFarlane1-1/+3
2017-03-01LaTeX writer: always add hypertarget when there's a non-empty identifier.John MacFarlane1-29/+19
Previously the hypertargets were only added when there was actually a link to that identifier. Closes #2719.
2017-02-23Removed `\strut` at beginning of table cells.John MacFarlane1-1/+1
This fixes a problem with alignment of lists in table cells (closes #3436). The `\strut` at the end seems to be enough to avoid the too-close spacing that motivated addition of the strut in #1573.
2017-02-17Added warnings for non-rendered blocks to some writers.John MacFarlane1-36/+51
2017-02-05Handle language in inline code with --listings.John MacFarlane1-4/+9
Closes #3422.
2017-01-28LaTeX writer: export writeBeamer.John MacFarlane1-25/+50
Removed writerBeamer from WriterOptions.
2017-01-25Removed writerHighlight; made writerHighlightStyle a Maybe.John MacFarlane1-7/+12
API change. For no highlighting, set writerHighlightStyle to Nothing.
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Removed writerIgnoreNotes.John MacFarlane1-4/+0
Instead, just temporarily remove notes when generating TOC lists in HTML and Markdown (as we already did in LaTeX). Also export deNote from Text.Pandoc.Shared. API change in Shared and Options.WriterOptions.
2017-01-25Removed writerTeXLigatures.John MacFarlane1-3/+3
Make `smart` extension work in LaTeX/ConTeXt writers instead. Instead of `-t latex --no-tex-ligatures`, do `-t latex-smart`.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-2/+3
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-0/+1
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-12-23Updates to use skylighting rather than highlighting-kate.John MacFarlane1-2/+2
So far this just reproduces capacity. Later we'll be able to add features like warning messages, dynamic loading of xml syntax definitions, and dynamic loading of themes.
2016-12-16LaTeX writer: allow tables with empty cells to count as "plain."John MacFarlane1-0/+1
This addresses a problem of too-wide tables when empty cells are used. Thanks to Joost Kremers for reporting the issue.