This question is in followup to this question; an excellent response there has allowed me to very easily make tables for examples in the grammar book I am working on which have one language on one row, and the corresponding translation on the following row. For example, the following example is produced by the code underneath it:
\begin{ExampleRow}
\dakota{čhaŋté + oyúze, čhaŋtóyuze, čhaŋté + ohnáka, čhaŋtóhnaka}
\english{heart + condition of, disposition, heart + to place inside, to cherish}
\gap
\dakota{ȟe + o + púza, ȟópuza, napé + ožáža ,napóžaža}
\english{mountain+ place + dry, desert, hand + washing place, sink}
\end{ExampleRow}
Such a method of quickly producing tables which are uniform in style has been very helpful; and I have been trying to take what I have learned since asking the last question and apply it to make a similar command for producing tables which function similarly (i.e. you need not specify the number of rows or columns beforehand) but instead are transposed, with words of the same language / font appearing in columns instead of rows.
More specifically, I am looking to create a command ExampleCol
which, when given the following input,
\begin{ExampleCol}
\dakota{čhaŋté + oyúze, čhaŋtóyuze, čhaŋté + ohnáka, čhaŋtóhnaka}
\english{heart + condition of, disposition, heart + to place inside, to cherish}
\end{ExampleCol}
Would produce the following table:
I'll try my best to summarize what I have so far: here is a minimal working example for the first table (which inputs by rows)
\documentclass{memoir}
\usepackage{fontspec}
\usepackage{booktabs}
\usepackage{etoolbox}
\newfontfamily\dak{Linux Biolinum O}
\newfontfamily\eng{JosefinSans-SemiBold}
\renewcommand{\arraystretch}{1.2}
\newcommand{\gap}{\\[-1.2ex]}
\newcommand{\doenglish}[1]{\appto\temp{&\eng{#1}}}
\newcommand{\dodakota}[1]{\appto\temp{&\dak{#1}}}
\newcommand{\english}[1]{%
\def\temp{}% initialize to empty
\forcsvlist{\doenglish}{#1}% add entries
\appto\temp{\\}% end the row
\temp % deliver contents
}
\newcommand{\dakota}[1]{%
\def\temp{}% initialize to empty
\forcsvlist{\dodakota}{ #1}% add entries
\appto\temp{\\}% end the row
\temp % deliver contents
}
\newenvironment{ExampleRow}
{\begin{center}
\begin{tabular}{ c@{} *{\maxcolumns}{c} } \toprule
{\bottomrule\end{tabular}
\end{center}}
\def\maxcolumns{20}
\begin{document}
\begin{ExampleRow}
\dakota{čhaŋté + oyúze, čhaŋtóyuze, čhaŋté + ohnáka, čhaŋtóhnaka}
\english{heart + condition of, disposition, heart + to place inside, to cherish}
\gap
\dakota{ȟe + o + púza, ȟópuza, napé + ožáža ,napóžaža}
\english{mountain+ place + dry, desert, hand + washing place, sink}
\end{ExampleRow}
\end{document}
After looking through previous questions on this site, I tried to modify one of the solutions given in this question to suit my needs. Here's my attempt (which is add-able to the minimal example file given above to run)
\newcount\rowc
\makeatletter
\def\ExampleCol{
\centering
\hbox\bgroup
\let\\\cr
\def\ruleb{
\ifnum\rowc=1\hrule height 1pt \else
\fi}
\valign\bgroup
\global\rowc\@ne
\hbox to 6em{\strut \hfill##\hfill}%
\ruleb
&&%
\global\advance\rowc\@ne
\hbox to 6em{\strut\hfill##\hfill}%
\ruleb
\cr}
\def\endExampleCol{%
\crcr\egroup\egroup}
Using this, the following code produces the accompanying picture:
\begin{ExampleCol}
\dakota{wáŋča, núŋpa, yámni, tópa, záptaŋ,sákpe}
\english{one, two, three, four, five, six}
\end{ExampleCol}
Which is looking great (with the exception that I would like a horizontal bar at the bottom of the table as well but don't want to specify its height beforehand, and the top bar is a bit too close to the text)
However, this solution doesn't work for me as the cells seem to be of a fixed size, if I try and enter longer words in the table neighboring cells overlap. For example, the following code
\begin{ExampleCol}
\dakota{čhaŋté + oyúze, čhaŋtóyuze, čhaŋté + ohnáka, čhaŋtóhnaka}
\english{heart + condition of, disposition, heart + to place inside, to cherish}
\end{ExampleCol}
produces this table:
Any suggestions on a good way to make an environment for entering tables in columns like this that doesn't have the same problems would be greatly appreciated!