[Feature Request] Support Markdown formatting of Bibliography

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

[Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

I always use Multimarkdown with Scrivener as it provides very flexible output options (especially via Pandoc). Of course markdown is just plain text, but does enable one to use full outlining, footnotes,bold / emphasis, figure legends etc. converting to multiple outputs, so for example:

Code: Select all

K. Rayner, *Q J Exp Psychol* (Hove) **62**, 1457 (2009).
becomes

K. Rayner, Q J Exp Psychol (Hove) 62, 1457 (2009).

However one major issue if I want to scan the markdown file directly with Bookends (using plain text output for the bibliography), new paragraphs require TWO spaces plus ENTER or the whitespace collapses into one paragraph (the whole bibliography becomes one long line).

So, my feature request is ideally to add another format to "Generate bibliography as" option, adding Markdown as an output format. This would generate plain text with [space][space][enter] terminating each line and *emphasis* and **bold** if specified by the formatting style. You could then paste this into the markdown document and get a well formatted bibliography...

If you don't want to add another format (even one as simple as markdown), then simply adding [space][space] before new lines would at least make it more compatible without any major impacts to the existing plain text output format.
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

You can add returns (and space + returns) in the format yourself.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

OK, so I just make a special format like [Cerebral Cortex Markdown] modified for that use case, yes I think that should work if it preserves the whitespace. Thanks Jon!

p.s. I still have lots of problems with Bookends trying to format LaTeX equations in plain text files, and still wish we had a way to stop Bookends formatting in certain parts of the text, like using HTML comment delimiters: <!-- dont try to format this R_{o} -->
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

The format has the option "don't clean up consecutive spaces".

As for scanning, you can use ~ or | as citation delimiters instead of { }.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

The tilde means subscript in markdown, e.g. CO~2~ and the | is also used in LaTeX maths :( ...
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

I also pointed out | (which can also be used, but have all 4 in use (- {} [] ~~ and || is probably uncommon). Feel free to suggest another symbol.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

Most of the standard symbols are used in LaTeX[1]: + - = ! / ( ) [ ] < > | ' : \ { } $ _ ^ and the tilde and asterisk used by markdown. I suppose the « » could be an option, but this would conflict with non-English quoting. The section symbol § probably doesn't conflict with anything, but would look very "cluttered" in text. The double tilde could be an option too, and perhaps less cluttered: .

So without a don't-parse syntax functional then those are probably the best compromises.

----
[1] This is why LaTeX, Multimarkdown, Pandoc and many others use specific parsing delimiters. Latex uses \[\], \( \), $$$$ and $$ and these are also used my MMD and Pandoc to denote an enclosed maths section. MMD and Pandoc also enable the use of <!-- HTML comments --> to stop parsing altogether, which solves these problems entirely.
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

How about <<temp cite>>?

Jon
Sonny Software
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

To answer my own question, I'll be adding

[[temp cite]]

and

<<temp cite>>

as options in the next update.

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

Jon would your scanning code be able to deal with unterminated blocks? What I mean is that << could be used by people in normal text without the matching closing >>, which may cause bookends to read in a large text chunk. Also blocks of code (aka computer science papers) could falsely trigger using that delimeter.

Otherwise [[]] and <<>> would be much less likely to clash with Multimarkdown/LaTeX therefore would be a welcome addition. Some way to convert temporary citations to different formats in existing projects would then be neat. I'll happily contribute a script to do that when/if I get time (which I can make so it ignores LaTeX maths or code blocks).
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

I think the odds of someone using both [[ ]] and << >> (or their unterminated variants) in the same paper are quite small (I've never used either). I'm not worried about that.

As for converting temp citations between difference formats, that's what Proofreading scans are for. It won't change delimiters (a simple search/replace in your word processor can do that), but it will change between, say, "by author-date", "by content", and "by format".

Jon
Sonny Software
iandol
Posts: 468
Joined: Fri Jan 25, 2008 2:31 pm

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by iandol »

OK, proofreading scan should do 99.48% of the heavy lifting, great! Is there a reason not to let the proofreading scan also change the delimiters?
Jon
Site Admin
Posts: 10098
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: [Feature Request] Support Markdown formatting of Bibliography

Post by Jon »

Because Bookends uses the delimiters set in preferences to detect the citations. If you set them to something else Bookends won't find the citations you inserted with different delimiters.

Use find/replace.

Jon
Sonny Software
Post Reply