I’m experimenting with Docx2LaTeX to see if it is feasible for use to do collaborative editing for a latex document that consists of mixed manually created and generated latex. The project is also stored in git so ideally changes in git would be reflected in the document.
Some of the generated latex uses custom commands which are currently defined is a cls file.
I was testing to see if \newcommand works. For a simple command that only returned text it worked if defined in the LaTeX block that uses it. It did not work by putting the \newcommand in the first latex block along with the documentclass.
\newcommand{\sayhello}[1]{Hello #1}
\sayhello{Mike}
Attempting to define a new command with use of ifthenelse fails. \usepackage{ifthen} is included alongside \documentclass in the first latex block.
\newcommand{\dayOfWeek}[1]
{
\ifthenelse{\equal{#1}{0}}{Sunday}{}
\ifthenelse{\equal{#1}{1}}{Monday}{}
\ifthenelse{\equal{#1}{2}}{Tuesday}{}
\ifthenelse{\equal{#1}{3}}{Wednesday}{}
\ifthenelse{\equal{#1}{4}}{Thursday}{}
\ifthenelse{\equal{#1}{5}}{Friday}{}
\ifthenelse{\equal{#1}{6}}{Saturday}{}
}
\dayOfWeek{0}
\dayOfWeek{4}