4

The following short document prints a scoresheet for a simple dice game called kinderyahtzee. It is close to what I want:

%%%%% Kinder-yatzee scoresheet in \LaTeX
\documentclass[a4paper,12pt,pdftex,active,tightpage,multi=true]{standalone}  
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{array}%%%%%Extended, modernized version of tabular
\usepackage{epsdice}%%%%%\epsdice command
\usepackage{igo} %%%%% circled numbers
%%%%% Defining commands for yatzee names:
%% If using epsdice, we need:
\newcommand{\Cube}[1]{\raisebox{-1.2pt}{\epsdice{#1}}}   
\newcommand{\two}{\whitestone[2]}
\newcommand{\three}{\whitestone[3]}
\newcommand{\four}{\whitestone[4]}
\newcommand{\five}{\whitestone[5]}
\newcommand{\six}{\whitestone[6]}
\newcommand{\seven}{\whitestone[7]}
\newcommand{\eight}{\whitestone[8]}
\newcommand{\nine}{\whitestone[9]}
\newcommand{\ten}{\whitestone[10]}
\newcommand{\eleven}{\whitestone[11]}
\newcommand{\twelve}{\whitestone[12]}
\newcommand{\titleline}{\Large\textsc{Barneyatzy}}
\dimen0=0.6cm{}
\newcommand{\onesheet}{% code for typesetting one score sheet
{\hspace*{1cm}
{\begin{tabular}[t]{||p{2\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}|p{\dimen0}||}\firsthline   \hline
             & & & & & & & & & & & & & & & &      \\   \hline
\two         & & & & & & & & & & & & & & & &      \\   \hline   
\three       & & & & & & & & & & & & & & & &      \\   \hline 
\four        & & & & & & & & & & & & & & & &      \\   \hline 
\five        & & & & & & & & & & & & & & & &      \\   \hline 
\six         & & & & & & & & & & & & & & & &      \\   \hline 
\seven       & & & & & & & & & & & & & & & &      \\   \hline 
\eight       & & & & & & & & & & & & & & & &      \\   \hline 
\nine        & & & & & & & & & & & & & & & &      \\   \hline 
\ten         & & & & & & & & & & & & & & & &      \\   \hline 
\eleven      & & & & & & & & & & & & & & & &      \\   \hline 
\twelve      & & & & & & & & & & & & & & & &      \\   \hline    \lasthline  
\end{tabular}}}
}%%%%% End \onesheet
\begin{document}
%\vspace*{1.5cm}{} %%%%% This line destroys the document! Why?
\titleline  \\[1ex] 
\onesheet   \\[4ex]
\onesheet   \\[4ex]   
\onesheet   \newpage
\vspace*{2cm}
\hspace*{1cm}
\parbox{0.7\textwidth}{Spilleregler:  Barna kaster med to vanlige terninger, summerer øynene
som gir et resultat fra 2 opp til tolv.  Kryss av for det man fikk,
kast igjen. Den vinner som først får krysset av alle mulighetene!   }
\end{document}

But when I uncomment the first line after \begin{document} the effect is not close to what I want, for instance a new vertical line is printed down the first column in the table, over the numbers!? What is going on.

I think I can get what I want in some other way, the most important for me is somme explanation of what is going on!

7

It's quite simple. You're misusing \dimen0 not just as a temporary storage bin. The command \vspace uses \dimen0 so your setting is lost.

The value of \dimen0 is not computed when \onesheet is defined, just \dimen0 is remembered and, at usage time, the current value will be used.

Say

\newdimen\cellwidth
\cellwidth=0.6cm

and use \cellwidth where you have \dimen0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.