Commit graph

144 commits

Author SHA1 Message Date
John MacFarlane
dfa4b76630 Changes to literate haskell options.
- Removed writerLiterateHaskell from WriterOptions.
- Removed readerLiterateHaskell from ReaderOptions.
- Added Ext_literate_haskell to Extensions.  Test for this
  instead of the above.
- Removed failUnlessLHS from Shared.

Note:  At this point, +lhs and .lhs extension no longer has any effect.
Need to fix.
2012-08-08 23:18:19 -07:00
John MacFarlane
acde1e82d2 Changed reader parameters from ParserState to ReaderOptions. 2012-07-25 22:35:41 -07:00
John MacFarlane
ef0619cc6d Moved ParseRaw from ParserState to ReaderOptions. 2012-07-25 11:43:56 -07:00
John MacFarlane
308436996e Use catch from Control.Exception to avoid warnings. 2012-07-24 19:38:16 -07:00
John MacFarlane
2c30c48757 Use Parser as type synonym for Parsec. 2012-07-20 15:54:57 -07:00
John MacFarlane
5085962c28 Text.Pandoc.Parsing: Export all Parsec functions used in pandoc code.
No other module directly imports Parsec.  This will make it easier
to change the parsing backend in the future, if we want to.
2012-07-20 14:41:44 -07:00
John MacFarlane
a4c28ead79 Use Text.Parsec instead of Text.ParserCombinators.Parsec. 2012-07-20 14:19:06 -07:00
John MacFarlane
2e4860bc6d LaTeX reader: Support \centerline. 2012-05-22 15:38:11 -07:00
John MacFarlane
206f261194 LaTeX reader: Allow skipping of unknown block commands in \author section.
Closes #505, which was a problem with `\vspace{10pt}` inside `\author`.
2012-05-11 20:50:00 -07:00
John MacFarlane
5a244bb7b3 LaTeX reader: Make \label and \ref sensitive to --parse-raw.
IF --parse-raw is selected, these will be parsed as raw latex
inlines, rather than bracketed text.
2012-04-15 17:41:45 -07:00
John MacFarlane
a388024a57 Small simplification of blank parser in LaTeX reader. 2012-04-11 08:52:16 -07:00
John MacFarlane
a4388279de LaTeX reader: Parse 'dimension' arguments to unknown commands.
e.g. `\parindent0pt`
2012-04-10 18:56:08 -07:00
John MacFarlane
54c9d4348a LaTeX reader: Control sequences can't be followed by a letter.
This fixes a bug where `\begingroup` was parsed as `\begin`
followed by `group`.
2012-04-10 18:25:18 -07:00
John MacFarlane
4fce1a63b1 LaTeX reader: Handle \bgroup, \egroup, \begingroup, \endgroup. 2012-04-07 16:16:43 -07:00
John MacFarlane
1db909e49b Fixed bug parsing LaTeX tables with one column.
Thanks to Steven Solie for finding the bug.
2012-03-19 08:18:32 -07:00
John MacFarlane
a768844751 Fixed lstlisting environment in LaTeX reader.
Closes #443.
2012-03-10 12:33:55 -08:00
John MacFarlane
c5fb21d524 Support "minted" as a LaTeX verbatim block.
Closes #431.
2012-02-27 11:37:54 -08:00
John MacFarlane
bf4e59bc46 LaTeX reader: correctly handle \^{}. 2012-02-25 09:55:38 -08:00
John MacFarlane
14984a7130 LaTeX reader: Fixed accents.
\~{a}, \c{c}.
2012-02-25 09:24:39 -08:00
John MacFarlane
24e3a65167 LaTeX math environment fixes. Closes #423.
`aligned` is now used instead of the nonexistent `aligned*`.
`multline` instead of the nonexistent `multiline`.
2012-02-19 21:11:07 -08:00
John MacFarlane
f59e33dd1a LaTeX reader: Add ", " to suffix...
if it doesn't start w space or punctuation.  Otherwise we
get no space between the year and the suffix in author-date styles.
2012-02-10 21:48:42 -08:00
John MacFarlane
ad4062fbff Made LaTeX parser more robust.
+ Skip options after block commands.
+ Correctly handle {\\} in braced.
+ Added a needed 'try'.
2012-02-09 17:45:40 -08:00
John MacFarlane
5ac6f88e34 Better handling of raw latex environments in markdown.
Now

    \begin{equation}
    a_1
    \end{equation}

