1

When we are using varwidth package and the below macro

\newcommand\MyCBox[1]{%
  \colorbox{red!60}{\begin{varwidth}{\dimexpr\linewidth-2\fboxsep}#1\end{varwidth}}}

While compiling we are getting the error as ! Undefined control sequence. \dimexpr

Please suggest me how to avoid this error.

closed as unclear what you're asking by Joseph Wright Aug 17 '13 at 8:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \dimexpr is an e-TeX command? This should not be a problem unless you are running a very old TeX distribution..? As always, a real minimal example (or here) would be helpful. – jon May 27 '13 at 6:17
  • Welcome to TeX.sx! Feel free to visit our TeX.SX starter guide to get the most out of the site. – Peter Jansson May 27 '13 at 6:30
  • With no MWE and no .log info, this is unclear. – Joseph Wright Aug 17 '13 at 8:18