Commit graph

246 commits

Author SHA1 Message Date
Mark Wright
f18ceb1b5e ghc 7.10.1 RC1 requires specifying the type of String literals https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof... 2015-01-05 14:38:06 +11:00
John MacFarlane
e7187fa3bb LaTeX reader: handle tabular* environment.
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.
2015-01-01 08:46:45 -08:00
John MacFarlane
7e41d0b1ee LaTeX reader: parse math environments as inline when possible.
Closes #1821.
2014-12-16 12:27:04 -08:00
John MacFarlane
58ea1ce5f1 LaTeX reader: parse label after caption into a span...
instead of inserting an additional paragraph of bracketed text.
Closes #1747.
2014-12-15 21:50:10 -08:00
John MacFarlane
8a3363a269 Merge branch 'patch-1' of https://github.com/Wikiwide/pandoc into Wikiwide-patch-1
Conflicts:
	src/Text/Pandoc/Readers/LaTeX.hs
2014-12-15 20:27:42 -08:00
John MacFarlane
9bf76fa5a2 LaTeX reader: better handling of \noindent and \greektext.
Closes #1783.
2014-12-15 10:34:59 -08:00
John MacFarlane
47c360e079 Improved texorpdfstring patch #1148.
* Make LaTeX reader recognize texorpdfstring.
* Don't use texorpdfstring unless it's actually needed.
* Fix tests.
2014-12-15 10:06:03 -08:00
John MacFarlane
6c0943000d LaTeX reader: support \smartcite and \Smartcite from biblatex.
See jgm/pandoc-citeproc#26.
2014-11-25 10:03:43 -08:00
Wikiwide
678aa31561 cref, sep
Adding inlineCommands
2014-10-03 11:33:02 +10:00
Matthew Pickering
83028c5982 Exported runParserT and Stream 2014-07-22 16:37:41 +01:00
Matthew Pickering
2fb8063f78 Removed (>>~) function
This function is equivalent to the more general (<*) which is defined in
Control.Applicative. This change makes pandoc code easier to understand for
those not familar with the codebase.
2014-07-11 12:51:26 +01:00
John MacFarlane
fc291efad3 LaTeX reader: Correctly handle table rows with too few cells.
LaTeX seems to treat them as if they have empty cells at the
end.  Closes #241.
2014-06-17 00:38:55 -07:00
John MacFarlane
87c08be58f LaTeX reader: handle leading/trailing spaces in emph better.
`\emph{ hi }` gets parsed as `[Space, Emph [Str "hi"], Space]`
so that we don't get things like `* hi *` in markdown output.

Also applies to textbf and some other constructions.

Closes #1146.  (`--normalize` isn't touched by this, but
normalization should not generally be necessary with the
changes to the readers.)
2014-06-16 19:18:33 -07:00
John MacFarlane
459805de4c LaTeX reader: don't assume preamble doesn't contain environments.
Closes #1338.
2014-06-16 17:43:56 -07:00
James Aspnes
abbf33ae7d allow (and discard) optional argument for \caption 2014-06-12 21:19:00 -04:00
John MacFarlane
9681574661 LaTeX reader: Handle comments at the end of tables.
This resolves the issue illustrated in
http://stackoverflow.com/questions/24009489/comments-in-latex-break-pandoc-table.
2014-06-03 23:17:42 -07:00
Albert Krewinkel
3238a2f919 Org reader: support for inline LaTeX
Inline LaTeX is now accepted and parsed by the org-mode reader.  Both,
math symbols (like \tau) and LaTeX commands (like \cite{Coffee}), can be
used without any further escaping.
2014-05-20 22:29:21 +02:00
John MacFarlane
aa019448d6 LaTeX reader: Support \addbibresource. 2014-05-12 13:06:06 -07:00
John MacFarlane
a8319d1339 LaTeX reader: set bibliography in metadata from \bibliography cmd. 2014-05-11 22:52:29 -07:00
John MacFarlane
0092606476 LaTeX reader: Don't error on "%foo" with no newline. 2014-05-10 23:26:32 -07:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
2ba7873086 LaTeX reader: Fixed regression introduced with last commit.
Tests now pass again.
2014-05-03 18:34:23 -07:00
John MacFarlane
743dac493f LaTeX reader: Better error messages with include files.
Closes #1274.

Rewrote handleIncludes.

We now report the actual source file and position where the error
occurs, even if it is included.  We do this by inserting special
commands, `\PandocStartInclude` and `\PandocEndInclude`, that encode
this information in the preprocessing phase.

Also generalized the types of a couple functions from
`Text.Pandoc.Parsing`.
2014-05-03 17:37:54 -07:00
John MacFarlane
22e36e1040 LaTeX reader: Made \nocite work.
This adds nocite citations to a metadata field, `nocite`.
These will appear in the bibliography but not in the text
(unless you use a `$nocite$` variable in your template, of
course).
2014-04-26 12:14:42 -07:00
John MacFarlane
fcddd0e4bd LaTeX reader: handle @{} and p{length} in tabular.
The length is not actually recorded, but at least we get a table.

Closes #1180.
2014-04-06 15:11:49 -07:00
John MacFarlane
69a7c9f634 LaTeX reader: Better handling of figure and table with caption.
We now look for a \caption inside the environment; if one is
found, it is attached to the graphic or tabular found there.

