Blog of an IT enthusiast, GNU/Linux-lover and arty idiot.

Application for PhD

Comments

Scripts for Adding Bookmarks to a PDF

As I gradually get used to reading more and more e-books, I find that it could be 100x more efficient if there were bookmarks that help you jump around the chapters for a scanned version pdf. It could be even more pleasant than reading the original paper-based book since the table of contents can be always on one side of the screen which is more accessible.

However, the true story is, those scanned pdfs usually don't come with such detailed bookmarks naturally. It is a painstaking task to use a pdf editing software to add bookmarks one after another via a graphical UI. Thus, a more desirable solution is to have a scripting-like way to add these bookmarks. Luckily, with the help of Adobe pdfmark Reference and this article, it is fairly easy to achieve:

The code above is used for generating the bookmark description according to the pdfmarks reference. Finally, we can concatenate the original pdf file with the generated bookmark file. Therefore:

Note that you need to change the variable toc in the above script to one which describes your table of contents.

/images/bookmarks.thumbnail.png
Comments

幸福

我想有個姑娘
能陪我同聽金色大廳的音樂會
也能一起去下街頭弄裏的麵館
窄小而溫暖的店內
透着盈盈的熱氣
兩人叼滿一嘴的麵條
說了聽不清什麼的話
相視一笑
這便是幸福

Read more...

Comments

Code Syntax Highlight

Test music score:

/static/lilypond/lesson_in_a_minor.svg

Test syntax highlight for Python:

Test syntax highlight for C++:

Test LaTeX:

\begin{equation*} e^{ix} = \cos x + i\sin x \end{equation*}
Comments

沒時間

「牛奶咖啡」組合的單曲《沒時間》。

最近的確沒時間。這個詼諧的歌詞權當自我調侃~

突然很想 不去上班
發一發呆 偷一點懶
但是又要 問我自己
是不是要 堅強一點

夢想總是 繞一個圈
卻還是要 回到原點
是不是我
還需要再堅強一點

我真的沒時間 沒時間 吃一頓早餐
我沒時間 沒時間 去鍛煉鍛煉
我沒時間 沒時間 逛一逛商店
我沒時間 沒時間 真的沒有時間

Read more...

Comments
Contents & Theme © 2016 Ted Yin
Creative Commons License BY-NC-SA