2

I am trying to use NiceTabular to create neat arrangements of slides. However, items inside itemize do not seem to properly align with the titles.

enter image description here

My questions are as follows

  1. How to precisely align the first item in itemize with the title in the first column?
  2. How to remove the empty line between the sample text and the itemization in tables?
  3. I am basically trying to get NiceTabular to behave similar to tabularx, but with the awesome functionalities provided by NiceTabular (such as the ability to determine contents horizontal alignment with p columns in concise fashion and hvlines), I would love to use NiceTabular. Is it possible to get the second and third columns to fill the remaining of \textwidth automatically?

My MWE

\documentclass[aspectratio=169, xcolor={x11names},t]{beamer}

\useinnertheme{rectangles} \usecolortheme{seahorse}

\usepackage{calc}

\usepackage[export]{adjustbox}

\usepackage{blindtext}

\usepackage{booktabs}

\usepackage{nicematrix}

\newlength{\widthSideBar} \setlength{\widthSideBar}{0mm}

\newlength{\widthTextMarginLeft} \setlength{\widthTextMarginLeft}{10mm} \newlength{\widthTextMarginRight} \setlength{\widthTextMarginRight}{5mm}

\setbeamersize{text margin left=\widthTextMarginLeft, text margin right=\widthTextMarginRight}

\setbeamersize{sidebar width left=\widthSideBar, sidebar width right=0cm}

\setbeamertemplate{itemize items}[triangle]

% Adjusting \leftmargini for adjustbox environments
\newlength{\widthItemizeIcon}
\setlength{\widthItemizeIcon}{3.1mm}% good value 3.1mm
\newcommand{\adjustboxItemize}{
    \addtolength{\leftmargini}{\widthItemizeIcon}
    \addtolength{\leftmargini}{\labelsep}}


\setlength{\leftmargini}{0mm} \setlength{\parskip}{5mm}

\makeatletter \newcommand{\itemizecompact}{ \def@listi{\leftmargin\leftmargini \setlength{\topsep}{0mm} \setlength{\itemsep}{0mm} \setlength{\parsep}{0mm} } \let@listI@listi @listi } \makeatother

\newlength{\widthQuad} \setlength{\widthQuad}{\widthof{\widthof{\quad}}}

\newcommand{\sampletext}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullamnec mi et neque pharetra sollicitudin. Praesent imperdiet mi nec ante.}

\begin{document}

\begin{frame}[plain]

\adjustboxItemize

\itemizecompact

{\noindent\setlength{\tabcolsep}{5.5pt}%
\begin{NiceTabular}{@{}>{\bfseries}p[l]{2.5cm} p[l]{\dimexpr 0.63\linewidth - \tabcolsep - 2.5cm/2 \relax} @{\quad}p[l]{\dimexpr 0.37\linewidth - \tabcolsep - 2.5cm/2 - \widthQuad \relax}}

    One-line title & \blindlist{itemize} & \includegraphics[width=\columnwidth, valign=t]{example-image-a}
    \\

    One-line title & \sampletext \newline \blindlist{itemize} & \includegraphics[width=\columnwidth, valign=t]{example-image-b}
    \\

\end{NiceTabular}
}

\end{frame}

\end{document}

1 Answers1

1

With the patch provided by Hendrik Vogt in that question, you have the expected output.

\documentclass[aspectratio=169, xcolor={x11names},t]{beamer}

