25 May, 2015

Go not to the Elves for Counsel

 ______________________________________
/ Go not to the elves for counsel, for \
| they will say both yes and no.       |
|                                      |
\ -- J.R.R. Tolkien                    /
 --------------------------------------
      \                    / \  //\
       \    |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \    
           /     /  \/_/    //   |  \  \  
           @_^_@'/   \/_   //    |   \   \ 
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~

21 May, 2015

Pandoc with citations

Compile and add the path to the bibliography file. I keep it in ~/Documents - so on my system the pandoc command looks a bit like this:



# pandoc myText.md --bibliography=/home/per/Dokumenter/bogliste/bogliste.bib -o test.pdf

Markdown with quotations like this:

Bla. bla bla bla [@bruceLee]


17 May, 2015

Writer2latex

Install Writer2Latex via apt. Then use the commandline like this:

# w2l -latex -ultraclean input.odt

Footnotes etc. will be saved correctly. See more here.

14 May, 2015

Pandoc convert *html



# find . -name "*.ht*" | while read i; do pandoc +RTS -K64m -RTS -f html -t markdown "$i" -o "${i%.*}.md"; done

Terminal convert files to html loffice

# loffice --headless --convert-to html *odt
# loffice --headless --convert-to html *doc
# loffice --headless --convert-to html *sxw

( ... etc ... )


ODT to Markdown (notes)

   
  515  loffice --headless --convert-to html test.odt 
  517  pandoc test.html -o markdown.text

(History dump)

LaTeX templates

Covers and much more here. If you want to use one of the covers with Lyx try to add the LaTeX code to the document header.

Try http://www.latextemplates.com/

Cowsay

______
< mooh >
 ------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Perhaps one of the most usefull bash commands for the Linux terminal.

# cowsay mooh

08 May, 2015

Turn off bluetooth at log in Cinnamon

Turning off the bluetooth will save power. The GUI does not give you the choice, so:


  # sudo nano /etc/rc.local


Add this line before exit 0

  echo disable > /proc/acpi/ibm/bluetooth


Add quotes to markdown in pandoc

The Markdown File

Add a yaml metadata section, that will point to a BibTex (.bib) file. The yaml section can be placed anywhere in the document:

---
title: "Sample Document"
output: html_document
bibliography: bogliste.bib
---

Citation in the markdown
Lorem ipsum dolor sit [@PHPWeb]

The citation points to a post in a BibLatex file in this case edited in Pybliographer:



@Book{PHPWeb,
  Author         = {Ullman, Larry},
  Title          = {P{HP} for the {W}eb},
  Publisher      = {Peachpit Press},
  year           = 2011
}


Compile html from the markdown
In order to create the file pandoc should make a standalone file (-s) and pandoc must know the name of the bibliography file (--bibliography=books.bib)

# pandoc -s --bibliography=books.bib yaml-test.markdown > yaml-test.markdown.html

Missing pandoc-citeproc
Linux Mint gave an error. Pandoc-citeproc was missing. Tried to install the package, and then the problem was solved.

#  sudo apt-get install pandoc-citeproc

Result
Lorem ipsum dolor sit (Ullman 2011)

At the end of the document the reference will appear, so you might add some markdown to state that here comes the list of sources. From the booklist the quoted (and only the quoted!) work will appear:

Ullman, Larry. 2011. PHP for the Web. Peachpit Press.

05 May, 2015

Pybliographer several authors

One line per author in the author field, e.g.:

Andreasen, Frederik
Mosekjær-Madsen, Fred
Jensen, Per Thykjær