John MacFarlane
f7229b1473
LaTeX reader: citation handling changes.
...
Previously, a LaTeX citation would always be parsed as a Citation
element, with the raw LaTeX in the [Inline] part.
Now, the LaTeX citation is parsed as a Citation element only if
`--biblio` was specified (i.e. only if there is a nonempty set
of references in readerReferences). Otherwise it is parsed as
raw LaTeX.
This will make it possible to simplify some things in the markdown
writer. It also makes the LaTeX reader behave more like the Markdown
reader.
2013-03-09 10:33:25 -08:00
John MacFarlane
48be39ae2a
Support :number-lines: in RST code output.
2013-03-06 10:13:12 -08:00
John MacFarlane
f7d37c97bb
LaTeX reader: Better support for Verbatim and minted environments.
...
Closes #763 .
2013-03-06 09:58:47 -08:00
John MacFarlane
8b3a81e4dd
LaTeX reader: Handle language attribute for lstlistings.
...
Convert it to a highlighting-kate language name.
2013-03-05 22:43:27 -08:00
John MacFarlane
3692e371a7
LaTeX reader: Read optional attributes in lstlisting environment.
...
We convert these to pandoc standard names, e.g. "numberLines"
for "numbers=left", "startFrom=100" from "firstnumber=100".
Still need to add code to convert the language names.
2013-03-04 09:50:11 -08:00
John MacFarlane
f449dfd55d
LaTeX reader: Add "fig:" as title for images with captions.
...
This is needed for them to be rendered as figures.
Closes #766 .
2013-03-01 12:22:01 -08:00
John MacFarlane
52ee09608a
LaTeX reader: Handle \caption for images in figures.
...
Closes #766 .
2013-02-26 22:16:03 -08:00
John MacFarlane
7a97369d01
LaTeX reader: Don't emit empty paragraph.
...
See #761 .
2013-02-20 13:01:50 -08:00
John MacFarlane
3f2dd98f45
LaTeX reader: Parse \section*
, etc. as unnumbered sections.
2013-02-20 09:59:31 -08:00
John MacFarlane
0e03962615
LaTeX reader: Parse \hrule
as HorizontalRule.
...
Closes #746 .
2013-02-11 17:39:52 -08:00
John MacFarlane
8dfbe3bbe8
Implement --default-image-extension
for LaTeX reader.
2013-02-06 08:36:29 -08:00
John MacFarlane
8c55023d18
Fixed latex macro parsing.
...
Now latex macro definitions are preserved when output is latex,
and applied when it is another format, as originally intended.
Partially addresses #730 .
\providecommand is still not supported. For this we need changes
to texmath.
2013-01-28 10:50:58 -08:00
John MacFarlane
9cc1cf1f40
Fixed bug with escaped % in LaTeX reader.
...
Also added tests. Closes #710 .
2013-01-20 19:21:13 -08:00
John MacFarlane
8c48bd8feb
Don't put the text of an autolink in Code font.
2013-01-06 20:51:51 -08:00
John MacFarlane
6e36375bdc
LaTeX reader: Make command macros work everywhere, including non-math.
...
Environment macros still not supported.
2012-12-12 19:28:33 -08:00
John MacFarlane
09603b94f7
LaTeX reader: skip comments in handleIncludes.
2012-11-05 08:22:26 -08:00
John MacFarlane
a6e56235d5
LaTeX reader: Avoid include loops.
2012-11-01 13:49:20 -07:00
John MacFarlane
0f24816291
Revert "LaTeX reader: Added code to handleIncludes to avoid inf loops."
...
This reverts commit da87837318
.
Reason: The code was overzealous and would rule out some things
we want to be able to do, like include the same file multiple
times.
2012-11-01 10:18:17 -07:00
John MacFarlane
da87837318
LaTeX reader: Added code to handleIncludes to avoid inf loops.
...
e.g. when one file includes another which includes it.
2012-11-01 10:17:00 -07:00
John MacFarlane
6dff7dccaa
LaTeX reader: Improved handling of included files.
...
* `\input` now works, as well as `\include`.
* TEXINPUTS is used.
* We now look recursively into included files for more included files.
2012-11-01 09:42:10 -07:00
John MacFarlane
06300e59d5
Removed citationSuppressParens.
...
Makefile: Use citeproc-0.3.6 release.
2012-10-28 09:36:15 -07:00
John MacFarlane
6f2347635c
LaTeX reader: Initialize citationSuppressParens field.
2012-10-22 19:17:00 -07:00
John MacFarlane
cfab8eaecb
Revert "LaTeX reader: Use new suppressParens option for footnote citations."
...
This reverts commit 7499499b68
.
Conflicts:
src/Text/Pandoc/Readers/LaTeX.hs
2012-10-21 23:16:23 -07:00
John MacFarlane
6f9151c64e
LaTeX reader: Basic \enquote support.
2012-10-15 20:15:34 -07:00
John MacFarlane
7499499b68
LaTeX reader: Use new suppressParens option for footnote citations.
...
Also changed Biblio, Markdown reader, and LaTeX reader tests because
of new citationSuppressParens field in Citation.
2012-10-15 19:53:57 -07:00
John MacFarlane
19e1d746da
LaTeX reader: Use normal citations, not author-in-text, for fn cites.
...
Eventually it would be nice to use a "suppress outer parens" variant,
if citeproc-hs provides one.
2012-10-14 08:44:25 -07:00
John MacFarlane
b5dd06d303
Moved bibliography processing into readers.
...
Previously this was done in src/pandoc.hs, which made it difficult
for library users.
* Removed readerCitations in ReaderOptions.
* Added readerReferences and readerCitationStyle to ReaderOptions.
* Moved use of processBiblio from main program to the
markdown and LaTeX readers.
2012-10-13 11:33:55 -07:00
John MacFarlane
40128754ab
LaTeX reader: Made rawLaTeXInline more flexible.
...
Now it will also try to parse block commands. This is usually
what we want, given how rawLaTeXInline is used in the markdown
and textile readers. If a block-level LaTeX command is used
in the middle of a paragraph (e.g. `\subtitle` inside a title),
we can treat it as raw inline LaTeX.
2012-10-11 21:21:09 -07:00
John MacFarlane
cfc2e00b84
LaTeX reader: Make \noindent
inline rather than block.
2012-10-11 20:56:44 -07:00
John MacFarlane
4349097990
LaTeX reader: Better support for citation commands.
...
* Make `\cite` etc. an AuthorInText.
* Make `\footcite` etc. into citations in notes.
2012-10-10 19:41:39 -07:00
John MacFarlane
93e92a4716
Renamed removedLeadingTrailingSpace to trim.
...
Also removeLeadingSpace to triml,
removeTrailingSpace to trimr.
2012-09-29 17:09:34 -04:00
John MacFarlane
1038606036
LaTeX reader: Added a 'try' in rawLaTeXBlock.
...
This allows the markdown reader to treat '\begin' (not followed
by an argument) as a raw string rather than erroring out when
it doesn't find a '{'.
Closes #622 .
2012-09-22 13:00:59 -07:00
John MacFarlane
4076e2f8be
LaTeX reader: Better error messages for environments.
...
Now it should tell you that it was looking for \end{env},
instead of giving "unknown parse error."
2012-09-09 19:23:55 -07:00
John MacFarlane
14dba12f90
LaTeX reader: guard against "begin"/"end" in blockCommand.
2012-09-09 18:27:52 -07:00
John MacFarlane
ccf314829b
LaTeX reader: Guard against "begin", "end" in inlineCommand.
...
Removed these from list of inline commands.
2012-09-09 18:21:53 -07:00
John MacFarlane
7d0438897b
LaTeX reader: Support obeylines environment.
...
Closes #604 .
2012-09-06 16:27:01 -07:00
John MacFarlane
e2cc9e7ca1
LaTeX reader: Use curly quotes for bare straight quotes.
2012-09-06 16:02:56 -07:00
John MacFarlane
bc4f3af2c3
LaTeX reader: Fixed parsing of paragraphs beginning with a group.
...
Previously a paragraph beginning ``` {``}hello{''} ``` would be
parsed as two paragraphs.
Closes #606 .
2012-09-06 15:28:25 -07:00
John MacFarlane
784e6e65c4
LaTeX reader: Handle \slash command.
...
Closes #605 .
2012-09-04 23:21:15 -07:00
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