turns into a raw latex block as expected.
2012-02-09 14:30:37 -08:00
John MacFarlane
1c432e72ea Put LaTeX verse environments in blockquotes. 2012-02-08 14:03:55 -08:00
John MacFarlane
328c91e307 Handle escaped $ in latex math. Closes #186. 2012-02-07 19:41:37 -08:00
John MacFarlane
df3f3ddb6e LaTeX reader: use raw latex as fallback for Cites.
This way you can still get the raw latex back, even if you don't
process with citeproc.  Previously, cites were not visible at all
unless you specified --biblio on the command line and converted
them using citeproc, or used --natbib or --biblatex.
2012-02-06 12:42:12 -08:00
John MacFarlane
9bf6e665ea Removed outdated comment in LaTeX reader. 2012-02-05 22:51:42 -08:00
John MacFarlane
f97391c7de Support \frametitle, \framesubtitle. 2012-02-05 09:28:56 -08:00
John MacFarlane
922469bbb2 LaTeX reader: Fixed bug in authors. 2012-02-05 09:06:34 -08:00
John MacFarlane
bae3b49a5a LaTeX reader: Support \TeX, \LaTeX. 2012-02-05 08:50:25 -08:00
John MacFarlane
c54c3d50b0 LaTeX reader: Skip everything after \end{document}. 2012-02-05 08:46:04 -08:00
John MacFarlane
79f1594470 Added \vspace and \hspace to latex ignored block commands. 2012-02-04 23:19:09 -08:00
John MacFarlane
be8bddcaf3 Improvements to LaTeX reader:
* Handle \ps
* Ignore ignorable commands in a uniform way.
* Handle \P
* handleIncludes skips \verb commands.
2012-02-04 22:28:16 -08:00
John MacFarlane
4257b9aff5 Handle \address and \signature in letter environment. Closes #393. 2012-02-04 20:02:00 -08:00
John MacFarlane
800d5cdb07 LaTeX reader: support macron accents \=o. 2012-02-04 19:36:05 -08:00
John MacFarlane
80505bc490 LaTeX reader: support \. dot accent. 2012-02-04 19:31:01 -08:00
John MacFarlane
0ec953793d handleIncludes: read file as UTF8, allow multiples separated by commas.
e.g. \usepackage{a,b}
2012-02-04 15:56:55 -08:00
John MacFarlane
93dad75a48 Don't print warnings for not-found packages, includes. 2012-02-04 13:31:21 -08:00
John MacFarlane
3f87c43640 Revert "LaTeX reader: Use kpsewhich to find paths for handleIncludes."
This reverts commit 1f90c6d7e0.
2012-02-04 13:20:36 -08:00
John MacFarlane
1f90c6d7e0 LaTeX reader: Use kpsewhich to find paths for handleIncludes.
Fall back without an error if kpsewhich is not available.
2012-02-04 13:10:48 -08:00
John MacFarlane
253a9e32aa Have handleIncludes look for local .sty files from \usepackage. 2012-02-04 13:01:00 -08:00
John MacFarlane
1e772aa59c LaTeX reader: small bug fixes. 2012-02-04 12:51:27 -08:00
John MacFarlane
e58d5bf087 Minor formatting change 2012-02-04 12:27:37 -08:00
John MacFarlane
47eb69a7e1 LaTeX reader: Factored out rawEnv 2012-02-04 12:27:24 -08:00
John MacFarlane
ade08f6330 Small improvements in latex table parser. 2012-02-04 11:50:06 -08:00
John MacFarlane
75485c2f11 Complete rewrite of LaTeX reader.
* The new reader is more robust, accurate, and extensible.
  It is still quite incomplete, but it should be easier
  now to add features.

* Text.Pandoc.Parsing: Added withRaw combinator.

* Markdown reader: do escapedChar before raw latex inline.
  Otherwise we capture commands like \{.

* Fixed latex citation tests for new citeproc.

* Handle \include{} commands in latex.
  This is done in pandoc.hs, not the (pure) latex reader.
  But the reader exports the needed function, handleIncludes.

* Moved err and warn from pandoc.hs to Shared.

* Fixed tests - raw tex should sometimes have trailing space.

* Updated lhs-test for highlighting-kate changes.
2012-02-04 09:56:43 -08:00
John MacFarlane
17e70940a0 LaTeX reader: Require non-letter after certain commands.
Previously "\opening" was rendered as "\248pening".
The "\o" should not be parsed as a control sequence.
Partially addresses #393.
2012-01-29 22:27:37 -08:00
John MacFarlane
1ce7c38bc4 LaTeX reader: Handle \@. 2012-01-26 11:52:25 -08:00
John MacFarlane
a579e2c892 Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings. 2011-12-27 15:45:34 -08:00
John MacFarlane
8838f473a8 LaTeX reader: Return Str instead of Apostrophe. 2011-12-27 11:19:23 -08:00