aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
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.
2018-05-15rawLaTeXBlock: don't expand macros in macro definitions!John MacFarlane1-11/+11
Closes #4653. Note that this only affected LaTeX in markdown. Added regression test.
2018-05-08LaTeX reader: handle `$` in `/text{..}` inside math.John MacFarlane1-7/+22
This fixes the main problem in #4576. There is still an issue about `\SI`, but that's a separate issue.
2018-04-25LaTeX reader: fixed previous commit.John MacFarlane1-3/+3
2018-04-25LaTeX reader: Improve handling of raw LaTeX (for markdown etc.).John MacFarlane1-31/+32
Previously there were some bugs in how macros were handled. Closes #4589, #4594.
2018-04-25LaTeX reader: support `\MakeUppercase`, `\MakeLowercase'.John MacFarlane1-1/+17
Also `\MakeTextUppercase`, `\MakeTextLowercase` from textcase and `\uppercase`, `\lowercase`. We don't mimic exactly the quirky semantic differences between these commands, but just uppercase/lowercase regular strings within them. We leave commands and code alone. Closes #4595.
2018-04-05LaTEX reader: properly resolve section numbers with \ref and chapters.John MacFarlane1-1/+7
Closes #4529.
2018-04-02LaTeX reader: parse sloppypar environment (#4517)Marc Schreiber1-0/+1
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-17Add support to parse unit string of \SI command (closes #4296).Marc Schreiber1-1/+14
2018-03-02LaTeX reader: Fix regression in package options including underscore.John MacFarlane1-1/+1
Closes #4424.
2018-02-26LaTeX reader: make --trace work.John MacFarlane1-2/+6
2018-02-17LaTeX reader: Fixed comments inside citations. Closes #4374.John MacFarlane1-3/+3
2018-01-19hlint code improvements.John MacFarlane1-10/+10
2018-01-19LaTeX reader: fixed parsing of tabular* environment.John MacFarlane1-1/+1
This was just a typo in the source. Closes #4279.
2018-01-14LaTeX reader: Advance source position at end of stream.John MacFarlane1-1/+1
2018-01-13LaTeX reader: pass through macro defs in rawLaTeXBlock...John MacFarlane1-4/+2
even if the `latex_macros` extension is set. This reverts to earlier behavior and is probably safer on the whole, since some macros only modify things in included packages, which pandoc's macro expansion can't modify. Closes #4246.
2018-01-13LaTeX reader: fixed pos calculation in tokenizing escaped space.John MacFarlane1-3/+6
2018-01-13LaTeX reader: allow macro definitions inside macros.John MacFarlane1-6/+9
Previously we went into an infinite loop with ``` \newcommand{\noop}[1]{#1} \noop{\newcommand{\foo}[1]{#1}} \foo{hi} ``` See #4253.
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-30LaTeX reader: Simplified a check for raw tex command.John MacFarlane1-2/+2
2017-12-28LaTeX reader: be more tolerant of `&` character.John MacFarlane1-1/+1
This allows us to parse unknown tabular environments as raw LaTeX. Closes #4208.
2017-12-26LaTeX reader: support `\foreignlanguage` from babel.John MacFarlane1-0/+30
2017-12-22`latex_macros` extension changes.John MacFarlane1-2/+4
Don't pass through macro definitions themselves when `latex_macros` is set. The macros have already been applied. If `latex_macros` is enabled, then `rawLaTeXBlock` in Text.Pandoc.Readers.LaTeX will succeed in parsing a macro definition, and will update pandoc's internal macro map accordingly, but the empty string will be returned. Together with earlier changes, this closes #4179.
2017-12-22LaTeX reader: use applyMacros in rawLaTeXBlock, rawLaTeXInline.John MacFarlane1-2/+5
2017-12-22LaTeX reader: Refactored inlineCommand.John MacFarlane1-24/+11
2017-12-21LaTeX reader: Fixed subtle bug in tokenizer.John MacFarlane1-2/+3
Material following `^^` was dropped if it wasn't a character escape. This only affected invalid LaTeX, so we didn't see it in the wild, but it appeared in a QuickCheck test failure https://travis-ci.org/jgm/pandoc/jobs/319812224
2017-12-15LaTeX reader: export tokenize, untokenize.John MacFarlane1-1/+3
Mainly so they can be tested.
2017-12-15Fixed regression in LateX tokenization.John MacFarlane1-2/+2
This mainly affects the Markdown reader when parsing raw LaTeX with escaped spaces. Closes #4159.