I tend to use the \mathbb{...} command a lot, so I have made some commands to ease the amount of typing I have to do when I use LaTeX:
\newcommand{\R}{\ensuremath{\mathbb{R}}}
\newcommand{\C}{\ensuremath{\mathbb{C}}}
\newcommand{\Z}{\ensuremath{\mathbb{Z}}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\W}{\mathbb{W}}
Up until this point, I have been simply copying and pasting these lines each time I begin working with a new file. What is the recommended way of importing these lines from say, a custom-made package? Is this generally recommended (i.e. making shortcuts like this)?
I'm currently using TexLive on Mac OS X.
~/Library/texmf/tex/latex/alexmath/, creating the needed folders if necessary (~represents the home directory); on GNU/Linux systems it's~/texmf/tex/latex/alexmath. The deepest folder is not really necessary, but it helps to maintain an ordered structure. It may well be calledalexor whatever, to be populated by similar personal packages. – egreg Sep 05 '11 at 23:26\usr\local\texlive\texmf-local\tex\latexdirectory.~/Library/texmf/tex/latexsounds a bit safer though :). – Alex Lockwood Sep 06 '11 at 00:05\input{./commands.tex}into the actual document. This way every project will compile on friends' machines or on my own computer in several years, when my local installation is long gone. – 0x6d64 Sep 06 '11 at 07:00.styfile in your current directory instead of installing it in your system. You will then benefit from using\usepackagewithout having the pitfall mentioned by @AlanMunn. This is what I usually do for my books. Eventually, if your packages are generic enough and potentially interesting for others, you can make them into CTAN packages, upload them and use them as standard LaTeX packages (which is what I also do when I reach this point). – raphink Sep 06 '11 at 07:28