[Question] Can the refnotes plugin be used to make A.P.A. style reference?

282 views
Skip to first unread message

Odin Jorna

unread,
May 11, 2020, 6:32:30 AM5/11/20
to TiddlyWiki
It seems that the https://kookma.github.io/Refnotes/ refnotes plugin uses another type of reference style than the A.P.A. style that I am used (or supposed to use) to.
It is possible to use this plugin to create A.P.A. style reference? It uses this format: Author, A., & Author, B. (year). Title of book. Publisher. or Author, A., & Author, B. (year). Title of article. Journal TitleVolume(Issue), page range. DOI for scientific articles.

So the example reference in the plugin: N.E. Amadeo and M.A. LabordeHydrogen Production From The Low-Temperature Water-Gas Shift Reaction: Kinetics And Simulation Of The Industrial Reactor,International Journal of Hydrogen Energy1995.

would look something like this: N.E. Amadeo and M.A. Laborde. (1995) Hydrogen Production From The Low-Temperature Water-Gas Shift Reaction: Kinetics And Simulation Of The Industrial Reactor,International Journal of Hydrogen EnergyVolume(Issue), page range. DOI

The in text reference would be: (Amadeo & Laborde, 1995) instead of :  
[Amadoe-1995]
 

Is there a way to change the formatting in the plugin code?

Anjar

unread,
May 11, 2020, 8:48:04 AM5/11/20
to tiddl...@googlegroups.com
Hi Odin,

Have a look at the tiddler $:/plugins/kookma/refnotes/macro/bibtex/showrefs. You can make your own output style there, and fiddle with things as you want; this will move the year and add DOI and page range.

\define custom_output(p)
<$wikify name=p2 text=<<__p__>> >
<$set name="curtid" tiddler=<<p2>> field="title" emptyValue="RefNotFound">
<$reveal type="nomatch" default="RefNotFound" text=<<curtid>> >
<li><$view field="bibtex-author" tiddler=<<curtid>>/> (<$view field="bibtex-year" tiddler=<<curtid>>/>), <span style="text-transform: capitalize;"><$view field="bibtex-title" tiddler=<<curtid>>/></span>,<i><$view field="bibtex-journal" tiddler=<<curtid>>/></i>, <$view field="bibtex-pages" tiddler=<<curtid>>/>. DOI <$view field="bibtex-doi" tiddler=<<curtid>>/></li>
</$reveal>
<$reveal type="match" default="RefNotFound" text=<<curtid>> >
<li style="color:red;">Reference <b>$p$</b> NOT FOUND. Check your input.</li>
</$reveal>
</$set></$wikify>
\end

The in-text formatting is governed by $:/plugins/kookma/refnotes/macro/bibtex/ref; this will give you (author, year)

\define ref(tid)
<$set name="ref-tid" tiddler=<<__tid__>> field="title" emptyValue="RefNotFound">
<div class="mr-tooltip refcls">
<$reveal type="match" default=<<ref-tid>> text="RefNotFound">
<$link overrideClass="link-refcls">
[<$view tiddler=<<__tid__>> field="title"/>]
</$link>
<div class="mr-tooltiptext ref-notfound"><b>Warning</b>: Reference Not Found.<br>Click to create it:<<create-notexisted-ref "$tid$">></div>
</$reveal>
<$reveal type="nomatch" default=<<ref-tid>> text="RefNotFound">
(<$view tiddler=<<__tid__>> field="bibtex-author"/>, <$view tiddler=<<__tid__>> field="bibtex-year"/>)
<div class="mr-tooltiptext">
<$macrocall $name="displayref-onhover" refTid=<<ref-tid>> />
</div>
</$reveal>
</div>
</$set>
\end




Best,
Anders

Mohammad

unread,
May 11, 2020, 10:58:57 AM5/11/20
to TiddlyWiki
Good hack Anders! This is the beauty of Tiddlywiki highly customizable!

--Mohammad

Odin Jorna

unread,
May 11, 2020, 11:54:28 AM5/11/20
to TiddlyWiki
Thank you so much for helping me out. Would you use instead of <<showrefs title:"References">>, <<custom_output title:"References">> in your example, to make a reference list with the new ordering?

Op maandag 11 mei 2020 14:48:04 UTC+2 schreef Anjar:

Anjar

unread,
May 11, 2020, 3:19:57 PM5/11/20
to TiddlyWiki
Hi Odin,

