Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Pandoc-style citations. #20

Merged
merged 3 commits into from Sep 6, 2016

Conversation

Witiko
Copy link
Collaborator

@Witiko Witiko commented Sep 3, 2016

This commit adds support for Pandoc-style citations as discussed in #19.

$ lunamark -Xcitations=biblatex -t latex
Smith says blah [-@smith04].
Smith says blah \autocite*{smith04}.

The LaTeX writer produces either vanilla LaTeX2e, Natbib, or BibLaTeX output;
the Natbib and BibLaTeX output has been modelled after the output of Pandoc.
The shell interface has been extended, so that the user can specify either
-citations, +citations, or citations=[latex|natbib|biblatex].

Non-LaTeX writers echo the original citations back. These are normalized, since
the information about the precise input syntax is lost during tokenization.

Unlike in Pandoc, there is no detection of locator terms. Therefore, an
(implicitly enabled) option of citation_nbsps has been added that replaces
all spacing inside the citation pre- and post-fixes with non-breaking spaces.
Non-breaking spaces were added to writers, so they are available for future use.

The citation syntax is a superset of the syntax understood by Pandoc (1.17.2),
since it recognizes @cite1 [; @cite2; @cite3] as a string of three in-text
citations, whereas Pandoc recognizes the input as an in-text citation followed
by a string of two bracketed citations, the first of which is prefixed with a
semicolon.

@jgm jgm merged commit 4da4883 into jgm:master Sep 6, 2016
@jgm
Copy link
Owner

jgm commented Sep 6, 2016

Looks good!

@Witiko
Copy link
Collaborator Author

Witiko commented Sep 7, 2016

I'm glad you find it to your liking. This concludes my string of pull requests,
since all the additional functionality of witiko/markdown has been backported
to lunamark.

@Witiko Witiko deleted the upstream-citations branch November 10, 2016 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants