This project is read-only.

Bibliography PDF output: how to remove [1], [2] when using textual citations and APA style?

Oct 13, 2015 at 11:12 AM
Edited Oct 13, 2015 at 1:13 PM
Hi!

First: thank you for your hard work with Madoko, it might very well suite my needs for academic writing!

However I have a problem with using textual references in a document with this metadata:
Doc class  : article
Bib Style   : apalike
Cite Style  : textual
In the document, a Markdown reference:
Mary Example (-@example_2008, 2)...
renders nicely into:
Mary Example (2008, 2)...
But when I have later in the markdown file the [BIB] section, the reference has an unneeded [1]:
[1] Example, M. (2008). Example title. Example Journal , 12.
in the PDF output. In the HTML version there is no [1], and the bibliography looks correct. Is there a way to remove the [1] from the PDF output as well?
Oct 13, 2015 at 8:16 PM
Hi -- thanks for enjoying Madoko :-)

You found a bug! I will fix it today and try to push a fresh release soon.
However, first of all, you usually need to also include a special package to set the bibliography in a textual style -- Madoko just emits \bibitem commands and it is up to latex to not use the [1] format. So, use:
Package: natbib
to display the bibliography correctly. However, the bug is that I accidentially made a mistake in the prelude; I think you can work around it by adding the following meta-data rule too:
~BibItem  : tex-cmd-before="\bibitem[&cite-label;]{&id;}"
(currently, it uses label instead of cite-label and therefore is always numeric :-( ).

Let me know if this work for you and I'll update the prelude soon and add some more documentation too about the intricacies of textual bibliographies.
Oct 19, 2015 at 12:02 PM
Edited Oct 19, 2015 at 12:04 PM
Hi!

Thanks for your response. Unfortunately neither one of those worked, with Madoko 0.9.9-beta. I think using natbib sort of worked at some point, but it gives quite a few errors in LaTeX output, and now when I retry it, it does not fix the problem. Using
Package     : biblatex
doesn't give any errors (and I think biblatex is the best bibliography manager), but the problem with [1] is in that one as well. Using your "~BibItem" hack results in the key in paranthesis [Example, M.].

So hope you can get the real fix out soon!
Oct 23, 2015 at 11:02 PM
I think I have fixed the trouble with bibitems in the latest release (0.9.12-beta). Please try it out.
You may have to:
  • Reset the prelude: in the online version write "Prelude: clear", wait a bit so it can catch up, and then delete that line again. This will load a fresh copy from the server.
  • Use a document class that supports natural references. It may work though as is -- let me know how it goes.
Best,
-- Daan
Nov 4, 2015 at 9:33 AM
Unfortunately 0.9.12-beta does not produce the right PDF either. With this markdown:
Doc class   : article
Bib Style   : apalike
Cite Style  : textual
Package : biblatex

Referencing Mary Example (-@example_example_2008, 2-3) and Matt Etc  (-@etc_and_2009, 4-5)

[BIB]
The HTML output is correct
Referencing Mary Example (2008, 2-3) and Matt Etc (2009, 4-5)

References
Etc, M. (2009). And then some. 45:43–72. 🔎
Example, M. (2008). Example book. International Publisher. 🔎
But the PDF output now instead of [1] has the [lastname, year] in front of the bibliography line:
Referencing Mary Example (2008, 2-3) and Matt Etc (2009, 4-5)

References
[Etc, 2009] Etc, M. (2009). And then some. 45:43–72.
[Example, 2008] Example, M. (2008). Example book. International Publisher.
This is because in the .tex file there is:
\bibitem[Example, 2008]{example_example_2008}\mdline{18;madoko-test-bib.bbl:12}Example, M. (2008).
Might there be some way for me to fix that myself?
Nov 4, 2015 at 6:22 PM
ah, darn -- sorry to see there is still trouble. But there are many ways to fix it :-) -- and perhaps you can help to refine the design too.

First of all, Madoko now generates standard \bibitem[<label>]{<cite-key>} commands to work better with the publishers. Currently, Madoko leaves out the [<label>] part when numeric citations are used (which causes bibitem to be a regular \item and be numbered) but leaves it in otherwise. Now it is up to the LaTeX package to display it nicely... and in your case, it doesn't. But for example, if you would use the sigplanconf.cls style, it will override the \bibitem command to always display a numbered reference list.

So, one solution is to explicitly leave out the [<label>] part when generating bibitems, here the metadata key to do that:
~BibItem  : tex-cmd-before="\bibitem{&id;}"
Another nice solution is to use a package that always numbers the references, like sigplanconf.cls.

This will still leave the references numbered, while sometimes you just want the references by itself. In general, this requires LaTeX to typeset things differently so it requires either a special document class or package, or you can redefine \@biblabel yourself:
Tex Header:
    \makeatletter
    \renewcommand\@biblabel[1]{}
    \makeatother
Hope this helps for now.
In general, I am not sure how to do the design here -- it depends a bit on the LaTeX package style; on the other hand, it would be nice to choose the bibliography list style just like we can set the citation style in Madoko. For example,
References Style: <numberic|labeled|none>
Where labeled is the default of passing the label (necessary for the natbib package), numeric just itemizes, and none leaves out the label completely (by redefining \@biblabel). What do you think?
Nov 5, 2015 at 6:30 AM
Thanks for looking into this! Adding this:
Tex Header:
    \makeatletter
    \renewcommand\@biblabel{}
    \makeatother
produces the correct output for both HTML and PDF. I would definitely prefer to do:
References Style: none
instead of that. But more than that, as a user, I would expect both the HTML and PDF References section to look identical, so changing References Style should then change the HTML output in the same way. Not sure if that is possible though.