aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
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
2020-09-02LaTeX reader: Factored out siunitx stuff into separate module.John MacFarlane1-223/+3
2020-08-15[Latex Reader] Fixing issues with \multirow and \multicolumn table cells (#6608)Laurent P. René de Cotret1-28/+48
* Added test to replicate (#6596) * Table cell reader not consuming spaces correctly (#6596) * Prevented wrong nesting of \multicolumn and \multirow table cells (#6603) * Parse empty table cells (#6603) * Support full prototype for multirow macro (#6603) Closes #6603
2020-08-14Change SIRange to SIrange (#6617)Emerson Harkin1-4/+4
2020-08-07[Latex Reader] Table cell parser not consuming spaces correctly (#6597)Laurent P. René de Cotret1-0/+2
* Added test to replicate (#6596) * Table cell reader not consuming spaces correctly (#6596)
2020-07-23Minimal support for SIRange in LaTeX reader (#6418)Emerson Harkin1-0/+24
Add support for `\SIRange{firstnumber}{secondnumber}{unit}` provided by siunitx. An en-dash is used instead of localized "to".
2020-07-23Col-span and row-span in LaTeX reader (#6470)Laurent P. René de Cotret1-19/+57
Add multirow and multicolumn support in LaTex reader. Partially addresses #6311.
2020-07-23Further improvements to ams theorem support, and a test.John MacFarlane1-2/+3
See #1608.
2020-07-23LaTeX reader: Add identifier in divs for ams theorem environments.John MacFarlane1-1/+1
2020-07-22LaTeX reader: SUpport ams `\theoremstyle`.John MacFarlane1-6/+28
2020-07-22Implement first optional argument for `\newtheorem`.John MacFarlane1-23/+30
This allows groups of theorem environments to be put in the same numbering sequence.
2020-07-22LaTeX reader: Don't boldface alt title in theorems.John MacFarlane1-2/+2
2020-07-22LaTeX reader: support theorem environments and `\newtheorem`.John MacFarlane1-3/+63
Includes numbering and labels and refs. Note that numbering support is not complete; we don't reset numbers with sections for example.
2020-07-22LaTeX reader: support ams proof environment.John MacFarlane1-0/+27
2020-07-22Moved more from LaTeX reader to LaTeX.Parsing.John MacFarlane1-63/+0
2020-07-20Move some code from T.P.R.LaTeX. to T.P.R.LaTeX.Parsing.John MacFarlane1-70/+14
We need to reduce the size of the LaTeX reader to ease compilation on resource-limited systems. More can be done in this vein.
2020-06-23LaTeX reader: Retain the Div around tables with attributes.John MacFarlane1-1/+8
We'll need this to store table attributes until all writers are adjusted to react to attributes on the Table element.
2020-05-19LaTeX reader: don't parse beyond `\end{document}`.John MacFarlane1-13/+25
This required some internal changes to `\subfile` handling. Closes #6380.
2020-04-28Support new Underline element in readers and writers (#6277)Vaibhav Sagar1-3/+3
Deprecate `underlineSpan` in Shared in favor of `Text.Pandoc.Builder.underline`.
2020-04-17LaTeX reader: don't put surrounding Div around Table.John MacFarlane1-2/+5
This reverts a change in the last release; the Div is no longer needed, because we can now put the id right in the Table's attributes. However, writers may still need to be modified to do something with the id in a Table (e.g. create an anchor), so in the short term we may lose the ability to link to tables in some writers.
2020-04-15Use the new builders, modify readers to preserve empty headersdespresc1-5/+7
The Builder.simpleTable now only adds a row to the TableHead when the given header row is not null. This uncovered an inconsistency in the readers: some would unconditionally emit a header filled with empty cells, even if the header was not present. Now every reader has the conditional behaviour. Only the XWiki writer depended on the header row being always present; it now pads its head as necessary.
2020-04-15Adapt to the newest Table type, fix some previous adaptation issuesdespresc1-10/+10
- Writers.Native is now adapted to the new Table type. - Inline captions should now be conditionally wrapped in a Plain, not a Para block. - The toLegacyTable function now lives in Writers.Shared.
2020-04-15Implement the new Table typedespresc1-12/+13
2020-04-07LaTeX reader: better handling of `\lettrine`.John MacFarlane1-1/+8
- SmallCaps instead of Span for the part after the initial capital. - Ensure that both arguments are parsed, so that in Markdown both are treated as raw LateX. (Closes #6258.)