aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
2021-03-19Use NonEmpty instead of minimumDef.John MacFarlane1-2/+2
2021-03-18Use minimumDef instead of minimum (partial function).John MacFarlane1-1/+1
2021-03-18Require safe >= 0.3.18 and remove cpp.John MacFarlane1-5/+0
2021-03-07LaTeX reader: support hyperref command.John MacFarlane1-4/+13
Closes #7127.
2021-03-03Revert "Add T.P.Readers.LaTeX.Include."John MacFarlane1-7/+50
This reverts commit b569b0226d4bd5e0699077089d54fb03d4394b7d. Memory usage improvement in compilation wasn't very significant.
2021-03-03Add T.P.Readers.LaTeX.Include.John MacFarlane1-50/+7
2021-03-03Remove T.P.Readers.LaTeX.Accent.John MacFarlane1-1/+1
Incorporate accentCommands into T.P.Readers.LaTeX.Inline.
2021-03-03Move enquote commands to T.P.LaTeX.Lang.John MacFarlane1-20/+2
2021-03-03Moved more into T.P.Readers.LaTeX.Lang.John MacFarlane1-78/+6
2021-03-03Split out T.P.Readers.LaTeX.Inline.John MacFarlane1-336/+138
2021-03-01Make T.P.Readers.LaTeX.Types an unexported module.John MacFarlane1-1/+1
[API change] This is really an implementation detail that shouldn't be exposed in the public API.
2021-03-01Factor out T.P.Readers.LaTeX.Macro.John MacFarlane1-139/+2
2021-02-28Removed unnecessary pragmas.John MacFarlane1-2/+0
2021-02-28Change T.P.Readers.LaTeX.SIunitx to export a command map...John MacFarlane1-9/+2
instead of individual commands.
2021-02-28T.P.Readers.LaTeX: Don't export tokenize, untokenize.John MacFarlane1-2/+0
[API change] These were only exported for testing, which seems the wrong thing to do. They don't belong in the public API and are not really usable as they are, without access to the Tok type which is not exported. Removed the tokenize/untokenize roundtrip test. We put a quickcheck property in the comments which may be used when this code is touched (if it is).
2021-02-28Factor out T.P.Readers.LaTeX.Math.John MacFarlane1-193/+8
2021-02-28LaTeX reader: another small efficiency improvement.John MacFarlane1-6/+12
2021-02-28LaTeX reader efficiency improvements.John MacFarlane1-31/+42
In conjunction with other changes this makes the reader almost twice as fast on our benchmark as it was on Feb. 10.
2021-02-28Move setDefaultLanguage to T.P.Readers.LaTeX.Lang.John MacFarlane1-14/+2
2021-02-28LaTeX reader: remove two unnecessary parsers in inline.John MacFarlane1-2/+0
These are handled anyway by regularSymbol.
2021-02-28Factor out T.P.Readers.LaTeX.Citation.John MacFarlane1-186/+16
2021-02-27Factor out T.P.Readers.LaTeX.Table.John MacFarlane1-363/+5
2021-02-27Split off T.P.Readers.LaTeX.Accent.John MacFarlane1-60/+8
To help reduce memory demands compiling the main LaTeX reader.
2021-02-13LaTeX reader: remove unnecessary lineJohn MacFarlane1-1/+0
2021-02-12Avoid an unnecessary withRaw.John MacFarlane1-1/+4
2021-02-12LaTeX reader improvements.John MacFarlane1-4/+2
* Rewrote `withRaw` so it doesn't rely on fragile assumptions about token positions (which break when macros are expanded). This requires the addition of `sEnableWithRaw` and `sRawTokens` in `LaTeXState`, and a new combinator `disablingWithRaw` to disable collecting of raw tokens in certain contexts. * Add `parseFromToks` to T.P.Readers.LaTeX.Parsing. * Fix parsing of single character tokens so it doesn't mess up the new raw token collecting. * These changes slightly increase allocations and have a small performance impact, but it's minor. Closes #7092.
2021-01-26Clean up BibTeX parsing.John MacFarlane1-0/+18
Previously there was a messy code path that gave strange results in some cases, not passing through raw tex but trying to extract a string content. This was an artefact of trying to handle some special bibtex-specific commands in the BibTeX reader. Now we just handle these in the LaTeX reader and simplify parsing in the BibTeX reader. This does mean that more raw tex will be passed through (and currently this is not sensitive to the `raw_tex` extension; this should be fixed). Closes #7049.
2021-01-08Update copyright notices for 2021 (#7012)Albert Krewinkel1-1/+1
2021-01-04LaTeX reader: handle filecontents environment.John MacFarlane1-6/+26
Closes #7003.
2021-01-02LaTeX reader: put contents of unknown environments in a Div...John MacFarlane1-1/+1
when `raw_tex` is not enabled. (When `raw_tex` is enabled, the whole environment is parsed as a raw block.) The class name is the name of the environment. Previously, we just included the contents without the surrounding Div, but having a record of the environment's boundaries and name can be useful. Closes #6997.
2020-12-05LaTeX reader: don't apply theorem default styling to a figure inside.John MacFarlane1-0/+1
If we put an image in italics, then when rendering to Markdown we no longer get an implicit figure. Closes #6925.
2020-11-29LaTeX reader: don't parse `\rule` with width 0 as horizontal rule.John MacFarlane1-1/+11
2020-11-26LaTeX reader: preserve center environment (#6852)Igor Pashev1-1/+1
The contents of the `center` environment are put in a `Div` with class `center`.
2020-11-21LaTeX reader: more robust parsing of bracketed options.John MacFarlane1-3/+8
Improves on 9a40976. Closes #6873.
2020-11-20Improve LaTeX option parsing...John MacFarlane1-1/+3
in cases where we run into trouble parsing inlines til the closing `]`, e.g. quotes, we return a plain string with the option contents. Previously we mistakenly included the brackets in this string. Closes #6869.
2020-11-16Move getNextNumber from Readers.LaTeX to Readers.LaTeX.Parsing.John MacFarlane1-26/+0
2020-11-05LaTeX reader: better handling of `\\` inside math in table cells.John MacFarlane1-0/+2
Previously this confused the table parser. Closes #6811.
2020-11-03Properly support optional cite argument for `\blockquote`.John MacFarlane1-7/+8
(LaTeX reader) Closes #6802.
2020-10-13LaTeX reader: support more acronym commands.John MacFarlane1-0/+10
`\acl`, `\aclp`, and capitalized versions of already supported commands. Closes #6746.
2020-10-10LaTeX reader: allow blank lines inside `\author`.John MacFarlane1-6/+3
2020-10-08LaTeX reader: Fix parsing of "show name" in newtheorem.John MacFarlane1-5/+6
Previously we were just treating it as a string and ignoring accents and formatting. See #6734.
2020-09-19Change deprecated Builder.isNull to null.John MacFarlane1-1/+1
2020-09-15LaTeX reader: fix improper empty cell filtering (#6689)Christian Despres1-8/+82
2020-09-13Fix hlint suggestions, update hlint.yaml (#6680)Christian Despres1-32/+31
* Fix hlint suggestions, update hlint.yaml Most suggestions were redundant brackets. Some required LambdaCase. The .hlint.yaml file had a small typo, and didn't ignore camelCase suggestions in certain modules.
2020-09-08Reader.LaTeX.hs: remove trailing whitespaceAlbert Krewinkel1-7/+7
2020-09-02Support numrange, numlist for siunitx.John MacFarlane1-1/+3
See #6658.
2020-09-02LaTeX reader: Support siunitx `\ang`.John MacFarlane1-0/+1
See #6658.
2020-09-02Skip opts for `\si`.John MacFarlane1-1/+1
2020-09-02LaTeX reader: support `\si` and improve other siunitx commands.John MacFarlane1-0/+1
2020-09-02LaTeX reader: support `\num` from siunitx.John MacFarlane1-1/+2