WIP: таблицы, вычисления в TeX
This commit is contained in:
parent
42fda72157
commit
724f3d3d84
|
@ -16,7 +16,7 @@
|
|||
\subsection{Холодное оружие}
|
||||
|
||||
\weapon{Камень}{Самый обыкновенный камень.}
|
||||
\weaponstats{0}{0,5}
|
||||
\weaponstats{0}{2.5}
|
||||
\meleestats{4}{5}{Рукопашный Урон + 1}
|
||||
\throwingstats{4}{5}{Рукопашный Урон + 1}{5-15}
|
||||
|
||||
|
|
22
special.cls
22
special.cls
|
@ -35,20 +35,30 @@
|
|||
\pagestyle{empty}
|
||||
\setcounter{secnumdepth}{0}
|
||||
\setcounter{tocdepth}{2}
|
||||
\RequirePackage{ifthen}
|
||||
\RequirePackage{pgf}%rounding
|
||||
|
||||
\newcommand*{\RoundNum}[1]{\pgfmathprintnumber[fixed,precision=0]{#1}}%
|
||||
|
||||
\chapterstyle{southall}
|
||||
|
||||
%%%
|
||||
\newcommand{\equalsNothing}[1]{%
|
||||
\ifthenelse{\equal{\unexpanded{#1}}{}}{true}{false}%
|
||||
}
|
||||
|
||||
\newcommand{\weapon}[2]{
|
||||
\subsubsection{#1}
|
||||
#2\par
|
||||
}
|
||||
\newcommand{\weaponstats}[2]{
|
||||
\begin{table}[h] \begin{tabulary}{\textwidth}{CC}
|
||||
Цена & #1\\
|
||||
Вес & #2\\
|
||||
Минимальная Сила & \\
|
||||
Дальность & 1
|
||||
\newcommand{\calcmaxstrength}[1]{\RoundNum{\pgfmathparse{#1/1.1}}}%
|
||||
\newcommand{\maxstrength}[1]{\ifthenelse{\calcmaxstrength{#1} < 1}{1}{\calcmaxstrength{#1}}}
|
||||
\newcommand{\weaponstats}[2]{%
|
||||
\begin{table}[h] \begin{tabulary}{\textwidth}{CC}%
|
||||
Цена & #1 \\
|
||||
Вес & #2 \\
|
||||
Минимальная Сила & \maxstrength{#2} \\
|
||||
Дальность & 1%
|
||||
\end{tabulary}\end{table}
|
||||
}
|
||||
% Холодное оружие.
|
||||
|
|
Loading…
Reference in a new issue