Download the file
  1. \NeedsTeXFormat{LaTeX2e}
  2. \ProvidesClass{mwlabels}[2002/02/03 0.2]
  3. \RequirePackage{ifthen}
  4.  
  5. \newboolean{frames}\setboolean{frames}{false}
  6. \newboolean{landscape}\setboolean{landscape}{false}
  7.  
  8. \DeclareOption{frames}{
  9. \setboolean{frames}{true}
  10. }
  11.  
  12. \DeclareOption{landscape}{
  13. \setboolean{landscape}{true}
  14. }
  15.  
  16. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  17. \ProcessOptions
  18. \LoadClass{article}
  19.  
  20. \ifthenelse{\boolean{landscape}}{
  21. \setlength{\textwidth}{29.7cm}
  22. \setlength{\textheight}{21cm}
  23. \setlength{\paperwidth}{29.7cm}
  24. \setlength{\paperheight}{21cm}
  25. \special{landscape}
  26. }%
  27. {
  28. \setlength{\textwidth}{21cm}
  29. \setlength{\textheight}{29.7cm}
  30. \setlength{\paperwidth}{21cm}
  31. \setlength{\paperheight}{29.7cm}
  32. }%
  33.  
  34. \pagestyle{empty}
  35. \setlength{\parindent}{0cm}
  36. \setlength{\oddsidemargin}{-1in}
  37. \setlength{\topmargin}{-1in}
  38. \setlength{\headheight}{0cm}
  39. \setlength{\headsep}{0cm}
  40. \setlength{\topskip}{0.01mm}
  41. \setlength{\footskip}{0cm}
  42. \setlength{\parindent}{0cm}
  43. \setlength{\parsep}{0mm}
  44. \setlength{\lineskip}{0pt}
  45. \setlength{\fboxsep}{5mm}
  46. \setlength{\fboxrule}{0.01mm}
  47.  
  48. \newlength{\cardwidth}
  49. \newlength{\cardheight}
  50.  
  51. \newcommand{\setcardsize}[2]{%
  52. \setlength{\cardwidth}{#1}%
  53. \setlength{\cardheight}{#2}%
  54. }
  55.  
  56. \newcommand{\setcardperpage}[2]{
  57. \setlength{\cardwidth}{\paperwidth}%
  58. \setlength{\cardheight}{\paperheight}%
  59. \divide\cardwidth #1%
  60. \divide\cardheight #2%
  61. }
  62.  
  63. \newlength{\cw}
  64. \newlength{\ch}
  65. \newlength{\bordure}
  66.  
  67. \ifthenelse{\boolean{frames}}{
  68. %%% Frame
  69. \newsavebox{\fmbox}
  70. \newenvironment{lbl}{%
  71. \setlength{\cw}{\cardwidth}%
  72. \setlength{\ch}{\cardheight}%
  73. \setlength{\bordure}{2\fboxsep}%
  74. \addtolength{\bordure}{2\fboxrule}%
  75. \begin{lrbox}{\fmbox}
  76. \addtolength{\cw}{-1\bordure}\addtolength{\ch}{-1\bordure}%
  77. \begin{minipage}[c][\ch][c]{\cw}%
  78. }{%
  79. \end{minipage}\end{lrbox}%
  80. \framebox{\usebox{\fmbox}}%
  81. }% end newenvironment
  82. }{%
  83. %%% No frame
  84. \newenvironment{lbl}{%
  85. \setlength{\cw}{\cardwidth}%
  86. \setlength{\ch}{\cardheight}%
  87. \begin{minipage}[c][\ch][c]{\cw}%
  88. }{%
  89. \end{minipage}%
  90. }% end newenvironment
  91. } %% end if frames
  92.