I am using Org Mode within Emacs and I am using the Export to LaTeX option. The output is fine, however I would love to show:
- TODOs as red
- DONEs as green
So they stand out.
Is there a way?
I copied the org-latex-format-headline-default-function from ox-latex.el to my .emacs and added the two cases TODO and DONE. I recommend not replacing the original function but putting this in your .emacs.
It will make any "TODO" containing string red, any "DONE" one green when you export to LaTeX. Make sure that you put
#+Latex_header: \usepackage{xcolor}
in your org heading. You can just edit the string after "format" to customize it. You can as well add more cases if you have other todo keywords.
(defun org-latex-format-headline-colored-keywords-function
(todo todo-type priority text tags info)
(concat
(cond ((string= todo "TODO")(and todo (format "{\\color{red}\\bfseries\\sffamily %s} " todo)))
((string= todo "DONE")(and todo (format "{\\color{green}\\bfseries\\sffamily %s} " todo))))
(and priority (format "\\framebox{\\#%c} " priority))
text
(and tags
(format "\\hfill{}\\textsc{%s}"
(mapconcat (lambda (tag) (org-latex-plain-text tag info))
tags ":")))))
(setq org-latex-format-headline-function 'org-latex-format-headline-colored-keywords-function)