3

In the following MWE, the second number in the enumerated list, namely 2., is moved inwards. This is clearly caused by use of the \surroundwithmdframed command. Is there some way to fix this while still using the \surroundwithmdframed command in the same way?

\documentclass[12pt]{article}
\usepackage{mdframed}
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage[vskip=10in]{quoting}
\surroundwithmdframed[linewidth=2pt]{quoting}

\begin{document}
  \begin{enumerate}
  \item An item.
  \item
    \begin{quoting}
      The \verb|\surroundwithmdframed| option moves the item number inwards.
    \end{quoting}
  \item Another item.
  \end{enumerate}
\end{document}
  • You can do the same with \item \mbox{}\par\vspace{-4\itemsep} \begin{quoting}... – user11232 May 18 '16 at 1:39
2

No mdframed based solution, but using tcolorbox and an automatic \mbox{} and some vertical upshift.

The \tcolorboxenvironment is basically the same what \surroundwithmdframed does.

\documentclass[12pt]{article}
%\usepackage{mdframed}
%\usepackage{enumitem}
\usepackage[most]{tcolorbox}
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage[vskip=10in]{quoting}
% \surroundwithmdframed[linewidth=2pt]{quoting}
\tcolorboxenvironment{quoting}{code={\mbox{}},nobeforeafter,before skip=-2\itemsep,boxrule=2pt,sharp corners,colback=white}

\begin{document}
  \begin{enumerate}
  \item An item.
  \item 
    \begin{quoting}
      The \verb|\surroundwithmdframed| option moves the item number inwards.
    \end{quoting}
  \item Another item.
  \end{enumerate}
\end{document}

enter image description here

  • Thanks for the alternative suggestion, Christian. Can I skip the grayed out interior? It doesn't survive scanning and reprinting the scans very well. – Faheem Mitha May 17 '16 at 17:14
  • @FaheemMitha: I assume you prefer white background then? Add colback=white to the option list, e.g. after sharp corners – user31729 May 17 '16 at 17:33
  • Yes, white background. Sorry, should have specified. Thanks. – Faheem Mitha May 17 '16 at 17:54
  • @FaheemMitha: No problem. – user31729 May 17 '16 at 17:56
  • Hi Christian, one issue with your alternative with your approach (which isn't an issue with mdframed), is that the boxes won't break across pages. This is a problem. Any ideas? – Faheem Mitha May 17 '16 at 20:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.