2

I have to censor sensitive information in CVs. The CVs use the moderncv package. I decided to use the censor package to blackening the sensitive information. When I try to censor the third parameter in a \cventry, I encounter an error:

! Use of @@array doesn't match its definition.

The MWE

%!TeX spellcheck = en_US
\documentclass[11pt, a4paper]{moderncv}

\moderncvtheme[orange]{classic} % [color]{stye}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}          
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{censor}

\usepackage{xpatch}
\xpatchcmd{\cventry}{.\strut}{\strut}{}{}

\firstname{firstname}
\familyname{lastname}
\address{street}{postal code}
\email{e-mail}

\begin{document}

\makecvtitle

\section{Interests}
\cventry{Since 2000}{}{\censor{to be censored}}{Test}{}{}

\end{document}

The error log

! Use of @@array doesn't match its definition. @ifnextchar \reserved@d =#1\def \reserved@a {#2}\def \reserved@b {#3}\f... l.26 ...2000}{}{\censor{to be censored}}{Test}{}{}

If you say, e.g., \def\a1{...}', then you must always put1' after `\a', since control sequence names are made up of letters only. The macro here has not been followed by the required stuff, so I'm ignoring it.

! Argument of @firstoftwo has an extra }. \par l.26 ...2000}{}{\censor{to be censored}}{Test}{}{}

I've run across a }' that doesn't seem to match anything. For example,\def\a#1{...}' and \a}' would produce this error. If you simply proceed now, the\par' that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your }' was purious, just type2' and it will go away.

Runaway argument? ! Paragraph ended before @firstoftwo was complete.

\par l.26 ...2000}{}{\censor{to be censored}}{Test}{}{}

I suspect you've forgotten a `}', causing me to apply this control equence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best.

1 Answer 1

2

You can use \protect before your command \censor to be able to compile the censored CV.

Please see this MWE

\documentclass[11pt, a4paper]{moderncv}

\moderncvtheme[orange]{classic} % [color]{stye}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{censor}

\usepackage{xpatch}
\xpatchcmd{\cventry}{.\strut}{\strut}{}{}

\name{firstname}{lastname}
\address{street}{postal code}
\email{e-mail}


\begin{document}

\makecvtitle

\section{Interests}
\cventry{Since 2000}{}{\protect\censor{to be censored}}{Test}{}{} % <=============

\end{document}

and its result:

resulting cv

You must log in to answer this question.

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