Right now my research and programming go hand in hand. Saving all sources and notes in a database proved to be a very good idea. Adding new sources to the database is easy in Adminer. Whenever new additions are made to the database, it’s a matter of seconds to compile a new bibliography file via… Continue reading Research and Programming
Here is the actual version of my eBook compiler, adorned with cowsay user feedback.
Why don’t you save the long pandoc command lines as a bash script?
In this project I write in Markdown most of the time. I may need the same text in many formats:
- .docx for the boss
- .pdf for nice presentations
- .tex for serious work
- .epub for ebooks
- .mobi for Kindle
In order to create an Ebook and a Kindle version, you need to:
pandoc myText.md -o myText.epub
Kindlegen will create a file with the .mobi extension: myFile.mobi. That’s it. Your book is ready for Kindle.
Here’s a list of pages, that I tend to use over and over again:
- Daring FireBall: Markdown.
- Using Pandoc to Create Your ePub eBook.
- The best tutorial: Creating an ebook with pandoc.
- How We Automated Our Ebook Builds With Pandoc and KindleGen.
Let’s try a conversion from Markdown to an eBook. The –ebook-cover will ad a frontpage. So you’ll have an eBook with a nice cover. The –toc means Table of Content.
pandoc -s --epub-cover-image=owl.jpg --toc meta.txt markdown.md -o x.epub
As you progress the pandoc commandline tends to become very long indeed. I save such lines i as a bash script. Here’s a sample:
# Create the eBook and a Kindle version of the same
pandoc -S --epub-cover-image=owl.jpg --toc -o yourBook.epub meta.txt markdown.md
Save the file as myFile.sh. Then run this command: chmod a+x myFile.sh. Now you can run the entire command like this:
in a terminal. As soon as your pandoc command works you can save it for future use. You could even save the script in
Then you can use your script as a Linux command.
I’m sure that you can do something similar in Windows or OSX. In the heyday of MS DOS I might have saved the pandoc command in a .bat file. But in the end I prefer a Linux solution.
– By thine own ingenium create your solution …
In this blogpost by Mike Schroder you can see, that WordPress will have better PDF support from WP 4.7. However, the PDF support needs several dependencies: Core support is provided through WP_Image_Editor_Imagick and requires Imagick, ImageMagick, and Ghostscript support. When not supported, or if the generation fails, WordPress falls back to previous behavior and saves the attachment without adding image previews to… Continue reading Better PDF support
My sources are saved in a MySQL database. I’d like to write my text in LaTeX via LyX. I cannot use the database directly in my reports. So I need a compiler, that will convert my data to a format, that LyX & friends can handle. Therefore I have made a little compiler in Python.… Continue reading Create aBibtex file via MySQL and Python