# LaTeX3 document class: coffins versus LaTeX2e style

Context: I'm currently setting a small journal. For that I wrote a expl3-based document class. It's expected that articles start at the same height of the page every time (that also means the same space for title/subtitle/author of an article).

Problem: While working on a simple method (\inputarticle) to achieve this, I worked with many LaTeX2e commands which I have to customize manually (should be no problem) to adjust their positions. On the other hand I wondered whether there is a more l3-consistent way and used coffins to replicate the same layout (\xinputarticle).

Question: If I'm working in a l3 class context what is best-practice to use: usual LaTeX2e commands and boxes or something like coffins? And if coffins should be preferred, how stable is the current interface at the moment (2017)?

File myjournal.cls:

\RequirePackage{expl3}
\ProvidesExplClass{myjournal}{2017/10/17}{0.0.1}{A journal}
\RequirePackage{xparse}

\RequirePackage{multicol}
\RequirePackage{scrlayer-scrpage}

\RequirePackage[left=1cm,right=1cm,top=1cm,bottom=1.5cm,twoside]{geometry}

\pagestyle{plain}
\renewcommand{\titlepagestyle}{plain}
\renewcommand{\indexpagestyle}{plain}

\RedeclareSectionCommand[tocbeforeskip=6pt,beforeskip=2\baselineskip,afterskip=1sp]{section}
\newcommand\prefix@section{}

\NewDocumentCommand { \inputarticle } { m m m m }
{
\section[\detokenize{#1}]{\strut #1}
\label{sec:\thesection}
\noindent{\usekomafont{disposition}\strut#2}\par
\noindent{\em\strut #4}\par
\begin{multicols}{2}
\noindent#3%
\null\hfill\artende
\end{multicols}
\clearpage
}

\coffin_new:N \l_myjournal_section_coffin
\coffin_new:N \l_myjournal_subtitle_coffin
\coffin_new:N \l_myjournal_author_coffin
\coffin_new:N \l_myjournal_result_coffin
\NewDocumentCommand { \xinputarticle } { m m m m }
{
\coffin_clear:N \l_myjournal_result_coffin
\hcoffin_set:Nn \l_myjournal_section_coffin
{\usekomafont{disposition}\Large\strut #1}
\hcoffin_set:Nn \l_myjournal_subtitle_coffin
{
{\usekomafont{disposition}\strut#2}
}
\hcoffin_set:Nn \l_myjournal_author_coffin
{
{\em\strut #4}
}
\coffin_join:NnnNnnnn
\l_myjournal_result_coffin {l} {t}
\l_myjournal_section_coffin {l} {t}
{0pt}{0pt}
\coffin_join:NnnNnnnn
\l_myjournal_result_coffin {l} {b}
\l_myjournal_subtitle_coffin {l} {t}
{0pt}{0pt}
\coffin_join:NnnNnnnn
\l_myjournal_result_coffin {l} {b}
\l_myjournal_author_coffin {l} {t}
{0pt}{0pt}
\coffin_typeset:Nnnnn \l_myjournal_result_coffin {l} {t}
{-10pt}{0pt}
\begin{multicols}{2}
\noindent#3%
\null\hfill\artende
\end{multicols}
\clearpage
}
\NewDocumentCommand { \artende } {}
{
\hspace*{\fill}■\par
}


Please do not blame me for not really having separated code and interface level yet.

File mwe.tex:

% arara: lualatex
% arara: lualatex: {synctex: 1}
% arara: lualatex: {synctex: 1}
%!TeX TS-program=arara
\documentclass{myjournal}

\title{Test}
\author{Journal Team}
\date{\today}

\usepackage{lipsum}

\begin{document}
\xinputarticle{Test 1}
{This has it all}
{\lipsum[1-2]}
{Some author}
\xinputarticle{Test 2}
{}
{\lipsum[1-2]}
{Without subtitle}
\xinputarticle{Test 3}
{Without author}
{\lipsum[1-2]}
{}
\xinputarticle{Test 1}
{This has it all}
{\lipsum[1-2]}
{Some author}
\end{document}


The coffin interfaces are stable, so if you are using expl3 anyway and find them useful, there is really no need to avoid them. On the other hand, if you are more comfortable with 'traditional' box constructs then use them.
The entire idea of expl3 classes is probably still needing work: ideally code goes in packages, design goes in classes. However, until we have a 'design language' sorted and thus a clear specification for L3 classes, there will be some mixing.