2

For my book I'm using this code (I have 4 with similar aspect) to put the important definitions, notes, and other. Here there is my MWE:

\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[1]{colback=teal!10,coltitle=black,colframe=teal!30,fonttitle=\bfseries,title=#1, arc=0mm}
\usepackage{lipsum}

\begin{document}

\begin{mybox}{An example}
\lipsum[1]
\end{mybox}

\end{document}

and the output is:

enter image description here

I would like use the package pifont to put a general symbol as the picture below:

enter image description here

My problems are:

  1. Why is there a rounded corner if I have writen arc=0mm? I would like to have an edge and not a rounded edge;
  2. I would like the thickness not to be there at all or to be reduced to a very small line;
  3. How to insert the desired symbol from pifont package in a lateral position as shown in the second figure, in a dynamic position, that is to say that you can move it either downwards or upwards.
Sigur
  • 37,330
Sebastiano
  • 54,118
  • @JouleV Thank you very much for edit my question. Have you fix also my English (I hope)? :-) – Sebastiano Feb 19 '19 at 17:20
  • 2
    Hmm, I just edit the list formatting. I'm also not from an English-speaking country, so I would not do that ;-) –  Feb 19 '19 at 17:21
  • I think we have some questions about overlaying symbols on tcolorbox environments already. This must be a duplicate. There are also examples of such overlays etc, as well as there is a pretty explanation about the geometry options of tcolorbox in the manual. Reading the manual does not hurt! –  Feb 19 '19 at 18:17
  • @ChristianHupfer There is only an old question. You're right but my problem was adapted into my MWE my request. I have read, surely, the manual but I'm not very able to solve my question. – Sebastiano Feb 19 '19 at 21:04

2 Answers2

5
  1. arc=0pt. This option fixes corner's inner radius while outer arc remains untouched. Use sharp corners option to get inner and outer sharp corners.
  2. rules. Tcolorbox defines five rules around the box: toprule, bottomrule, leftrule, rightrule and titlerule (this one between title and upper part). You can fix each one with independence of others or all together with boxrule. To suppress of all them use boxrule=0pt
  3. Overlay symbol. You can use overlay options to add any symbol or figure with TikZ commands. It's conveninent to declare the box as enhanced to allow TikZ commands.

All together:

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

\newtcolorbox{mybox}[1]{%
    colback=teal!10,
    coltitle=black,
    colframe=teal!30,
    fonttitle=\bfseries,
    title=#1, 
    sharp corners,
    boxrule=0pt,
    enhanced,
    overlay={\node[font=\Huge, text=cyan!70!black] at ([yshift=-4mm]interior.north west) {\ding{228}};}
    }

\usepackage{lipsum}

\begin{document}

\begin{mybox}{An example}
\lipsum[1]
\end{mybox}

\end{document}

enter image description here

Ignasi
  • 136,588
3

Only answering the first question, because multiple questions in one post are not good:

The radius of the other corners is defined by outer arc, not arc

\documentclass{article}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox} [1]{
                colback=teal!10,
                coltitle=black,
                colframe=teal!30,
                fonttitle=\bfseries,
                title=#1, 
                arc=0mm, 
                outer arc=0mm
              }
\usepackage{lipsum}

\begin{document}

\begin{mybox}{An example}
\lipsum[1]
\end{mybox}

\end{document}

enter image description here