I want to insert text in a beamer slide using an invisible tikz matrix of fixed width (.85\paperwidth), 2 columns (~ 3cm) on the upper left part and similarly on the upper right part. Only one matrix, with a middle empty column used as spacer. This way the two blocks will be symmetrically placed.
The main problem is the calculation of the width of the middle column. I thought of setting minimum width = .8\paperwidth for the matrix settings and setting the width of col. 1,2,4,5 individually would automatically adjust the width of the middle column so that the whole matrix width is equal to my setting, but that does not work. Also I've not been able to setup the use of width("x") for setting the width of columns 1,2,4,5.
\documentclass{beamer}
\newlength{\slw}\setlength{\slw}{160mm}
\newlength{\slh}\setlength{\slh}{100mm}
\geometry{verbose,papersize={\slw,\slh}}
\usepackage{tikz,calc,xfp}
\usetikzlibrary{calc,matrix}
\tikzset{
allmatrix/.style = {matrix of nodes, rounded corners = 1mm,
nodes in empty cells,matrix anchor=#1,
row sep=-\pgflinewidth, column sep=-\pgflinewidth,
ampersand replacement=&, nodes={outer sep=0pt},
text height=1.5ex, text depth=.25ex},
table/.style args= {#1/#2}{
column #1/.append style={nodes={align=left,
minimum width={\fpeval{#2 + 2 * 2mm}pt}, text width=#2}},
}}
\begin{document}
\begin{frame}
\begin{tikzpicture}[overlay,remember picture]
\matrix at (current page.north)
[shift={(0,-2)}, allmatrix=north, nodes={draw},
table/.list={1/3cm,
2/3cm,
4/3cm,
5/3cm}] (mytab)
% table/.list={1/width("le monde"),
% 2/width("new york times"),
% 4/width("le figaro"),
% 5/width("southern echo")}] (near)
{
le monde & new york times & & le figaro & southern echo\
innadu & le maine & & penpavar & the hindu \
times & spectrum & & science & nature \
};
\end{tikzpicture}
\end{frame}
\end{document}



\fpeval. Just use#2+2*2mmdirectly. PGF/TikZ evaluates that on its own. Instead of2mmuse\pgfkeysvalueof{/pgf/inner xsep}. – Qrrbrbirlbel Nov 16 '22 at 08:32.85\paperwidthminus all the text widths minus all the inner xseps. – Qrrbrbirlbel Nov 16 '22 at 08:36