Book references

187 views
Skip to first unread message

Jon

unread,
Mar 21, 2020, 9:39:50 AM3/21/20
to TiddlyWiki
Hi,

In a datatiddler called 'Footnotes', I have a series of book references e.g.

myref1: The Greek Myths, Robert Graves

To make reference to the book in another tiddler I use Mohammed's Refnotes

<<fnote  "{{Footnotes##myref1}} p.19">>


Then in a tiddler titled The Greek Myths, Robert Graves

{{{[!is[system]regexp:text[{{Footnotes##myref1}}]]}}}

shows the names of those tiddlers, as links, which contain a reference to the book
(I don't know if this is the most elegant way of doing this)

I was wondering, is it possible to extract the page number as well, to somehow create a list of the page numbers for myref1?

Regards
Jon

A Gloom

unread,
Mar 22, 2020, 12:11:05 AM3/22/20
to TiddlyWiki
Jon

shows the names of those tiddlers, as links, which contain a reference to the book
(I don't know if this is the most elegant way of doing this)
I was wondering, is it possible to extract the page number as well, to somehow create a list of the page numbers for myref1?

The page numbers for each footnote entry as entered in the macro?

a wild idea, so warning VOLTAILE & untested..

<$vars ftrpage="Hi">
<<fnote  "{{Footnotes##myref1}} $(ftrpage)$">>
</$vars>

then instead of {{{ }}}
go with a list widget

<$list filter="[!is[system]regexp:text{{
Footnotes##myref1}}"><$link><$view field="title"/></$link><$list filter=for reading vars of each tiddler of the first list/>
</$list>

is there any operators to read variables in a tiddler? I know there is a global (wiki wide) variable display.  https://tiddlywiki.com/#getvariable%20Operator

don't know how it will work but I'm sure someone will yell "Danger!" : D

Mohammad

unread,
Mar 22, 2020, 12:54:29 AM3/22/20
to TiddlyWiki
Jon,


On Saturday, March 21, 2020 at 6:09:50 PM UTC+4:30, Jon wrote:
Hi,

In a datatiddler called 'Footnotes', I have a series of book references e.g.

myref1: The Greek Myths, Robert Graves

To make reference to the book in another tiddler I use Mohammed's Refnotes

<<fnote  "{{Footnotes##myref1}} p.19">>


Then in a tiddler titled The Greek Myths, Robert Graves

{{{[!is[system]regexp:text[{{Footnotes##myref1}}]]}}}

I see here nested curly brackets. To my best knowledge, TW confuses with such script. 

shows the names of those tiddlers, as links, which contain a reference to the book
(I don't know if this is the most elegant way of doing this)

I was wondering, is it possible to extract the page number as well, to somehow create a list of the page numbers for myref1?

Regards
Jon

--Mohammad 

Jon

unread,
Mar 22, 2020, 3:16:32 AM3/22/20
to TiddlyWiki
So, I need to go with the list widget but there seems to be a missing [ in the example and I've played around with adding one in but can't get it to work.

Can't get this bit to work either:

<$vars ftrpage="Hi">
<<fnote  "{{Footnotes##myref1}} $(ftrpage)$">>
</$vars>

Thanks for the input.
 
Jon

Mohammad

unread,
Mar 22, 2020, 4:28:50 AM3/22/20
to TiddlyWiki
Jon,
 Give a try for this

<ol>
<$list filter="[!is[system]!has[draft.of]search:text[Footnotes##myref1]]-[<currentTiddler>]" variable=lnk>
<li><$link to=<<lnk>>><$text text=<<lnk>>/></$link></li>
</$list>
</ol>

This should also work in TW 5.1.17

--Mohammad




On Saturday, March 21, 2020 at 6:09:50 PM UTC+4:30, Jon wrote:

Jon

unread,
Mar 22, 2020, 4:43:02 AM3/22/20
to TiddlyWiki
That works, thanks Mohammad.

Now just need the list of page numbers for myref1 if that was possible.

Regards
Jon

Mohammad

unread,
Mar 22, 2020, 4:56:54 AM3/22/20
to TiddlyWiki
John,
 Do you mean in

<<fnote  "{{Footnotes##myref1}} p.19">>

extract p.19?  could you give an example in plain text?

Jon

unread,
Mar 22, 2020, 5:17:57 AM3/22/20
to TiddlyWiki
So the list widget gives a list of all the tiddlers which contain myref1.

What I'd also like is a list of the page numbers for myref1.

So yes, extract p.19 and also p.45, p.78 etc. 

Does that make sense?

Regards
Jon

Mohammad

unread,
Mar 22, 2020, 6:39:43 AM3/22/20
to TiddlyWiki
Jon,
 Have you used the showfnotes

The below code in any tiddler shows all footnotes

<<showfnotes filter:"[!is[system]search:text[myref1]]">>


For your special case, please give a try on this script

\define customOutput(p) 
<ul>
<$wikify name=p2 text=<<__p__>> >
<li><$text text={{{[<p2>split["]join[]]}}}/></li>
</$wikify>
</ul>
\end

\define jon-macro(fntext:"Footnotes##myref1")
<ol>
<$list filter="[!is[system]!has[draft.of]search:text[$fntext$]]-[<currentTiddler>]" variable=lnk>
<li>
<$link to=<<lnk>>><$text text=<<lnk>>/></$link>
<$macrocall 
 $name="find" text={{Test}}
 begin="""<<fnote""" end=""">>"""
 output="customOutput"
/>
</li>
</$list>
</ol>
\end

<<jon-macro fntext:"Footnotes##myref1">>


This solution uses the internal find macro of Refnotes plugin.
It only works on TW5.1.21+

To use above script create a new tiddler and copy and paste the above code. Save and see the results.

--Mohammad

Mohammad

unread,
Mar 22, 2020, 6:40:38 AM3/22/20
to TiddlyWiki
If you like to use above code everywhere, then tag the tiddler hosts the code with $:/tags/Macro

Good luck.
Mohammad

Jon

unread,
Mar 22, 2020, 7:23:48 AM3/22/20
to TiddlyWiki
Hi Mohammad,

Ah, I didn't investigate the showfnotes

<<showfnotes filter:"[!is[system]search:text[myref1]]">>

That gives exactly what I want!!

Thanks for your work on the other script but it seems to give the same result as your previous solution which I've adopted:

<ol>
<$list filter="[!is[system]!has[draft.of]search:text[Footnotes##myref1]]-[<currentTiddler>]" variable=lnk>
<li><$link to=<<lnk>>><$text text=<<lnk>>/></$link></li>
</$list>
</ol>


Thanks again.
Jon

Mohammad

unread,
Mar 22, 2020, 7:29:55 AM3/22/20
to TiddlyWiki
The showfnotes macro just does not show a link to tiddler where the footnote is used, but it is quite powerful.
By the way the code I sent you shows the link!

Use which one you like!

--Mohammad

Jon

unread,
Mar 22, 2020, 8:00:00 AM3/22/20
to TiddlyWiki
Ah, I see this bit should show the page numbers but it doesn't seem to work

 <$wikify name=p2 text=<<__p__>> >
<li><$text text={{{[<p2>split["]join[]]}}}/></li>

I have the page numbers listed in this format: <<fnote  "{{Footnotes##myref1}} p.19">>

Regards
Jon

Mohammad

unread,
Mar 22, 2020, 8:42:48 AM3/22/20
to TiddlyWiki
For me it shows!

Actually the output macro grabs "{{Footnotes##myref1}} p.19" and wikify it and then remove double quotes!

If you can give a link or post a simple wiki somewhere!

Jon

unread,
Mar 22, 2020, 1:34:12 PM3/22/20
to TiddlyWiki
Hi Mohammad,

I don't know how to host so I'll stick with your showfnotes macro which does what I need.

Thanks again
Jon
Reply all
Reply to author
Forward
0 new messages