I'd like to define a command \alert{}
by
\newcommand{\alert}[1]{\textcolor{red}{#1}}
in a way that I could use it on every new file.
I was thinking to define it on some cls
file (amsart
for example). But if I create a new file using report
class the new command will not work.
Is there some internal file where I could define my command to work as a default LaTeX command. For example, using any class we can make use of some commands (\textrm{}
for example). So I guess that there is some file to be loaded globally.
Best Answer
Adding a "global" command is possible. But one of the strengths of the TeX system is portability: if you have the same TeX distribution on two machines, the same file will compile on both, with the same result.
What would happen in your case is that compiling the document on a different machine would bang out with an
error.
The safest way is to have a file, say
sigur.sty
containing the lineswith possibly other definition you deem useful, and save it in the "local tree", that is as
and doing
after that operation.
Any user on your machine will be able to say
in their document. Don't forget to enclose the file when you distribute a document using it.
Also, don't forget to document your macros.