1

I want to have custom commands for my documents in Org (which I export to Latex) for this I use \newcommand. I use a template that I load with #+setupfile, but if I define the new commands in that template I can't access them from my documents.

Command like this:

\newcommand\corazon[2]{\color{#1}{\heartsuit}\kern-2.5pt\color{#2}{\heartsuit}}

How can I make these commands global in my .emacs init file?

1 Answer 1

1

You can either change your SETUPFILE to read something like this:

#+LATEX_HEADER: \newcommand\corazon[2]{\color{#1}{\heartsuit}\kern-2.5pt\color{#2}{\heartsuit}}

or (much better IMO), you put all these things into your own style file, say personal.sty, which you put in a place where LaTeX can find it (check with kpsepath tex for places where LaTeX checks for such files and with kpsewhich to make sure that it can find the file) and then just add this to your SETUPFILE:

#+LATEX_HEADER: \usepackage{personal}

That allows you to use those commands both in your Org mode files and in your LaTeX files and keeps the SETUPFILE neat and tidy. If you have questions about setting up your personal.sty file, you should ask in the TeX SE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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