Closes #1204.
2014-03-25 23:10:43 -07:00
John MacFarlane
994597f071 Revert "LaTeX reader: Added LPState."
This reverts commit 82ddec698e.
2014-03-25 22:40:18 -07:00
John MacFarlane
82ddec698e LaTeX reader: Added LPState.
Plan is to use this instead of ParserState in LP.
2014-03-25 15:38:30 -07:00
John MacFarlane
5e69f845d5 LaTeX reader: Better handling of "table" environment.
Positioning options no longer rendered verbatim.
Partially addresses #1204.
2014-03-25 12:04:25 -07:00
Henry de Valence
0c5e7cf8cb HLint: use elem and notElem
Replaces long conditional chains with calls to `elem` and `notElem`.
2013-12-19 20:19:24 -05:00
John MacFarlane
0132f6fcb7 LaTeX reader: Support babel-style quoting: ` "..."' ``. 2013-12-17 16:03:43 -08:00
Jeff Arnold
5adbe7b365 LaTeX reader: add support for Verb macro 2013-12-13 19:16:04 -05:00
John MacFarlane
def05d3504 HTML reader: Parse LaTeX math if appropriate options are set.
* Moved inlineMath, displayMath from Markdown reader to Parsing.
* Export them from Parsing.  (API change.)
* Generalize their types.
2013-12-06 17:15:13 -08:00
John MacFarlane
a3eba6ee84 LaTeX reader: Parse contents of curly quotes or matched " as quotes. 2013-11-18 20:28:27 -08:00
John MacFarlane
e690c87dc4 LaTeX reader: Support \textnormal as span with class "nodecor".
This is needed for pandoc-citeproc.
2013-11-17 09:07:25 -08:00
John MacFarlane
75ea0c4d0d LaTeX reader: Improved citation parsing.
This fixes a run-time error that occured with `\citet{}` (empty
list of keys).  It also ensures that empty keys don't get produced.
2013-10-21 09:33:10 -07:00
John MacFarlane
1a55c8f5de LaTeX reader: Ensure that preamble doesn't contribute to text of doc. 2013-10-11 22:43:47 -07:00
John MacFarlane
25e43d1c89 LaTeX reader: Fixed character escaping in \url{}.
Previously `\~` wasn't handled properly, among others.
2013-10-11 10:43:07 -07:00
John MacFarlane
9e7072cf1b LaTeX reader: Parse {groups} as Span.
This is needed for accurate conversion of bibtex titles,
since we need to know what was protected from titlecase conversions.
2013-09-28 11:53:34 -07:00
John MacFarlane
9282f63278 Use registerHeader in RST and LaTeX readers.
This will give automatic unique identifiers, unless
`-auto_identifiers` is specified.
2013-09-01 09:13:31 -07:00
John MacFarlane
940515a00b LaTeX reader: allow spaces in alignment spec in tables.
E.g. `{ l r c }`.
2013-08-28 16:54:37 -07:00
John MacFarlane
8014809578 LaTeX reader: Allow accents with combining characters.
accent now returns [Char], not Char.
2013-08-27 20:12:21 -07:00
John MacFarlane
ad9447cf92 Merge branch 'master' of github.com:jgm/pandoc 2013-08-27 19:56:21 -07:00
John MacFarlane
e7a4bcc6fe Merge pull request #961 from nougad/add_latex_listings_label
Write id for code block to label attr in latex when listing is used
2013-08-25 20:48:38 -07:00
John MacFarlane
deb59b6235 Removed dependency on citeproc-hs.
Going forward we'll use pandoc-citeproc, as an external filter.

The `--bibliography`, `--csl`, and `--citation-abbreviation` fields
have been removed.  Instead one must include `bibliography`, `csl`,
or `csl-abbrevs` fields in the document's YAML metadata.  The filter
can then be used as follows:

    pandoc --filter pandoc-citeproc

The `Text.Pandoc.Biblio` module has been removed.  Henceforth,
`Text.CSL.Pandoc` from pandoc-citations can be used by library users.

The Markdown and LaTeX readers now longer format bibliographies and
citations.  That must be done using `processCites` or `processCites'`
from Text.CSL.Pandoc.

All bibliography-related fields have been removed from `ReaderOptions`
and `WriterOptions`: `writerBiblioFiles`, `readerReferences`,
`readerCitationStyle`.

API change.
2013-08-24 22:33:01 -07:00
Florian Eitel
5f09cf7ff0 Write id for code block to label attr in latex when listing is used
The code:

    ~~~{#test}
    asdf
    ~~~

gets compiled to html:

    <pre id="test">
    asdf
    </pre>

So it is possible to link to the identifier `test`

But this doesn't happen on latex

When using the listings package (`--listings`) it is possible to set the
identifier using the `label=test` property:

    \begin{lstlisting}[label=id]
    hi
    \end{lstlisting}

And this is exactly what this patch is doing.

Modified LaTeX Reader/Writer and added tests for this.
2013-08-22 20:15:36 +02:00
John MacFarlane
1d91e2cdb3 LaTeX reader: Added o-cedilla. 2013-08-21 20:07:36 -07:00
John MacFarlane
f7c14eddd8 Merge pull request #960 from semorrison/master
Processing some additional cedilla accents while reading LaTeX
2013-08-21 20:05:49 -07:00
Scott Morrison
5b97b150cc cedilla-o breaks the compile, removing again 2013-08-21 16:10:42 +10:00
Scott Morrison
0b5156cc7e adding some cedilla characters to the LaTeX reader 2013-08-21 16:04:06 +10:00