Template for reading note

Hello,

I try to understand how to make a capture template for taking notes while reading.

My goal is, the first time I read a book/article:

  • I create a node representing the book/article
  • On the node creation, I get asked source title, author name, year, etc
  • If I have a digital copy of the book/article, I attach a copy with attach feature of Org-mode

Then, as I read, I add notes as org heading inside the Org-roam node. If I have attached a copy of the book/article, I use org-noter.

And when I search for the nodes representing the books/articles, I would like to see the title + author + year.

I have done some tries with the org-roam captures templates, but I always have problems.

If I choose to have a node representing a book/article, I didn’t find how to set custom properties of this node to store author, year, etc.

If I create a heading inside the node to represent the book/article, the book is no longer the node and I have only 1 level 1 heading. Which is not optimal. And the title, author and year is asked two times: For the node creation and for the node content creation.

Any suggestions ?

You had this solution before: Try to understand how the templates work in org-roam-capture-templates - #4 by Postroutine

And you say this:

What are the problems?

On the previous thread, I have difficulties to understand how org-roam capture templates work. Now, I have a better understanding. I still have some part I’m not sure, but nobodies have replied to my last questions.

After that, I have tried to create a template that I’m not happy with. So, I create a different thread to ask what template would be best for my usage.

Sure. There is nothing wrong with creating a new thread. What have you tried and what are remaining issues?

Is this the only remaining issue?

If I choose to have a node representing a book/article, I didn’t find how to set custom properties of this node to store author, year, etc.

If I go back to the previous thread, you seem to have found a solution — that’s how I read it. So I am scratching my head asking: there seems to be a solution but it has some issues? What are they?

And I added this on the top of my template file (“~/Roam/templates/literature.org”):

#+title: %^{Year}, %^{Author}: %^{Title}
#+filetags: :literature:

And finally, I replaced each ${key} with %^{key}, so I can use %\1, %\2, etc to reuse asked values.

With this, I finally have a simple literature note capture

The solution I have chosen at the post you have cited, is to not use the target template and only the content template. If I remember correctly.

But I didn’t like this solution, because:

  • I create a node without using the node (target) template
  • The title is asked to me and not re-used from the node title
  • At the end, I still have the problems I have written on this thread first post (except the parts asked twice, if I not define a target template)

If I create a new node with the org-roam capture template I have defined, I get this result:

:PROPERTIES:
:ID:       9855206c-9ca4-44fb-87f7-29627de915c2
:END:
#+title: 1999, me, test
#+filetags: :literature:

* test
:PROPERTIES:
:Author:        me
:Publisher:     you
:Release_year:  1999
:URL:           https://example.org
:END:

I have a node representing the book, then inside it I have a heading also representing the book. The book properties are attached to the heading, not the node. And the node title is only like that so when I search for my noted I can see “YEAR, author, title”.

What I would like to have:

  • A node representing a book
  • All properties attached to the node
  • The only heading inside the nodes should be the notes
  • When I search for my notes, each literature note appear in the format “YEAR, author, title”
  • Other notes appear in the format “title”
  • If I have a digital copy of a book, I attach it to the node

But maybe what I search to do is not the correct way. Maybe I need a separated node with all read books as a heading, repsective properties attached to them and a link to a node representing their notes ?

Or maybe something else ?

I am guessing this is what you are after (?).
I have changed some details:

  • File name your content template org file
  • Target file name.
  • Removed URL property (I thought you’d manually enter it anyway).
(add-to-list 'org-roam-capture-templates
             '("b" "Literature note (book or article)" plain
               (file "~/tmp/lit.org")
               :target (file+head
                        "lit/%<%Y%m%d%H%M%S>-literature-${slug}.org"
                        ":PROPERTIES:
:Author:        %^{Author}
:Release_year:  %^{Year}
:END:
#+title: %\\1 %\\2 %^{Title}
#+filetags: :literature:")
               :unnarrowed t))

The content of file ~/tmp/lit.org is as follows.


# If I have the numeric copy of the book, attach it

** Synopsis

%?


** Notes

# Use Org-noter if numeric book is attached"

Did I capture what you want correctly?

1 Like

Yes, this is what I was searching for.

I was sure it was not possible to set custom properties with target node template. I think I have read it somewhere that it was not possible and my brain have record it. But I’m happy to see it’s possible.

And if was defining a target and a content templates, I had difficulties with re-usable values between the 2 templates.

The slug in the file name and the title are different ?

Yes. I think it’s better to see it for yourself. Replace this part of the template #+title: %\\1 %\\2 %^{Title},with the following two patterns and compare.

Pattern 1

#+title: %\\1 %\\2 %^{Enter book title}

Pattern 2

#+title: %\\1 %\\2 ${title}

For Pattern 1, the text inside the curly brackets is only the text for prompt; for human to see on the screen. For Pattern 2, it’s the name of the node property, which is used by the slug.

1 Like