%% test-tate.tex
%% =============
%% Typesetting test in vertical writing (tate): three columns (dan)
%% with spanning floats, a spanning block and the footnotes in the
%% last column.
%%
%%   platex  test-tate.tex && dvipdfmx test-tate
%%   uplatex -jobname=test-tate "\def\CLS{utarticle}\input test-tate"
%%   lualatex test-tate.tex
%% The class is tarticle with pTeX and ltjtarticle with LuaTeX by
%% default; set \CLS for another one.  The expected state depends on
%% the layout of the class, which is the same for tarticle, utarticle
%% and ltjtarticle.
%%
%% What is covered:
%%   * a float of one column, floats across all columns at the top and
%%     at the bottom, floats across two columns (at=tl, at=br);
%%   * \spanblock across two columns;
%%   * footnotes=last-column.
%%
%% What to check:
%%   * NCOL-RESULT OK (every footnote text is on the page of its
%%     mark), and no error;
%%   * in the PDF, the first column is the upper one and the top of a
%%     column is on the right: a float with at=tl is in the upper
%%     right corner of the page, one with at=br in the lower left
%%     corner.
\ifdefined\ptexversion
  \ifdefined\CLS\else\def\CLS{tarticle}\fi
\else
  \ifdefined\CLS\else\def\CLS{ltjtarticle}\fi
\fi
\documentclass{\CLS}
\usepackage[columns=3,footnotes=last-column]{ncolumn}
\input{test-common}
\newcommand\fn{\NCOLfootnote{\NCOLmark{fn\thefootnote}note}}
\NCOLexpect{
  {page 1: N=3 fnres=0pt}
    {col 1: top=0.0pt bot=0.0pt marks=[a]..[a]}
    {col 2: top=0.0pt bot=0.0pt marks=[a]..[a]}
    {col 3: top=0.0pt bot=0.0pt marks=[fn1]..[fn2]}
  {page 2: N=3 fnres=0pt}
    {col 1: top=60.0pt bot=50.0pt marks=[fn2]..[fn2]}
    {col 2: top=60.0pt bot=50.0pt marks=[fn2]..[fn2]}
    {col 3: top=60.0pt bot=50.0pt marks=[b]..[fn3]}
    {span: top from column 1, 3 wide, at 0.0pt}
    {span: bot from column 1, 3 wide, at 0.0pt}
  {page 3: N=3 fnres=0pt}
    {col 1: top=70.0pt bot=0.0pt marks=[fn3]..[fn3]}
    {col 2: top=70.0pt bot=70.0pt marks=[fn3]..[fn3]}
    {col 3: top=0.0pt bot=70.0pt marks=[fn3]..[fn3]}
    {span: top from column 1, 2 wide, at 0.0pt}
    {span: bot from column 2, 2 wide, at 0.0pt}
  {page 4: N=3 fnres=0pt}
    {col 1: top=0.0pt bot=0.0pt marks=[c]..[c]}
    {col 2: top=0.0pt bot=0.0pt marks=[c]..[c]}
    {col 3: top=0.0pt bot=0.0pt marks=[fn4]..[fn4]}
  {page 5: N=3 fnres=0pt}
    {col 1: top=34.0pt bot=0.0pt marks=[d]..[d]}
    {col 2: top=34.0pt bot=0.0pt marks=[d]..[d]}
    {col 3: top=0.0pt bot=0.0pt marks=[fn5]..[fn5]}
    {span: top from column 1, 2 wide, at 0.0pt}
}
\begin{document}
\NCOLmark{a}\NCOLlines{10}\fn\NCOLlines{20}\NCOLfloat{figure}[t]{20pt}\NCOLlines{30}\fn
\NCOLfloat{figure*}[t]{40pt}\NCOLfloat{figure*}[b]{30pt}
\NCOLlines{60}\NCOLmark{b}\fn
\NCOLfloat{figure*}[span=2,at=tl]{50pt}\NCOLfloat{figure*}[span=2,at=br]{50pt}
\NCOLlines{90}\NCOLmark{c}\fn
\spanblock[span=2,at=tl]{\NCOLlines{2}}
\NCOLmark{d}\NCOLlines{20}\fn
\clearpage
\end{document}
