(this version of this question is highly edited based on suggestions)
I thought to quickly create a fax cover sheet last night and, quickly creating one, I ran into a problem I can't figure out so I thought I'd ask around. First, the structure: I have 2 files: one is the style file and the other is the file with the specific fax info. In the style file I've created some variables to hold data that is specified in the info file. Here is the style file:
\newcommand{\myfaxdate}[1]{\newcommand{\@myfaxdate}{#1}}
\newcommand\myfaxto[1]{\newcommand{\@myfaxto}{#1}}
\newcommand\myfaxfrom[1]{\newcommand{\@myfaxfrom}{#1}}
\newcommand\myfaxre[1]{\newcommand{\@myfaxre}{#1}}
\newcommand\myfaxnumpages[1]{\newcommand{\@myfaxnumpages}{#1}}
\newcommand\myfaxtelnum[1]{\newcommand{\@myfaxtelnum}{#1}}
\newcommand\myfaxnum[1]{\newcommand{\@myfaxnum}{#1}}
\newcommand\myfaxcomments[1]{\newcommand{\@myfaxcomments}{#1}}
\newsavebox{\faxcover}
\savebox{\faxcover}{%
\put(0,7){\makebox{\bfseries Date:} \@myfaxdate}
\put(0,6){\makebox{\bfseries To:} \@myfaxto}
\put(0,5){\makebox{\bfseries From:} \@myfaxfrom}
\put(0,4){\makebox{\bfseries Re:} \@myfaxre}
\put(0,3){\makebox{\bfseries Comments:} \@myfaxnumpages}
\put(0,2){\makebox{\bfseries From:} \@myfaxtelnum}
\put(0,1){\makebox{\bfseries Re:} \@myfaxnum}
\put(0,0){\makebox{\bfseries Comments:} \@myfaxcomments}
}
\newcommand{\makefax}{%
\begin{picture}(10,10)
\put (0,0){\usebox\faxcover}
\end{picture}
}
Here's the other file (the top-level file)
\documentclass[10pt]{report}
\usepackage{./myfax}
\begin{document}
\myfaxdate{09-28-2011}
\myfaxto{Ozymandius, King of Kings}
\myfaxfrom{Bev}
\myfaxre{Two vast and trunkless legs of stone}
\myfaxnumpages{3 counting the cover sheet}
\myfaxtelnum{(516) 676-4099}
\myfaxnum{(800) 123-4567}
\myfaxcomments{blah not blee}
\makefax
\end{document}
When I compile, I get an error telling me that \@myfaxdate is an undefined control sequence. I should add that the purpose of dividing into 2 files is because I want to create my own fax style that I may want others in my org to use (maybe). This will simplify it so all they have to know how to do is to fill in some blanks in the main file.
@is not considered a letter normally by LaTeX. Please add a minimal working example (MWE). – Andrey Vihrov Sep 29 '11 at 7:39\@myfaxdateis defined locally and its definition is lost outside of the group it was created in. Perhaps try\newcommand{\@myfaxdate}{}outside of any group in your style file, and then use\newcommand{\myfaxdate}[1]{\renewcommand{\@myfaxdate}{#1}}? If this does not work, perhaps a little more context by expanding on your "simplified example". – Werner Sep 29 '11 at 7:40