<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% \iffalse meta-comment
%
% Copyright (C) 2011--2020 by Leo Liu &lt;leoliu.pku@gmail.com&gt;
% ---------------------------------------------------------------------------
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Leo Liu.
%
% This work consists of the files diagbox.dtx and diagbox.ins
% and the derived filebase diagbox.sty.
%
% \fi
%
% \iffalse
%&lt;*driver&gt;
\ProvidesFile{diagbox.dtx}
%&lt;/driver&gt;
%&lt;package&gt;\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%&lt;package&gt;\ProvidesPackage{diagbox}
%&lt;*package&gt;
    [2020/02/09 v2.3 Making table heads with diagonal lines]
%&lt;/package&gt;
%
%&lt;*driver&gt;
\documentclass[letterpaper]{ltxdoc}
\AtBeginDocument{
  \DeleteShortVerb{\|}
  \MakeShortVerb{\"}}
\usepackage{diagbox}
\usepackage{xcolor}
\usepackage[left=1.7in,top=1in,bottom=1in]{geometry}
\usepackage{fancyvrb-ex}
\usepackage{amsmath}
\usepackage[UTF8]{ctex}
\setmainfont{Latin Modern Roman}
\setsansfont{Latin Modern Sans}
\setmonofont{Latin Modern Mono}
\makeatletter
\renewcommand\glossary@prologue{%
  \section*{迚域悽蜴�彰}
  \markboth{迚域悽蜴�彰}{迚域悽蜴�彰}}
\renewcommand\index@prologue{%
  \section*{Index / 莉｣遐∫ｴ｢蠑扶
  \markboth{Index / 莉｣遐∫ｴ｢蠑扶{Index / 莉｣遐∫ｴ｢蠑扶
  譁應ｽ鍋噪謨ｰ蟄苓｡ｨ遉ｺ蟇ｹ蠎秘｡ｹ隸ｴ譏取園蝨ｨ逧�｡ｵ遐√ゆｸ句�郤ｿ逧�焚蟄苓｡ｨ遉ｺ螳壻ｹ画園蝨ｨ逧�ｻ｣遐∬｡悟捷�幄檎峩
  遶倶ｽ鍋噪謨ｰ蟄苓｡ｨ遉ｺ蟇ｹ蠎秘｡ｹ菴ｿ逕ｨ譌ｶ謇蝨ｨ逧�｡悟捷縲�}
\renewcommand*\title[2][]{\gdef\@title{#2}}
\renewcommand*\author[2][]{\gdef\@author{#2}}
\providecommand\eTeX{$\m@th\varepsilon$-\TeX}
\makeatother
\usepackage[numbered]{hypdoc}
\hypersetup{pdfstartview=FitH}
\fvset{gobble=1} %% 蛻�髯､萓句ｭ蝉ｻ｣遐∝ｼ螟ｴ逧� %
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{diagbox.dtx}
  \PrintChanges
  \PrintIndex
\end{document}
%&lt;/driver&gt;
% \fi
%
% \CheckSum{901}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&amp;
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \&lt;
%   Equals        \=     Greater than  \&gt;     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
% \changes{v1.0}{2011/11/21}{蛻晏ｧ狗沿譛ｬ縲�}
%
% \DoNotIndex{\newcommand, \newenvironment, \@nameuse, \@pkgextension,
% \@reserveda, \@tfor, \begin, \begingroup, \box, \csname, \def, \define@key,
% \dimexpr, \do, \dp, \edef, \else, \end, \endcsname, \endgroup, \endinput,
% \expandafter, \fi, \hbox, \ht, \ifcsname, \ifdim, \ifx, \Line, \makebox,
% \newbox, \newdimen, \p@, \PackageError, \pkg, \put, \relax, \RequirePackage,
% \setbox, \setkeys, \setlength, \strip@pt, \unexpanded, \unitlength,
% \vcenter, \wd, \xdef, \z@, \@ifnextchar, \bgroup, \FPadd, \FPmul, \FPneg,
% \FPsub, \FPupn, \let, \unless, \hspace, \@tempskipa, \newif, \detokenize,
% \@@, \\, \c, \l, \cs, \fp, \dim, \msg, \scan}
%
% \providecommand*{\pkg}{\textsf}
% \GetFileInfo{diagbox.dtx}
% \title[diagbox Package (\fileversion):
%   Making Table Heads with Diagonal Lines]%
%  {\hypertarget{English}{\pkg{diagbox} Package (\fileversion)}
%   \makebox[0pt][l]{\hspace{3cm}\large
%     \hyperlink{Chinese}{$\Rightarrow$ \textsf{荳ｭ譁�沿}}}\\
%   Making Table Heads with Diagonal Lines}
% \author[Leo Liu &lt;leoliu.pku@gmail.com&gt;]%
%   {Leo Liu \\ \path{leoliu.pku@gmail.com}}
% \date{\filedate}
%
% \maketitle
%
% \section{Introduction}
%
% \pkg{diagbox} is a replacement of old \pkg{slashbox} package\footnote{By
% Koichi Yasuoka and Toru Sato. Available on
% \url{CTAN://macros/latex/contrib/slashbox/slashbox.sty}}. I write this
% package simply because that \pkg{slashbox} is not available in \TeX\ Live
% for licening problems. \pkg{slashbox} has no explicit license information
% available, but \pkg{diagbox} is under LPPL.
%
% \pkg{diagbox} is a modern alternative of \pkg{slashbox}. I changed the
% user interface to use a key-value syntax, get rid of some restrictions of
% \pkg{slashbox}, use \pkg{pict2e} to draw diagonal lines. Especially, this
% package also provides ability to make a box with two diagonal lines in it.
% All these can be obtained by a "\diagbox" command.
%
% As a replacement of \pkg{slashbox}, \pkg{diagbox} package also provides
% compatible macros of \pkg{slashbox}, but the result is a little different.
%
% To use \pkg{diagbox}, \eTeX{} is needed. And \pkg{diagbox} requires
% \pkg{pict2e}, \pkg{keyval}, \pkg{calc}, and \pkg{fp} packages.
%
%
% \section{Usage}
%
% \subsection{Basic usage}
%
% To load the package, just put this in the preamble:
% \begin{Verbatim}
% \usepackage{diagbox}
% \end{Verbatim}
%
% \DescribeMacro{\diagbox}
% "\diagbox" is the main command. It can take two arguments, to produce a box
% with a diagonal line from north west to south east.
%
% For example:\\
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|l|ccc|}
% \hline
% \diagbox{Time}{Day} &amp; Mon &amp; Tue &amp; Wed \\
% \hline
% Morning   &amp; used &amp; used &amp;      \\
% Afternoon &amp;      &amp; used &amp; used \\
% \hline
% \end{tabular}
% \end{SideBySideExample}
% \medskip
%
% "\diagbox" can also take three arguments, to draw a table head with two
% diagonal lines. For example,
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|l|ccc|}
% \hline
% \diagbox{Time}{Room}{Day} &amp; Mon &amp; Tue &amp; Wed \\
% \hline
% Morning   &amp; used &amp; used &amp;      \\
% Afternoon &amp;      &amp; used &amp; used \\
% \hline
% \end{tabular}
% \end{Example}
%
% \subsection{More options}
%
% "\diagbox" can take a key-value list as an optional argument to specify the
% width and height of the box, the direction of the diagonal line, and the
% trimming margins:
% \begin{description}
% \item[width] Specify the width of the box explicitly. If it is omitted,
% \pkg{diagbox} will calculate the width automatically.
%
% \item[height] Specify the height of the box explicitly. If it is omitted,
% \pkg{diagbox} will calculate the height automatically. In the argument, one
% can use "\line" as a line height.
%
% \item[dir] Specify the direction of the diagonal line. The value can be
% "NW", "NE", "SW" and "SE". Default value is "NW". The meaning of the values
% see below.
% \begin{itemize}
% \item "\diagbox[dir="\meta{direction}"]{A}{B}" in a table looks:\\
% \begin{tabular}{ll@{\qquad}ll}
% "NW" or "SE"��&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SE]{A}{B} \\\hline \end{tabular} &amp;
% "SW" or "NE"��&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NE]{A}{B} \\\hline \end{tabular}
% \end{tabular}
% \item "\diagbox[dir="\meta{direction}"]{A}{M}{B}" in a table looks:\\
% \begin{tabular}{*4{ll@{\qquad}}}
% "NW"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NW]{A}{M}{B} \\\hline \end{tabular}&amp;
% "NE"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NE]{A}{M}{B} \\\hline \end{tabular}&amp;
% "SW"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SW]{A}{M}{B} \\\hline \end{tabular}&amp;
% "SE"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SE]{A}{M}{B} \\\hline \end{tabular}
% \end{tabular}
% \end{itemize}
%
% \item[innerwidth] Specify the width of the inner content box. "innerwidth"
% option is useful when specifying column width. For example:
% \begin{Example}
% \begin{tabular}{|p{2cm}|} \hline
% \diagbox[innerwidth=2cm]{A}{B} \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[innerleftsep, innerrightsep] Specify the distances between the border
% of the inner content box and the border of the diagonal box. We have:
% \[
%   "innerleftsep" + "innerwidth" + "innerrightsep" = "width".
% \]
% For example:
% \begin{Example}
% \begin{tabular}{|c|} \hline
% \diagbox[innerleftsep=.5cm,innerrightsep=0pt]{A}{B} \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[outerleftsep, outerrightsep] Specify the distances between the border
% of the diagonal box and the border of the tabular cell. Usually they are
% negative values, which satisfy
% \begin{align*}
%   "outerleftsep" + "LEFTtabcolsep" &amp;= 0\,\mathrm{pt}, \\
%   "outerrightsep" + "RIGHTtabcolsep" &amp;= 0\,\mathrm{pt}.
% \end{align*}
% where "LEFTtabcolsep" and "RIGHTtabcolsep" are the distances between
% verticle lines and the tabular cell content (the diagonal box). For example:
% \begin{Example}
% \begin{tabular}{|r@{\hspace{20pt}}|l|} \hline
% \diagbox[outerrightsep=-20pt]{A}{B} &amp; C \\ \hline
% AABB &amp; CC \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[leftsep, rightsep] Specify the left and right distances, which are
% equivalent to:
% \begin{align*}
% "innerleftsep" &amp;:= "leftsep",  &amp;  "innerrightsep" &amp;:= "rightsep", \\
% "outerleftsep" &amp;:= -"leftsep",  &amp;  "outerrightsep" &amp;:= -"rightsep".
% \end{align*}
%
% \item[trim] Specify the margin to be trimmed. The value can be "l", "r", and
% "lr", "rl". This helps the slash line exceeds the boundary when "@{}" column
% specifier is used.
%
% Note: "trim=l" has the same effect as "leftsep=0pt", and "trim=r" has the
% same effect as "rightsep=0pt".
%
% \item[font] Specify the font of the cell.
%
% "\diagbox[font=\footnotesize\itshape]{Small}{Italic}"\quad
% \begin{tabular}{|c|} \hline
% \diagbox[font=\footnotesize\itshape]{Small}{Italic} \\ \hline
% \end{tabular}
%
% \item[linewidth] Specify the line width of the diagonal lines.
% \item[linecolor] Specify the line color of the diagonal lines. (\pkg{color}
% or \pkg{xcolor} is needed.)
%
% "\diagbox[linewidth=2pt,linecolor=blue]{AAA}{BBB}"\quad
% \begin{tabular}{|c|} \hline
% \diagbox[linewidth=2pt,linecolor=blue]{AAA}{BBB} \\ \hline
% \end{tabular}
% \end{description}
%
% Here is a more complex example to show the usage of the options:
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|@{}l|c|c|r@{}|}
% \hline
% \diagbox[width=5em,trim=l]{Time}{Day} &amp; Mon &amp; Tue &amp; Wed\\
% \hline
% Morning   &amp; used &amp; used &amp; used\\
% \hline
% Afternoon &amp;      &amp; used &amp; \diagbox[dir=SW,height=2em,trim=r]{A}{B} \\
% \hline
% \end{tabular}
% \end{Example}
%
% \bigskip
% What's more, you can use "\\" to break lines in "\diagbox". Manual setting
% of the height of the head may be needed. For example,
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|c|}
% \hline
% \diagbox[height=3\line]{line\\heads}{column\\heads} \\
% \hline
% \end{tabular}
% \end{Example}
%
% \subsection{Compatibility with \pkg{slashbox}}
%
% \pkg{diagbox} package emulates \pkg{slashbox} and also prevents
% \pkg{slashbox} to be loaded.
%
% \pkg{diagbox} package provides "\slashbox" and "\backslashbox" which syntax
% similar to \pkg{slashbox} package. However, the results of the two packages
% are a little different. These two commands are for compatibility only, it is
% better to use "\diagbox" instead for new documents.
%
% \DescribeMacro{\backslashbox}
% "\backslashbox" works as "\diagbox", but it takes two optional arguments to
% specify the "width" and "trim" options.
%
% \DescribeMacro{\slashbox}
% "\slashbox" works as "\diagbox[dir=SW]", and takes two optional arguments to
% specify the "width" and "trim" options.
%
% For example,\\
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|c|c|c|} \hline
% \backslashbox[2cm]{num}{alpha}
%   &amp; A  &amp; B  \\\hline
% 1 &amp; A1 &amp; B1 \\\hline
% 2 &amp; A2 &amp; B2 \\\hline
% \end{tabular}
% \end{SideBySideExample}
%
%
% \section{Known issues and TODO}
%
% Known issues:
% \begin{itemize}
% \item The result of "\slashbox" and "\backslashbox" is different with
% \pkg{slashbox} package. The algorithms to calculate the width and height are
% different; and the results of the second optional argument of "\slashbox"
% (i.e. "trim" key in "\diagbox") in the two packages are differernt.
%
% This is not a bug. Usually the width calculated by \pkg{diagbox} is more
% safe than \pkg{slashbox}.
%
% \item For a triple box (a table head with two diagonal lines), the first
% argument must not be too wide and the third argument must not be too high.
% Otherwise, the layout algorithm cannot calculate the proper width and height
% of the table head, and a warning will be issued. (Thanks to Frank Mittelbach.)
%
% \item
% The cell with "\diagbox" should be the widest one of the column. Otherwise
% the slash line cannot exceeds the boundary. For example,\\[1ex]
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|c|}  \hline
%   \diagbox{A}{B}    \\\hline
%   Very long term    \\\hline
% \end{tabular}
% \end{SideBySideExample}
% \\[1ex]
% This can be solved by setting a wider "width" option of "\diagbox" manually.
% \end{itemize}
%
%
% \title[]{\hypertarget{Chinese}{\pkg{diagbox} 螳丞桁��\fileversion�厭
%   \makebox[0pt][l]{\hspace{3cm}\large
%     \hyperlink{English}{$\Rightarrow$ \textsf{English Version}}}\\
%    蛻ｶ蛛壽万郤ｿ陦ｨ螟ｴ}
% \author{蛻俶ｵｷ豢� \\ \path{leoliu.pku@gmail.com}}
% \date{\filedate}
%
% \maketitle
%
%
% \section{邂莉急
%
% \pkg{diagbox} 隶ｾ隶｡逕ｨ譚･莉｣譖ｿ譌ｧ逧� \pkg{slashbox} 螳丞桁\footnote{菴懆� Koichi
% Yasuoka�亥ｮ牙ｲ｡蟄昜ｸ�我ｸ� Sato Toru�井ｽ占陸蠕ｹ�峨ょｮ丞桁隗�
% \url{CTAN://macros/latex/contrib/slashbox/slashbox.sty}縲�}縲らｼ門�霑吩ｸｪ螳丞桁逧�ｼ�
% 襍ｷ譏ｯ \pkg{slashbox} 蝗�荳ｺ郛ｺ蟆第�遑ｮ逧��逕ｱ隶ｸ蜿ｯ菫｡諱ｯ�瑚｢ｫ \TeX\ Live 謗帝勁縲りｿ吩ｸｪ螳丞桁
% 譏ｯ蝨ｨ LPPL 蜊剰ｮｮ荳句書陦檎噪縲�
%
% \pkg{diagbox} 譏ｯ \pkg{slashbox} 螳丞桁逧�ｸ荳ｪ邇ｰ莉｣逧�沿譛ｬ縲ょｮ�㊦逕ｨ莠�眠逧� key-value
% 蠑剰ｯｭ豕募盾謨ｰ�悟悉髯､莠� \pkg{slashbox} 蜴滓怏逧�ｸ莠幃柄蠎ｦ髯仙宛�悟ｹｶ隹�畑 \pkg{pict2e} 螳�
% 蛹�判譁懃ｺｿ�帷音蛻ｫ霑俶ｷｻ蜉�莠�ｻ伜宛荳､譚｡譁懃ｺｿ逧�｡ｨ螟ｴ逧�眠蜉溯�縲�
%
% 菴應ｸｺ \pkg{slashbox} 逧�ｻ｣譖ｿ�圭pkg{diagbox} 髯､莠�署萓幄�蟾ｱ逧�眠蜻ｽ莉､�御ｹ滓署萓帑ｺ�
% \pkg{slashbox} 蜴滓怏逧�ｸ､荳ｪ蜻ｽ莉､�瑚ｯｭ豕穂ｸ榊序�檎ｼ冶ｯ醍ｻ捺棡逡･譛牙玄蛻ｫ縲�
%
% \pkg{diagbox} 萓晁ｵ� \eTeX{} 謇ｩ螻包ｼ郁ｿ吝惠逶ｮ蜑肴ｻ譏ｯ蜿ｯ逕ｨ逧�ｼ会ｼ御ｾ晁ｵ� \pkg{pict2e}縲�
% \pkg{keyval}縲―pkg{calc} 蜥� \pkg{fp} 螳丞桁縲�
%
% \section{逕ｨ豕戊ｯｴ譏枝
%
% \subsection{蝓ｺ譛ｬ逕ｨ豕扶
%
% 隕∽ｽｿ逕ｨ譛ｬ螳丞桁�碁ｦ門�蝨ｨ蟇ｼ險蛹ｺ隹�畑��
% \begin{Verbatim}
% \usepackage{diagbox}
% \end{Verbatim}
%
% \DescribeMacro{\diagbox}
% "\diagbox" 譏ｯ螳丞桁謠蝉ｾ帷噪荳ｻ隕∝多莉､縲ょｮ�庄莉･蟶ｦ譛我ｸ､荳ｪ蠢�牙盾謨ｰ�瑚｡ｨ遉ｺ隕∫函謌先万郤ｿ陦ｨ螟ｴ逧�
% 荳､驛ｨ蛻��螳ｹ縲るｻ倩ｮ､譁懃ｺｿ譏ｯ莉手･ｿ蛹怜芦荳懷漉譁ｹ蜷醍噪縲�
%
% 萓句ｦゑｼ喀\
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|l|ccc|}
% \hline
% \diagbox{Time}{Day} &amp; Mon &amp; Tue &amp; Wed \\
% \hline
% Morning   &amp; used &amp; used &amp;      \\
% Afternoon &amp;      &amp; used &amp; used \\
% \hline
% \end{tabular}
% \end{SideBySideExample}
% \medskip
%
% \changes{v2.0}{2011/11/22}{蠅槫刈譛我ｸ蛾Κ蛻�∝曙譁懃ｺｿ逧�｡ｨ螟ｴ譬ｼ蠑上�}
% "\diagbox" 荵溷庄莉･謗･蜿嶺ｸ我ｸｪ蜿よ焚�瑚ｿ呎�ｷ蟆ｱ莨夂函謌仙ｸｦ譛我ｸ､譚｡譁懃ｺｿ逧�｡ｨ螟ｴ�御ｾ句ｦゑｼ�
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|l|ccc|}
% \hline
% \diagbox{Time}{Room}{Day} &amp; Mon &amp; Tue &amp; Wed \\
% \hline
% Morning   &amp; used &amp; used &amp;      \\
% Afternoon &amp;      &amp; used &amp; used \\
% \hline
% \end{tabular}
% \end{Example}
%
% \subsection{譖ｴ螟壼盾謨ｰ隶ｾ鄂ｮ}
%
% "\diagbox" 霑伜庄莉･蝨ｨ蜑埼擇蟶ｦ荳荳ｪ蜿ｯ騾牙盾謨ｰ�碁㈹髱｢逕ｨ key-value 逧�ｯｭ豕戊ｮｾ鄂ｮ螳ｽ蠎ｦ縲∵婿蜷�
% 遲画峩螟夂噪騾蛾｡ｹ��
% \begin{description}
% \item[width] 譏守｡ｮ謖�ｮ夂將蟄千噪諤ｻ螳ｽ蠎ｦ縲ょｦよ棡逵∫払�悟�莨夊�蜉ｨ隶｡邂苓�螟滓叛荳区園譛牙�螳ｹ逧�
% 螳ｽ蠎ｦ縲�
% \item[height] 譏守｡ｮ謖�ｮ夂將蟄千噪諤ｻ鬮伜ｺｦ縲�
% \item[dir] 謖�ｮ壽万郤ｿ譁ｹ蜷代ょ庄莉･蜿� "NW"�郁･ｿ蛹暦ｼ峨�"NE"�井ｸ懷圏�峨�"SW"�郁･ｿ蜊暦ｼ峨�
% "SE"�井ｸ懷漉�牙屁遘肴婿蜷代ょ惠蜿ｪ譛我ｸ譚｡譁懃ｺｿ逧�｡ｨ螟ｴ荳ｭ��"NE" 荳� "SW"縲� "SE" 荳� "NW" 譏ｯ
% 遲我ｻｷ逧�よ万郤ｿ譁ｹ蜷醍噪鮟倩ｮ､蛟ｼ譏ｯ "NW"縲�
%
% "\diagbox[dir="\meta{譁ｹ蜷挿"]{A}{B}" 蝨ｨ陦ｨ譬ｼ荳ｭ逧�譜譫懶ｼ喀\
% \begin{tabular}{ll@{\qquad}ll}
% "NW" 謌� "SE"��&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SE]{A}{B} \\\hline \end{tabular} &amp;
% "SW" 謌� "NE"��&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NE]{A}{B} \\\hline \end{tabular}
% \end{tabular}
%
% "\diagbox[dir="\meta{譁ｹ蜷挿"]{A}{M}{B}" 蝨ｨ陦ｨ譬ｼ荳ｭ逧�譜譫懶ｼ喀\
% \begin{tabular}{*4{ll@{\qquad}}}
% "NW"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NW]{A}{M}{B} \\\hline \end{tabular}&amp;
% "NE"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=NE]{A}{M}{B} \\\hline \end{tabular}&amp;
% "SW"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SW]{A}{M}{B} \\\hline \end{tabular}&amp;
% "SE"&amp;
% \begin{tabular}{|c|} \hline \diagbox[dir=SE]{A}{M}{B} \\\hline \end{tabular}
% \end{tabular}
%
% \item[innerwidth] 隶ｾ鄂ｮ逶貞ｭ蝉ｸｭ蜀�ｮｹ逧�ｮｽ蠎ｦ縲�"innerwidth" 騾蛾｡ｹ蜿ｯ莉･荳手｡ｨ譬ｼ逧��螳ｽ蠎ｦ
% 荳襍ｷ隶ｾ鄂ｮ蟷ｶ菫晄戟荳閾ｴ縲ょｦゑｼ�
% \begin{Example}
% \begin{tabular}{|p{2cm}|} \hline
% \diagbox[innerwidth=2cm]{A}{B} \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[innerleftsep, innerrightsep] 隶ｾ鄂ｮ蜀�龍霍晢ｼ悟叉蜀�ｮｹ逶貞ｭ蝉ｸ取万郤ｿ逶貞ｭ占ｾｹ逡御ｹ矩龍
% 逧�ｷ晉ｦｻ縲よ�莉ｬ譛牙�邉ｻ蠑擾ｼ�
% \[
%   "innerleftsep" + "innerwidth" + "innerrightsep" = "width".
% \]
% 萓句ｦゑｼ�
% \begin{Example}
% \begin{tabular}{|c|} \hline
% \diagbox[innerleftsep=.5cm,innerrightsep=0pt]{A}{B} \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[outerleftsep, outerrightsep] 隶ｾ鄂ｮ螟夜龍霍晢ｼ悟叉譁懃ｺｿ逶貞ｭ占ｾｹ逡悟芦陦ｨ譬ｼ蜊募�譬ｼ霎ｹ
% 逡檎噪霍晉ｦｻ縲ら罰莠取万郤ｿ譏ｯ豐ｿ蜊募�譬ｼ逕ｻ蜃ｺ閠碁撼譁懃ｺｿ逶貞ｭ先悽霄ｫ逕ｻ蜃ｺ�梧万郤ｿ騾壼ｸｸ莨壻ｼｸ蜃ｺ譁懃ｺｿ逶貞ｭ�
% 荵句､厄ｼ梧ｭ､霍晉ｦｻ荳ｺ雍滓焚�悟ｹｶ貊｡雜ｳ螯ゆｸ句�邉ｻ蠑擾ｼ�
% \begin{align*}
%   "outerleftsep" + "LEFTtabcolsep" &amp;= 0\,\mathrm{pt}, \\
%   "outerrightsep" + "RIGHTtabcolsep" &amp;= 0\,\mathrm{pt}.
% \end{align*}
% 蜈ｶ荳ｭ "LEFTtabcolsep" 荳� "RIGHTtabcolsep" 譏ｯ陦ｨ譬ｼ遶也ｺｿ荳手｡ｨ譬ｼ蜀�ｮｹ�域万郤ｿ萓句ｭ占ｾｹ
% 逡鯉ｼ我ｹ矩龍逧�ｷ晉ｦｻ縲ゆｾ句ｦゑｼ�
% \begin{Example}
% \begin{tabular}{|r@{\hspace{20pt}}|l|} \hline
% \diagbox[outerrightsep=-20pt]{A}{B} &amp; C \\ \hline
% AABB &amp; CC \\ \hline
% \end{tabular}
% \end{Example}
%
% \item[leftsep, rightsep] 蜷梧慮隶ｾ鄂ｮ蟾ｦ蜿ｳ蜀�､夜龍霍晢ｼ梧ｻ｡雜ｳ蜈ｳ邉ｻ蠑擾ｼ�
% \begin{align*}
% "innerleftsep" &amp;:= "leftsep",  &amp;  "innerrightsep" &amp;:= "rightsep", \\
% "outerleftsep" &amp;:= -"leftsep",  &amp;  "outerrightsep" &amp;:= -"rightsep".
% \end{align*}
%
% \item[trim] 隶ｾ鄂ｮ蟾ｦ霎ｹ逡梧�蜿ｳ霎ｹ逡御ｸ崎ｮ｡邂鈴｢晏､也噪遨ｺ逋ｽ�悟庄莉･蜿門ｼ荳ｺ "l", "r", "lr" 謌�
% "rl"縲りｿ吩ｸｪ騾蛾｡ｹ蝨ｨ蛻玲�ｼ蠑丞桁蜷ｫ "@{}" 譌ｶ蟆�ｼ壽怏逕ｨ縲�
%
% 豕ｨ��"trim=l" 荳� "leftsep=0pt" 謨域棡逶ｸ蜷鯉ｼ瑚� "trim=r" 荳� "rightsep=0pt" 謨域棡逶ｸ
% 蜷後�
%
% \item[font] 隶ｾ鄂ｮ蜊募�譬ｼ蟄嶺ｽ薙�
%
% "\diagbox[font=\footnotesize\itshape]{Small}{Italic}"\quad
% \begin{tabular}{|c|} \hline
% \diagbox[font=\footnotesize\itshape]{Small}{Italic} \\ \hline
% \end{tabular}
%
% \item[linewidth] 隶ｾ鄂ｮ譁懃ｺｿ螳ｽ蠎ｦ縲�
% \item[linecolor] 隶ｾ鄂ｮ譁懃ｺｿ鬚懆牡縲ゑｼ磯怙隕∬�陦瑚ｽｽ蜈･ \pkg{color} 謌� \pkg{xcolor} 螳�
% 蛹�ゑｼ�
%
% "\diagbox[linewidth=2pt,linecolor=blue]{AAA}{BBB}"\quad
% \begin{tabular}{|c|} \hline
% \diagbox[linewidth=2pt,linecolor=blue]{AAA}{BBB} \\ \hline
% \end{tabular}
% \end{description}
%
% \changes{v2.0}{2011/11/23}{蜿俶峩 "trim" 騾蛾｡ｹ逧�｡御ｸｺ�悟悉謗我ｺ�ｽｿ逕ｨ "trim" 騾蛾｡ｹ譌ｶ
% 蜀�Κ逧�龍霍昴りｿ吩ｸ� \pkg{slashbox} 陦御ｸｺ荳榊酔縲�}
% 荳荳ｪ譖ｴ螟肴揩逧�ｾ句ｭ撰ｼ�
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|@{}l|c|c|r@{}|}
% \hline
% \diagbox[width=5em,trim=l]{Time}{Day} &amp; Mon &amp; Tue &amp; Wed\\
% \hline
% Morning   &amp; used &amp; used &amp; used\\
% \hline
% Afternoon &amp;      &amp; used &amp; \diagbox[dir=SW,height=2em,trim=r]{A}{B} \\
% \hline
% \end{tabular}
% \end{Example}
% \bigskip
%
% 豁､螟厄ｼ�"\diagbox" 逧�｡ｨ螟ｴ蜀�ｮｹ霑伜庄莉･逕ｨ "\\" 謇句ｷ･謐｢陦後よｭ､譌ｶ騾壼ｸｸ髴隕∝ｯｹ閾ｪ蜉ｨ隶｡邂礼噪
% 陦ｨ螟ｴ鬮伜ｺｦ霑幄｡梧焔蟾･隹�紛縲ゆｾ句ｦゑｼ�
% \begin{Example}[frame=single,numbers=left]
% \begin{tabular}{|c|}
% \hline
% \diagbox[height=3\line]{line\\heads}{column\\heads} \\
% \hline
% \end{tabular}
% \end{Example}
%
% \subsection{蟇ｹ \pkg{slashbox} 螳丞桁逧��螳ｹ諤ｧ}
%
% 蝨ｨ菴ｿ逕ｨ \pkg{diagbox} 螳丞桁譌ｶ�御ｼ壽ｨ｡諡� \pkg{slashbox} 螳丞桁逧�粥閭ｽ�悟ｹｶ遖∵ｭ｢
% \pkg{slashbox} 蜀崎｢ｫ隹�畑縲�
%
% \pkg{diagbox} 螳丞桁謠蝉ｾ帑ｺ�ｸ� \pkg{slashbox} 螟ｧ閾ｴ逶ｸ蜷檎噪 "\slashbox" 荳�
% "\backslashbox" 荳､荳ｪ蜻ｽ莉､縲� "\slashbox" 荳� "\backslashbox" 逧�ｯｭ豕墓擂閾ｪ
% \pkg{slashbox} 螳丞桁�梧賜迚域譜譫懃払譛牙玄蛻ｫ縲りｿ吩ｸ､荳ｪ蜻ｽ莉､莉�惠譌ｧ譁�｡｣荳ｭ菴應ｸｺ蜈ｼ螳ｹ蜻ｽ莉､菴ｿ
% 逕ｨ縲ょｮ樣刔荳ｭ菴ｿ逕ｨ "\diagbox" 譖ｴ荳ｺ譁ｹ萓ｿ縲�
%
% \DescribeMacro{\backslashbox}
% "\backslashbox" 蝓ｺ譛ｬ蜉溯�荳� "\diagbox" 邀ｻ莨ｼ縲ょｮ�ｸｦ譛我ｸ､荳ｪ蜿ｯ騾牙盾謨ｰ�悟�蛻ｫ陦ｨ遉ｺ
% "\diagbox" 荳ｭ逧� "width" 荳� "trim" 騾蛾｡ｹ縲�
%
% \DescribeMacro{\slashbox}
% "\slashbox" 蝓ｺ譛ｬ蜉溯�荳� "\diagbox[dir=SW]" 邀ｻ莨ｼ縲ょｮ�ｹ溷ｸｦ譛我ｸ､荳ｪ蜿ｯ騾牙盾謨ｰ�瑚｡ｨ遉ｺ
% "\diagbox" 荳ｭ逧� "width" 蜥� "tirm" 騾蛾｡ｹ縲�
%
% 萓句ｦゑｼ喀\
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|c|c|c|} \hline
% \backslashbox[2cm]{num}{alpha}
%   &amp; A  &amp; B  \\\hline
% 1 &amp; A1 &amp; B1 \\\hline
% 2 &amp; A2 &amp; B2 \\\hline
% \end{tabular}
% \end{SideBySideExample}
%
% \section{蟾ｲ遏･髣ｮ鬚伜柱譛ｪ譚･迚域悽}
%
% 蟾ｲ遏･髣ｮ鬚假ｼ�
% \begin{itemize}
% \item "\slashbox" 荳� "\backslashbox" 蜻ｽ莉､逧�譜譫應ｸ主惠 \pkg{slashbox} 螳丞桁荳ｭ荳�
% 蜷後ゆｸ､荳ｪ螳丞桁蝨ｨ隶｡邂礼將蟄仙ｮｽ蠎ｦ蜥碁ｫ伜ｺｦ譌ｶ�御ｽｿ逕ｨ莠�ｸ榊酔逧�ｮ玲ｳ包ｼ帛酔譌ｶ�悟惠螟�炊
% "\slashbox" 隨ｬ莠御ｸｪ蜿ｯ騾牙盾謨ｰ�亥叉 "\diagbox" 逧� "trim" 髞ｮ�画慮�御ｽｿ逕ｨ逧�婿蠑丈ｹ滉ｸ堺ｸ
% 譬ｷ縲�
%
% 霑吩ｸ肴弍 bug縲る壼ｸｸ \pkg{diagbox} 隶｡邂怜�逧�ｮｽ蠎ｦ豈� \pkg{slashbox} 逧�ｻ捺棡譖ｴ螳牙�荳
% 莠帙�
%
% \item 譛我ｸ､譚｡譁懃ｺｿ逧�ｸ蛾Κ蛻�｡ｨ螟ｴ�悟�謇驥�畑逧��蜉ｨ蟶�ｱ邂玲ｳ墓弍蜿鈴剞逧�ら音蛻ｫ譏ｯ�梧怙蟾ｦ逧�
% 驛ｨ蛻�ｸ崎�霑�ｮｽ�梧怙蜿ｳ逧�Κ蛻�ｸ崎�霑�ｫ假ｼ悟凄蛻吝ｰ�裏豕戊ｮ｡邂怜�蜷育炊逧�ｻ捺棡�悟ｮ丞桁莨壼書蜃ｺ隴ｦ
% 蜻翫ゑｼ域─隹｢ Frank Mittelbach 謖��隸･髣ｮ鬚倥ゑｼ�
%
% \item
% "\diagbox" 逕滓�逧�黒蜈��ｼ蠢�｡ｻ譏ｯ陦ｨ蛻嶺ｸｭ譛螳ｽ逧�ｸ荳ｪ縲ょｦよ棡荳崎�霎ｾ蛻ｰ譛螳ｽ�悟�逕ｻ蜃ｺ逧�万
% 郤ｿ荳崎�菫晁ｯ∝惠豁｣遑ｮ逧�ｽ咲ｽｮ縲ゆｾ句ｦゑｼ喀\[1ex]
% \begin{SideBySideExample}[frame=single,numbers=left,xrightmargin=.45\linewidth]
% \begin{tabular}{|c|}  \hline
%   \diagbox{A}{B}    \\\hline
%   Very long term    \\\hline
% \end{tabular}
% \end{SideBySideExample}
% \\[1ex]
% 豁､譌ｶ蜿ｯ莉･謇句ｷ･隶ｾ鄂ｮ霎�ｮｽ逧� "\diagbox" 逧� "width" 騾蛾｡ｹ�瑚ｧ｣蜀ｳ豁､髣ｮ鬚倥�
% \end{itemize}
%
% \StopEventually{}
%
%
% \clearpage
% \section{Implementation / 莉｣遐∝ｮ樒鴫}
%
% \iffalse
%&lt;*package&gt;
% \fi
%
% \subsection{螳樒鴫萓晁ｵ也噪蟾･蜈ｷ蛹�}
%
% 菴ｿ逕ｨ key-value 逡碁擇縲�
%    \begin{macrocode}
\RequirePackage{keyval}
%    \end{macrocode}
% 扈伜崟萓晁ｵ� \pkg{pict2e} 螳丞桁縲�
%    \begin{macrocode}
\RequirePackage{pict2e}
%    \end{macrocode}
% \changes{v2.2}{2016/12/28}{驕ｿ蜈� \pkg{fp} 蛹�噪 \texttt{nomessages} 騾蛾｡ｹ蝨ｨ菴ｿ逕ｨ
% \pkg{catoptions} 蛹�慮蜀ｲ遯±
% 髟ｿ蠎ｦ隶｡邂� \pkg{calc} 螳丞桁縲�
% \changes{v2.2}{2016/12/28}{菴ｿ逕ｨ \pkg{calc} 蛹�ｮ｡邂鈴蛾｡ｹ蜿よ焚�御ｻ･謾ｯ謖�
% \cs{widthof} 遲牙多莉､縲�}
%    \begin{macrocode}
\RequirePackage{calc}
%    \end{macrocode}
% 蜀�Κ謗ｧ蛻ｶ \pkg{array} 螳丞桁縲�
%    \begin{macrocode}
\RequirePackage{array}
%    \end{macrocode}
%
%
% \subsection{襍�ｺ仙�驟閤
%
% 蛻��逕ｨ蛻ｰ逧�將蟄仙ｯ�ｭ伜勣縲ょｮ�ｻｬ蛻�悪蟇ｹ蠎比ｺ� "\diagbox" 荳我ｸｪ蠢�牙盾謨ｰ逧��螳ｹ縲�
%    \begin{macrocode}
\newbox\diagbox@boxa
\newbox\diagbox@boxb
\newbox\diagbox@boxm
%    \end{macrocode}
% 蛻��髟ｿ蠎ｦ蜿倬㍼縲�
%    \begin{macrocode}
\newdimen\diagbox@wd
\newdimen\diagbox@ht
\newdimen\diagbox@insepl
\newdimen\diagbox@insepr
\newdimen\diagbox@outsepl
\newdimen\diagbox@outsepr
%    \end{macrocode}
%
%    \begin{macrocode}
\def\diagbox@clear{%
  \diagbox@wd=\z@
  \diagbox@ht=\z@
  \diagbox@insepl=\tabcolsep
  \diagbox@insepr=\tabcolsep
  \diagbox@outsepl=-\tabcolsep
  \diagbox@outsepr=-\tabcolsep
}
%    \end{macrocode}
%
% \subsection{蜻ｽ莉､騾蛾｡ｹ螳壻ｹ厭
%
% 荳矩擇螳壻ｹ� "\diagbox" 逧�醗蛟ｼ騾蛾｡ｹ縲�
%
% \changes{v2.1}{2014/07/03}{蜈∬ｮｸ蝨ｨ \texttt{width} 蜥� \texttt{height} 逧�多莉､騾蛾｡ｹ
% 荳ｭ蜀呵｡ｨ霎ｾ蠑剰ｮ｡邂鈴柄蠎ｦ縲�}
% \changes{v2.1}{2016/02/24}{蜈∬ｮｸ蝨ｨ \texttt{height} 騾蛾｡ｹ荳ｭ菴ｿ逕ｨ
% \texttt{\textbackslash line} 陦ｨ遉ｺ陦碁ｫ倥�}
% 譁懃ｺｿ逶貞ｭ千噪諤ｻ螳ｽ蠎ｦ縲�
%    \begin{macrocode}
\define@key{diagbox}{width}{%
  \unless\ifdim\diagbox@wd=\z@
    \PackageWarning{diagbox}%
      {You should not set width/innerwidth option more than once.}%
  \fi
  \setlength{\diagbox@wd}{#1}}
%    \end{macrocode}
% 譁懃ｺｿ逶貞ｭ千噪諤ｻ鬮伜ｺｦ�悟盾謨ｰ荳ｭ蜿ｯ菴ｿ逕ｨ "\line" 陦ｨ遉ｺ陦碁ｫ倥�
%    \begin{macrocode}
\define@key{diagbox}{height}{%
  \let\diagbox@save@line\line
  \def\line{\normalbaselineskip}%
  \setlength{\diagbox@ht}{#1}%
  \let\line\diagbox@save@line}
%    \end{macrocode}
%
% \changes{v2.1}{2014/08/15}{逶貞ｭ仙�螳ｹ荳取万郤ｿ譯�ｷ晉ｦｻ \texttt{innerleftsep},
% \texttt{innerrightsep} 蜻ｽ莉､騾蛾｡ｹ縲�}
% 逶貞ｭ仙�螳ｹ荳取万郤ｿ譯�ｷｦ蜿ｳ逧�ｷ晉ｦｻ縲�
%    \begin{macrocode}
\define@key{diagbox}{innerleftsep}{%
  \setlength{\diagbox@insepl}{#1}}
\define@key{diagbox}{innerrightsep}{%
  \setlength{\diagbox@insepr}{#1}}
%    \end{macrocode}
%
% \changes{v2.1}{2016/02/24}{逶貞ｭ仙�螳ｹ螳ｽ蠎ｦ \texttt{innerwidth} 蜻ｽ莉､騾蛾｡ｹ縲�}
% 隶ｾ鄂ｮ逶貞ｭ仙�螳ｹ逧�ｮｽ蠎ｦ�井ｸ主�譬ｼ蠑� "p{螳ｽ蠎ｦ}" 蟇ｹ蠎費ｼ峨ら將蟄仙�螳ｹ螳ｽ蠎ｦ蜉�荳顔將蟄蝉ｸ取万郤ｿ譯�
% 蟾ｦ蜿ｳ霍晉ｦｻ荵句柱蠎比ｸｺ譁懃ｺｿ逶貞ｭ先ｻ螳ｽ蠎ｦ�悟叉譛�
% \[
%   "innerleftsep" + "innerwidth" + "innerrightsep" = "width".
% \]
% "innerwidth" 騾蛾｡ｹ蟆�夊ｿ�ｮｾ鄂ｮ逶貞ｭ先ｻ螳ｽ蠎ｦ�檎ｻｴ謚､荳企擇逧��邉ｻ蠑上�
%    \begin{macrocode}
\define@key{diagbox}{innerwidth}{%
  \unless\ifdim\diagbox@wd=\z@
    \PackageWarning{diagbox}%
      {You should not set width/innerwidth option more than once.}%
  \fi
  \setlength{\diagbox@wd}{#1+\diagbox@insepl+\diagbox@insepr}}
%    \end{macrocode}
%
% \changes{v2.1}{2014/08/15}{譁懃ｺｿ逶貞ｭ蝉ｸ手｡ｨ譬ｼ蜊募�霎ｹ譯�ｷ晉ｦｻ \texttt{outerleftsep},
% \texttt{outerrightsep} 蜻ｽ莉､騾蛾｡ｹ縲�}
% 譁懃ｺｿ逶貞ｭ蝉ｸ手｡ｨ譬ｼ蜊募�霎ｹ譯�ｷ晉ｦｻ縲りｯ･螟夜Κ髣ｴ霍晏ｺ比ｸｺ螳樣刔陦ｨ蛻怜�螳ｹ荳主�蛻�囈郤ｿ荵矩龍霍晉ｦｻ逧�嶌
% 蜿肴焚�御ｻ･豁､菫晁ｯ∵万郤ｿ荳手｡ｨ譬ｼ遶也ｺｿ閭ｽ逶ｸ謗･�悟叉蠎碑ｾ灘�蜿よ焚菫晁ｯ�
% \begin{align*}
%   "outerleftsep" + "LEFTtabcolsep" &amp;= 0\,\mathrm{pt}, \\
%   "outerrightsep" + "RIGHTtabcolsep" &amp;= 0\,\mathrm{pt}.
% \end{align*}
%    \begin{macrocode}
\define@key{diagbox}{outerleftsep}{%
  \setlength{\diagbox@outsepl}{#1}}
\define@key{diagbox}{outerrightsep}{%
  \setlength{\diagbox@outsepr}{#1}}
%    \end{macrocode}
%
% \changes{v2.1}{2014/08/15}{蟾ｦ蜿ｳ霎ｹ霍� \texttt{leftsep}, \texttt{rightsep} 蜻ｽ莉､
% 騾蛾｡ｹ縲�}
% 隶ｾ鄂ｮ蟾ｦ蜿ｳ霎ｹ霍晢ｼ悟ｮ�ｰ�酔譌ｶ隶ｾ鄂ｮ逶貞ｭ仙�螳ｹ荳取万郤ｿ譯�噪蜀�Κ髣ｴ霍晢ｼ御ｻ･蜿頑万郤ｿ逶貞ｭ蝉ｸ手｡ｨ譬ｼ蜊募�
% 霎ｹ譯�噪螟夜Κ髣ｴ霍昴ょｹｶ菫晄戟蜈ｳ邉ｻ��
% \begin{align*}
% "innerleftsep" &amp;:= "leftsep",  &amp;  "innerrightsep" &amp;:= "rightsep", \\
% "outerleftsep" &amp;:= -"leftsep",  &amp;  "outerrightsep" &amp;:= -"rightsep".
% \end{align*}
%    \begin{macrocode}
\define@key{diagbox}{leftsep}{%
  \setlength{\diagbox@insepl}{#1}%
  \setlength{\diagbox@outsepl}{(#1)*-1}}
\define@key{diagbox}{rightsep}{%
  \setlength{\diagbox@insepr}{#1}%
  \setlength{\diagbox@outsepr}{(#1)*-1}}
%    \end{macrocode}
%
% 逶貞ｭ占ｮ｡邂苓ｾｹ逡梧慮譏ｯ蜷ｦ蠢ｽ逡･蟾ｦ蜿ｳ逧�ｩｺ逋ｽ縲�"trim=l" 謨域棡遲牙酔莠� "leftsep=0pt"��"trim=r"
% 謨域棡遲牙酔莠� "rightsep=0pt"縲�
%    \begin{macrocode}
\define@key{diagbox}{trim}{%
  \@tfor\@reserveda:=#1\do{%
    \ifcsname diagbox@insep\@reserveda\endcsname
      \setlength{\csname diagbox@insep\@reserveda\endcsname}{\z@}%
      \setlength{\csname diagbox@outsep\@reserveda\endcsname}{\z@}%
    \else
      \PackageError{diagbox}{Unknown trim option `#1'.}{l, r, lr and rl are supported.}%
    \fi}}
%    \end{macrocode}
%
% 逶貞ｭ千噪譁ｹ蜷代�
%    \begin{macrocode}
\define@key{diagbox}{dir}{%
  \def\diagbox@dir{#1}%
  \unless\ifcsname diagbox@dir@#1\endcsname
    \PackageError{diagbox}{Unknown direction `#1'.}{NW, NE, SW, SE are supported.}%
    \def\diagbox@dia{NW}%
  \fi}
\let\diagbox@dir@SE\relax
\let\diagbox@dir@SW\relax
\let\diagbox@dir@NE\relax
\let\diagbox@dir@NW\relax
%    \end{macrocode}
%
% \changes{v2.1}{2014/07/03}{蠅槫刈蜻ｽ莉､騾蛾｡ｹ \texttt{linewidth}, \texttt{linecolor}
% 隶ｾ鄂ｮ譁懃ｺｿ螳ｽ蠎ｦ荳朱｢懆牡縲�}
% 譁懃ｺｿ螳ｽ蠎ｦ荳朱｢懆牡縲�
%    \begin{macrocode}
\define@key{diagbox}{linewidth}{%
  \setlength{\@tempskipa}{#1}%
  \linethickness{\@tempskipa}}
\define@key{diagbox}{linecolor}{%
  \def\diagbox@setlinecolor{\color{#1}}}
\let\diagbox@setlinecolor\empty
%    \end{macrocode}
%
% \changes{v2.1}{2014/07/03}{蠅槫刈蜻ｽ莉､騾蛾｡ｹ \texttt{font} 謾ｯ謖∬ｮｾ鄂ｮ蜀�ｮｹ蟄嶺ｽ薙�}
% 隶ｾ鄂ｮ蜀�ｮｹ蟄嶺ｽ薙�
%    \begin{macrocode}
\define@key{diagbox}{font}{%
  \def\diagbox@font{#1}}
\let\diagbox@font\empty
%    \end{macrocode}
%
% \subsection{扈伜宛譁懃ｺｿ逶貞ｭ図
%
% \begin{macro}{\diagbox@pict}
% 霑呎弍蟶ｦ譁懃ｺｿ逧�將蟄先悽霄ｫ縲ら罰荳荳ｪ "picture" 邇ｯ蠅�ｮ樒鴫縲�
%    \begin{macrocode}
\def\diagbox@pict{%
  \unitlength\p@
  \begin{picture}
    (\strip@pt\dimexpr\diagbox@wd+\diagbox@outsepl+\diagbox@outsepr\relax,\strip@pt\diagbox@ht)
    (\strip@pt\dimexpr-\diagbox@outsepl\relax,0)
      \@nameuse{diagbox@\diagbox@part @pict@\diagbox@dir}
  \end{picture}}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@double@pict@SE}
% 譁ｹ蜷台ｸｺ "SE" 逧�万郤ｿ逶貞ｭ仙�螳ｹ縲�
%    \begin{macrocode}
\def\diagbox@double@pict@SE{%
  \put(0,0) {\makebox(0,0)[bl]{\box\diagbox@boxa}}
  \put(\strip@pt\diagbox@wd,\strip@pt\diagbox@ht) {\makebox(0,0)[tr]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,\strip@pt\diagbox@ht)(\strip@pt\diagbox@wd,0)}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@double@pict@NW}
% 譁ｹ蜷� "NW" 荳� "SE" 逶ｸ蜷後�
%    \begin{macrocode}
\let\diagbox@double@pict@NW\diagbox@double@pict@SE
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@double@pict@NE}
% 譁ｹ蜷台ｸｺ "NE" 逧�万郤ｿ逶貞ｭ仙�螳ｹ縲�
%    \begin{macrocode}
\def\diagbox@double@pict@NE{%
  \put(0,\strip@pt\diagbox@ht) {\makebox(0,0)[tl]{\box\diagbox@boxa}}
  \put(\strip@pt\diagbox@wd,0) {\makebox(0,0)[br]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,0)(\strip@pt\diagbox@wd,\strip@pt\diagbox@ht)}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@double@pict@NE}
% 譁ｹ蜷� "SW" 荳� "NE" 逶ｸ蜷後�
%    \begin{macrocode}
\let\diagbox@double@pict@SW\diagbox@double@pict@NE
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@double}
% \changes{v2.0}{2011/11/22}{蝨ｨ菴ｿ逕ｨ "trim" 騾蛾｡ｹ譌ｶ蜴ｻ謗牙�螳ｹ荳守將蟄占ｾｹ逡檎噪髣ｴ霍昴りｿ�
% 荳� \pkg{slashbox} 逧�｡御ｸｺ荳榊酔縲�}
% 蛻��荳､驛ｨ蛻�噪逶貞ｭ舌ゆｸ我ｸｪ蜿よ焚�悟�蛻ｫ荳ｺ key-value 譬ｼ蠑冗噪蜿ｯ騾蛾｡ｹ縲∝ｷｦ蜊願ｾｹ蜀�ｮｹ縲∝承蜊願ｾｹ
% 蜀�ｮｹ縲りｿ咎㈹逧�ｸｻ隕∝ｷ･菴懈弍隸ｻ蜈･蜿よ焚蟷ｶ隶｡邂玲万郤ｿ逶貞ｭ千噪螟ｧ蟆上�
%
% 霑咎㈹閾ｪ蜉ｨ隶｡邂玲万郤ｿ逶貞ｭ仙､ｧ蟆冗噪邂玲ｳ穂ｸｺ�壽万郤ｿ逶貞ｭ千噪螳ｽ蠎ｦ蜿紋ｸ､荳ｪ蟄千將螳ｽ蠎ｦ霎�､ｧ蛟ｼ逧�ｺ悟搾ｼ�
% 閠碁ｫ伜ｺｦ蛻咏峩謗･蜿紋ｸ､荳ｪ蟄千將逧�ｻ鬮伜ｺｦ縲�
%    \begin{macrocode}
\def\diagbox@double#1#2#3{%
  \begingroup
  \diagbox@clear
  \def\diagbox@part{double}%
  \setkeys{diagbox}{dir=NW,#1}%
  \setbox\diagbox@boxa=\hbox{%
    \begin{tabular}{@{\hspace{\diagbox@insepl}}&gt;{\diagbox@font}l@{}}
      #2
    \end{tabular}}%
  \setbox\diagbox@boxb=\hbox{%
    \begin{tabular}{@{}&gt;{\diagbox@font}r@{\hspace{\diagbox@insepr}}}
      #3
    \end{tabular}}%
  \ifdim\diagbox@wd=\z@
    \ifdim\wd\diagbox@boxa&gt;\wd\diagbox@boxb
      \diagbox@wd=\dimexpr2\wd\diagbox@boxa+\diagbox@insepl+\diagbox@insepr\relax
    \else
      \diagbox@wd=\dimexpr2\wd\diagbox@boxb+\diagbox@insepl+\diagbox@insepr\relax
    \fi
  \fi
  \ifdim\diagbox@ht=\z@
    \diagbox@ht=\dimexpr\ht\diagbox@boxa+\dp\diagbox@boxa+\ht\diagbox@boxb+\dp\diagbox@boxb\relax
  \fi
  $\vcenter{\hbox{\diagbox@pict}}$%
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@triple@setbox@NW}
%    \begin{macrocode}
\def\diagbox@triple@setbox@NW#1#2#3{%
  \setbox\diagbox@boxa=\hbox{%
    \begin{tabular}{@{\hspace{\diagbox@insepl}}&gt;{\diagbox@font}l@{}}
      #1
    \end{tabular}}%
  \setbox\diagbox@boxm=\hbox{%
    \begin{tabular}{@{\hspace{\diagbox@insepl}}&gt;{\diagbox@font}l@{}}
      #2
    \end{tabular}}%
  \setbox\diagbox@boxb=\hbox{%
    \begin{tabular}{@{}&gt;{\diagbox@font}r@{\hspace{\diagbox@insepr}}}
      #3
    \end{tabular}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@triple@setbox@SW}
%    \begin{macrocode}
\let\diagbox@triple@setbox@SW\diagbox@triple@setbox@NW
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@triple@setbox@SE}
%    \begin{macrocode}
\def\diagbox@triple@setbox@SE#1#2#3{%
\setbox\diagbox@boxa=\hbox{%
  \begin{tabular}{@{\hspace{\diagbox@insepl}}&gt;{\diagbox@font}l@{}}
    #1
  \end{tabular}}%
\setbox\diagbox@boxm=\hbox{%
  \begin{tabular}{@{}&gt;{\diagbox@font}r@{\hspace{\diagbox@insepr}}}
    #2
  \end{tabular}}%
\setbox\diagbox@boxb=\hbox{%
  \begin{tabular}{@{}&gt;{\diagbox@font}r@{\hspace{\diagbox@insepr}}}
    #3
  \end{tabular}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\diagbox@triple@setbox@NE}
%    \begin{macrocode}
\let\diagbox@triple@setbox@NE\diagbox@triple@setbox@SE
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@triple@pict@NW}
%    \begin{macrocode}
\def\diagbox@triple@pict@NW{%
  \put(0,0)   {\makebox(0,0)[bl]{\box\diagbox@boxa}}
  \put(0,\y)  {\makebox(0,0)[tl]{\box\diagbox@boxm}}
  \put(\x,\y) {\makebox(0,0)[tr]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,\yym)(\x,0)
  \Line(\xm,\y)(\x,0)}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@triple@pict@NE}
%    \begin{macrocode}
\def\diagbox@triple@pict@NE{%
  \put(0,\y)  {\makebox(0,0)[tl]{\box\diagbox@boxa}}
  \put(\x,\y) {\makebox(0,0)[tr]{\box\diagbox@boxm}}
  \put(\x,0)  {\makebox(0,0)[br]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,0)(\xxm,\y)
  \Line(0,0)(\x,\yym)}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@triple@pict@SW}
%    \begin{macrocode}
\def\diagbox@triple@pict@SW{%
  \put(0,\y) {\makebox(0,0)[tl]{\box\diagbox@boxa}}
  \put(0,0)  {\makebox(0,0)[bl]{\box\diagbox@boxm}}
  \put(\x,0) {\makebox(0,0)[br]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,\ym)(\x,\y)
  \Line(\xm,0)(\x,\y)}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@triple@pict@SE}
%    \begin{macrocode}
\def\diagbox@triple@pict@SE{%
  \put(0,0)   {\makebox(0,0)[bl]{\box\diagbox@boxa}}
  \put(\x,0)  {\makebox(0,0)[br]{\box\diagbox@boxm}}
  \put(\x,\y) {\makebox(0,0)[tr]{\box\diagbox@boxb}}
  \diagbox@setlinecolor
  \Line(0,\y)(\xxm,0)
  \Line(0,\y)(\x,\ym)}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\diagbox@triplebox}
% \changes{v2.0}{2011/11/22}{譁ｰ蠅樔ｸ蛾Κ蛻�曙譁懃ｺｿ逧�將蟄図
% \changes{v2.3}{2020/02/09}{譽豬倶ｺ梧ｬ｡譁ｹ遞区裏隗｣縲∝ｼょｸｸ隗｣逧�ュ蠖｢}
% 蛻��荳蛾Κ蛻�噪逶貞ｭ舌ょ屁荳ｪ蜿よ焚�悟�蛻ｫ荳ｺ key-value 譬ｼ蠑冗噪蜿ｯ騾蛾｡ｹ縲∝ｷｦ蜊願ｾｹ蜀�ｮｹ縲∽ｸｭ髣ｴ
% 蜀�ｮｹ縲∝承蜊願ｾｹ蜀�ｮｹ縲�
%    \begin{macrocode}
\def\diagbox@triple#1#2#3#4{%
  \begingroup
  \diagbox@clear
  \def\diagbox@part{triple}%
  \setkeys{diagbox}{dir=NW,#1}%
  \@nameuse{diagbox@triple@setbox@\diagbox@dir}{#2}{#3}{#4}%
%    \end{macrocode}
% 蝨ｨ螳丞桁譛蜷主ｮ壻ｹ会ｼ碁怙隕∬ｿ泌屓 "\x", "\xm", "\xxm", "\y", "\ym" 蜥� "\yym"縲�
%    \begin{macrocode}
  \diagbox@solve@equations
  $\vcenter{\hbox{\diagbox@pict}}$%
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
% \subsection{逕ｨ謌ｷ蜻ｽ莉､}
%
% \begin{macro}{\diagbox}
% \changes{v2.0}{2011/11/22}{蛻､譁ｭ蜿よ焚荳ｪ謨ｰ�碁画叫荳､驛ｨ蛻��荳蛾Κ蛻�將蟄舌�}
% 荳ｻ隕∫噪逕ｨ謌ｷ蜻ｽ莉､縲ょ愛譁ｭ菴ｿ逕ｨ荳､驛ｨ蛻�ｿ俶弍荳蛾Κ蛻�噪逶貞ｭ舌�
%    \begin{macrocode}
\newcommand\diagbox[3][]{%
  \@ifnextchar\bgroup
    {\diagbox@triple{#1}{#2}{#3}}{\diagbox@double{#1}{#2}{#3}}}
%    \end{macrocode}
% \end{macro}
%
% 莉･荳倶ｻ｣遐∫畑譚･讓｡諡� \pkg{slashbox} 螳丞桁逧�粥閭ｽ縲�
%
% 遖∵ｭ｢隸ｻ蜈･ \pkg{slashbox}縲�
%    \begin{macrocode}
\expandafter\xdef\csname ver@slashbox.\@pkgextension\endcsname{9999/99/99}
%    \end{macrocode}
%
%
% \begin{macro}{\slashbox}
% 讓｡諡� "\slashbox"縲�
%    \begin{macrocode}
\def\slashbox{%
  \def\diagbox@slashbox@options{dir=SW,}%
  \slashbox@}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\backslashbox}
% 讓｡諡� "\backslashbox"縲�
%    \begin{macrocode}
\def\backslashbox{%
  \def\diagbox@slashbox@options{dir=NW,}%
  \slashbox@}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\slashbox@}
%    \begin{macrocode}
\newcommand\slashbox@[1][]{%
  \ifx\relax#1\relax\else
    \edef\diagbox@slashbox@options{%
      \unexpanded\expandafter{\diagbox@slashbox@options}%
      \unexpanded{width=#1,}}%
  \fi
  \slashbox@@}
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\slashbox@@}
%    \begin{macrocode}
\newcommand\slashbox@@[3][]{%
  \edef\diagbox@slashbox@options{%
    \unexpanded\expandafter{\diagbox@slashbox@options}%
    \unexpanded{trim=#1,}}%
  \expandafter\diagbox\expandafter[\diagbox@slashbox@options]{#2}{#3}}
%    \end{macrocode}
% \end{macro}
%
% \changes{v2.4}{2020/02/28}{蛻ｩ逕ｨ \pkg{l3fp} 隗｣譁ｹ遞狗ｻ��}
%
% \subsection{隗｣譁ｹ遞狗ｻм
%
% 霑咎㈹隶｡邂怜曙譁懃ｺｿ逶貞ｭ仙ｮｽ縲�ｫ倡噪邂玲ｳ墓弍邂蜊戊檎峩隗ら噪縲ょｦゆｸ句崟謇遉ｺ�悟ｰ� A縲｀縲。 荳我ｸｪ蟄千將
% 蟄仙�蛻ｫ謾ｾ蝨ｨ譁懃ｺｿ逶堤噪荳我ｸｪ隗貞錘�梧万郤ｿ豁｣螂ｽ菴ｿ M 逶偵、 謌� B 逶偵∵万郤ｿ逶堤噪荳隗剃ｸ臥せ蜈ｱ
% 郤ｿ縲�
% \[
%   \tabcolsep=0pt
%   \linespread{1}\selectfont
%   \begin{tabular}{|c|}\hline
%   \diagbox{\fbox{A}}{\fbox{M}}{\fbox{B}}\\ \hline
%   \end{tabular}
% \]
% 蝨ｨ A縲｀縲。 荳我ｸｪ逶貞ｭ仙�螳ｹ遑ｮ螳壼錘�梧万郤ｿ逶堤噪螳ｽ縲�ｫ伜叉蜿ｯ騾夊ｿ�嶌莨ｼ荳芽ｧ貞ｽ｢逧�ｯ比ｾ句�邉ｻ豎�
% 隗｣縲りｮｾ譁懃ｺｿ逶堤噪螳ｽ縲�ｫ倅ｸｺ $x$, $y$�瑚� A縲｀縲。 逶堤噪螳ｽ縲�ｫ伜�蛻ｫ荳ｺ $(x_a, y_a)$,
% $(x_m, y_m)$, $(x_b, y_b)$縲ょ�譛会ｼ�
% \begin{align*}
%   \frac{x}{x_a} &amp;= \frac{y - y_m}{y - y_m - y_a}, \\
%   \frac{y}{y_b} &amp;= \frac{x - x_m}{x - x_m - x_b}.
% \end{align*}
% 隸･譁ｹ遞狗ｻ�壼ｸｸ蜿ｯ蛹也ｮ荳ｺ荳荳ｪ荳蜈�ｺ梧ｬ｡譁ｹ遞区ｱりｧ｣�御ｸ､扈��霓ｭ譬ｹ荳ｭ蜿ｯ莉･蜿ｪ髴隕∬ｾ�､ｧ逧�ｸ扈��
% 騾夊ｿ� Mathematica 霓ｯ莉ｶ�悟ｮｹ譏灘ｾ怜芦譁ｹ遞狗ｻ�噪隗｣荳ｺ��
% \begin{align*}
% x &amp; = \frac{u + v \pm \sqrt{\Delta}} {2(t - y_b)}, \\
% y &amp; = \frac{u - v \mp \sqrt{\Delta}} {2(x_a - s)}, \\
% \Delta &amp; := (u + v)^2 + 4 x_a (t - y_b) \bigl(x_m (y_b - y_m) - x_b y_m\bigr), \\
%      u &amp; := x_a y_m - x_m y_b, \\
%      v &amp; := st - x_a y_b, \\
%      s &amp; := x_b + x_m, \\
%      t &amp; := y_a + y_m.
% \end{align*}
% 菴�｡ｻ豕ｨ諢丈ｸ企擇逧�婿遞狗ｻ�ｹｶ髱樊ｻ譛画ｭ｣逧�ｮ樊�ｹ�檎ｻ剰ｿ�ｮ蜊慕噪莉｣謨ｰ蛻�梵蜿ｯ遏･�瑚ｦ∫ｻ吝�蜃�菴慕峩隗�
% 逧�庄陦瑚ｧ｣�域ｭ｣螳樊�ｹ�会ｼ碁怙隕∝酔譌ｶ貊｡雜ｳ莉･荳区擅莉ｶ��
% \begin{align*}
%   x_a &amp;&lt; x_m + x_b, \\
%   y_b &amp;&lt; y_m + y_a.
% \end{align*}
% 隸･譚｡莉ｶ髴隕∝惠隶｡邂嶺ｸｭ莠井ｻ･譽譟･縲�
%
% \begin{macro}{\diagbox@solve@equations}
% 螯よ棡 \pkg{expl3} 邇ｯ蠅�庄逕ｨ�悟ｰｱ菴ｿ逕ｨ \pkg{l3fp} 隶｡邂暦ｼ悟凄蛻吩ｽｿ逕ｨ \pkg{fp} 蛹��
%    \begin{macrocode}
\ifcsname\detokenize{fp_eval:n}\endcsname
\csname fi\endcsname
\ExplSyntaxOn
%&lt;@@=diagbox&gt;
\cs_new_protected:Npn \@@_solve_equations:
  {
%    \end{macrocode}
% 蜿夜柄螳ｽ縲�
%    \begin{macrocode}
    \fp_set:Nn \l_@@_xa_fp
      { \dim_to_fp:n { \wd \diagbox@boxa } }
    \fp_set:Nn \l_@@_ya_fp
      { \dim_to_fp:n { \ht \diagbox@boxa + \dp \diagbox@boxa } }
    \fp_set:Nn \l_@@_xb_fp
      { \dim_to_fp:n { \wd \diagbox@boxb } }
    \fp_set:Nn \l_@@_yb_fp
      { \dim_to_fp:n { \ht \diagbox@boxb + \dp \diagbox@boxb } }
    \fp_set:Nn \l_@@_xm_fp
      { \dim_to_fp:n { \wd \diagbox@boxm } }
    \fp_set:Nn \l_@@_ym_fp
      { \dim_to_fp:n { \ht \diagbox@boxm + \dp \diagbox@boxm } }
    \fp_set:Nn \l_@@_s_fp { \l_@@_xb_fp + \l_@@_xm_fp }
    \fp_set:Nn \l_@@_t_fp { \l_@@_ya_fp + \l_@@_ym_fp }
%    \end{macrocode}
% 螯よ棡螳ｽ蠎ｦ蜥碁柄蠎ｦ驛ｽ陲ｫ謖�ｮ壻ｺ�ｼ悟ｰｱ荳埼怙隕∝�譁ｹ遞狗ｻ�ｱりｧ｣縲�
%    \begin{macrocode}
    \fp_set_eq:NN \l_@@_delta_fp \c_nan_fp
    \dim_compare:nNnTF \diagbox@wd = \c_zero_dim
      { \@@_calculate_width: }
      { \fp_set:Nn \l_@@_x_fp { \dim_to_fp:n { \diagbox@wd } } }
    \dim_compare:nNnTF \diagbox@ht = \c_zero_dim
      { \@@_calculate_height: }
      { \fp_set:Nn \l_@@_y_fp { \dim_to_fp:n { \diagbox@ht } } }
    \edef \x   { \fp_use:N \l_@@_x_fp }
    \edef \y   { \fp_use:N \l_@@_y_fp }
    \edef \xm  { \fp_use:N \l_@@_xm_fp }
    \edef \ym  { \fp_use:N \l_@@_ym_fp }
    \edef \xxm { \fp_eval:n { \l_@@_x_fp - \l_@@_xm_fp } }
    \edef \yym { \fp_eval:n { \l_@@_y_fp - \l_@@_ym_fp } }
  }
%    \end{macrocode}
% 譽譟･蜿ｯ陦瑚ｧ｣譚｡莉ｶ�瑚ｧ｣莠梧ｬ｡譁ｹ遞九りｿ咎㈹蟇ｹ莠取裏豁｣螳樊�ｹ逧�ュ蠖｢�御ｼ夂ｻ吝�荳荳ｪ螳ｽ譚ｾ逧�ｼ菴應ｸｺ譁�
% 郤ｿ逶貞ｭ千噪螳ｽ鬮假ｼ�
% \begin{align*}
%  x &amp;= 2 \max(x_a + x_m, x_b + x_m),\\
%  y &amp;= 2 \max(y_a + y_m, y_b + y_m).
% \end{align*}
%    \begin{macrocode}
\cs_new_protected:Npn \@@_calculate_width:
  {
    \fp_zero:N \l_@@_x_fp
    \fp_compare:nNnT \l_@@_yb_fp &lt; \l_@@_t_fp
      {
        \@@_calculate_coefficient:
        \fp_if_nan:nF { \l_@@_sqrt_fp }
          {
            \fp_set:Nn \l_@@_x_fp
              {
                ( \l_@@_u_fp + \l_@@_v_fp + \l_@@_sqrt_fp ) /
                ( 2 ( \l_@@_t_fp - \l_@@_yb_fp ) )
              }
          }
      }
    \fp_compare:nNnF \l_@@_x_fp &gt; \c_zero_fp
      {
        \fp_set:Nn \l_@@_x_fp
          { 2 ( max( \l_@@_xa_fp , \l_@@_xb_fp ) + \l_@@_xm_fp ) }
        \msg_warning:nnxx { diagbox } { calculate-error }
          { width } { \fp_use:N \l_@@_x_fp }
      }
    \diagbox@wd = \fp_to_dim:N \l_@@_x_fp \scan_stop:
  }
\cs_new_protected:Npn \@@_calculate_height:
  {
    \fp_zero:N \l_@@_y_fp
    \fp_compare:nNnT \l_@@_xa_fp &lt; \l_@@_s_fp
      {
        \@@_calculate_coefficient:
        \fp_if_nan:nF { \l_@@_sqrt_fp }
          {
            \fp_set:Nn \l_@@_y_fp
              {
                ( \l_@@_u_fp - \l_@@_v_fp - \l_@@_sqrt_fp ) /
                ( 2 ( \l_@@_xa_fp - \l_@@_s_fp ) )
              }
          }
      }
    \fp_compare:nNnF \l_@@_y_fp &gt; \c_zero_fp
      {
        \fp_set:Nn \l_@@_y_fp
          { 2 ( max( \l_@@_ya_fp , \l_@@_yb_fp ) + \l_@@_ym_fp ) }
        \msg_warning:nnxx { diagbox } { calculate-error }
          { height } { \fp_use:N \l_@@_y_fp }
      }
    \diagbox@ht = \fp_to_dim:N \l_@@_y_fp \scan_stop:
  }
\cs_new_protected:Npn \@@_calculate_coefficient:
  {
    \fp_if_nan:nT { \l_@@_delta_fp }
      { \@@_calculate_coefficient_aux: }
  }
\cs_new_protected:Npn \@@_calculate_coefficient_aux:
  {
    \fp_set:Nn \l_@@_u_fp
      {
        \l_@@_xa_fp * \l_@@_ym_fp -
        \l_@@_xm_fp * \l_@@_yb_fp
      }
    \fp_set:Nn \l_@@_v_fp
      {
        \l_@@_s_fp * \l_@@_t_fp -
        \l_@@_xa_fp * \l_@@_yb_fp
      }
    \fp_set:Nn \l_@@_delta_fp
      {
        ( \l_@@_u_fp + \l_@@_v_fp )^2 +
        4 * \l_@@_xa_fp * ( \l_@@_t_fp - \l_@@_yb_fp ) *
          ( \l_@@_xm_fp * ( \l_@@_yb_fp - \l_@@_ym_fp ) -
            \l_@@_xb_fp * \l_@@_ym_fp )
      }
    \fp_compare:nNnTF \l_@@_delta_fp &lt; \c_zero_fp
      { \fp_set_eq:NN \l_@@_sqrt_fp \c_nan_fp }
      { \fp_set:Nn \l_@@_sqrt_fp { sqrt(\l_@@_delta_fp) } }
  }
\cs_new_eq:NN \diagbox@solve@equations \@@_solve_equations:
\fp_new:N \l_@@_xa_fp
\fp_new:N \l_@@_ya_fp
\fp_new:N \l_@@_xb_fp
\fp_new:N \l_@@_yb_fp
\fp_new:N \l_@@_xm_fp
\fp_new:N \l_@@_ym_fp
\fp_new:N \l_@@_x_fp
\fp_new:N \l_@@_y_fp
\fp_new:N \l_@@_s_fp
\fp_new:N \l_@@_t_fp
\fp_new:N \l_@@_u_fp
\fp_new:N \l_@@_v_fp
\fp_new:N \l_@@_sqrt_fp
\fp_new:N \l_@@_delta_fp
\msg_new:nnn { diagbox } { calculate-error }
  {
    Cannot~calculate~proper~#1~of~triple~diagbox~
    \msg_line_context:. \\
    Use~#2pt~instead.
  }
\file_input_stop:
%    \end{macrocode}
%
% 闍･ \pkg{l3fp} 荳榊庄逕ｨ�悟�蠑募� \pkg{fp} 蛹�ｮ｡邂励�
%    \begin{macrocode}
\fi
\RequirePackage{fp}
\FPmessagesfalse
\def\diagbox@solve@equations{%
%    \end{macrocode}
% 蜿夜柄螳ｽ
%    \begin{macrocode}
  \edef\xa{\strip@pt\wd\diagbox@boxa}%
  \edef\ya{\strip@pt\dimexpr\ht\diagbox@boxa+\dp\diagbox@boxa\relax}%
  \edef\xb{\strip@pt\wd\diagbox@boxb}%
  \edef\yb{\strip@pt\dimexpr\ht\diagbox@boxb+\dp\diagbox@boxb\relax}%
  \edef\xm{\strip@pt\wd\diagbox@boxm}%
  \edef\ym{\strip@pt\dimexpr\ht\diagbox@boxm+\dp\diagbox@boxm\relax}%
%    \end{macrocode}
% 蛻玲婿遞具ｼ瑚ｮ｡邂玲婿遞狗ｳｻ謨ｰ
%    \begin{macrocode}
  \FPneg\bi\yb
  \FPadd\ci\xb\xm  \FPneg\ci\ci
  \FPmul\di\xm\yb
  \FPadd\bj\ya\ym  \FPneg\bj\bj
  \FPneg\cj\xa
  \FPmul\dj\xa\ym
%    \end{macrocode}
% 譽譟･蜿ｯ陦瑚ｧ｣譚｡莉ｶ�瑚ｧ｣莠梧ｬ｡譁ｹ遞九りｿ咎㈹蟇ｹ莠取裏豁｣螳樊�ｹ逧�ュ蠖｢�御ｼ夂ｻ吝�荳荳ｪ螳ｽ譚ｾ逧�ｼ菴應ｸｺ譁�
% 郤ｿ逶貞ｭ千噪螳ｽ鬮假ｼ�
% \begin{align*}
%  x &amp;= 2 \max(x_a + x_m, x_b + x_m),\\
%  y &amp;= 2 \max(y_a + y_m, y_b + y_m).
% \end{align*}
%    \begin{macrocode}
  \FPsub\u\dj\di
  \FPupn{v}{bj ci * bi cj * -}%
  \FPupn{delta}{bi dj * bj di * - cj ci - * 4 * v u + copy * -}%
  \newif\ifdeltapositive
  \FPifneg\delta \deltapositivefalse \else \deltapositivetrue \fi
  \FPset\x{0}%
  \FPset\y{0}%
  \ifdim\diagbox@wd=\z@
    \ifdim\bi\p@&gt;\bj\p@\ifdeltapositive
      \FPupn{x}{2 bj bi - 2 delta root v u - + / /}%
    \fi\fi
    \ifdim\x\p@=\z@
      \FPupn{x}{xa xm + xb xm + max 2 *}%
      \PackageWarning{diagbox}{Cannot calculate proper width of triple diagbox.\MessageBreak
        Use \x pt instead.}%
    \fi
    \diagbox@wd=\x\p@
  \else
    \edef\x{\strip@pt\diagbox@wd}%
  \fi
  \ifdim\diagbox@ht=\z@
    \ifdim\ci\p@&lt;\cj\p@\ifdeltapositive
      \FPupn{y}{2 cj ci - 2 delta root v u + - / /}%
    \fi\fi
    \ifdim\y\p@=\z@
      \FPupn{y}{ya ym + yb ym + max 2 *}%
      \PackageWarning{diagbox}{Cannot calculate proper height of triple diagbox.\MessageBreak
        Use \y pt instead.}%
    \fi
    \diagbox@ht=\y\p@
  \else
    \edef\y{\strip@pt\diagbox@ht}%
  \fi
  \FPsub\xxm\x\xm
  \FPsub\yym\y\ym
}
%    \end{macrocode}
% \end{macro}
%
% \iffalse
%&lt;/package&gt;
% \fi
%
% \Finale
\endinput
</pre></body></html>