Good question! First I thought this was controlled by the class parameter, but I was wrong. I think the easiest would be to add another macro in $:/plugins/kookma/refnotes/macro/bibtex/showrefs:

\define showrefsAPA(filter:"[<currentTiddler>]", title:"Empty", class:"ref-list")
<$reveal tag="div" type="nomatch" default="Empty" text=<<__title__>> >
<h2>$title$</h2>
</
$reveal>
<$wikify name="mylist" text="""
<$list filter=<<__filter__>> >
<$macrocall $name="
find-refs" tid=<<currentTiddler>> />
</$list>
"""
>
<ol class="$class$">
<$list filter="[enlist<mylist>sort[]]" variable="myListItem">

<$macrocall $name="custom_output" p=<<myListItem>> />
</
$list>
</ol>
</
$wikify>
\end

and then call <<showrefsAPA title:"References">>. Or, if you have already used the showrefs macro, you could simply insert the highlighted part into the existing showrefs macro and remove "output-journal-article" on that line. Or you can simply replace the output-journal-article macro defined in $:/plugins/kookma/refnotes/macro/bibtex/showrefs with the custom_putput macro and rename it. So many options:) Please let me know if it was hard to follow or you have questions!

Best, 
Anders

TiddlyTweeter

unread,
May 12, 2020, 5:53:08 AM5/12/20
to TiddlyWiki
Ciao Odin,

Interesting thread!

Flexible citation styling is a real world issue for academic writing.

In my own case, for instance, I work in humanities and social science where APA & Chicago are often needed. It don't want have to hack that. Just switch on per document basis.

Ideally one should be able to switch between the major citation styles in TW. I think its slowly coming.

Your post is important because it succinctly presents the issues in a concrete way.

An issue is the more esoteric citations. For instance "grey literature" or "intermittent journals". Its complex to cope with all variations.

YET, for my use, just getting styling working for the main cases is good enough to work with --- and likely most writers most of the time.

The variant styling solution are likely toggleable between a "click" for a good TW programmer?

Side thoughts
TT

Anjar

unread,
May 12, 2020, 10:59:23 AM5/12/20
to TiddlyWiki
I agree @TT, that would be useful! Combine this with some way to export to pandoc-ready markdown with citations and we are close to a real alternative for academic writing

Best,
Anders

Odin Jorna

unread,
Jun 19, 2020, 9:38:24 AM6/19/20
to TiddlyWiki
Using the solutions in this thread for my study notes that I take in my tiddlywiki, I've run into another problem I am looking for some help with.

The <<showrefs>> marco does not differentiate between the type of reference. When I am referencing a journal article it is fine, but when I am referencing a book it uses the same layout for the bibliography.
I know I can add a custom_output. So I could make one for the A.P.A. styled journal reference and a A.P.A. styled book reference. I am trying to figure out how to add a check in the macro for deciding if it is a book or journal article, and there is already a 'bibtex-entry-type' field built-in. I am looking for a way to add a check of that field, so when there are references within a tiddler of different types of sources (books vs journal articles) it changes the template of that reference.

For example, this tiddler has a reference to a book (Green, 2007) and a reference to an article (Johnson, 2010).

References:
1) Author, A., & Author, B. (year). Title of book. Publisher
2) Author, A., & Author, B. (year). Title of article. Journal TitleVolume(Issue), page range. DOI




Op maandag 11 mei 2020 12:32:30 UTC+2 schreef Odin Jorna:

Mohammad

unread,
Apr 4, 2021, 1:00:01 AM4/4/21
to TiddlyWiki
Hi Odin,

 These will be addressed in new update of Refnotes plugin! 
 adding output styles for different entry types. 
See GitHub and Forum for feedback.


Odin

unread,
Apr 4, 2021, 12:24:41 PM4/4/21
to TiddlyWiki
Hi Mohammad,

Thank you for remembering and posting the update in this thread! I am really excited to read you are working on refnotes : )
I am looking at the new update and will post any feedback/questions in your announcement thread.

Odin

Op zondag 4 april 2021 om 07:00:01 UTC+2 schreef Mohammad:

Mohammad

unread,
Apr 8, 2021, 12:43:01 AM4/8/21
to TiddlyWiki
This has been addressed in Refnotes 1.6.2 beta. For citation APA has two formats (author, year) and author (year).
Refnotes 1.6.2 beta uses the second form. But it is planned to add options in setting page to support both! 

Reply all
Reply to author
Forward
0 new messages