Outils pour utilisateurs

Outils du site


pele_mele:stack_exchange:tex_latex:370684

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
pele_mele:stack_exchange:tex_latex:370684 [2024/11/23 04:02] – supprimée - modification externe (Date inconnue) 127.0.0.1pele_mele:stack_exchange:tex_latex:370684 [2024/11/23 04:02] (Version actuelle) – ↷ Nom de la page changé de pele_mele:stack_exchange:tex_latex:tex-370684 à pele_mele:stack_exchange:tex_latex:370684 alexis
Ligne 1: Ligne 1:
 +====== Is there a better way to repeat the content of a page? ======
 +I am back with [[https://tex.stackexchange.com/questions/367891/is-there-a-better-way-for-drawing-my-table|my table]].
 +
 +I edited it to use macros and it works very well. Now I was trying to print a single page twice on a recto-verso page. I ended up having 2 tables on 2 pages instead of 2 tables on 1 pages. I figured I can not do that and I should repeat my table to accommodate the printer.
 +
 +So I used a macro to repeat the table and it works. But I wonder if there is a better way of doing that?
 +
 +In case you are wondering, here is the code in my tex file:
 +
 +<code latex>
 +    \documentclass{letter}
 +
 +    \usepackage[a4paper, landscape, margin=0.5cm]{geometry}
 +    \usepackage{multirow}
 +    \usepackage{tabularx}
 +    \usepackage{graphicx}
 +
 +    \setlength{\extrarowheight}{14pt}
 +
 +    \newcommand\customTable{
 +            \begin{tabularx}{\textwidth}{cc|c|X|c|X|c|X|c|X|c|X|c|X|c|X|c|X|c|X|c|X|c|c|}
 +                    \cline{3-22}
 +
 +                    & & \multicolumn{20}{ c| }{\LARGE Joueurs} \\ \cline{3-22}
 +
 +                    & & \multicolumn{4}{ c| }{} & \multicolumn{4}{ c| }{} & \multicolumn{4}{ c| }{} & \multicolumn{4}{ c| }{} & \multicolumn{4}{ c| }{} \\ \cline{1-24}
 +
 +                    \customRow{10}{\multirow{20}{*}{\rotatebox[origin=c]{90}{\LARGE Cartes}}}\cline{2-24}
 +                    \customRow{9}{}\cline{2-24}
 +                    \customRow{8}{}\cline{2-24}
 +                    \customRow{7}{}\cline{2-24}
 +                    \customRow{6}{}\cline{2-24}
 +                    \customRow{5}{}\cline{2-24}
 +                    \customRow{4}{}\cline{2-24}
 +                    \customRow{3}{}\cline{2-24}
 +                    \customRow{2}{}\cline{2-24}
 +                    \customRow{1}{}\cline{1-22}
 +            \end{tabularx}
 +    }
 +    \newcommand\customHeader[2]{
 +            \multicolumn{1}{|c}{#2} &
 +            \multicolumn{1}{|c|}{\multirow{2}{*}{\LARGE #1}}
 +    }
 +    \newcommand\emptyCells{
 +            & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & & ~~~ & ~~~ \\
 +    }
 +    \newcommand\customBorder{
 +            \cline{3-3} \cline{5-5} \cline{7-7} \cline{9-9} \cline{11-11} \cline{13-13} \cline{15-15} \cline{17-17} \cline{19-19} \cline{21-21} \cline{23-24}
 +    }
 +    \newcommand\emptyDoubleCells{
 +            \multicolumn{1}{|c}{} & \multicolumn{1}{|c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} & \multicolumn{2}{c|}{} \\
 +    }
 +    \newcommand\customRow[2]{
 +            \customHeader{#1}{#2}\emptyCells\customBorder\emptyDoubleCells
 +    }
 +
 +
 +    \begin{document}
 +            \pagenumbering{gobble}
 +            \customTable
 +            \customTable
 +    \end{document}
 +</code>
 +
 +<WRAP info>
 +[[https://tex.stackexchange.com/questions/370684/is-there-a-better-way-to-repeat-the-content-of-a-page|tables - Is there a better way to repeat the content of a page? - TeX - LaTeX Stack Exchange]]
 +</WRAP>