1

Here are two examples of the formatting I'm trying to recreate:

enter image description here enter image description here

I'm trying to recreate this style as closely as possible (including the slight shadow), but I don't know the font. I'd also like the code to fit/clip the image so I don't have to exactly resize them for each one.

0

1 Answer 1

5

Here is a version that clips the image.

\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\newtcolorbox{imagebox}[3][]{enhanced,coltitle=black,
title filled=false,
sharp corners,colback=gray!20,colbacktitle=gray!20,
boxrule=0.4pt,top=2mm,bottom=2mm,toptitle=2mm,left=1mm,right=1mm,
leftrule=2cm,drop fuzzy midday shadow,
titlerule=-0.1pt,
fonttitle=\sffamily\large,fontupper=\sffamily,
title={#2},
overlay={ 
\begin{tcbclipframe}
\clip (frame.north west) rectangle ([xshift=2cm]frame.south west);
\node at ([xshift=1cm]frame.west) 
    {\includegraphics[width=0.5\textwidth]{#3}}; 
\end{tcbclipframe}                                                                                  
}}
\begin{document}
\begin{imagebox}{some title}{example-image-duck}
blah blah blah blah blah blah blah blah blah blah blah blah 
\end{imagebox}
\end{document}

enter image description here

4
  • I just replaced the image path, and it's giving me an error: test.tex (line 1366) LaTeX Error: Cannot determine size of graphic in inf.jpg (no BoundingBox). (\end{imagebox} ...)
    – M.R.
    Oct 22, 2018 at 21:51
  • Does this solution only work with certain types of image files?
    – M.R.
    Oct 22, 2018 at 21:54
  • Nevermind got it working - somtimes in TexPad you need to open a new editor window to get things to work.
    – M.R.
    Oct 22, 2018 at 21:59
  • @M.R. Yes, this solution works as long \includegraphics works.
    – user121799
    Oct 22, 2018 at 22:00

You must log in to answer this question.

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