Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mwe.tex % instance of personal letter
- address.tex % full address of individual being addressed in mwe.tex
- C:LocalTeXtexlatexmymygeneralmatter.sty % author's address and signature defined here
- C:LocalTeXtexlatexmymyletter.cls % author's address and signature defined here
- NeedsTeXFormat{LaTeX2e}
- documentclass{myletter}
- newcommand{thetoaddress}{input{address}} % doesn't compile
- %newcommand{thetoaddress}{%
- %Addressee name\
- %Addressee title\
- %Address line 1\
- %Address line 2\
- %Address line 3%
- %} % does compile
- newcommand{theopening}{Dear addressee,}
- newcommand{theclosing}{Sincerely,}
- newcommand{thepostscript}{}
- begin{document}
- I would like to thank you for your recommendation during the hiring process for the position of position with company.
- I have thoroughly enjoyed being a part of company. It has indeed been a privelege to have worked with such a competant team.
- I very much appreciate the support.
- end{document}
- Person\
- Title\
- Address line 1\
- Address line 2\
- Address line 3
- NeedsTeXFormat{LaTeX2e}
- ProvidesPackage{mygeneralmatter}[2013/05/21 a package containing general matter]
- newcommand{email}{first.last@domain.com} % appropriate email address
- newcommand{phone}{(999) 999 9999} % phone number
- % company name and address
- newcommand{authoraddress}{%
- Address line 1 \%
- Address line 2 \%
- Address line 3 %
- }%
- % company name, address and phone numbers
- newcommand{authoraddresslong}{%
- authoraddress \%
- phone \%
- email
- }%
- % signature for formal letters
- newcommand{authorsignature}{First Last}
- NeedsTeXFormat{LaTeX2e}
- ProvidesClass{myletter}[2013/04/22 a class for a personal letter which essentially preloads the authors current personal information]
- LoadClass[]{letter}
- RequirePackage{mygeneralmatter} % provides the commands: authorsignature, authoraddresslong
- signature{authorsignature} % signature of the letter defined in jclgenmatter.sty
- address{authoraddresslong} % author's long address defined in jclgenmatter.sty
- AtBeginDocument{%
- begin{letter}{thetoaddress}
- opening{theopening}
- }%
- AtEndDocument{%
- closing{theclosing}
- ps{thepostscript}
- end{letter}
- }
- ! Argument of @no@pgbk has an extra }.
- <inserted text>
- par
- l.22 end{document}
- RequirePackage{catchfile}
- newcommand{getaddressfrom}[1]{CatchFileDef{thetoaddress}{#1}{}}
- newcommand{defineaddress}[1]{defthetoaddress{#1}}
- AtBeginDocument{%
- begingroupdeftempa{endgroupbegin{letter}}
- expandaftertempaexpandafter{thetoaddress}%
- opening{theopening}
- }
- documentclass{myletter}
- getaddressfrom{address}
- newcommand{theopening}{Dear addressee,}
- newcommand{theclosing}{Sincerely,}
- newcommand{thepostscript}{}
- begin{document}
- I would like to thank you for your recommendation during the hiring
- process for the position of position with company.
- I have thoroughly enjoyed being a part of company. It has indeed
- been a privelege to have worked with such a competant team.
- I very much appreciate the support.
- end{document}
- defineaddress{John Doe\
- 42, Some Street\
- 12345 Somecity}
- newcommand{thetoaddress}{protectinput{address}} % does compile
- textheight=9in % text height can be bigger for a longer letter
- textwidth=7in % text width of `6.5in` leaves 1 inch for right margin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement