
He definido un entorno de la siguiente manera. Me gustaría tener una modificación en la que no agregue espacios verticales en blanco si no se proporcionan argumentos.
\documentclass[10]{article}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage{tabu}
\usepackage{enumitem}
\setlist{leftmargin=5mm, noitemsep, topsep=-1\parskip}
\newenvironment{cvsection}[1]{
\vspace{3pt}
\hspace{3pt}{\scriptsize{\textbf{#1}}}
\vspace{2pt}
\hrule
}
\newenvironment{cvsubsection}[3]{
\vspace{-8pt}
\begin{center}
\begin{tabu} to 1\textwidth { X[l,m] X[c,m] X[r,m] }
\textbf{\small #1} & \textbf{\small #2} & \textbf{\small #3} \\
\end{tabu}
\end{center}
}
\begin{document}
\begin{cvsection}{LANGUAGES \& TECHNOLOGIES}
\begin{cvsubsection}{}{}{}
\begin{itemize}
\item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema
\item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
\end{itemize}
\end{cvsubsection}
\end{cvsection}
\end{document}
Lo anterior da lo siguiente. Me gustaría eliminar el espacio en blanco marcado en rojo, si no proporciono argumentos a mi archivo cvsubsection
. Si proporciono argumentos, debería funcionar como ya se definió anteriormente.
Salida deseada con código relevante(El código NOTA es solo para mostrar el resultado que quiero. Todavía quiero pasar argumentos vacíos a mi cvsubsection
)
\begin{cvsection}{LANGUAGES \& TECHNOLOGIES}
% \begin{cvsubsection}{}{}{}
\vspace{4pt}
\begin{itemize}
\item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema
\item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
\end{itemize}
% \end{cvsubsection}
\end{cvsection}
Respuesta1
Una idea con check solo del primer argumento de cvsubsection (ya que siento que si esto está vacío... los demás también estarán vacíos -no dudes en pedirme que extienda el check a los demás también-)
\documentclass{article}
\usepackage{tabu}
\usepackage{enumitem}
\setlist{leftmargin=5mm, noitemsep, topsep=-1\parskip}
\newenvironment{cvsection}[1]{
\vspace{3pt}
\hspace{3pt}{\scriptsize{\textbf{#1}}}
\vspace{2pt}
\hrule
}
\newenvironment{cvsubsection}[3]{
\edef\FirstArg{#1}
\ifx\FirstArg\empty\vspace{-25pt}\fi
\begin{center}
\begin{tabu} to 1\textwidth { X[l,m] X[c,m] X[r,m] }
\textbf{\small #1} & \textbf{\small #2} & \textbf{\small #3} \\
\end{tabu}
\end{center}
}
\begin{document}
\begin{cvsection}{LANGUAGES \& TECHNOLOGIES}
\begin{cvsubsection}{}{}{}
\begin{itemize}
\item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema
\item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
\end{itemize}
\end{cvsubsection}
\begin{cvsubsection}{Arg2}{Arg3}{Arg4}
\begin{itemize}
\item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema
\item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
\end{itemize}
\end{cvsubsection}
\end{cvsection}
\end{document}