0

I am quite not sure how to create something like this: text across a line border on latex.

enter image description here

Edit1:

\begin{tcolorbox}[enhanced,title=My title,
attach boxed title to top center={yshift*=-3mm},
boxed title style={size=small,colback=lightblue}]
This is a \textbf{tcolorbox}.
\end{tcolorbox}

Output of Edit1 code: enter image description here

4
  • Welcome! There are quite a few possibilities such as \marginpar and/or a TikZ overlay picture. To produce this very output I recommend looking at section 6 Side by Side of the tcolorbox manual. This makes it rather straightforward to produce examples of this sort.
    – user194703
    Commented Feb 22, 2020 at 1:26
  • Thanks, I have figured it somewhat. I would like to know how to remove the rectangular shape from the background and also make the background white instead of grey.
    – Born2Code
    Commented Feb 22, 2020 at 1:47
  • If you post a specific code that comprises a minimal compilable example it will be much easier to provide you with a specific answer.
    – user194703
    Commented Feb 22, 2020 at 1:48
  • Oh yeah. I have appended it to my question.
    – Born2Code
    Commented Feb 22, 2020 at 1:50

1 Answer 1

1

Welcome! We usually communicate by posting fully compilable examples like

\documentclass{article}
\usepackage[skins]{tcolorbox}
\definecolor{lightblue}{RGB}{80,142,209}
\begin{document}
\begin{tcolorbox}[enhanced,title=My title,coltitle=cyan,
attach boxed title to top center={yshift*=-3mm},colback=white,
colframe=cyan,
boxed title style={size=small,colback=white,colframe=white}]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{document}

enter image description here

1
  • My bad. I am quite new here. Apologies. Thanks.
    – Born2Code
    Commented Feb 22, 2020 at 2:04

You must log in to answer this question.

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