
我必須審查履歷中的敏感資訊。簡歷使用該moderncv
包。我決定使用該censor
包來黑化敏感資訊。當我嘗試審查 a 中的第三個參數時\cventry
,遇到錯誤:
! @@array 的使用與其定義不符。
氣象局
%!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}
錯誤日誌
! @@array 的使用與其定義不符。 @ifnextchar \reserved@d =#1\def \reserved@a {#2}\def \reserved@b {#3}\f... l.26 ...2000}{}{\censor{將審查}}{測試}{}{}
例如,如果您
\def\a1{...}', then you must always put
在“\a”後面加上“1”,因為控制序列名稱僅由字母組成。這裡的宏後面沒有跟隨所需的內容,所以我忽略它。! @firstoftwo 的參數有一個額外的 }。 \par l.26 ...2000}{}{\censor{待審查}}{測試}{}{}
我遇到了我剛剛插入的
}' that doesn't seem to match anything. For example,
\def\a#1{...}' 和\a}' would produce this error. If you simply proceed now, the
\par' 會導致我報告一個失控的參數,這可能是問題的根源。但如果你的}' was purious, just type
2' 它就會消失。逃跑的爭論? !該段落在@firstoftwo 完成之前就結束了。
\par l.26 ...2000}{}{\censor{待審查}}{測試}{}{}
我懷疑您忘記了“}”,導致我將此控制序列應用於太多文字。我們怎樣才能恢復?我的計劃是忘記整件事並抱持最好的希望。
答案1
您可以\protect
在命令之前使用\censor
,以便能夠編譯經過審查的簡歷。
請參閱此 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}
及其結果: