Best Practice: Tiddlywiki and Structure of Long Note

Thanks! Yep, I use TW for my math class and I use KaTeX extensively :slight_smile:

@Pak I like the idea that you kind of have a print preparation step. I imagine its best for an occasional print more than if you had to do a lot.

  • I suppose you could pull that information from each note tiddlers fields as well.
  • Do you make any attempt to handle page breaks?
  • Is it even possible to print PDF’s without page breaks?
  • Do you make any attempt to handle page breaks?

No. The new window is simply one webpage with long text. I let the pdf printer handle the page breaks itself (which depend on the paper size setting). This is the same as when you compile a LaTeX document.

But if I want to force a page break after every transcluded tiddler I can define a css class

.section-page-break {
page-break-after: always;
}

and transclude every tiddler (or even selectively) with this class.

Here I exported my two tiddlers so you can try in on https://tiddlywiki.com/

noteprinter.json (2.5 KB)

Anyway, I guess my method didn’t quite answer @Mohammad 's original question of how to handle long note Tiddlywiki-way, sorry.

Thank you! We learn from different approaches, your method shows how build a pdf from long tiddlers or a compound tiddler built from many tiddlers at print time!
Thank you!

1 Like

I do this ALL the time, though I call them author-elements and I don’t use the technique at the chapter level. In my world, a chapter is a grouping of tiddlers.

A chapter-section (chapsec) is a tiddler. Chapsecs belonging to the same chapter have the same number/name in their chapter field.

A chapsec might contain zero or more author-elements:

<about-fission>
Stuff about nuclear fission
</about-fission>

<about-bilbo-baggins>
Stuff about Bilbo Baggins
</about-bilbo-baggins>

Another tiddler might be used to pull together (transclude) all the about-bilbo-baggins blocks to present them as one tiddler. Same with about-fission.

To answer @Mohammad’s question:

I favor both patterns and techniques.

Some chapter section tiddlers are small, 100 words or even less. Some contain thousands of words. Basically, however many words (and images) it contains, a chapsec covers a topic, beginning to end.

If a given block of text is likely to be reused in another context, it becomes either:

  1. its own tiddler which I can transclude in its entirety
  2. an <author-element> which I can transclude using a regex macro that splits on the author-element

For #2, I try to conjure text that is self supporting, aiding its use in different contexts. Without doing that, you can end up with “patchwork text” that doesn’t read so well.

1 Like

Thanks @CodaCoder! I like your terminology a chapsec.

Yes, it is a section sometimes is a compound/composite tiddler!

If I understand correctly, you do not use tag to show chpater-tiddler relation! instead you use field chapter.
Do you freely name such sub tiddlers or have some naming rules?

That is correct. I might use tagging for other reasons, but the chapter<>section relationship is as you said, purely a manual process. (The add new chapsec button defaults to adding 10 to the last known chapsec - see below.)

Chapsecs have a title which includes the chapter. So,

  • 1-010 is chapter 1, section 10.
  • REF-125 is chapter “reference”, section 125.

A screenshot might help:

1 Like

There are times when I miss the edit section feature of mediawiki and docuwiki.

Described here: section_editing [DokuWiki]

@CodaCoder - many thanks for detailed explanation!
While there are some manual parts, but the procedure powerful to create real e-books with many chapter!

I don’t understand how this works. I feel like I must be missing something important.

What is the mechanism you’re using to pull these in? Regexp ? If you’re gathering blocks into tiddlers, how do you know in which order?

And does this solve the problem of creating a long document? Are you doing step-wise excision as you work ?

Thanks!

You wrote (most of) the regex :confused:

:flushed:
You have no idea how many times I’ve looked at my code and said, “Who wrote this?”

So do you use CSS to hide away your own tagged areas as you work?

1 Like

With help from Eric and Saq, and the kin plugin, I did get branch level search working. The main advantage is that it uses the toc-expandable macro without modifications. It does require a button, and I know the very thought of all this manual labor strikes fear in the hearts of many TW users. But there you go …

3 Likes

Write more briefly? :innocent:

That is neat and I can see it being very useful in some situations. I imagine you could add keyboard shortcuts as alternatives to the buttons, Enter and Escape perhaps?

Very nice Mark! I assume you find the location of tiddler in tree and then you open the branches up to first level! Very interesting!

This can have many use cases! Maybe its time to publish a plugin :wink:

1 Like

Well, I have now :grin:

3 Likes

plugins_MAS_TOC-Search.json (5.9 KB)

1 Like

You may use Section Editor from kookma library.

Hi, everyone,

I might not have understood the original problem or the sub posts, but I am not an academiologist, coputations major or chefs de 'ordinateur so if my answer doesn’t make any sense to you, forgive me:

This is some of "long" text 

...With serveral paragraphs, 

naturally. 

And here are several citations and references (and other items I'll want in their respective fields). 
(use your imagination, please)

Manually create a JSON tiddler by “Creating a custom export format”: instructions at: https://tiddlywiki.com/#Creating%20a%20custom%20export%20format

Do that but change the extention to .json. Change the description to JSON Raw Text

You could paste your paper into one single tiddler and prefix the whole text with [ and suffix the whole thing with ].

Then you prefix all the individual components paragraphs, citations, etc. with {"title":"title for unique tiddler","text":"

Example:

{"tags":"EnglineerPaper#32","title":"EngineerPaper#32","text":"<list filter="[tag[EngineerPaper#32]]">
{"tags":"EnglineerPaper#32","title":"001 title for unique tiddler","text":"This is some of "long" text
{"tags":"EnglineerPaper#32","title":"002 title for unique tiddler","text":"...With serveral paragraphs,

…etc.

Then suffix each component with "},, but the last one with only "}. Make certain you do not leave any spaces or other characters in a JSON file outside of the ""

in the type field: “text/plain”

Export as raw JSON (NOT the regular JSON export)