fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

consecutive citations #79

Closed janrito closed 12 years ago

janrito commented 13 years ago

When consecutive citations are processed to latex, they are kept as separate. I would guess that if the default behaviour for most uses would be better if they were joined:

[#cit1][#cit2][#cit3]

to:

~\citep{cit1, cit2, cit3}

rather than:

~\citep{cit1}~\citep{cit2}~\citep{cit3}

Maybe they could be manually separated by adding a space in between the references:

[#cit1] [#cit2] [#cit3]
fletcher commented 13 years ago

This is typically handled in a post-processing script, if desired. I'll look into including it in the built-in output.

fletcher commented 13 years ago

I looked at this again, and it's going to take some serious code refactoring. Not a high priority given everything else on my plate, so you're definitely better off with a post-processing script to do this (which is how it's always been with MMD).

janrito commented 13 years ago

Thanks for taking a look at it again.

janrito commented 12 years ago

I was looking at how pandoc's markdown deals with this issue.

[@cit1; @cit2; @cit3] is used to denote consecutive citations.

The ; in multimarkdown actually denotes an authorless citation. But the idea could be incorporated by just changing the separator to ,. The advantage of this approach would be that the current syntax would not change. For example,

[#cit1][#cit2][#cit3]

would translate to:

~\citep{cit1}~\citep{cit2}~\citep{cit3}

but

[#cit1, #cit2, #cit3]

would translate to:

~\citep{cit1, cit2, cit3}
janrito commented 12 years ago

I just realised that if you write:

[#cit1, cit2, cit3]

multimarkdown translates directly to:

~\citep{cit1, cit2, cit3}

I feel very dumb now.