5

I am trying to get a very specific border going. Using \tcolorbox, I'm now close, but have some problems. Specifically:

  • There is a shadow that I want to remove
  • For some reason the text is gray, not black

Reading through the manual I know there is a "no shadow" option, but lacking any example I am unable to put it to use. In the MWE below I have tried adding "no shadow" to the list of options but I get this error:

! Package pgfkeys Error: I do not know the key /tcb/noshadow and I am going to ignore it. Perhaps you misspelled it.

Just to clarify, I do NOT want a border/shadow on the bottom or right hand side. I do want a (very wide) border on the left and a normal border on the top.

Here is the MWE:

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}

\newtcolorbox{topbot}[1][]{leftrule=5pt, toprule=.5pt, rightrule=0pt, bottomrule=0pt, colback=white, notitle, sharp corners, #1}

\begin{document}

\begin{topbot}
\subsection*{This is the title}
\end{topbot}
\lipsum[2]

\end{document}

Here is a zoomed in screenshot that shows the color problem and the shadow at the bottom of the box:

zoomed in image

Here is another screenshot of the solution proposed by AboAmmar:

still a shadow

3
  • Did you try \newtcolorbox{topbot}[1][]{leftrule=5pt, toprule=.5pt, rightrule=-0.1pt, bottomrule=-0.1pt, colback=white, notitle, sharp corners, #1}
    – Ubiquitous
    Nov 29 '16 at 16:24
  • @Ubiquitous still the same
    – User402841
    Nov 29 '16 at 16:37
  • For no shadow try with \newtcolorbox{topbot}[1][]{enhanced, no shadow, left..... And load the package with \usepackage[most]{tcolorbox}.
    – Ignasi
    Nov 29 '16 at 20:51
3

I don't see any phantom rules, but this could be an alternative solution. It uses an empty skin which doesn't draw any frame or background but keeps all margins. After that two borderlines can be used to draw the desired frame.

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\newtcolorbox{topbot}[1][]{empty, notitle, sharp corners, borderline north={1pt}{0pt}{black},
borderline west={5pt}{0pt}{black},
#1}

\begin{document}

\begin{topbot}
\subsection*{This is the title}
\lipsum[2]
\end{topbot}
\lipsum[2]

\end{document}

enter image description here

0
4

There is no shadow, it is that leftrule that you have specified 5pt in width.

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{lipsum}

\newtcolorbox{topbot}[1][]{leftrule=5pt, toprule=.5pt, rightrule=0pt, bottomrule=0pt, colback=white, notitle, sharp corners, #1}

\begin{document}

\begin{topbot}
\subsection*{This is the title}
\end{topbot}
\lipsum[2]

\end{document}

enter image description here

9
  • Sorry, this still gives a border for me. See updated question.
    – User402841
    Nov 29 '16 at 17:01
  • Also, I do want the wide border on the left. I just don't want any border or shadow on the bottom or right hand side.
    – User402841
    Nov 29 '16 at 17:03
  • I just tried your code. There is definitively no shadow. What LaTeX engine do you use? Nov 29 '16 at 17:09
  • 1
    The tiny rule that you sometimes see is merely a viewer issue. The PDF viewer at some values of zoom makes that line visible, but this is not found in print.
    – AboAmmar
    Nov 29 '16 at 17:21
  • @AboAmmar. This is surprising. I can't see a reason why the viewer would show a line which does not exist at all. Mine does not show any line at any zoom level. I suspect that the code which produces the picture above is not excatly the one given in the mwe. Nov 29 '16 at 17:34

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.