4

I am trying to come up with a template for moderncv package. I would like to be able to render org-mode lists using \cvitem for example. Better yet, if I could choose the LaTeX command for rendering list items (there are several available in this package). I know about :environment and :options but these don't really help. I would really prefer to make this as much independent of the export back-end as possible, so that it would be less painful to export the same document as HTML if need be.

3

An export filter (section 12.15 of org documentation) can do that:

(defun my-latex-item (text backend info)
  "Replace \\item with \\cvitem."
  (when (org-export-derived-backend-p backend 'latex)
    (concat "\\cvitem" (substring text 5))))

(add-to-list 'org-export-filter-item-functions
         'my-latex-item)

For extending with other back-ends the when can be replaced by a cond.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.