0
\documentclass{book}
\usepackage[a4paper,margin=1cm,landscape]{geometry}
\usepackage{multicol}


\newenvironment{flagsAndExplanation}[2]
{
    \begin{itemize}
        \item \textit{#1} %commandFlags
        \begin{itemize}
            \item #2 %commandDescription
        \end{itemize}
    \end{itemize}
}

\newenvironment{commandTemplate}[3]
{
    \chapter{#1} %commandName
    \section{#2} %sectionName
}

\begin{document}

\begin{multicol}{3}

\newcommand{\mainSomething}{GNU}
\newcommand{\derivedPackage}{coreutils}
\newcommand{\commandName}{ls}
\newcommand{\sectionName}{FilesFilter}

\begin{commandTemplate}{\mainSomething}{\derivedPackage}{\commandName}
\end{commandTemplate}

\newcommand{\commandFlags}{{\texttt{-a, --all}}}
\newcommand{\commandDescription}
{
    do not ignore file names that start with '.' .
}

\begin{flagsAndExplanation}{\commandFlags}{\commandDescription}
\end{flagsAndExplanation}

\renewcommand{\commandFlags}{{\texttt{
-d, --directory /
}}}
\renewcommand{\commandDescription}
{
    List just the names of directories in current 
}

\begin{flagsAndExplanation}{\commandFlags}{\commandDescription}
\end{flagsAndExplanation}

\end{multicol}
\end{document}

Is there something I have done wrong? Why does it work with a simple document, but not on mine?

2
  • Welcome to TeX.SE. Please make your sample code as minimal as possible while still exhibiting the problem behavior you wish to fix. A suggestion: For the sake of this example, the preamble need only contain a suitable \documentclass directive and the instruction \usepackage{multicol}. And the body of the document could be simplified to \begin{document} \begin{multicol}{3} bla bla bla \end{multicol} \end{document}. Everything else is fluff.
    – Mico
    Commented Jul 16 at 12:29
  • 3
    Note that your \newenvironments are working because of sheer luck. They expect two mandatory arguments, the second one being presently grabbed as \par because of the empty lines you are leaving in the code.
    – campa
    Commented Jul 16 at 12:41

1 Answer 1

1
\begin{multicol}

\end{multicol}

are the mistakes. It should be

\begin{multicols}

\end{multicols}

with the final "s".

Not the answer you're looking for? Browse other questions tagged .