1

I have a 3 commands for my ease of access namely resumeBulletStart, resumeBullet and resumeBulletEnd. Compiling while using the commands fails. Although, when I copy the same content as sequential code, it compiles.

\documentclass[letterpaper, 11pt]{article}
\usepackage{tabularx}

\newcommand{\resumeBulletStart}{ \begin{tabularx}{\textwidth}{| X | r |} } \newcommand{\resumeBullet}[2]{ \begin{itemize} \item \small{#1} \item \small{#2} \end{itemize} & \small{\textit{#2}} \ } \newcommand{\resumeBulletEnd}{ \end{tabularx} }

\begin{document} \centering

%%%% Using Command %%%%
\resumeBulletStart
    \resumeBullet{one}{two}
\resumeBulletEnd

%%%% Not Using Command %%%%
% \begin{tabularx}{\textwidth}{| X | r |}

%     \begin{itemize}
%         \item \small{one}
%           \item \small{one}
%     \end{itemize}
%     & \small{\textit{two}} \\

% \end{tabularx}

\end{document}

What am I doing wrong?

  • 3
    tabularx looks for the end of the current environment. You can wrap it in an environment like described in https://tex.stackexchange.com/q/42325/82917 but it won't work like you are trying. You might do it with delimited arguments. – campa Jan 26 '21 at 08:37

1 Answers1

1

Thanks to the comment, I have solved my question. Shoutout to @campa and this answer by @Werner <3

\documentclass[letterpaper, 11pt]{article}
\usepackage{tabularx}

\newcommand{\resumeBullet}[2]{ \begin{itemize} \item \small{#1} \item \small{#2} \end{itemize} & \small{\textit{#2}} \ }

\newenvironment{resumeBullets} {\tabularx{\textwidth}{| X | r |}} {\endtabularx}

\begin{document} \centering

\begin{resumeBullets}
    \resumeBullet{one}{two}
\end{resumeBullets}

\end{document}