aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-11-22Hlint suggestions.John MacFarlane1-1/+1
2018-11-19LaTeX reader: cleaned up handling of dimension arguments.John MacFarlane1-1/+1
Allow decimal points, preceding space. Also require text 1.1+.
2018-11-18LaTeX reader: don't allow arguments for verbatim, etc.John MacFarlane1-1/+0
2018-11-18LaTeX reader: Allow space before bracketed options.John MacFarlane1-1/+2
2018-11-18LaTeX reader: allow optional arguments after \\ in tables.John MacFarlane1-1/+2
2018-11-18LaTeX reader: improve parsing of `\tiny`, `scriptsize`, etc.John MacFarlane1-4/+18
Parse as raw, but know that these font changing commands take no arguments.
2018-10-29LaTeX reader: allow space at end of math after `\`.John MacFarlane1-2/+2
Closes #5010. Expose trimMath from T.P.Shared.
2018-10-22LaTeX reader: add support for `nolinkurl` command. (#4992)Brian Leung1-0/+2
2018-10-15LaTeX reader: small verbatim mode cleanups.John MacFarlane1-17/+15
2018-10-15LaTeX reader: simplified type on doMacros'.John MacFarlane1-1/+1
2018-10-15LaTeX reader: tokenize before pulling tokens,John MacFarlane1-4/+2
rather than after. This has some performance penalty but is more reliable. Closes #4408.
2018-10-15LaTeX reader: more care with verbatim mode in macro definitions.John MacFarlane1-17/+20
This solves some of the issues in #4408, but it is fragile and may introduce new problems. We really need to change the approach fundamentally and expand macros before pulling tokens from the stream, rather than after.
2018-10-15LaTeX reader: more careful placement of withVerbatimMode.John MacFarlane1-14/+16
for macros
2018-10-15LaTeX reader: make macroDef polymorphic and allow in inline context.John MacFarlane1-10/+4
Otherwise we can't parse something like ``` \lowercase{\def\x{Foo}} ``` I have actually seen tex like this in the wild.
2018-10-15LaTeX reader: improved parsing of `\def`, `\let`.John MacFarlane1-11/+18
We now correctly parse: ``` \def\bar{hello} \let\fooi\bar \def\fooii{\bar} \fooi +\fooii \def\bar{goodbye} \fooi +\fooii ```
2018-10-15More refactoring of LaTeX reader code.John MacFarlane1-1/+1
2018-10-15LaTeX reader: improve parsing of `\def` argspec.John MacFarlane1-4/+4
2018-10-14LaTeX reader: skip `\PackageError` commands.John MacFarlane1-0/+2
See #4408. But this doesn't fix the issue.
2018-10-07LaTeX reader: fix bugs omitting raw tex.John MacFarlane1-2/+7
The default is `-raw_tex`, so no raw tex should result unless we explicitly say `+raw_tex`. Previously some raw commands did make it through. Closes #4527.
2018-10-01Moved isArgTok to Readers.LaTeX.Parsing.John MacFarlane1-4/+0
2018-10-01Moved babelLangToBCP, polyglossiaLangToBCP to new module...John MacFarlane1-134/+2
Text.Pandoc.Readers.LaTeX.Lang (unexported).
2018-09-30LaTeX reader: simplified accent code using unicode-transforms.John MacFarlane1-322/+33
New dependency on unicode-transforms package for normalization.
2018-09-29LaTeX reader: allow verbatim blocks ending with blank lines.John MacFarlane1-1/+14
Closes #4624.
2018-09-29LaTeX reader: support breq math environments: dmath, dgroup, darray.John MacFarlane1-0/+6
2018-09-28Added Text.Pandoc.Readers.LaTeX.Parsing (unexported).John MacFarlane1-557/+3
This collects some of the general-purpose code from the LaTeX reader, with the aim of making the module smaller. (We've been having out-of-memory issues compiling this module on CI.)
2018-09-25Add support for multiprenote and multipostnote arguments in LaTeX. (#4930)Brian Leung1-1/+34
* Add support for multiprenote and multipostnote arguments. The multiprenotes occur before the first prefix of a multicite, and the multipostnotes follow the last suffix. * Add test for multiprenote and multipostnote.
2018-09-09LaTeX reader: resolve `\ref` for figure numbers.John MacFarlane1-12/+41
2018-08-29LaTeX reader: fixed parsing of \texorpdfstring.John MacFarlane1-1/+1
We were returning the wrong argument as the content.
2018-08-21LaTeX reader: support blockcquote, foreignblockquote from csquotes.John MacFarlane1-5/+19
Also foreigncblockquote, hyphenblockquote, hyphencblockquote. Closes #4848. But note: currently foreignquote will be parsed as a regular Quoted inline (not using the quotes appropriate to the foreign language).
2018-08-21LaTeX reader: support enquote*, foreignquote, hypphenquote...John MacFarlane1-6/+24
from csquotes. See #4848. Still TBD: blockquote, blockcquote, foreignblockquote.
2018-08-18Fix compiler warning.John MacFarlane1-1/+1
2018-08-17LaTeX reader: Support more text-mode accents.John MacFarlane1-1/+91
Add support for `\|`, `\b`, `\G`, `\h`, `\d`, `\f`, `\r`, `\t`, `\U`, `\i`, `\j`, `\newtie`, `\textcircled`. Also fall back to combining characters when composed characters are not available. Closes #4652.
2018-08-17LaTeX reader: use combining characters when needed for accents.John MacFarlane1-1/+4
For example, there is no unicode code point corresponding to \"{X}, so we use a combining accent.
2018-08-17Add support for latex mintinline (#4365)Marc Schreiber1-0/+11
2018-08-17LaTeX reader: fix siunitx unit commands...John MacFarlane1-174/+182
...they should only be recognized in siunitx contexts. For example, `\l` outside of an siunitx context should be l-slash, not l (for liter)! Closes #4842.
2018-08-16LaTeX reader: fix double `unnumbered` class.John MacFarlane1-21/+20
The `unnumbered` class was being included twice for starred sections. Closes #4838.
2018-08-14LaTeX reader: handle parameter patterns for `\def`.John MacFarlane1-22/+45
For example: `\def\foo#1[#2]{#1 and #2}`. Closes #4768. Also fixes #4771. API change: in Text.Pandoc.Readers.LaTeX.Types, new type ArgSpec added. Second parameter of Macro constructor is now `[ArgSpec]` instead of `Int`.
2018-08-12LaTeX reader: Allow `%` characters in URLs.John MacFarlane1-13/+31
This affects `\href` and `\url`. Closes #4832.
2018-07-19Fix for bug in parsing `\include` in markdown.John MacFarlane1-1/+10
Starting in 2.2.2, everything after an `\input` (or `\include`) in a markdown file would be parsed as raw LaTeX. This commit fixes the issue and adds a regression test. Closes #4781.
2018-07-19rawLaTeXBlock: never retokenize macroDef.John MacFarlane1-1/+1
2018-07-15Support abbreviated units for siunitx (#4773).John MacFarlane1-0/+89
2018-07-15LaTeX reader: be more forgiving in key/value option parsing.John MacFarlane1-16/+39
We now allow arbitrary LaTeX values. This helps with #4761. The `\maxwidth` is still not propagated to the latex destination, but at least we don't choke on parsing.
2018-06-25LaTeX reader: Treat `lilypond` as a verbatim environment.John MacFarlane1-1/+2
Closes #4725.
2018-06-25Fixed typo in LaTeX writer.John MacFarlane1-1/+1
2018-06-13LaTeX Reader: parse figure label into Image id (#4704)Mauro Bieg1-14/+20
closes #4700
2018-06-12LaTeX reader: allow spaces around `\graphicspath` arguments.John MacFarlane1-1/+2
Closes #4698.
2018-06-01LaTeX reader: handle includes without surrounding blanklines.John MacFarlane1-7/+9
In addition, `\input` can now be used in an inline context, e.g. to provide part of a paragraph, as it can in LaTeX. Closes #4553.
2018-05-30LaTeX reader `rawLaTeXBlock`: handle macros that resolve to a...John MacFarlane1-1/+17
...`\begin` or `\end`. Fixes #4667.
2018-05-30LaTeX reader: tighten up reading of beamer overlay specifications.John MacFarlane1-9/+20
Ideally we'd turn these on only when reading beamer, but currently beamer is not distinguished from latex as an input format. This commit also activates parsing of overlay specifications after commands in general (e.g. `\item`), since they can occur in many contexts in beamer. Closes #4669.
2018-05-16LaTeX reader: parse more siunitx unit commands.John MacFarlane1-1/+73
Improves on earlier fix for #4296.