3

I am getting started with WinEdt 7.1 and TEX in general on a windows platform. I have a file where I've defined custom commands. Its current contents are:

\newcommand{\avgE}{\bar{E}}
\newcommand{\setE}{\mathcal{A}}
\newcommand{\enum}[1]{\begin{enumerate} #1 \end{enumerate}}
\newcommand{\eqa}[1]{\begin{eqnarray} #1\end{eqnarray}}
\newcommand{\par}[1]{\left(#1\right)}
\newcommand{\brac}[1]{\left[#1\right]}
\newcommand{\eq}[1]{\begin{align*}#1\end{align*}}
\newcommand{\eqn}[1]{\begin{align}#1\end{align}}
\newcommand{\lf}[2]{\parenth {\frac {#1} {#2} } }

I'd like to place this file in my C:/Users/myName/.dotfiles folder which is currently under version control (git), and be able to reference this from whatever latex project I'm currently working on wherever it is. Im not exactly sure how to go about doing this? Do I just have to say

\input{C:\Users\diego\.dotfiles\customCommands.txt} 

on every file or is there some "best practices" I'm missing?

4
  • 2
    It depends on your distribution (not your editor), but there is a place in your home directory where tex will look files to be included. Then you can just say \input{customCommands} (Make it a .tex file not a .txt file). On unix that directory is ~/lib/texmf/tex/inputs, on Mac it's ~/Library/texmf/tex/inputs, and the reason this comment is not an answer is that I don't know what it is on Windows. – Matthew Leingang Mar 21 '13 at 20:10
  • 1
    See tex.stackexchange.com/questions/1137/… (possible duplicate?) – Matthew Leingang Mar 21 '13 at 20:14
  • thanks between these 2 comments and the links that followed I was able to fix my problem! I can't accept a comment :L – Diego Mar 21 '13 at 21:14
  • Glad you found the help you needed. We should just close this as duplicate, then. – Matthew Leingang Mar 21 '13 at 23:28

Browse other questions tagged or ask your own question.