% \iffalse % % makecell.dtx - Managing of tabular column heads and cells. % Russian documentation. % (c) 2005--2006 Olga Lapko (Lapko.O@g23.relcom.ru) % % This program is provided under the terms of the % LaTeX Project Public License distributed from CTAN % archives in directory macros/latex/base/lppl.txt. % %<*driver> \ProvidesFile{makecell-rus.tex} \documentclass{ltxdoc} \usepackage{mathtext} \usepackage[T2A]{fontenc} \usepackage[cp1251]{inputenc} \usepackage[english,russian]{babel} \IfFileExists{rotating.sty}{\usepackage{rotating}}{} \IfFileExists{footmisc.sty}{\usepackage[perpage]{footmisc}}{} \IfFileExists{multirow.sty}{\usepackage{multirow}}{} \IfFileExists{hyperref.sty}{\usepackage[unicode]{hyperref}}{} \IfFileExists{hypcap.sty}{\usepackage{hypcap}}{} \usepackage{makecell} \IfFileExists{caption.sty} {\usepackage[font=small,labelfont=bf,labelsep=period]{caption}[2004/11/28] \IfFileExists{floatrow.sty} {\usepackage[font=small,style=plaintop,captionskip=5pt]{floatrow}} {}}{} \makeatletter \@ifundefined{ttabbox}{\let\ttabbox\relax}{} \makeatother \usepackage{tabularx} \usepackage{slashbox} \usepackage{hhline} \EnableCrossrefs \CodelineIndex \RecordChanges \makeatletter \@beginparpenalty10000 \widowpenalty10000 \clubpenalty10000 \makeatother \providecommand*{\file}[1]{\texttt{#1}} \providecommand*{\package}[1]{\textsf{#1}} \providecommand*{\cls}[1]{\textsf{#1}} \providecommand*{\env}[1]{\texttt{#1}} \begin{document} \DocInput{makecell-rus.tex} \PrintChanges \end{document} % % \fi % % \GetFileInfo{makecell-rus.tex} % % \title{Пакет \textsf{makecell}} % \author{% % Ольга Лапко\\ % {\tt Lapko.O@g23.relcom.ru} } % \maketitle % \begin{abstract} %^^A% This package helps to create common layout for tabular material. %^^A% The |\thead| command, based on one-column tabular environment, is offered %^^A% for creation of tabular column heads. This macro allows to support common %^^A% layout for tabular column heads in whole documentation. Another command, %^^A% |\makecell|, is offered for creation of multilined tabular cells. %^^A% There are also command |\makecellbox| command and |mcellbox| environment %^^A% usage of tabular cells inside text. % Данный пакет помогает создать единое оформление для таблиц во всём % документе. Команда |\thead|, использующая окружение одноколоночной % таблицы, позволяет создать единообразное оформление для заголовков % табличных колонок в~документе. Ещё одна команда, |\makecell|, % предлагается для создания многострочных ячеек в~таблицах. % Также созданы команда |\makecellbox| и~окружение |mcellbox| % для создания таблиц-ячеек внутри текста. % %^^A% Package also offers: \quad 1)\nobreak\enskip macro |\makegapedcells|, %^^A% which changes vertical spaces around all cells in tabular, like in %^^A% \package{tabls} package, but uses code of \package{array} package. (Macro %^^A% |\makegapedcells| redefines macro |\@classz| from \package{array} package. %^^A% Macro |\nomakegapedcells| cancels this redefinition.); %^^A% \quad 2)\nobreak\enskip macros |\multirowhead| and |\multirowcell|, %^^A% which use |\multirow| macro from \package{multirow} package; %^^A% \quad 3)\nobreak\enskip numbered rows |\nline| or skipping cells |\eline| %^^A% in tabulars; also are the skipping rows command |\erows| and %^^A% repeated rows command |\Xrows|; %^^A% \quad 4)\nobreak\enskip diagonally divided cells (|\diaghead|) %^^A% plus citation of sample file of \package{slashbox} package, which does the same; %^^A% \quad 5)\nobreak\enskip |\hline| and |\cline| width necessary thickness: %^^A% |\Xhline| and |\Xcline| consequently. % Также предлагается: \qquad 1)\nobreak\enskip макрокоманда |\makegapedcells|, % которая изменяет вертикальные отбивки вокруг табличных ячеек, аналогично % пакету \package{tabls}, но использует пакет \package{array}. (Команда % |\makegapedcells| переопределяет макрокоманду |\@classz| пакета % \package{array}. Макрокоманда |\nomakegapedcells| отменяет переопределение.); % \qquad 2)\nobreak\enskip макрокоманды |\multirowhead| и~|\multirowcell|, % использующие макрокоманду |\multirow| из пакета \package{multirow}; % \qquad 3)\nobreak\enskip ряд нумерованных |\nline| или пропущенных |\eline| % ячеек, а~также пустых рядов |\erows| и~рядов с~повторяющимся текстом |\Xrows|; % \qquad 4)\nobreak\enskip ячейки разделённые диагональю (|\diaghead|), % а~также файл образец пакета \package{slashbox}, делающего то же самое; % \qquad 5)\nobreak\enskip линейки |\hline| и~|\cline| с~заданной толщиной: % |\Xhline| и~|\Xcline|. % \smallskip % % \end{abstract} % % \clearpage % \tableofcontents % % \clearpage %^^A% \section{Tabular Cells and Column Heads} % \section{Табличные ячейки и~заголовки колонок} % %^^A% \subsection{Building Commands} % \subsection{Основные команды} % % \DescribeMacro{\makecell} %^^A% Macro creates one-column tabular with predefined common settings of %^^A% alignment, spacing and vertical spaces around (see section~\ref{sec:sets}). %^^A% This will be useful for creation of multilined cells. This macro allows %^^A% optional alignment settings. % Макрокоманда создаёт окружение одноколоночной таблицы с~предопределёнными общими % параметрами выключки, интерлиньяжа и~вертикальных отбивок вокруг % (см. разд.~\ref{sec:sets}). Её удобно использовать для % многострочных ячеек. Дополнительный аргумент команды позволяет % изменить выключку таблицы. % \begin{quote} % |\makecell|\oarg{vertical or/and horizontal alignment}\marg{cell text} % \end{quote} %^^A% For vertical alignment you use \texttt{t}, \texttt{b}, or \texttt{c}---%^^A %^^A% this letters you usually put in optional argument of \env{tabular} or %^^A% \texttt{array} environments. For horizontal alignment you may use alignment %^^A% settings like \texttt{r}, \texttt{l}, or \texttt{c}, or more complex, like %^^A% |{p{3cm}}|. Since this package loads \package{array} package, you may %^^A% use such alignment settings like |{>{\parindent1cm}p{3cm}}|. % Для вертикальной выключки используются обозначения \texttt{t}, \texttt{b}, % или \texttt{c} \cdash--- эти буквы используются в~дополнительном аргументе окружений % \env{tabular} или \texttt{array}. Для горизонтальной выключки вы можете % использовать обозначения \texttt{r}, \texttt{l}, или \texttt{c}, или более % сложные: |{p{3cm}}|. Поскольку данный пакет загружает пакет \package{array}, вы % можете использовать и~такие определения выключки: |{>{\parindent1cm}p{3cm}}|. %\begin{verbatim} %\begin{tabular}{|c|c|} %\hline %Cell text & 28--31\\ %\hline %\makecell{Multilined \\ cell text} & 28--31\\ %\hline %\makecell[l]{Left aligned \\ cell text} & 37--43\\ %\hline %\makecell*[r]{Right aligned \\ cell text} & 37--43\\ %\hline %\makecell[b]{Bottom aligned \\ cell text} & 52--58\\ %\hline %\makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\ %\hline %\makecell[{{>{\parindent1em}p{3cm}}}]{Cell long...} & 52--58\\ %\hline %\end{tabular} %\end{verbatim} % \begin{table}[h] % \ttabbox % {\caption{Пример многострочных ячеек}\label{tab:cells}}% % {\begin{tabular}{|c|c|} % \hline % Cell text & 28--31\\ % \hline % \makecell{Multilined \\ cell text} & 28--31\\ % \hline % \makecell[l]{Left aligned \\ cell text} & 37--43\\ % \hline % \makecell*[r]{Right aligned \\ cell text} & 37--43\\ % \hline % \makecell[b]{Bottom aligned \\ cell text} & 52--58\\ % \hline % \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\ % \hline % \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & % 52--58\\ % \hline % \end{tabular}} % \end{table} % %^^A% Starred form of command, |\makecell*|, creates vertical |\jot| spaces %^^A% around. % Звёздная форма команды, |\makecell*|, создаёт вертикальные отбивки равные~|\jot|. % %^^A% \emph{Note}. When you define column alignment like |p{3cm}| in optional %^^A% argument of |\makecell| (or |\thead|, see below), please follow these %^^A% rules: \quad 1)\nobreak\enskip if vertical %^^A% alignment defined, write column alignment in group, e.g. |[c{p{3cm}}]|; %^^A% \quad 2)\nobreak\enskip if vertical alignment is absent, %^^A% write column alignment in double %^^A% group---|[{{p{3cm}}}]|, or add empty group---|[{}{p{3cm}}]|. Be also %^^A% careful with vertical alignment when you define column alignment as %^^A% paragraph block: e.g., use |{{b{3cm}}}| for bottom alignment (and %^^A% |{{m{3cm}}}| for centered vertical alignment). % \emph{Замечание}. При определении выключки колонки типа |{p{3cm}}| % в~дополнительном аргументе команды |\makecell| (или |\thead|, см.~ниже), % нужно соблюдать следующие правила: % \quad 1)\nobreak\enskip если есть % обозначение вертикальной выключки, взять выключку колонки в~группу: % |[c{p{3cm}}]|; \quad % 2)\nobreak\enskip если вертикальной выключки нет, взять выключку % колонки в~двойную группу \cdash--- |[{{p{3cm}}}]| или добавить пустую группу % \cdash--- |[{}{p{3cm}}]|. % Будьте внимательны с~вертикальной выключкой ячейки при задании выключки % колонки в~виде абзаца: % например, нужно использовать |{b{3cm}}| для выключки по нижней линии % (и~|{m{3cm}}| для выключки по средней линии). % % \DescribeMacro{\thead} %^^A% Macro creates one-column \texttt{tabular} for column heads with predefined %^^A% common settings (see table~\ref{tab:thead}). This macro uses common layout %^^A% for column heads: font, alignment, spacing, and vertical spaces around %^^A% (see section~\ref{sec:sets}). % Макрокоманда создаёт окружение одноколоночной таблицы для заголовков колонок % с~предопределёнными % общими параметрами выключки и~интерлиньяжа (см.~табл.~\ref{tab:thead}). % Эта макрокоманда использует общие установки для заголовков колонок: шрифт, % выключку, интерлиньяж, вертикальные отбивки вокруг (см. разд.~\ref{sec:tsets}). %\begin{verbatim} %\renewcommand\theadset{\def\arraystretch{.85}}% %\begin{tabular}{|l|c|} %\hline %\thead{First column head}& % \thead{Second \\multlined \\ column head}\\ %\hline %Left column text & 28--31\\ %\hline %\end{tabular} %\end{verbatim} % \begin{table}[h] % \ttabbox % {\caption{Пример заголовков колонок}\label{tab:thead}} % {\renewcommand\theadset{\def\arraystretch{.85}} % \begin{tabular}{|l|c|} % \hline % \thead{First column head}& % \thead{Second \\multlined \\ column head}\\ % \hline % Long left column text & 28--31\\ % \hline % \end{tabular}} % \end{table} % %^^A% Starred form of command, |\thead*|, creates vertical |\jot| spaces around. % Звёздная форма команды, |\thead*|, создаёт вертикальные отбивки равные~|\jot|. % % \DescribeMacro{\rothead} %^^A% Creates table heads rotated by 90$^\circ$ counterclockwise. %^^A% Macro uses the same font and spacing settings as previous %^^A% one, but column alignment changed to |p{\rotheadsize}| with |\raggedright| %^^A% justification: in this case left side of all text lines ``lies'' %^^A% on one base line. % Создаёт заголовки колонок, развёрнутые на 90$^\circ$ против часовой стрелки. % Макрокоманда использует те же установки шрифта и~интерлиньяжа как и~предыдущая, % но выключка колонки изменена на |p{\rotheadsize}| с~выравниванием вправо % (|\raggedright|): в~результате левый край строк заголовка оказывается % на одной базовой линии. % % \DescribeMacro{\rotheadsize} %^^A% This parameter defines the width of rotated tabular heads. You may define %^^A% that like: % Данный параметр определяет ширину колонки для развёрнутых вертикально заголовков. % Его можно определить как: % \begin{quote} % |\setlength\rotheadsize{3cm}| % \end{quote} % или % \begin{quote} % |\settowidth\rotheadsize{\theadfont |\meta{Widest head text}|}| % \end{quote} %^^A% like in following example: % как сделано в~следующем примере (табл.~\ref{tab:rotheads}): % \begin{table} % \ttabbox % {\caption{Пример заголовков колонок, развёрнутых вертикально}\label{tab:rotheads}}% % {\settowidth\rotheadsize{\theadfont Second multilined}%^^A % \begin{tabular}{l|l} % \hline % \thead{First column head}& % \rothead{Second multilined \\ column head}\\ % \hline % Long left column text & 28--31\\ % \hline % \end{tabular}} % \end{table}% %\begin{verbatim} %\settowidth\rotheadsize{\theadfont Second multilined} %\begin{tabular}{|l|c|} %\hline %\thead{First column head}& % \rotthead{Second multilined \\ column head}\\ %\hline %Left column text & 28--31\\ %\hline %\end{tabular} %\end{verbatim} % %^^A% \subsection{Settings For Tabular Cells}\label{sec:sets} % \subsection{Установки для табличных ячеек}\label{sec:sets} % %^^A% This section describes macros, which make layout tuning for multilined %^^A% cells, created by |\makecell| macro (and also |\multirowcell| and %^^A% |\rotcell| macros). The |\cellset| macro also is used by |\thead| %^^A% (|\rothead|, |\multirowtead|) macro. % В~данном разделе приведены команды, которые задают оформление % многострочных ячеек, заданных командой |\makecell| (а~также % |\multirowcell| и~|\rotcell|). % Команда |\cellset| используется также командой |\thead| (а~также % |\rothead|, |\multirowtead|). % % \DescribeMacro{\cellset} %^^A% Spacing settings for cells. Here you could use commands like: % Установки интерлиньяжа для табличных ячеек. Здесь можно использовать следующие % команды: % \begin{quote} % |\renewcommand\cellset{\renewcommand\arraytretch{1}%|\\ % | \setlength\extrarowheight{0pt}}| % \end{quote} %^^A% as was defined in current package. % как определено в~данном пакете. % % \DescribeMacro{\cellalign} %^^A% Default align for cells. Package offers vertical and horizontal centering %^^A% alignment, it defined like: % Выключка по умолчанию для табличных ячеек. Пакет предлагает вертикальную % и~горизонтальную выключку по центру, определённую следующим образом: % \begin{quote} % |\renewcommand\cellalign{cc}| % \end{quote} % % \DescribeMacro{\cellgape} %^^A% Define vertical spaces around |\makecell|, using |\gape| command if %^^A% necessary. It defined like: % Определяет вертикальные отбивки вокруг ячейки (|\makecell|), используя, % если нужно, команду |\gape|. Она определена как: % \begin{quote} % |\renewcommand\cellgape{}| % \end{quote} %^^A% You may define this command like % Можно определить макрокоманду как % \begin{quote} % |\renewcommand\cellgape{\Gape[1pt]}| % \end{quote} %^^A% or % или % \begin{quote} % |\renewcommand\cellgape{\gape[t]}| % \end{quote} %^^A% (See also section~\ref{sec:gape} about |\gape| and |\gape| command.) % (См.~также разд.~\ref{sec:gape} о~командах |\gape| и~|\Gape|.) % % \DescribeMacro{\cellrotangle} %^^A% The angle for rotated cells and column heads. The default value 90 %^^A% (counterclockwise). This value definition is used by both |\rotcell| and %^^A% |\rothead| macros. % Угол поворота для развёрнутых ячеек и~заголовков колонок. % По умолчанию задан угол 90 (против часовой стрелки). Это определение % используется командами |\rotcell| и~|\rothead|. % %^^A% \subsection{Settings For Column Heads} % \subsection{Установки для заголовков колонок}\label{sec:tsets} % %^^A% This section describes macros, which make layout tuning for tabular column %^^A% heads, created by |\thead| (|\rothead|, |\multirowtead|) macro. % В~данном разделе приведены команды, которые позволяют настроить оформление заголовков % табличных колонок, заданных командой |\thead| (|\rothead|, |\multirowtead|). % % \DescribeMacro{\theadfont} %^^A% Sets a special font for column heads. It could be smaller size % Задаёт шрифт для заголовков колонок. Может быть задан меньший кегель % \begin{quote} % |\renewcommand\theadfont{\foonotesize}| % \end{quote} %^^A% as was defined in current package (here we suppose that %^^A% \verb|\small| command used for tabular contents itself). %^^A% Next example defines italic shape % как определено в данном пакете (здесь учитывается, что задана % команда \verb|\small| для шрифта самой таблицы). % Следующий пример задаёт курсивное начертание % \begin{quote} % |\renewcommand\theadfont{\itshape}| % \end{quote} % % \DescribeMacro{\theadset} %^^A% Spacing settings for column heads. Here you could use commands like: % Установки интерлиньяжа для заголовков колонок. Здесь можно использовать следующие % команды: % \begin{quote} % |\renewcommand\theadset{\renewcommand\arraytretch{1}%|\\ % | \setlength\extrarowheight{0pt}}| % \end{quote} % % \DescribeMacro{\theadalign} %^^A% Default align for tabular column heads. Here also offered centering %^^A% alignment: % Выключка по умолчанию для заголовков колонок. Здесь также задана выключка по центру: % \begin{quote} % |\renewcommand\theadalign{cc}| % \end{quote} % % \DescribeMacro{\theadgape} %^^A% Define vertical spaces around column head (|\thead|), %^^A% using |\gape| command if necessary. %^^A% It defined like: % Определяет вертикальные отбивки вокруг заголовка колонки (|\thead|), используя, % если нужно, команду |\gape|. Определена как: % \begin{quote} % |\renewcommand\theadgape{\gape}| % \end{quote} % % \DescribeMacro{\rotheadgape} %^^A% Analogous definition for rotated column heads. Default is absent: % То же самое для вертикальных заголовков. По умолчанию отсутствует: % \begin{quote} % |\renewcommand\rotheadgape{}| % \end{quote} % % \clearpage %^^A% \section{Changing of Height and Depth of Boxes}\label{sec:gape} % \section{Изменение высоты и глубины боксов}\label{sec:gape} % %^^A% Sometimes \env{tabular} or \env{array} cells, or some elements in text need a %^^A% height/depth correction. The |\raisebox| command could help for it, but %^^A% usage of that macro in these cases, especially inside math, is rather %^^A% complex. Current package offers the |\gape| macro, which usage is similar %^^A% to |\smash| macro. The |\gape| macro allows to change height and/or depth %^^A% of included box with necessary dimension. % Иногда заголовки табличных колонок, табличные ячейки или элементы текста требуют % коррекции высоты/глубины. Макрокоманда |\raisebox| может помочь, % но использование её в~подобных ситуациях, особенно в~математике, довольно громоздко. % Данный пакет предлагает макрокоманду |\gape|, которая используется аналогично % команде |\smash|. Макрокоманда |\gape| позволяет изменить высоту и/или глубину бокса % на необходимую величину. % % \DescribeMacro{\gape} %^^A% This macro changes included box by |\jot| value (usually 3\,pt). It is %^^A% defined with optional and mandatory arguments, like |\smash| macro, which %^^A% (re)defined by \package{amsmath} package. Optional argument sets change of %^^A% height only (\texttt{t}) or depth only~(\texttt{b}). Mandatory argument %^^A% includes text. % Первая макрокоманда изменяет бокс на величину |\jot| (обычно 3\,pt). Она задаётся % дополнительным и~обязательным аргументами, как и~команда |\smash|, % (пере)определённая пакетом \package{amsmath}. Дополнительный аргумент задаёт % изменение только высоты (\texttt{t}) или только глубины % (\texttt{b}). Обязательный включает собственно текст. % \begin{quote} % |\gape|\oarg{\texttt{t} or \texttt{b}}\marg{text} % \end{quote} %^^A% Examples of usage: % Примеры использования: % \begin{quote} % \noindent % \vbox{\halign{#\cr % \noalign{\hrule} % \gape{\cmd{\gape}\texttt{\{text\}}}\cr % \noalign{\hrule} % \crcr}}\qquad % \vbox{\halign{#\cr % \noalign{\hrule} % \gape[t]{\cmd{\gape}\texttt{[t]\{text\}}}\cr % \noalign{\hrule\vskip\jot} % \crcr}}\qquad % \vbox{\halign{#\cr % \noalign{\hrule} % \gape[b]{\cmd{\gape}\texttt{[b]\{text\}}}\cr % \noalign{\hrule} % \crcr}} % \end{quote} % % \DescribeMacro{\Gape} %^^A% Another way of height/depth modification. This macro allows different %^^A% correction for height and depth of box: % Другой вариант изменения высоты/глубины. Данная макрокоманда позволяет сделать % корректировку отдельно для высоты и~глубины бокса: % \begin{quote} % |\Gape|\oarg{height corr}\oarg{depth corr}\marg{text} % \end{quote} % %^^A% If both arguments absent, |\Gape| command works like |\gape|\marg{text}, in %^^A% other words, command uses |\jot| as correction value for height and depth %^^A% of box. % Если отсутствуют оба необязательных аргумента, команда |\Gape| работает аналогично % |\gape|\marg{text}, другими словами, использует для корректировки высоты и~глубины % величину~|\jot|. % %^^A% If only one optional argument exists, |\Gape| command uses value %^^A% from this argument for both height and depth box corrections. % Если присутствует только один необязательный аргумент, команда |\Gape| использует % его значение для корректировки высоты и~глубины бокса. % \begin{quote} % \noindent % \vbox{\halign{#\cr % \noalign{\hrule} % \Gape{\cmd{\Gape}\texttt{\{text\}}}\cr % \noalign{\hrule} % \crcr}}\texttt{\phantom{xxxxx}}\qquad % \vbox{\halign{#\cr % \noalign{\hrule} % \Gape[\jot]{\cmd{\Gape}\texttt{[\cmd{\jot}]\{text\}}}\cr % \noalign{\hrule} % \crcr}}\\[2ex] % \vbox{\halign{#\cr % \noalign{\hrule} % \Gape[6pt]{\cmd{\Gape}\texttt{[6pt]\{text\}}}\cr % \noalign{\hrule} % \crcr}}\qquad % \vbox{\halign{#\cr % \noalign{\hrule} % \Gape[6pt][-2pt]{\cmd{\Gape}\texttt{[6pt][-2pt]\{text\}}}\cr % \noalign{\hrule\vskip8pt} % \crcr}} % \end{quote} % %^^A% You may also use |\height| and |\depth| parameters in optional arguments %^^A% of |\Gape| macro, parameters was borrowed from |\raisebox| command. % В~опциях команды |\Gape| вы можете использовать параметры |\height| и~|\depth|, % которые позаимствованы из команды |\raisebox|. % % \DescribeMacro{\bottopstrut} % \DescribeMacro{\topstrut} % \DescribeMacro{\botstrut} %^^A% These three macros modify standard |\strut| by |\jot| value: %^^A% |\bottopstrut| changes both height and depth; %^^A% \nopagebreak|\topstrut| changes only height; %^^A% |\botstrut| changes only depth. %^^A% These commands could be useful, for example, in first and last table rows. % Эти три команды изменяют стандартную команду |\strut| на величину |\jot|: % |\bottopstrut| изменяет и~высоту и~глубину; % |\topstrut| изменяет только высоту; % |\botstrut| изменяет только глубину. % Эти команды можно использовать, например, в~первом и~последнем рядах таблицы. % %^^A% \emph{Note}. If you use %^^A% \package{bigstrut} package note that these macros duplicate \cmd{\bigstrut}, %^^A% \cmd{\bigstrut[t]}, and \cmd{\bigstrut[b]} commands consequently. Please %^^A% note that value, which increases strut in \cmd{\topstrut} etc. equals to %^^A% \cmd{\jot}, but \cmd{\bigstrut} and others use a special dimension %^^A% \cmd{\bigstrutjot}. % \emph{Замечание}. Если % вы используете пакет \package{bigstrut}, обратите внимание, что эти три команды % дублируют \cmd{\bigstrut}, \cmd{\bigstrut[t]}, и~\cmd{\bigstrut[b]} соответственно. % Обратите также внимание что величина, изменяющая \cmd{\strut} в~команде % \cmd{\topstrut} и~других равна \cmd{\jot}, а~команда % \cmd{\bigstrut} и~использует специальную величину \cmd{\bigstrutjot}. % % \clearpage %^^A% \section{How to Change Vertical Spaces Around %^^A% in Whole Table}\label{sec:beta} % \section{Как изменить вертикальные отбивки во всей таблице}\label{sec:beta} % %^^A% This section describes macros which try to emulate one of possibilities of %^^A% \package{tabls} package: to get necessary vertical spacing around cells. % Данный раздел описывает макрокоманды, которые пытаются эмулировать % одну из возможностей пакета \package{tabls}: % создание необходимых отбивок вокруг ячеек таблицы. % % \DescribeMacro{\setcellgapes} %^^A% Sets the parameters for vertical spaces: % Определяет параметры для вертикальных отбивок: % \begin{quote} % |\setcellgapes|\oarg{\texttt{t} or \texttt{b}}\marg{value} % \end{quote} %^^A% The next examples with array and tabular use following settings: % Примеры таблиц, приведённые ниже используют следующие установки: % \begin{quote} % |\setcellgapes{5pt}| % \end{quote} %^^A% You may also try to load negative values if you wish. This macro you may %^^A% put in the preamble as common settings. % Вы можете также ввести отрицательные значения. Данную макрокоманду можно поместить % в~преамбуле документа как общие установки. % % \DescribeMacro{\makegapedcells} % \DescribeMacro{\nomakegapedcells} %^^A% The first macro switches on vertical spacing settings. The second cancels %^^A% first~one. % Первая макрокоманда включает создание вертикальных отбивок. Вторая отменяет первую. % %^^A% The \cmd{\makegapedcells} macro temporarily redefines macro %^^A% |\@classz| of \package{array} package, so use this mechanism carefully. %^^A% Load |\makegapedcells| inside group or inside environment %^^A% (see table~\ref{tab:gaped}): % Макрокоманда \cmd{\makegapedcells} временно переопределяет макрокоманду % |\@classz| из пакета \package{array}, поэтому используйте её осторожно. % Вводите команду |\makegapedcells| внутри группы или внутри окружения % (см.~табл.~\ref{tab:gaped}): %\begin{verbatim} %\begin{table}[h] %\makegapedcells %... %\end{table} %\end{verbatim} % \setcellgapes{5pt} % \begin{table} % \makegapedcells % \ttabbox % {\caption{Пример многострочных ячеек с~дополнительными вертикальными отбивками}%^^A % \label{tab:gaped}}% % {\begin{tabular}{|c|c|} % \hline % Cell text & 28--31\\ % \hline % \makecell{Multilined \\ cell text} & 28--31\\ % \hline % \makecell[l]{Left aligned \\ cell text} & 37--43\\ % \hline % \makecell*[r]{Right aligned \\ cell text} & 37--43\\ % \hline % \makecell[b]{Bottom aligned \\ cell text} & 52--58\\ % \hline % \makecell*[{{p{3cm}}}]{Cell long text with predefined width} & 52--58\\ % \hline % \makecell[{{>{\parindent1em}p{3cm}}}]{Cell long text with predefined width} & % 52--58\\ % \hline % \end{tabular}} % \end{table} % %^^A% Please note that space defined in |\setcellgapes| and space which creates %^^A% |\gape| mechanism in commands %^^A% for tabular cells (usually |\thead| or |\makecell*|) are summarized. % Обратите внимание, что отбивка заданная в~|\setcellgapes| и~отбивки, которые % создаёт макрокоманда |\gape| (|\Gape|) в~командах ячеек (обычно в~|\thead| % или в~|\makecell*|) суммируются. % % \clearpage %^^A% \section{Multirow Table Heads and Cells} % \section{Заголовки колонок и~ячейки, занимающие несколько рядов} % %^^A% The next examples show usage of macros which use |\multirow| command from %^^A% \package{multirow} package.\nopagebreak % Следующие примеры показывают использование макрокоманд, использующих команду % |\multirow| из пакета \package{multirow}.\nopagebreak % %^^A% At first goes short repetition of arguments of |\multirow| macro itself: % В~начале краткое повторение значений аргументов команды |\multirow|: % \begin{quote} % |\multirow|\marg{nrow}\oarg{njot}\marg{width}\oarg{vmove}\marg{contents} % \end{quote} %^^A% \marg{nrow} sets number of rows (i.e. text lines); % \marg{nrow} задаёт число рядов (то есть строк текста); %^^A% \oarg{njot} is mainly used if you've used \package{bigstrut} package: it makes %^^A% additional tuning of vertical position (see comments in %^^A% \package{multirow} package); % \oarg{njot} обычно используется если вы используете пакет \package{bigstrut}: делает % дополнительную настройку вертикального положения (см. пояснения в~пакете % \package{mutirow}); %^^A% \marg{width} defines width of contents, the |*| sign used to indicate that %^^A% the text argument's natural width is to be used; % \marg{width} определяет ширину включённого текста, знак~|*| используется % для указания, что используется натуральная ширина включённого текста; %^^A% \oarg{vmove} is a length used for fine tuning: the text will be raised (or %^^A% lowered, if \meta{vmove} is negative) by that length; % \oarg{vmove} величина, используемая для тонкой настройки: текст может быть % поднят (или опущен, если \meta{vmove} отрицательна) на эту величину; %^^A% \marg{contents} includes ``|\multirow|'ed'' text.\smallskip % \marg{contents} <<многорядный>> текст.\smallskip\pagebreak[3] % % \DescribeMacro{\multirowcell} % \DescribeMacro{\multirowthead} %^^A% These two macros use following arguments (example uses |\multirowcell| %^^A% command): % Эти две команды используют следующие аргументы (пример использует команду % |\multirowcell|): % \begin{quote} % |\multirowcell|\marg{nrow}\oarg{vmove}\oarg{v or/and h alignment}\marg{contents} % \end{quote} %^^A% in these macros were skipped \oarg{njot} and \marg{width}. Instead of %^^A% tuning optional argument \oarg{njot} for vertical %^^A% correction used \oarg{vmove} optional argument. %^^A% For the \marg{width} argument both |\multirowcell| and |\multirowthead| %^^A% macros use natural width of contents (i.e. the |*| argument used). % в~этих макрокомандах опущены аргументы \oarg{njot} и~\marg{width}. % Вместо дополнительного аргумента \oarg{njot} для вертикальной настройки % используется дополнительный аргумент \oarg{vmove}. % В~качестве аргумента \marg{width} макрокоманды |\multirowcell| и~|\multirowthead| % используют натуральную величину включённого текста (то есть используется % аргумент |*|). % %^^A% First example (table~\ref{tab:mrowI}) with ``|\multirow|'ed'' column heads %^^A% and cells: % Первый пример (табл.~\ref{tab:mrowI}) с~<<многорядными>> заголовками % табличных колонок и~ячейками: %\begin{verbatim} %\renewcommand\theadset{\def\arraystretch{.85}}% %\begin{tabular}{|l|c|c|} % \multirowthead{4}{First ...}& % \multicolumn{2}{c|}{\thead{Multicolumn head}}\\ % \cline{2-3} % & \thead{Second ...} & \thead{Third ...}\\ % \hline % Cell text & A &\multirowcell{3}{28--31}\\ % \cline{1-2} % \makecell{Multilined\\Cell text} & B& \\ % \hline % \makecell[l]{Left ...} & C & \multirowcell{4}[1ex][l]{37--43}\\ % \cline{1-2} % \makecell[r]{Right ...} & D & \\ % \hline % \makecell[b]{Bottom ...} & E & \multirowcell{5}[1ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{5cm}}}]{Cell ...} & F & \\ % \cline{1-2} % \makecell[{{>{\parindent1em}p{5cm}}}]{Cell ...} & G & \\ % \hline % \end{tabular} %\end{verbatim} % % \begin{table} %\renewcommand\theadset{\def\arraystretch{.85}}% % \ttabbox % {\caption{Пример <<многорядных>> ячеек}\label{tab:mrowI}}% % {\begin{tabular}{|l|c|c|} % \hline % \multirowthead{4}{First Column head}& % \multicolumn{2}{c|}{\thead{Multicolumn head}}\\ % \cline{2-3} % & \thead{Second \\multlined \\ column head} & % \thead{Third \\ column head}\\ % \hline % Cell text & A &\multirowcell{3}{28--31}\\ % \cline{1-2} % \makecell{Multilined\\Cell text} & B& \\ % \hline % \makecell[l]{Left aligned\\ cell text} & C & \multirowcell{4}[1ex][l]{37--43}\\ % \cline{1-2} % \makecell[r]{Right aligned\\ cell text} & D & \\ % \hline % \makecell[b]{Bottom aligned\\ cell text} & E & % \multirowcell{5}[1ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\ % \cline{1-2} % \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text with % predefined width} & G & \\ % \hline % \end{tabular}} % \end{table} % %^^A% Second example (table~\ref{tab:mrowII}) with ``multirow'ed'' column heads %^^A% and cells uses |\makegapedcells| command. The |\theadgape| command does %^^A% nothing: % Второй пример (табл.~\ref{tab:mrowII}) с~<<многорядными>> заголовками колонок % и~ячейками использует команду |\makegapedcells|. Команда |\theadgape| ничего % не делает: %\begin{verbatim} %\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} %... %\end{verbatim} % \begin{table}\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} % \ttabbox % {\caption{Пример <<многорядных>> ячеек с~дополнительными вертикальными % отбивками}\label{tab:mrowII}}% % {\begin{tabular}{|l|c|c|} % \hline % \multirowthead{4}{First Column head}& % \multicolumn{2}{c|}{\thead{Multicolumn head}}\\ % \cline{2-3} % & \thead{Second \\multlined \\ column head} & % \thead{Third \\ column head}\\ % \hline % Cell text & A &\multirowcell{4}{28--31}\\ % \cline{1-2} % \makecell{Multilined \\Cell text} & B& \\ % \hline % \makecell[l]{Left aligned \\ cell text} & C & \multirowcell{4}[0ex][l]{37--43}\\ % \cline{1-2} % \makecell[r]{Right aligned \\ cell text} & D & \\ % \hline % \makecell[b]{Bottom aligned \\ cell text} & E & % \multirowcell{6}[0ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{5cm}}}]{Cell long long long long text with predefined width} & F & \\ % \cline{1-2} % \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long text % with predefined width} & G & \\ % \hline % \end{tabular}} % \end{table} % \bigskip % %^^A% The last example (table~\ref{tab:mrowIII}) uses \env{tabularx} environment %^^A% with |\hsize| in the width argument. % Последний пример (табл.~\ref{tab:mrowIII}) использует окружение \env{tabularx} % со значением |\hsize| в~аргументе ширины таблицы. %\begin{verbatim} %\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} %\begin{tabularx}\hsize{|X|c|c|} %... %\cline{1-2} %\makecell[{{p{\hsize}}}]{Cell ...} & F & \\ %\cline{1-2} %\makecell[{{>{\parindent1em}p{\hsize}}}]{Cell ...} & G & \\ %\hline %\end{tabularx} %\end{verbatim} %^^A% As you may see the |\makecell|'s in last two rows defined as % Как можно видеть, ячейки |\makecell| в~последних двух рядах определены как % \begin{quote} % |\makecell[{{p{\hsize}}}]{...}| % \end{quote} % и % \begin{quote} % |\makecell[{{>{\parindent1em}p{\hsize}}}]{...}| % \end{quote} %^^A% consequently. % соответственно. % \begin{table}\makegapedcells %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadfont{\footnotesize}% %\renewcommand\theadgape{} % \ttabbox % {\caption{Пример окружения \env{tabularx}}\label{tab:mrowIII}}% % {\begin{tabularx}\hsize{|X|c|c|} % \hline % \multirowthead{4}{First Column head}& % \multicolumn{2}{c|}{\thead{Multicolumn head}}\\ % \cline{2-3} % & \thead{Second \\multlined \\ column head} & % \thead{Third \\ column head}\\ % \hline % Cell text & A &\multirowcell{4}{28--31}\\ % \cline{1-2} % \makecell{Multilined \\Cell text} & B& \\ % \hline % \makecell[l]{Left aligned \\ cell text} & C & \multirowcell{4}[0ex][l]{37--43}\\ % \cline{1-2} % \makecell[r]{Right aligned \\ cell text} & D & \\ % \hline % \makecell[b]{Bottom aligned \\ cell text} & E & % \multirowcell{6}[0ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{\hsize}}}]{Cell long long long long long long text with % predefined width} & F & \\ % \cline{1-2} % \makecell[{{>{\parindent1em}p{\hsize}}}]{Cell long long long long % long long text with predefined width} & G & \\ % \hline % \end{tabularx}} % \end{table} % %^^A% \subsection{Multirow Table Heads and Cells: Second Variant} % \subsection{Ячейки на несколько рядов: второй вариант} % %^^A% Another, simplified, variant of multirow cell: use %^^A% |\makecell| and |\thead| commands, and set |\\| with %^^A% negative space at the end, for example % Второй, упрощённый, вариант задания ячейки на несколько рядов: \cdash--- % использовать команды |\makecell| и~|\thead|, а~в~конце аргумента задать |\\| % с~отрицательной отбивкой, например %\begin{quote} % |\thead{First Column head\\[-5ex]}| %\end{quote} %^^A% cells, which stay in one ``multi row'' will have the same value of this %^^A% negative space, in spite of different number of lines in their contents. % при этом у~ячеек в~одном <<многоярусном>> ряду, сколько бы строк они ни имели бы, % отрицательная отбивка будет всегда одинаковая. % % \clearpage\suppressfloats[t] %^^A% \section{Numbered Lines in Tabulars} % \section{Нумерованные ряды ячеек в~таблицах} % %^^A% The three commands |\eline|, |\nline|, |\rnline| allow to skip: % Команды |\eline|, |\nline|, |\rnline| позволяют пропустить несколько ячеек: % \begin{quote} % |\eline|\marg{number of cells} % \end{quote} % и~пронумеровать (|\nline|) несколько или все ячейки в~ряду: % \begin{quote} % |\nline|\oarg{numbering type}\oarg{start number}\marg{number of cells} % \end{quote} %^^A% Command |\rnline| does the same as |\nline|, but allows numbering by %^^A% Russian letters (it redefines %^^A% \LaTeX's |\Alph| and |\alph| with |\Asbuk| and |\asbuk| consequently). %^^A% (see table~\ref{tab:elines}) % Команда |\rnline| работает так же как |\nline|, но вместо нумерации % латинскими буквами задаётся нумерация русскими (переопределяются счётчики % \LaTeX'а |\Alph| а~|\alph| на |\Asbuk| и~|\asbuk| соответственно). % (см.~табл.~\ref{tab:elines}) %\begin{verbatim} % \begin{tabular}{|*{12}{c|}} % \hline % \eline{6} \\ \hline % \nline{6} \\ \hline % \eline{3} & \nline[1][4]{3} \\ \hline % \rnline[(a)]{6} \\ \hline % \nline[column I]{6} \\ \hline % \end{tabular} %\end{verbatim} % % \begin{table}[htb] % \ttabbox % {\caption{Примеры заполнения ячеек}\label{tab:elines}}% % {\begin{tabular}{|*{12}{c|}} % \hline % \eline{6} \\ \hline % \nline{6} \\ \hline % \eline{3} & \nline[1][4]{3} \\ \hline % \rnline[(a)]{6} \\ \hline % \nline[column I]{6} \\ \hline % \end{tabular}} %\end{table} % %^^A% Two ``lazy'' commands: for empty table rows %^^A% (|\erows|) and for rows with repeated text (|\Xrows|) were added in the version V0.1e. % В~версии V0.1e добавлены две команы «для лодырей»: для создания пустых рядов в~таблице % (|\erows|) и~для рядов с~повторяющимся текстом (|\Xrows|). % %\DeleteShortVerb{\|} %\begin{verbatim} % \begin{tabular}{|*{4}{c|}} % \hline % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hline % \erows{4}{8} % \end{tabular}\quad % \begin{tabular}{||c||c||c||c||} % \hhline{|t:=:t:=:t:=:t:=:t|} % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hhline{|:=::=::=::=:|} % \erows[\\ \hhline{|:=::=::=::=:|}]{4}{8} % \eline{4}\\ \hhline{|b:=:b:=:b:=:b:=:b|} % \end{tabular}\quad % \begin{tabular}{|*{4}{c|}} % \hline % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hline % \Xrows{\refstepcounter{enumi}\arabic{enumi}.\eline{3}\\ \hline}{8} % \end{tabular} %\end{verbatim} % % \begin{table}[hbt]\extrarowheight1pt % \ttabbox[\hsize] % {\caption{Examples of filling of cells}\label{tab:elines}}% % {\begin{tabular}{|*{4}{c|}} % \hline % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hline % \erows{4}{8} % \end{tabular}\par\bigskip % \begin{tabular}{||c||c||c||c||} % \hhline{|t:*3{=:t:}=:t|} % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hhline{|:*3{=::}=:|} % \erows[\\ \hhline{|:*3{=::}=:|}]{4}{7} % \eline{4}\\ % \hhline{|b:*3{=:b:}=:b|} % \end{tabular}\par\bigskip % \begin{tabular}{|*{4}{c|}} % \hline % \thead{No}&\thead{First Data}&\thead{Second Data}&\thead{Third Data} \\ % \hline % \Xrows{\refstepcounter{enumi}\arabic{enumi}.\eline{4}\\ \hline}{8} % \end{tabular}} %\end{table} %\MakeShortVerb{\|} % %^^A% \section{Cells (One-Column Tabulars) in the Text} % \section{Ячейки (одноколоные таблицы) вкралпённые в~текст} % %^^A% If the |\makecell| command appears in the text (outside outer tabular %^^A% environment) it could create wrong layout. The |\makecellbox| command %^^A% and |mcellbox| environment are created for one-column tabulars in the text. % Если команда |\makecell| появится внутри текста (т.\,е. вне другого окружения % выравнивания) она создаст неверную вёрстку. Команда |\makecellbox| и~окружение % |mcellbox| созданы для одноколонных простых таблиц, вкраплённых в~текст. % %^^A% \section{Diagonally Divided Cell} % \section{Ячейки, разделённые по диагонали} % %^^A% This variant of head's positioning is not too popular nowadays, but in %^^A% the some cases it could be used. Instead of creating of %^^A% multicolumn head above a wide couple of all column heads except the %^^A% very left column, the most left column head (upper left cell) %^^A% divided by diagonal line. The lower head is usually head of very left %^^A% column and upper head---``multicolumn'' to all other column heads of %^^A% table to the right. % Сейчас такой вариант расположения заголовков колонок не так популярен, % но всё же иногда используется. Вместо создания большого % заголовка-перереза над большим числом колонок, самый левый заголовок % (верхняя левая ячейка таблицы) разделяется диагональю, где в~нижнем % треугольнике обычно помещают заголовок боковика, а~в~верхнем \cdash--- % заголовок относящийся к~колонкам прографки (заголовкам всех колонок справа). % %^^A% This package offers macro based on possibilities of \env{picture} %^^A% environment. % Данный пакет предлагает макрокоманду, в~основе которой используется % окружение \env{picture}. % \begin{quote} % |\diaghead|\texttt{(}\meta{\texttt{\textup{H}} ratio,%^^A % \textup{\texttt{V}} ratio}\texttt{)}%^^A % \marg{Text set for column width}|%|\\ % \phantom{/diaghead }\marg{First head}\marg{Second head} % \end{quote} %^^A% where \texttt{(}\meta{\textup{\texttt{H ratio}},%^^A %^^A% \textup{\texttt{V ratio}}}\texttt{)} sets the ratios like in |\line| %^^A% command (digits from~|1| up to~|6|). This argument is optional, %^^A% the default ratio (|\line| %^^A% direction) defined as~|(5,-2)|. % где \texttt{(}\meta{\textup{\texttt{H ratio}},%^^A} % \textup{\texttt{V ratio}}}\texttt{)} определяет отношение диагонали, как % в~первом аргументе команды |\line| % (целые числа от~|1| до~|6|). Аргумент не является обязательным, отношение, % заданное по умолчанию (направление диагонали |\line|) равно~|(5,-2)|. % %^^A% The \marg{Text set for column width} %^^A% defined by hand, for example: %^^A% \quad 1)\nobreak\enskip sets the width, using longest text lines from %^^A% both heads---in this case you must put |\theadfont| macro, if you use %^^A% |\thead|s; \quad 2)\nobreak\enskip the longest text from the rest of %^^A% column; \quad 3)\nobreak\enskip |\hskip|\meta{value}, even |\hskip\hsize| %^^A% the case of |p| column (or |X| column in \env{tabularx} environment). %^^A% The \marg{First head} %^^A% is head in lower corner (usually for first or very left column), %^^A% \marg{Second head}---in the upper corner (head for the all right columns). % Аргумент \marg{Text set for column width} % задаётся обычно подбором, например: % \quad 1)\nobreak\enskip задаёт ширину, используя самые длинные строки % в~обоих заголовках \cdash--- в~этом случае, если вы % используете в~таблицах команды |\thead|, нужно задать |\theadfont|; % \quad 2)\nobreak\enskip самую длинную строку боковика, % если она больше заголовков; % \quad 3)\nobreak\enskip горизонтальную отбивку |\hskip|\meta{value}, % можно использовать даже такое: |\hskip\hsize| если это % колонка |p| (или |X| из окружения \env{tabularx}). % Аргумент \marg{First head} \cdash--- % заголовок в~нижнем углу (обычно для боковика), % \marg{Second head} \cdash--- в~верхнем углу (заголовок для прографки % \cdash--- остальных колонок). % %^^A% Here is code of table~\ref{tab:diaghead}. % Здесь приведён код табл.~\ref{tab:diaghead}. %\begin{verbatim} % \begin{tabular}{|c|c|c|}% % \hline % \diaghead{\theadfont Diag ColumnmnHead II}%^^A % {Diag \\Column Head I}{Diag Column\\ Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % ... % \end{tabular}\medskip % % \begin{tabularx}{.62\hsize}{|X|c|c|}% % \hline % \diaghead(4,1){\hskip\hsize}% % %^^A{\theadfont Diag ColuDiag Column}%^^A % {Diag \\Column Head I}{Diag Column \\Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % ... % \end{tabularx}\medskip % % \nomakegapedcells % \begin{tabular}{|l|c|c|}% % \hline % \diaghead(-4,1){\hskip4.2cm}%^^A % {Diag \\Column Head I}{Diag Column \\Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % ... % \end{tabular}% %\end{verbatim}% % % \begin{table}[!bp]\makegapedcells % \begin{tabular}{|c|c|c|}% % \hline % \diaghead{\theadfont Diag ColumnmnHead II}%^^A % {Diag \\Column Head I}{Diag Column\\ Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % \hline % \makecell[l]{Left aligned \\ cell text} & A & 37--43\\ % \hline % \makecell*[r]{Right aligned \\ cell text} & B & 37--43\\ % \hline % \makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\ % \hline % \end{tabular}% % \medskip % % \begin{tabularx}{.62\hsize}{|X|c|c|}% % \hline % \diaghead(4,1){\hskip\hsize}% % %^^A{\theadfont Diag ColuDiag Column}%^^A % {Diag \\Column Head I}{Diag Column \\Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % \hline % \makecell[l]{Left aligned \\ cell text} & A & 37--43\\ % \hline % \makecell*[r]{Right aligned \\ cell text} & B & 37--43\\ % \hline % \makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\ % \hline % \end{tabularx}% % \medskip % % \nomakegapedcells % \begin{tabular}{|l|c|c|}% % \hline % \diaghead(-4,1){\hskip4.2cm}%^^A % {Diag \\Column Head I}{Diag Column \\Head II}& % \thead{Second\\column}&\thead{Third\\column}\\ % \hline % \makecell[l]{Left aligned \\ cell text} & A & 37--43\\ % \hline % \makecell*[r]{Right aligned \\ cell text} & B & 37--43\\ % \hline % \makecell[b]{Bottom aligned\\ cell text} & C & 52--58\\ % \hline % \end{tabular}% % \caption{Пример таблиц с~ячейками поделёнными по % диагонали}\label{tab:diaghead} % \end{table}% %^^A% The correct position of diagonal ends depends of width of column. If cell width %^^A% is narrower then necessary %^^A% column ends of diagonal don't touch corners of cell. % Точное попадание концов диагонали в~углы ячейки зависит от её ширины. Если ячейка % \'уже необходимого то концы диагонали не «дотягиваются» до углов. % %^^A% \section{Comparison: Diagonally Divided Cell with the slashbox package} % \section{Сравнение: ячейки, разделённые по диагонали в~пакете slashbox} % %^^A% I didn't know about the \texttt{slashbox} package in time %^^A% when the part of code for the diagonal cells was created. This package uses also picture %^^A% |\line| mechanism, but calculates slopes automatically. It creates the %^^A% |\backslash| direction of diagonal lines only. (The |\slash| direction %^^A% is not correct? Or direction depends to traditions of current publishing house?) % Во время создания команд ячеек, разделённых по диагонали мне не было известно % о~пакете \texttt{slashbox}. Этот пакет также использует механизм окружения |picture| % и~команды |\line|, но наклон линии рассчитывается автоматически. Пакет создаёт % только наклон, соответствующий обратной наклонной (|\backslash|). (Направление, % соответствующее прямой наклонной (|\slash|) всё-таки не является % корректным. Или направление зависит от традиций издательства?) % %^^A% Here is used citation of the sample file distributed with the \texttt{slashbox} package%^^A %^^A% \footnote{by Koichi Yasuoka, May 27, 1993; minor modification by Toru Sato, May 31, 1993}. %^^A% The verbatim of the table examples are added only in citation.\smallskip % Далее цитируется файл-образец (лучше читать текст этого параграфа % на английском!), распространяемый вместе с~пакетом \texttt{slashbox}%^^A % \footnote{by Koichi Yasuoka, May 27, 1993; minor modification by Toru Sato, May 31, 1993}. % Здесь только добавлен |verbatim| примеров.\smallskip % % \begingroup\slshape %^^A% The usage is pretty straightforward, such as % Использование достаточно простое, например % %\begin{table}[H]% %\begin{verbatim} %\begin{tabular}{|l||*{5}{c|}}\hline %\backslashbox{Room}{Date} %&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2} %&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline %Meeting Room &&&&&\\\hline %Auditorium &&&&&\\\hline %Seminar Room &&&&&\\\hline %\end{tabular} %\end{verbatim}% % % \noindent % \begin{tabular}{|l||*{5}{c|}}\hline % \backslashbox{Room}{Date} % &\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2} % &\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline % Meeting Room &&&&&\\\hline % Auditorium &&&&&\\\hline % Seminar Room &&&&&\\\hline % \end{tabular} %\end{table}% % %^^A% You may include a newline (\verb+\\+) in `Room' and/or `Date'. %^^A% Note that you will get spaces aside the slash line if there is a %^^A% wider column in the same column of a different line. %^^A% In such a case, you need to specify the width of the slashed column %^^A% by saying % Вы можете использовать команду новой строки (\verb+\\+) в~аргументах, % где заданы слова «Room» и/или «Date». Обратите внимание, что вы % получите пробелы около наклонной линии, если содержимое колонки % шире её головки. В~этом случае вам нужно определить ширину колонки, % задав % %\begin{table}[H]% %\begin{verbatim} %\begin{tabular}{|l||*{4}{c|}}\hline %\backslashbox[48mm]{Room}{Date} %&\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2} %&\makebox[3em]{6/3}\\\hline\hline %Room With a Long Name &&&&\\\hline %Auditorium &&&&\\\hline %Seminar Room &&&&\\\hline %\end{tabular} %\end{verbatim}% % % \noindent % \begin{tabular}{|l||*{4}{c|}}\hline % \backslashbox[48mm]{Room}{Date} % &\makebox[3em]{5/31}&\makebox[3em]{6/1}&\makebox[3em]{6/2} % &\makebox[3em]{6/3}\\\hline\hline % Room With a Long Name &&&&\\\hline % Auditorium &&&&\\\hline % Seminar Room &&&&\\\hline % \end{tabular} %\end{table}% % %^^A% The specified width is neglected if it is narrower than the natural %^^A% width of the column. % Заданная ширина не будет принята в~расчёт, если реальная ширина шапки % больше. % %^^A% \verb+\(back)slashbox+ assumes by default that there is a blank space %^^A% of width \verb+\tabcolsep+ on both sides of the column. Thus the %^^A% slash line might exceeds the boundary when you use \verb+@{}+ %^^A% etc. % Команда \verb+\(back)slashbox+ по умолчанию предполагает, что вокруг колонки % задана отбивка, равная \verb+\tabcolsep+. В~результате, если вы используете % что-то вроде \verb+@{}+, наклонная может вылезти на поля. % % Этого можно избежать, задав % %\begin{table}[H]% %\begin{verbatim} %\begin{tabular}{|@{\ $\bullet$\hspace*{3mm}}l||*{5}{c|}}\hline %\multicolumn{1}{|@{}l||}{\backslashbox[0pt][l]{Room}{Date}} %&\makebox[3em]{5/31}&\makebox[4em]{6/1}&\makebox[3em]{6/2} %&\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline %Meeting Room &&&&&\\\hline %Auditorium &&&&&\\\hline %Seminar Room &&&&&\\\hline %\end{tabular} %\end{verbatim}% % % \bigskip % % \noindent % \begin{tabular}{|@{\ $\bullet$\hspace*{3mm}}l||*{5}{c|}}\hline % \multicolumn{1}{|@{}l||}{\backslashbox[0pt][l]{Room}{Date}} % &\makebox[3em]{5/31}&\makebox[4em]{6/1}&\makebox[3em]{6/2} % &\makebox[3em]{6/3}&\makebox[3em]{6/4}\\\hline\hline % Meeting Room &&&&&\\\hline % Auditorium &&&&&\\\hline % Seminar Room &&&&&\\\hline % \end{tabular} %\end{table}% % %^^A% Here \verb+[l]+ tells the command that there is no extra space on the %^^A% left of this column. You can use \verb+[r]+ and \verb+[lr]+ likewise. %^^A% You have to also specify the width of the column in this case, but it %^^A% can be~0pt. % Здесь \verb+[l]+ сообщает, что слева не дополнительной отбивки слева. % Можно использовать \verb+[r]+ и~\verb+[lr]+ аналогично. % В~этом случае вы должны не забыть задать ширину колонки, которую можно % задать как~0pt. % \endgroup % %^^A% The addition for the sample with |\slashbox| command. This example demonstrates %^^A% that you may combine the \texttt{makecell} commands and |\backslashbox|. % Небольшое дополнение к~файлу-образцу. Даный пример показывает, что возможно % использование команд \texttt{thead} (или \texttt{makecell}), а~также % команд-настроек выключки и~шрифта вместе с~|\backslashbox|. % %\begin{table}[H]% %\begin{verbatim} %\begin{tabular}{|l||*{5}{c|}}\hline %\theadset\theadfont\backslashbox{Room}{Date} %&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}} %&\makebox[3em]{6/3}&\makebox[3em]{\thead{6/4}}\\\hline\hline %Meeting Room &&&&&\\\hline %Auditorium &&&&&\\\hline %Seminar Room &&&&&\\\hline %\end{tabular} %\end{verbatim}% % % \noindent % \begin{tabular}{|l||*{5}{c|}}\hline %\theadset\theadfont\backslashbox{Room}{Date} %&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}} %&\makebox[3em]{6/3}&\makebox[3em]{\thead{6/4}}\\\hline\hline % Meeting Room &&&&&\\\hline % Auditorium &&&&&\\\hline % Seminar Room &&&&&\\\hline % \end{tabular} %\end{table}% % %\begin{table}[H] %\begin{verbatim} %\begin{tabular}{|l||*{4}{c|}}\hline %\theadset\backslashbox[48mm]{Room}{Date} %&\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}} %&\makebox[3em]{\thead{6/3}}\\\hline\hline %Room With a Long Name &&&&\\\hline %Auditorium &&&&\\\hline %Seminar Room &&&&\\\hline %\end{tabular} %\end{verbatim}% % % \noindent % \begin{tabular}{|l||*{4}{c|}}\hline % \theadset\backslashbox[48mm]{Room}{Date} % &\makebox[3em]{\thead{5/31}}&\makebox[3em]{\thead{6/1}}&\makebox[3em]{\thead{6/2}} % &\makebox[3em]{\thead{6/3}}\\\hline\hline % Room With a Long Name &&&&\\\hline % Auditorium &&&&\\\hline % Seminar Room &&&&\\\hline % \end{tabular} %\end{table}% % % \clearpage %^^A% \section{Thick \cmd{\hline} and \cmd{\cline}} % \section{Команды \texorpdfstring{\cmd{\hline}}{hline} и~\texorpdfstring{\cmd{\cline}}{cline} заданной толщины} % %^^A% For horizontal rules in tabular there were added two commands %^^A% \cmd{\Xhline} and \cmd{\Xcline} %^^A% They use additional mandatory argument with defined rule width. % Для горизонтальных линеек в~табличном материале добавлены две команды % \cmd{\Xhline} и~\cmd{\Xcline} % Они имеют обязательный аргумент с~заданием ширины линейки. % %^^A% The example, with result in table~\ref{tab:XmrowIII}. % Пример применения команд см.~в~табл.~\ref{tab:XmrowIII}. %\begin{verbatim}% %\begin{table} %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} %\ttabbox %{\caption{...}\label{...}}% %{\begin{tabular}{!{\vrule width1.2pt}c % !{\vrule width1.2pt}c|c % !{\vrule width1.2pt}} %\Xhline{1.2pt} %\multirowthead{4}{First Column head}& %\multicolumn{2}{c!{\vrule width1.2pt}}{\thead{Multicolumn head}}\\ %\Xcline{2-3}{1.2pt} % & \thead{Second \\multlined \\ column head} & % \thead{Third \\ column head}\\ %\Xhline{1.2pt} %Cell text & A &\multirowcell{4}{28--31}\\ %... %\Xhline{1.2pt} %\end{tabular}} %\end{table} %\end{verbatim}% % % \begin{table}\makegapedcells\relax %\renewcommand\theadset{\def\arraystretch{.85}}% %\renewcommand\theadgape{} % \ttabbox % {\caption{Пример окружения \env{tabular} с~использованием толстых % линеек}\label{tab:XmrowIII}}% % {\begin{tabular}{!{\vrule width1.2pt}c % !{\vrule width1.2pt}c|c!{\vrule width1.2pt}} % \Xhline{1.2pt} % \multirowthead{4}{First Column head}& % \multicolumn{2}{c!{\vrule width1.2pt}}{\thead{Multicolumn head}}\\ % \Xcline{2-3}{1.2pt} % & \thead{Second \\multlined \\ column head} & % \thead{Third \\ column head}\\ % \Xhline{1.2pt} % Cell text & A &\multirowcell{4}{28--31}\\ % \cline{1-2} % \makecell{Multilined \\Cell text} & B& \\ % \hline % \makecell[l]{Left aligned \\ cell text} & C % & \multirowcell{4}[0ex][l]{37--43}\\ % \cline{1-2} % \makecell[r]{Right aligned \\ cell text} & D & \\ % \hline % \makecell[b]{Bottom aligned \\ cell text} & E & % \multirowcell{6}[0ex][r]{37--43\\52--58}\\ % \cline{1-2} % \makecell[{{p{5cm}}}]{Cell long long long long long long text with % predefined width} & F & \\ % \cline{1-2} % \makecell[{{>{\parindent1em}p{5cm}}}]{Cell long long long long long % long text with predefined width} & G & \\ % \Xhline{1.2pt} % \end{tabular}} % \end{table} % % \Finale \endinput