You are not logged in.

#1 2008-11-24 05:45:50

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Defining & exporting custom commands in LaTeX?

I'm trying to figure out how to define a command like "\runhead" so that if I were to type

\runhead{impact of borderline personality disorder}

the result would be

Running head: IMPACT OF BORDERLINE PERSONALITY DISORDER

... I know it involves the command \MakeUppercase, but I'm still pretty dumb when it comes to this stuff wink

EDIT:

\newcommand{\runhead}[1]{Running head: \MakeUppercase{#1}}

does the trick. But how can I export this so I can use it in other documents without having to define it again (or use "\usepackage")? Is this possible? If not, it seems like a waste of time, in this particular case.

Offline

#2 2008-11-24 20:46:35

bt
Member
Registered: 2007-04-11
Posts: 198

Re: Defining & exporting custom commands in LaTeX?

In kile, under Latex - edit user tags to add your own commands.

Offline

#3 2008-12-02 08:51:47

cautha
Member
From: Kingston, Ontario
Registered: 2008-06-02
Posts: 115
Website

Re: Defining & exporting custom commands in LaTeX?

Thanks, but what if I use Texmaker?

Offline

#4 2008-12-02 12:45:21

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Defining & exporting custom commands in LaTeX?

cautha wrote:

... But how can I export this so I can use it in other documents without having to define it again (or use "\usepackage")? Is this possible? If not, it seems like a waste of time, in this particular case.

You can't. Your own commands have to be either declared at the beggining of each new document you write, or \include-d. It's like in programming - if you write your own library (or whatever), you have to include it in programs whenever you want to use it.

In most advanced latex editors, you can edit "templates". You can create your own template (or edit an old one) which would already have your newly defined macros in it; and then when you use this template to create a new document, it will naturally have the macros there.

Offline

Board footer

Powered by FluxBB