Advertisement
Guest User

Untitled

a guest
Jul 15th, 2017
951
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. mwe.tex % instance of personal letter
  2. address.tex % full address of individual being addressed in mwe.tex
  3. C:LocalTeXtexlatexmymygeneralmatter.sty % author's address and signature defined here
  4. C:LocalTeXtexlatexmymyletter.cls % author's address and signature defined here
  5.  
  6. NeedsTeXFormat{LaTeX2e}
  7. documentclass{myletter}
  8.  
  9. newcommand{thetoaddress}{input{address}} % doesn't compile
  10. %newcommand{thetoaddress}{%
  11. %Addressee name\
  12. %Addressee title\
  13. %Address line 1\
  14. %Address line 2\
  15. %Address line 3%
  16. %} % does compile
  17. newcommand{theopening}{Dear addressee,}
  18. newcommand{theclosing}{Sincerely,}
  19. newcommand{thepostscript}{}
  20.  
  21. begin{document}
  22. I would like to thank you for your recommendation during the hiring process for the position of position with company.
  23.  
  24. I have thoroughly enjoyed being a part of company. It has indeed been a privelege to have worked with such a competant team.
  25.  
  26. I very much appreciate the support.
  27. end{document}
  28.  
  29. Person\
  30. Title\
  31. Address line 1\
  32. Address line 2\
  33. Address line 3
  34.  
  35. NeedsTeXFormat{LaTeX2e}
  36. ProvidesPackage{mygeneralmatter}[2013/05/21 a package containing general matter]
  37.  
  38. newcommand{email}{first.last@domain.com} % appropriate email address
  39.  
  40. newcommand{phone}{(999) 999 9999} % phone number
  41.  
  42. % company name and address
  43. newcommand{authoraddress}{%
  44. Address line 1 \%
  45. Address line 2 \%
  46. Address line 3 %
  47. }%
  48.  
  49. % company name, address and phone numbers
  50. newcommand{authoraddresslong}{%
  51. authoraddress \%
  52. phone \%
  53. email
  54. }%
  55.  
  56. % signature for formal letters
  57. newcommand{authorsignature}{First Last}
  58.  
  59. NeedsTeXFormat{LaTeX2e}
  60. ProvidesClass{myletter}[2013/04/22 a class for a personal letter which essentially preloads the authors current personal information]
  61. LoadClass[]{letter}
  62.  
  63. RequirePackage{mygeneralmatter} % provides the commands: authorsignature, authoraddresslong
  64.  
  65. signature{authorsignature} % signature of the letter defined in jclgenmatter.sty
  66. address{authoraddresslong} % author's long address defined in jclgenmatter.sty
  67.  
  68. AtBeginDocument{%
  69. begin{letter}{thetoaddress}
  70. opening{theopening}
  71. }%
  72.  
  73. AtEndDocument{%
  74. closing{theclosing}
  75. ps{thepostscript}
  76. end{letter}
  77. }
  78.  
  79. ! Argument of @no@pgbk has an extra }.
  80. <inserted text>
  81. par
  82. l.22 end{document}
  83.  
  84. RequirePackage{catchfile}
  85. newcommand{getaddressfrom}[1]{CatchFileDef{thetoaddress}{#1}{}}
  86. newcommand{defineaddress}[1]{defthetoaddress{#1}}
  87.  
  88. AtBeginDocument{%
  89. begingroupdeftempa{endgroupbegin{letter}}
  90. expandaftertempaexpandafter{thetoaddress}%
  91. opening{theopening}
  92. }
  93.  
  94. documentclass{myletter}
  95.  
  96. getaddressfrom{address}
  97.  
  98. newcommand{theopening}{Dear addressee,}
  99. newcommand{theclosing}{Sincerely,}
  100. newcommand{thepostscript}{}
  101.  
  102. begin{document}
  103. I would like to thank you for your recommendation during the hiring
  104. process for the position of position with company.
  105.  
  106. I have thoroughly enjoyed being a part of company. It has indeed
  107. been a privelege to have worked with such a competant team.
  108.  
  109. I very much appreciate the support.
  110. end{document}
  111.  
  112. defineaddress{John Doe\
  113. 42, Some Street\
  114. 12345 Somecity}
  115.  
  116. newcommand{thetoaddress}{protectinput{address}} % does compile
  117.  
  118. textheight=9in % text height can be bigger for a longer letter
  119. textwidth=7in % text width of `6.5in` leaves 1 inch for right margin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement