aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/LaTeX.hs
AgeCommit message (Collapse)AuthorFilesLines
2016-07-29LaTeX reader: drop duplicate `*` in bibtexKeyCharsAlbert Krewinkel1-1/+1
2016-07-20LaTeX reader: be more forgiving of non-standard characters.John MacFarlane1-1/+1
E.g. `^` outside of math. Some custom environments give these a meaning, so we should try not to fall over when we encounter them.
2016-07-20LaTeX reader: more robust parsing of unknown environments.John MacFarlane1-2/+9
We no longer fail on things like `^` inside options for tikz. Closes #3026.
2016-07-01LaTeX reader: strip off double quotes around image source if present.John MacFarlane1-1/+8
Avoids interpreting these as part of the literal filename. See #2825.
2016-06-29LaTeX reader: fixed `\cite` so it is a NormalCitation not AuthorInText.John MacFarlane1-2/+2
2016-02-28LaTeX reader: handle interior `$` characters in math.John MacFarlane1-4/+12
e.g. `$$\hbox{$i$}$$`. Partially addresses #2743.
2016-01-31LaTeX reader: `inlineCommand` now gobbles an empty `{}` after any command.John MacFarlane1-1/+2
This gives better results when people write e.g. `\TeX{}` in Markdown. \TeX{} and \LaTeX{} now works as expected with `pandoc -f markdown -t latex`. Closes #2687.
2016-01-29Properly handle LaTeX "math" environment as inline math.John MacFarlane1-0/+1
See #2171.
2016-01-11Fixed regression in latex smart quote parsing.John MacFarlane1-4/+5
Closes #2645. In cases where a match was not found for a quote, everything from the open quote to the end of the paragraph was being dropped.
2015-12-22LaTeX reader: allow blank space between braced arguments of commands.John MacFarlane1-1/+3
For example \foo {bar} {baz} Closes #2592.
2015-12-12Modified readers to emit SoftBreak when appropriate.John MacFarlane1-3/+9
2015-11-24LaTeX reader: Improved smart quote parsing.John MacFarlane1-14/+13
This fixes redering of unmatched quotes. Closes #2555.
2015-11-23LaTeX reader: Use curly quotes for unmatched `.John MacFarlane1-1/+8
Partially addresses #2555. Note that there's still a problem with the code sample given.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-10/+19
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-19Rationalized behavior of --no-tex-ligatures and --smart.John MacFarlane1-9/+15
This change makes `--no-tex-ligatures` affect the LaTeX reader as well as the LaTeX and ConTeXt writers. If it is used, the LaTeX reader will parse characters `` ` ``, `'`, and `-` literally, rather than parsing ligatures for quotation marks and dashes. And the LaTeX writer will print unicode quotation mark and dash characters literally, rather than converting them to the standard ASCII ligatures. Note that `--smart` has no affect on the LaTeX reader. `--smart` is still the default for all input formats when LaTeX or ConTeXt is the output format, *unless* `--no-tex-ligatures` is used. Some examples to illustrate the logic: ``` % echo "'hi'" | pandoc -t latex `hi' % echo "'hi'" | pandoc -t latex --no-tex-ligatures 'hi' % echo "'hi'" | pandoc -t latex --no-tex-ligatures --smart ‘hi’ % echo "'hi'" | pandoc -f latex --no-tex-ligatures <p>'hi'</p> % echo "'hi'" | pandoc -f latex <p>’hi’</p> ``` Closes #2541.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Merge pull request #2502 from minoki/latex-comment-environmentJohn MacFarlane1-1/+2
LaTeX reader: Handle `comment` environment.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-11-08LaTeX reader: Handle `comment` environment.ARATA Mizuki1-1/+2
The `comment` environment is handled in a similar way to the `verbatim` environment, except that its content is discarded.
2015-10-15LaTeX reader: fixed longtable support.John MacFarlane1-1/+1
2015-10-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-2/+1
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-10-09LaTeX reader: don't eat excess whitespace after macros.John MacFarlane1-4/+4
Really close #2446.
2015-10-09LaTeX reader: don't eat whitespace after macro with only opt arg.John MacFarlane1-1/+3
Closes #2446.
2015-09-23LaTeX reader: support longtable.John MacFarlane1-0/+2
Closes #2411.
2015-08-08LaTeX reader: Implement \Cite.John MacFarlane1-0/+1
See #2335.
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-10/+19
(mb21)
2015-07-23LaTeX reader: support abstract environment.John MacFarlane1-0/+1
The abstract populates an "abstract" metadata field.
2015-07-21LaTeX reader: properly handle booktabs lines.John MacFarlane1-1/+10
Lines aren't part of the pandoc table model, but we can just ignore them. Closes #2307.
2015-06-29LaTeX reader: Allow `_` and `^` as regular inline text.John MacFarlane1-1/+1
Normally these will cause an error in LaTeX, but there are contexts (e.g. `alltt` environments) where they are okay. Now that we aren't treating them as super/subscript outside of math mode, it seems okay to parse them as regular text.
2015-06-29LaTeX reader: don't parse `_`,`^` as super/sub outside math mode.John MacFarlane1-2/+0
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-04-22LaTeX reader: recognize `\newpage` as a block command.John MacFarlane1-0/+1
2015-04-12LaTeX Reader: Code cleanupNikolay Yakimov1-92/+82
2015-03-31Latex Reader: Block commands code cleanupNikolay Yakimov1-3/+2
2015-03-30Latex Reader: Guard against para starting with inline macroNikolay Yakimov1-0/+1
2015-03-30LaTeX Reader: check for block-level newcommand aliases in blockCommandNikolay Yakimov1-3/+13
2015-03-28Merge branch 'errortype' of https://github.com/mpickering/pandoc into ↵John MacFarlane1-7/+4
mpickering-errortype Conflicts: benchmark/benchmark-pandoc.hs src/Text/Pandoc/Readers/Markdown.hs src/Text/Pandoc/Readers/Org.hs src/Text/Pandoc/Readers/RST.hs tests/Tests/Readers/LaTeX.hs
2015-03-14Properly gobble spaces after \\.John MacFarlane1-10/+12
Closes #2007.
2015-03-14LaTeX reader: allow block content in \title{}.John MacFarlane1-1/+3
Closes #2001.
2015-03-08LaTeX reader: allow non-empty colsep in tablesMathias Schenner1-1/+1
The `tabular` environment allows non-empty column separators with the "@{...}" syntax. Previously, pandoc would fail to parse tables if a non-empty colsep was present. With this commit, these separators are still ignored, but the table gets parsed. A test case is included.
2015-03-08LaTeX reader: allow valign argument in tablesMathias Schenner1-1/+1
The `tabular` environment takes an optional parameter for vertical alignment. Previously, pandoc would fail to parse tables if this parameter was present. With this commit, the parameter is still ignored, but the table gets parsed. A test case is included.
2015-03-07LaTeX reader: ignore options in `\lstinline`.John MacFarlane1-1/+1
Rather than raising a parse error. Closes #1997.
2015-02-18Change return type of LaTeX readerMatthew Pickering1-7/+4
2015-01-22LaTeX reader: don't limit includes to .tex extension.John MacFarlane1-2/+8
Previously `\input` and `\include` would only work if the included files had the extension `.tex`. This change relaxes that restriction, though if the extension is not `.tex`, it must be given explicitly in the `\input` or `\include`. Closes #1882.
2015-01-05ghc 7.10.1 RC1 requires specifying the type of String literals ↵Mark Wright1-2/+2
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof...
2015-01-01LaTeX reader: handle `tabular*` environment.John MacFarlane1-3/+5
This change allows pandoc not to choke on the table-width parameter of `tabular*`. Note that the table width is not actually parsed or taken into account, but this should give tolerable results in many cases. Closes #1850.
2014-12-16LaTeX reader: parse math environments as inline when possible.John MacFarlane1-15/+42
Closes #1821.
2014-12-15LaTeX reader: parse label after caption into a span...John MacFarlane1-4/+11
instead of inserting an additional paragraph of bracketed text. Closes #1747.
2014-12-15Merge branch 'patch-1' of https://github.com/Wikiwide/pandoc into ↵John MacFarlane1-0/+2
Wikiwide-patch-1 Conflicts: src/Text/Pandoc/Readers/LaTeX.hs
2014-12-15LaTeX reader: better handling of `\noindent` and `\greektext`.John MacFarlane1-1/+3
Closes #1783.