2

The cals package allows to create the tables with design capabilities which are available in Microsoft Word. This package is not based on tabular and has more bulky syntax than tabular. I'm try to write the macro to make the syntax more compact.

This table has been created by cals package: cals table sample

Total source text is too bulky, but the begin of the table is

\begin{calstable}
\makeatletter
\colwidths{{10mm}{25mm}{31mm}{60mm}{24mm}{40mm}}
\def\cals@framers@width{1.5pt}
\def\cals@framecs@width{1.5pt}
\def\cals@rs@width{0.5pt}

Suppose we're going to replace this by tabbegin macro:

\newcommand{\tabbegin}{
\makeatletter
\colwidths{{10mm}{25mm}{31mm}{60mm}{24mm}{40mm}}
\def\cals@framers@width{1.5pt}
\def\cals@framecs@width{1.5pt}
\def\cals@rs@width{0.5pt}}

However, if to do this, the tabular frame will be lost. What is the reason?

The MVE includes only first five rows of the table which has been represented on the picture, but it's enough. Please use XeLaTeX to compile the MWE:

\documentclass[11pt,a4paper]{article}

\usepackage[BoldFont]{xeCJK}
\setCJKmainfont{MS PMincho}

\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{russian}
\newfontfamily\russianfont{Calibri}

% --- 振り仮名 ---------------------------------------------------------------
\usepackage{ruby}
\renewcommand{\rubysep}{-0.1ex}

\usepackage{cals}

\oddsidemargin=-10.4mm
\topmargin=-35mm
\textwidth=190mm
\textheight=275mm

\usepackage{color}
\definecolor{ookiikanji}{rgb}{0.76,0.84,0.61}
\definecolor{onyomi}{rgb}{0.84,0.89,0.74}
\definecolor{kunyomi}{rgb}{0.92,0.95,0.87}

\newcommand{\tabbegin}{
\makeatletter
\colwidths{{10mm}{25mm}{31mm}{60mm}{24mm}{40mm}}
\def\cals@framers@width{1.5pt}
\def\cals@framecs@width{1.5pt}
\def\cals@rs@width{0.5pt}}


\begin{document}
\begin{calstable}
\tabbegin
% === 日 =================
% --- 音読み -------------    
% --- ニチ
\brow \def\cals@bgcolor{ookiikanji}
\nullcell{ltr} \def\cals@borderL{0.75pt} \alignL\def\cals@bgcolor{onyomi}
\alignL\cell{\vfil \fontsize{12}{1} 日} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{11}{1} ニチ}
\alignL\cell{\vfil \fontsize{10}{1}\itshape день; солнце; Япония, японский} \def\cals@borderL{0.75pt}
\alignC\cell{\vfil \fontsize{12}{1} \ruby{日常}{にちじょう}の} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{10}{1}\itshape  повседневный, обычный} \erow \def\cals@rs@width{0.5pt}
% --- ニ
\brow \def\cals@bgcolor{ookiikanji}
\nullcell{lr} \def\cals@borderL{0.75pt} \alignL\def\cals@bgcolor{onyomi}
\alignL\cell{\vfil \fontsize{12}{1} 日} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{11}{1} ニ}
\alignL\cell{\vfil \fontsize{10}{1}\itshape день; солнце; Япония, японский} \def\cals@borderL{0.75pt}
\alignC\cell{\vfil \fontsize{12}{1} \ruby{日本}{にほん}} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{10}{1}\itshape Япония} \erow
% --- ジツ
\brow \def\cals@bgcolor{ookiikanji}
\nullcell{lr} \def\cals@borderL{0.75pt} \alignL\def\cals@bgcolor{onyomi}
\alignL\cell{\vfil \fontsize{12}{1} 日} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{11}{1} ジツ}
\alignL\cell{\vfil \fontsize{10}{1}\itshape день; солнце; Япония, японский} \def\cals@borderL{0.75pt}
\alignC\cell{\vfil \fontsize{12}{1} \ruby{末日}{まつじつ}} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{10}{1}\itshape последний день} \erow \def\cals@rs@width{0.75pt}
% --- 訓読み -------------    
% --- ひ/び
\brow \def\cals@bgcolor{ookiikanji}
\nullcell{lr} \def\cals@borderL{0.75pt} \def\cals@bgcolor{kunyomi}
\alignL\cell{\vfil \fontsize{12}{1} 日} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{11}{1} ひ/び}
\alignL\cell{\vfil \fontsize{10}{1}\itshape день; солнце} \def\cals@borderL{0.75pt}
\alignC\cell{\vfil \fontsize{12}{1} \ruby{日切}{ひぎ}り} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{10}{1}\itshape расчёт по дням, график} \erow \def\cals@rs@width{0.5pt}
% --- が
\brow \def\cals@bgcolor{ookiikanji}
\nullcell{lrb}\alignC\spancontent{\vfil \fontsize{20}{1}\bfseries 日} \def\cals@borderL{0.75pt} \def\cals@bgcolor{kunyomi}
\alignL\cell{\vfil \fontsize{12}{1} 日} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{11}{1} か}
\alignL\cell{\vfil \fontsize{10}{1}\itshape день (соч.)} \def\cals@borderL{0.75pt}
\alignC\cell{\vfil \fontsize{12}{1} \ruby{二日}{ふつか}} \let\cals@borderL=\relax
\alignL\cell{\vfil \fontsize{10}{1}\itshape 2 дня} \erow \def\cals@rs@width{1pt}
\makeatother
\end{calstable}
\end{document}
  • You have to put the \makeatletter outside the macro definition. So try \makeatletter \newcommand{\tabbegin}{ \colwidths{{10mm}{25mm}{31mm}{60mm}{24mm}{40mm}} \def\cals@framers@width{1.5pt} \def\cals@framecs@width{1.5pt} \def\cals@rs@width{0.5pt}} – Werner Jul 22 '13 at 17:09

0 Answers0