\makeatletter \def\beamer@callorigitem{% @ifnextchar[ \beamer@@callorigitem {\beamer@origitem \if@minipage\else \kern0pt % don't put the \kern at the top of a \minipage \fi \ignorespaces }% } \newcommand*\if@minipage@and@vmode[2]{% \let\mini@vmode 0% \if@minipage\ifvmode \let\mini@vmode 1% \fi\fi \if\mini@vmode 1 #1\else #2\fi } % Redefine \beamerorig@set@color, \pgfsys@begininvisible and \pgfsys@endinvisible % such that they don't act at the top of a \minipage; % instead save the corresponding commands in \set@minipage@color ... \def\set@minipage@color{}% \let\save@beamerorig@set@color\beamerorig@set@color \def\beamerorig@set@color{% \if@minipage@and@vmode{% \begingroup \def\reset@color{\relax}% \xdef\addto@minipage@color{\save@beamerorig@set@color}% \endgroup \expandafter\g@addto@macro\expandafter\set@minipage@color \expandafter{\addto@minipage@color}% \aftergroup\reset@color }{% \save@beamerorig@set@color }% } \let\save@pgfsys@begininvisible\pgfsys@begininvisible \let\save@pgfsys@endinvisible\pgfsys@endinvisible \def\pgfsys@begininvisible{% \if@minipage@and@vmode {\g@addto@macro\set@minipage@color{\save@pgfsys@begininvisible}} {\save@pgfsys@begininvisible}% } \def\pgfsys@endinvisible{% \if@minipage@and@vmode {\g@addto@macro\set@minipage@color{\save@pgfsys@endinvisible}} {\save@pgfsys@endinvisible}% } % ... and execute them at the beginning of the first paragraph of the minipage % (where \everypar issues @minipagefalse). \let\save@minipagefalse@minipagefalse \def@minipagefalse{% \set@minipage@color \gdef\set@minipage@color{}% \save@minipagefalse } \makeatother

\useinnertheme{rectangles} \usecolortheme{seahorse}

\usepackage{calc}

\usepackage[export]{adjustbox}

\usepackage{blindtext}

\usepackage{booktabs}

\usepackage{nicematrix}

\newlength{\widthSideBar} \setlength{\widthSideBar}{0mm}

\newlength{\widthTextMarginLeft} \setlength{\widthTextMarginLeft}{10mm} \newlength{\widthTextMarginRight} \setlength{\widthTextMarginRight}{5mm}

\setbeamersize{text margin left=\widthTextMarginLeft, text margin right=\widthTextMarginRight}

\setbeamersize{sidebar width left=\widthSideBar, sidebar width right=0cm}

\setbeamertemplate{itemize items}[triangle]

% Adjusting \leftmargini for adjustbox environments
\newlength{\widthItemizeIcon}
\setlength{\widthItemizeIcon}{3.1mm}% good value 3.1mm
\newcommand{\adjustboxItemize}{
    \addtolength{\leftmargini}{\widthItemizeIcon}
    \addtolength{\leftmargini}{\labelsep}}


\setlength{\leftmargini}{0mm} \setlength{\parskip}{5mm}

\makeatletter \newcommand{\itemizecompact}{ \def@listi{\leftmargin\leftmargini \setlength{\topsep}{0mm} \setlength{\itemsep}{0mm} \setlength{\parsep}{0mm} } \let@listI@listi @listi } \makeatother

\newlength{\widthQuad} \setlength{\widthQuad}{\widthof{\widthof{\quad}}}

\newcommand{\sampletext}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullamnec mi et neque pharetra sollicitudin. Praesent imperdiet mi nec ante.}

\begin{document}

\begin{frame}[plain]

\adjustboxItemize

\itemizecompact

{\noindent\setlength{\tabcolsep}{5.5pt}%
\begin{NiceTabular}{@{}>{\bfseries}p[l]{2.5cm} p[l]{\dimexpr 0.63\linewidth - \tabcolsep - 2.5cm/2 \relax} @{\quad}p[l]{\dimexpr 0.37\linewidth - \tabcolsep - 2.5cm/2 - \widthQuad \relax}}

    One-line title & \blindlist{itemize} & \includegraphics[width=\columnwidth, valign=t]{example-image-a}
    \\

    One-line title & \sampletext \newline \blindlist{itemize} & \includegraphics[width=\columnwidth, valign=t]{example-image-b}
    \\

\end{NiceTabular}
}

\end{frame}

\end{document}

Output of the above code

F. Pantigny
  • 40,250