[Tex/LaTex] tcolorbox little adjustment: how to shift the text inside, the box and the title

tcolorbox

I need to do something: either I want to shift a box on the right in tcolorbox or just shift the title and the text inside it.

I found those formulas:

/tcb/lefttitle=〈length〉

/tcb/leftupper=〈length〉

but I don't know how to make them work.

The fact is it has to be set in the config .tex and not only on box. But how to do this?

Here is, for now, the configuration of the boxes.

\tcbset{
    thmbox/.style={
        enhanced,
        breakable,
        sharp corners=all,
        fonttitle=\bfseries\normalsize,
        fontupper=\normalsize\itshape,
         top=0mm,
         bottom=0mm,
         right=0mm,
        colframe=white,
        colbacktitle=white,
        before={\vspace{0.1cm}}, 
        after={\vspace{0.25cm}},
        attach boxed title to top left,
        boxed title style={empty, size=minimal, bottom=1.5mm}
        }

(this isn't the whole box but I don't know what to share you… so here is the style which I think is sufficient)

So to complete my question here is a picture :enter image description here

You see here the box in yellow is a little bit set on the right. That would be what I want. The title would stay on the top left corner but the whole box would move a little bit.

A question I have is, will it generate troubles? sometimes when my formulas are too long it goes outside the page on the right…

And finally here I discovered that it is also possible to write the title in a bubble on the left, how do you do this?

Sorry if the question changed a little bit of direction here…

Best Answer

I suggest to you two solutions, but the second is a workaround (I used the colors yellow and blue to make the title more evident, but, of course, you can easily change them).

For the formulae which go outside the margin, it's not a problem of the box, please ask a new question with a complete minimal working example (MWE) for that problem.

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

\tcbset{
    thmbox/.style={
        enhanced,
        breakable,
        sharp corners=all,
        fonttitle=\bfseries\normalsize,
        fontupper=\normalsize\itshape,
        toprule=0pt,
        bottomrule=0pt,
        leftrule=0pt,
        rightrule=0pt,
        colframe=white,
        colbacktitle=yellow,
        coltitle=blue,
        left skip={.15\linewidth},
        attach boxed title to top left,
        boxed title style={
            sharp corners=all,
            leftrule=0pt,
            rightrule=0pt,
            bottomrule=0pt,
            boxsep=0pt,
            top=4pt,
            bottom=4pt,
        }
    }
}

\begin{document}
    Some text.
    \begin{tcolorbox}[thmbox,title={Box title}]
        Box with a top left positioned title.
        Shifting a box is not a problem, you can use 
        \verb|left skip={|\textit{lenght}\verb|}|.
        This solution gives no problem.
    \end{tcolorbox}
    Some text.
    \begin{tcolorbox}[thmbox,title={Box\\ title}, 
        attach boxed title to top left={xshift=-.15\linewidth,yshift=-.11\linewidth},
        minipage boxed title=.1\linewidth]
        Positioning the title at the left is more problematic.
        You can use \verb|xshift/yshift|, but this require to adjust the
        \verb|yshift| according to the box height. 
    \end{tcolorbox}
    Some text.
\end{document}

enter image description here