This page permanently redirects to gemini://gmi.bacardi55.io/blog/2023/07/15/manga-collections-with-orgmode-orgtable-and-orgplot/.
Posted on 2023-07-15
I've talked about [my move to orgmode] (and thus emacs) [before]. I'm still heavily using orgmode while trying to understand emacs and use it better, even though I do believe it is a very complex software to get used to. That being said, I decided to manage my [manga] collection with it in an orgmode file. Before that, I was using a simple spreadsheet.
I know tools exists to help a lot any book / comics / manga collection and can even alert me when there is a new volume of a collection I'm buying. But for some reason, I prefer the manual way of managing it in a simple file that I can read in any devices. It is also very simple to export in any format like pdf (when I share it with friends) or in html / gemtext. The org file and exported versions are shared via [syncthing] to my other devices including my phone, making it easy to know what I need to buy when I'm in a store (I did buy some volumes twice before, that's why I started saving my collection status in a spreadsheet in the first place).
Also, while I'm talking specifically about my manga collection in this case, the same idea could be used for any collections (book or otherwise).
=> my move to orgmode | before | manga | syncthing
Within my org directory structure, I have a single manga.org file that contains everything. Let's look at it.
The org file structure is simple:
#+title: Manga #+html_head: #+FILETAGS: :perso:manga: #+STARTUP: overview * Summary * Details ** Ongoing series ** Finished series with missing volumes ** Complete series * Wishlist / Ideas
The heading section should be easy to understand. Let's talk about each section, keeping the summary section for the end.
The Details section
The first subsection is ongoing series which contains manga named that are still being published (usually with different publishing cycles). Such manga are kept in a table looking like this:
#+name: manga-ongoing |-------+-----------+-----------+---------+----------------------------| | Name | Purchased | Available | Missing | Comments | |-------+-----------+-----------+---------+----------------------------| | Name1 | 5 | 6 | 1 | Avail. Pre-ordered. | | Name2 | 13 | 13 | 0 | Avail | |-------+-----------+-----------+---------+----------------------------| | TOTAL | 18 | 19 | 1 | 2 |
Each line represent a manga collection and the comments column allow me to write when the next volume will be available and if I already pre-ordered it. I don't add them in the Available column if they are not published (in France) yet. The TOTAL values are automatically calculated as well as the value of the missing column (explained later in this post). The number in the TOTAL row and Comments column is the number of collections in this table. In this example 2: Name1 and Name2.
The second subsection is Finished series with missing volumes which contains manga that are entirely available already, but I don't have all of them yet. I use the same table format as for the previous section:
#+name: manga-finished-incomplete |-------+-----------+-----------+---------+----------| | Name | Purchased | Available | Missing | Comments | |-------+-----------+-----------+---------+----------| | Name3 | 0 | 4 | 4 | | | Name4 | 14 | 26 | 12 | | |-------+-----------+-----------+---------+----------| | TOTAL | 14 | 30 | 16 | 2 |
No need for more explanation than the previous similar one. In this case, the Comments section is usually empty, but I keep that row to have the total number of manga in this section too.
The 3rd and last subsection Completed series. The table here is even simpler:
#+name: manga-finished-complete |-------+---------+----------| | Name | Achetés | Comments | |-------+---------+----------| | Name5 | 22 | | | Name6 | 21 | | | Name7 | 74 | | |-------+---------+----------| | TOTAL | 1056 | 42 |
No missing volumes here as if they are in this section, I have them all :). The comments section is again helpful to get the number of manga in this section.
The summary section
The summary section contains aggregated values of the different tables to give me an overview of my collections. Both in a table format and in graphs.
First it shows me an overview in terms of owned vs missing volumes:
And also in a table automatically filled also (see below):
#+name: manga-summary |----------------+------| | Total owned | 1411 | | Missing volume | 158 | |----------------+------|
(Up to date number is 1470 :P).
And second overview is about collections:
Also as an automatically filled table:
#+name: manga-summary-series |-----------------+----| | Total series | 68 | | Finished series | 52 | | Complete series | 42 | | On going series | 16 | |-----------------+----|
To be fully honest, I create graphs just because I wanted to play with orgplot, not because it was really necessary :).
The wishlist section
The last section of the file is the wishlist. Just a unordered list of manga names I may one day decide to purchase. Or not.
Let's talk about the fun part here: using orgmode TBLFM to write formula in order to calculate table values. Again, let's keep the summary section for the end.
Ongoing series / Finished collections with missing volumes
The table are the same for this 2 sections, and the formula will be too. The TBLFM line must be placed below the the TOTAL row. In the case of this two tables, the formula is:
#+TBLFM: @>$3=vsum(@2..@-1)::@>$2=vsum(@2..@-1)::$4=$3-$2::@>$5=@#-2
The :: separates different formula, it means we have the following:
Completed collections
Very similar to the above, the formula i'm using on this simpler table is also simpler:
#+TBLFM: @>$2=vsum(@2..@-1)::@>$3=@#-2
Which means:
The summary section
Now this is fine to get all the values for each tables, but let's use these values in the summary table. For the 1st summary table (owned / missing volumes), the formula is:
#+TBLFM: @1$2=remote(manga-ongoing, @>$2) + remote(manga-finished-incomplete, @>$2) + remote(manga-finished-complete, @>$2)::@2$2=(remote(manga-ongoing, @>$3) + remote(manga-finished-incomplete, @>$3) + remote(manga-finished-complete, @>$2) - @1$2)
A bit longer because using "external" values is more verbose (with remote()), but simply explained:
For the second table, same idea:
#+TBLFM: @1$2=remote(manga-ongoing, @>$5) + remote(manga-finished-incomplete, @>$5) + remote(manga-finished-complete, @>$3)::@2$2=remote(manga-finished-complete, @>$3) + remote(manga-finished-incomplete, @>$5)::@3$2=remote(manga-finished-complete, @>$3)::@4$2=remote(manga-ongoing, @>$5)
Only simple maths taking values from external tables:
To generate the graphs showed above, I use orgplot (that uses gnuplot for generating the graphs). To do so, we need a new line above the table with our plot definition, for example for the first table:
#+PLOT: title:"Manga Collection owned volumes" ind:1 deps!(2) set:"xrange [-0.5:1.5]" with:histograms type:2d file:"./manga-summary.png"
And with some colors:
For the second table, I use a very similar command that I don't think I need to re-explain:
#+PLOT: title:"Manga Collection - series summary" ind:1 deps!(2) set:"xrange [-0.5:3.5]" with:histograms type:2d file:"./manga-summary-series.png"
To tell emacs to calculate values within tables automatically, I added in my emacs configuration:
(add-hook 'before-save-hook 'org-table-recalculate-buffer-tables)
This is not the most automated or simplest way to manage such a collection. Using a selfhosted app or specialized websites might be better. But I like the simplicity and it is sync-ed with my phone and other devices with ease and without relying on an external and/or mobile app (well it does require syncthing, but I used it already for other file sharing anyway).
I still manage my book collection in a spreadsheet because it is more complex than my manga collection (with reading dates) but I still plan to move that collection to orgmode some day too… A day I won't be as lazy or when it will be higher in my todo list :).
Also, I'm not sharing the collection itself on this blog. I keep that for my [gemini capsule]. If you are curious about gemini or really want to see my manga collection, read [here to learn a bit more about gemini].
=> gemini capsule | here to learn a bit more about gemini
=> /gemlog/
=> Send me a gemini mention | send me an email! This content has been proxied by September (3851b).Proxy Information
text/gemini; lang=en