0

I'm writing teaching materials and in my materials I want to include some optional paragraphs which go deeper into certain subjects. To easily tell them apart, I would like them to have a special layout, as in the picture below.

enter image description here

I want my environment to automatically indent my text and place a vertical blue bar left of it. Next to the bar (where the bold S is located in my example) I want to include a symbol (a picture of a magnifying glass), to make it clear that this is an optional piece.

I'm not that experienced with LaTeX and have spent a few hours looking through StackExchange for help, but unfortunately to no avail. Can you help me please? Thanks in advance!

Edit: I know how to make a vertical left line, but I can't find out how to automatically add the symbol to the environment. I don't want to add the symbol manually each time.

4
  • Welcome to TeX.SE!
    – Mensch
    Oct 21, 2021 at 9:56
  • Not entirely: I would like to have this symbol on the top left automatically placed when using the environment. I'll be using it multiple times and it's not really efficient to place the symbol in the environment manually every time.
    – MVH
    Oct 21, 2021 at 10:47
  • Do you mean, place the symbol as part of the environment definition (\usepackage{fontspec}\newfontface\fmag{Noto Sans Symbols2}[Scale=2,Colour=blue] \newenvironment{magpar} { \begin{tcolorbox}[breakable, enhanced,colback=yellow!10!white,boxrule=0pt,frame hidden,borderline west={1mm}{-2mm}{black}] { \fmag 🔍 } } { \end{tcolorbox} }? Or as part of the drawn line?
    – Cicada
    Oct 21, 2021 at 13:28
  • Yeah, I would like to place the symbol as part of the environment definition (and not as part of the drawn line). However, I can't get the fontspec package to work - it won't stop giving errors, even after I switched to LuaTeX or XeTex. Is there a way to work around this?
    – MVH
    Oct 21, 2021 at 15:13

1 Answer 1

1

You can define your own tcolorbox:

\documentclass{article}
\usepackage{mwe}% <--- for texting purpose only
\usepackage{bclogo}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}{
    breakable,
    enhanced,
    before skip=10pt,
    after skip=10pt,
    borderline west={4pt}{0pt}{blue},
    boxrule=0pt,
    boxsep=0pt,
    frame hidden,
    opacityback=0,
    left=30pt,%
    right=0pt,%
    overlay={
        \node[anchor=north west,inner xsep=7pt]     at (frame.north west) 
            {\bcloupe};
    }
}

\begin{document}
Normal text 
\blindtext% <--- for texting purpose only
\begin{mybox}
    Some special explanation
    \blindtext% <--- for texting purpose only
\end{mybox}
Normal text
\blindtext% <--- for texting purpose only
\end{document}

enter image description here

You must log in to answer this question.

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