Download the file
  1. \NeedsTeXFormat{LaTeX2e}
  2. \ProvidesClass{cartes}[2006/03/13 1.0 Planche de cartes (9x9)]
  3. \typeout{Planche de cartes (9x9)}
  4.  
  5. \LoadClass[a4paper,draft]{article}
  6.  
  7. \RequirePackage[top=0pt, bottom=0pt, left=0pt, right=0pt]{geometry}
  8. \RequirePackage[latin9]{inputenc}
  9. \RequirePackage{graphicx}
  10. \RequirePackage[T1]{fontenc}
  11. \RequirePackage{corsiva}
  12. \RequirePackage{multido}
  13. \RequirePackage{lettrine}
  14. \RequirePackage[frenchb]{babel}
  15.  
  16. \setlength{\unitlength}{1mm}
  17. \setlength{\parindent}{0pt}
  18. \setlength{\lineskip}{0pt}
  19. \setlength{\fboxsep}{0pt}
  20.  
  21. \def\cartes@nom@personnage{Personnage}
  22. \def\cartes@nom@objet{Objet}
  23. \def\cartes@nom@lieu{Lieu}
  24. \def\cartes@nom@position{Position}
  25. \def\cartes@nom@aspect{Aspect}
  26. \def\cartes@nom@evenement{Événement}
  27.  
  28. \def\cartes@dos{dos-carte}
  29. \newcommand\setdos[1]{\gdef\cartes@dos{#1}}
  30.  
  31. \def\cartes@icon{}
  32. \def\cartes@nom{}
  33. \newcommand\type[1]{%
  34. \gdef\cartes@nom{\csname cartes@nom@#1\endcsname}%
  35. \gdef\cartes@icon{icon-#1}}
  36.  
  37. \newcounter{ligne}
  38. \newcounter{carte}[ligne]
  39. \newcounter{totalcartes}
  40. \newif\ifface\facetrue
  41.  
  42. %% Place les cartes en 3 lignes de 3 cartes. Après chaque série de 9
  43. %% (planche), insère une planche de dos de cartes.
  44. \newcommand\espacement{%
  45. \ifface\stepcounter{totalcartes}\fi%
  46. \ifnum\thecarte < 2
  47. \stepcounter{carte}\ignorespaces
  48. \else
  49. \par
  50. \stepcounter{ligne}%
  51. \ifnum\theligne = 3
  52. \ifface\dosplanche\fi
  53. \fi
  54. \fi}
  55.  
  56. \newcommand\putfond{%
  57. \put(0,0){\includegraphics[width=70mm,height=99mm]{fond}}
  58. \put(0.1,0.1){\linethickness{0.10mm}\framebox(69.8,98.8){}}
  59. }
  60.  
  61. \newcommand{\carte}[2]{%
  62. \begin{picture}(70,99)
  63. \putfond
  64. \put(3,75){\parbox[b][20mm][c]{15mm}{\includegraphics[width=15mm,height=20mm,keepaspectratio]{\cartes@icon}}}
  65. \put(14,15){\parbox{39mm}{\LARGE\centering #1}}
  66. \if#2\relax\else\put(14,24){\parbox[b][50mm][c]{45mm}{\centering\includegraphics[width=45mm,height=50mm,keepaspectratio]{#2}}}\fi
  67. \put(30,6){\parbox{35mm}{\large\hfill\cartes@nom}}
  68. \end{picture}\espacement}
  69.  
  70. \newcommand\setlettrineparam[2]{\expandafter\gdef\csname cartes@#1\endcsname{#2}}
  71. \newcommand\resetlettrineparams{%
  72. \setlettrineparam{lhang}{0.40}%
  73. \setlettrineparam{loversize}{0.40}%
  74. \setlettrineparam{lraise}{0.0}%
  75. \setlettrineparam{findent}{0.25em}%
  76. \setlettrineparam{nindent}{0em}%
  77. }
  78. \resetlettrineparams%
  79. \renewcommand{\LettrineTextFont}{\relax}
  80. \def\L{\lettrine[lhang=\cartes@lhang,loversize=\cartes@loversize,lraise=\cartes@lraise,findent=\cartes@findent,nindent=\cartes@nindent]}
  81. \newcommand{\denouement}[1]{%
  82. \begin{picture}(70,99)
  83. \putfond
  84. \put(12,20){\parbox[b][59mm][c]{48mm}{\raggedright\LARGE \L#1}}
  85. \end{picture}\espacement}
  86.  
  87. \newcommand{\interruption}[1]{%
  88. \begin{picture}(70,99)
  89. \putfond
  90. \put(10,80){\parbox{50mm}{\LARGE\centering Interruption}}
  91. \put(15,33){\parbox[b][40mm][c]{40mm}{\centering\includegraphics[width=40mm,height=40mm,keepaspectratio]{\cartes@icon}}}
  92. \put(10,22){\parbox{50mm}{\normalsize\centering Peut être utilisé comme}}
  93. \put(14,15){\parbox{39mm}{\LARGE\centering #1}}
  94. \put(30,6){\parbox{35mm}{\large\hfill\cartes@nom}}
  95. \end{picture}\espacement}
  96.  
  97. \newcommand{\dos}{%
  98. \begin{picture}(70,99)
  99. \put(10,10){\includegraphics[width=50mm,height=79mm,keepaspectratio]{\cartes@dos}}
  100. \end{picture}\espacement}
  101.  
  102. \newcommand{\vide}{%
  103. \begin{picture}(70,99)
  104. \end{picture}\espacement}
  105.  
  106. \newcommand{\dosplanche}{%
  107. \setcounter{carte}{0}%
  108. \setcounter{ligne}{0}%
  109. \facefalse%
  110. \clearpage
  111.  
  112. \multido{}{\thetotalcartes}{%
  113. \ifnum\thecarte=0
  114. \ifnum\value{totalcartes}=1
  115. \vide\vide%
  116. \fi
  117. \ifnum\value{totalcartes}=2
  118. \vide%
  119. \fi
  120. \fi
  121. \addtocounter{totalcartes}{-1}%
  122. \dos}
  123. \setcounter{carte}{0}%
  124. \setcounter{ligne}{0}%
  125. \setcounter{totalcartes}{0}%
  126. \facetrue%
  127. \clearpage
  128.  
  129. }
  130.  
  131. \AtEndDocument{\ifodd\thepage\dosplanche\fi}
  132.