aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane1-1/+2
The readers previously assumed that CRs had been filtered from the input. Now we strip the CRs in the readers themselves, before parsing. (The point of this is just to simplify the parsers.) Shared now exports a new function `crFilter`. [API change] And `tabFilter` no longer filters CRs.
2017-06-11Support for \faCheck and \faClose (#3727)schrieveslaach1-0/+3
2017-06-10Changed all readers to take Text instead of String.John MacFarlane1-2/+3
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-06-01LaTeX reader: handle some width specifiers on table columns.John MacFarlane1-3/+13
Currently we only handle the form `0.9\linewidth`. Anything else would have to be converted to a percentage, using some kind arbitrary assumptions about line widths. See #3709.
2017-06-01LaTeX reader: more table refactoring.John MacFarlane1-12/+13
2017-06-01LaTeX reader: Small refactoring of table parsing code.John MacFarlane1-16/+18
This makes room for doing something with widths.
2017-06-01LaTeX reader: Handle block structure inside table cells.John MacFarlane1-18/+18
minipage is no longer required. Closes #3709.
2017-05-29LaTeX reader: handle escaped & inside table cell.John MacFarlane1-3/+5
Closes #3708.
2017-05-29LaTeX reader: don't crash on empty enumerate environment.John MacFarlane1-1/+1
Closes #3707.
2017-05-24LaTeX reader: Fixed failures on \ref{}, \label{} with `+raw_tex`.John MacFarlane1-6/+9
Now these commands are parsed as raw if `+raw_tex`; otherwise, their argument is parsed as a bracketed string.
2017-05-24Parsing: Provide parseFromString'.John MacFarlane1-6/+6
This is a verison of parseFromString specialied to ParserState, which resets stateLastStrPos at the end. This is almost always what we want. This fixes a bug where `_hi_` wasn't treated as emphasis in the following, because pandoc got confused about the position of the last word: - [o] _hi_ Closes #3690.
2017-05-24LaTeX reader: parse tikzpicture as raw verbatim environment...John MacFarlane1-0/+14
if `raw_tex` extension is selected. Otherwise skip with a warning. This is better than trying to parse it as text! Closes #3692.
2017-05-21Finished implemtation of `--resource-path`.John MacFarlane1-2/+2
* Default is just working directory. * Working directory must be explicitly specifide if `--resource-path` option is used.
2017-05-16Merge pull request #3671 from WUUUGI/horizont-spacingJohn MacFarlane1-1/+1
Added support for horizontal spacing in LaTeX
2017-05-15Added support for horizontal spacing in LaTeX: parse \, to \8198 (six-per-em ↵Henri Werth1-1/+1
space)
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-06LaTeX reader: Better handling of comments inside math environments.John MacFarlane1-30/+43
This solves a problem with commented out `\end{eqnarray}` inside an eqnarray (among other things). Closes #3113.
2017-05-06Fix keyval funtion: pandoc did not parse options in braces correctly.… (#3642)schrieveslaach1-1/+1
* Fix keyval funtion: pandoc did not parse options in braces correctly. Additionally, dot, dash, and colon were no valid characters * Add | as possible option value * Improved code
2017-05-03LaTeX reader: Add support for tabularx environment (#3632)schrieveslaach1-1/+6
2017-04-26LaTeX reader: Add basic support for hyphenat package (#3603)schrieveslaach1-1/+13
2017-04-26LaTeX reader: Add support for \vdots (#3607)schrieveslaach1-0/+1
2017-04-24LaTeX reader: better support for subfigure package.John MacFarlane1-5/+11
A figure with two subfigures turns into two pandoc figures; the subcaptions are used and the main caption ignored, unless there are no subcaptions. Closes #3577.
2017-04-22Add siunitx Support (#3588)schrieveslaach1-0/+17
For example: ```latex \SI[round-precision=2]{1}{m} is equal to \SI{1000}{mm}. \SI[round-precision=2]{1}[\$]{} is equal to \SI{0.938094}{\euro} ```
2017-03-29lstinline with braces can be used (verb cannot be used with braces) (#3535)schrieveslaach1-1/+8
* Fix lstinline handling: lstinline with braces can be used (verb cannot be used with braces) * Use codeWith and determine the language from lstinline * Improve code * Add another test: convert lstinline without language option
2017-03-27LaTeX reader: add support for LaTeX subfiles package.schrieveslaach1-0/+1
Closes #3530.
2017-03-24Revert "LaTeX reader: be more picky about beamer angle arguments."John MacFarlane1-1/+1
This reverts commit b98a05d604ab4353c2e684beecf669b182d88906.
2017-03-24LaTeX reader: be more picky about beamer angle arguments.John MacFarlane1-1/+1
We now only allow them if they contain only numbers, spaces, `-`, and `,`.
2017-03-13Better handling of \part in LaTeX.John MacFarlane1-8/+17
Closes #1905. Removed stateChapters from ParserState. Now we parse chapters as level 0 headers, and parts as level -1 headers. After parsing, we check for the lowest header level, and if it's less than 1 we bump everything up so that 1 is the lowest header level. So `\part` will always produce a header; no command-line options are needed.
2017-03-10Expand \newenvironment macros.John MacFarlane1-10/+12
Closes #987. Depends on still unreleased texmath 0.9.3.
2017-03-09LaTeX reader: Treat `{{xxx}}` the same as `{xxx}`.John MacFarlane1-9/+14
Closes #2115.
2017-03-07Markdown reader: Treat certain environments as inlineJohn MacFarlane1-1/+3
when they occur without space surrounding them. E.g. equation, math. This avoids incorrect vertical space around equations. Closes #3309. Closes #2171. See also rstudio/bookdown#358.
2017-03-06LaTeX reader: allow newpage, clearpage, pagebreak in inline contextsJohn MacFarlane1-0/+5
as well as block contexts. Closes #3494.
2017-03-05LaTeX reader: support all \textXX commands.John MacFarlane1-1/+5
where XX = rm, tt, up, md, sf, bf. Spans with a class are used when there is nothing better. Closes #3488.
2017-03-05LaTeX reader: small improvements in parsing arguments.John MacFarlane1-10/+7
2017-03-05LaTeX reader: Handle spaces before \cite arguments.John MacFarlane1-3/+1
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-29/+29
2017-03-01LaTeX reader: don't drop contents of \hypertarget.John MacFarlane1-0/+3
2017-02-27LaTeX reader: Handle komascript `\dedication`.John MacFarlane1-0/+2
It now adds a `dedication` field to metadata. It is up to the user to supply a template that uses this variable. Closes #1845.
2017-02-27Minor cleanups in LaTeX reader.John MacFarlane1-5/+4
2017-02-25LaTeX reader: allow hspace and vspace to count as raw block or inline.John MacFarlane1-3/+5
Previously we would refuse to parse anything as raw inline if it was in the blockCommands list. Now we allow exceptions if they're listed under ignoreInlines in inlineCommands. This should make it easier e.g. to include an \hspace between two side-by-side raw LaTeX tables.
2017-02-25Revert "LaTeX reader: don't treat `\vspace` and `\hspace` as block commands."John MacFarlane1-0/+1
This reverts commit 2873cd82886d1fa557bf3abde37b5ceb3cadf40c.
2017-02-24Implemented `\graphicspath` in LaTeX reader.John MacFarlane1-1/+8
Closes #736.
2017-02-22When parsing raw LaTeX commands, include trailing space.John MacFarlane1-2/+2
Otherwise things like `\noindent foo` break and turn into `\noindentfoo`. Affects `-f latex+raw_tex` and `-f markdown` (and other formats that allow `raw_tex`). Closes #1773.
2017-02-14LaTeX reader: include contents of `\parbox`.John MacFarlane1-0/+1
2017-02-14Removed unnecessary import.John MacFarlane1-1/+1
2017-02-13LaTeX reader: properly handle column prefixes/suffixes.John MacFarlane1-12/+33
For example, in \begin{tabular}{>{$}l<{$}>{$}l<{$} >{$}l<{$}} each cell will be interpreted as if it has a `$` before its content and a `$` after (math mode).
2017-02-11Use new warnings throughout the code base.John MacFarlane1-6/+13
2017-02-10LaTeX reader: Improved messages for skipped environments.John MacFarlane1-5/+13
2017-02-10LaTeX reader: Improved warning messages for unknown commands.John MacFarlane1-19/+23
2017-02-09LaTeX reader: Issue warnings when skipping unknown latex commands.John MacFarlane1-4/+10
See #3392.