#+date: 2022-07-18 #+options: toc:nil num:nil author:nil * Convert files using pandoc First, install `pandoc`: #+begin_example bash pacman -S pandoc # in Parabola or Archlinux apt install pandoc # in Debian or derived distributions #+end_example Use pandoc with "-s" flag to produce a standalone document and "-o" to redirect output to a file. In the example a file "foo" is converted from ~odt~ to ~org~ #+begin_example bash pandoc -s -o foo.org foo.odt #+end_example Check the manual for more information: #+begin_example bash man pandoc #+end_example ** Convert multiple files using 'xarg' Convert all ~odt~ files to ~emacs-org~: #+begin_example bash find . -type f -name '*.odt' -print-1 | xargs -0 -n2 -P2 pandoc {} -f odt -o {}.org #+end_example A for loop can be used to convert all markdown files in a directory to ~emacs-org mode~ files, e.g. #+begin_example bash for i in *.md ; do echo "$i" && pandoc -s $i -o $i.org ; done #+end_example ** Convert a bibliography text Use citeproc to convert a '.bib' file to html #+begin_example bash pandoc ./bib/biblio.bib -s --citeproc -o arquivo.html #+end_example