1

I want to create a block that looks like: enter image description here

I am unable to find the latex template for the same. Any ideas?

tachyon
  • 316

2 Answers2

8

tcolorbox package is the best option. The box is so minimalistic that can easly be done with TikZ.

\documentclass[10pt,a4paper]{article}
\usepackage{tikz}
\newcommand{\minimalisticBox}[2]{
\begin{figure}
\centering
\begin{tikzpicture}
\node[rounded corners,draw,line width=1.5pt,inner sep=5ex](MBoxForm){#2};
\node[anchor=west,fill=white] at (MBoxForm.155) {#1};
\end{tikzpicture}
\end{figure}
}%\minimalisticBox{title}{contents}
\begin{document}
\minimalisticBox{Scattering probability}{$f_{ij}=\frac{\alpha_S^2(Q^2)}{2}\log^2[\frac{r_{14}r_{23}}{r_{24}r_{13}}]$}
\end{document}

minimalistic box

vi pa
  • 3,394
  • Thanks @vi_pa, I have been trying to find something from the tcolorbox, but it seems confusing. – tachyon Nov 28 '19 at 10:15
  • I don't have used the tcolorbox package I've used only TikZ. – vi pa Nov 28 '19 at 10:37
  • \usepackage[most]{tcolorbox} \begin{document} \begin{tcolorbox}[enhanced,attach boxed title to top left={xshift=5mm,yshift=-3mm,yshifttext=-1mm}, colback=white!100!black,colframe=black,colbacktitle=white,coltitle=black,title=My title,fonttitle=\bfseries, boxed title style={size=small,colframe=white}] This box uses a \textit{boxed title}. The box of the title can be formatted independently from the main box. \end{tcolorbox} \end{document} – vi pa Nov 28 '19 at 10:49
3

A solution in tcolorbox:

\begin{tcolorbox}[enhanced,attach boxed title to top center={yshift=-3mm,yshifttext=-1mm},
colback=white!100!black,colframe=black,colbacktitle=white,coltitle=black,title=My title,fonttitle=\bfseries,boxed title style={size=small,colframe=white} ]This box uses a \textit{boxed title}. The box of the title can be formatted independently from the main box.\end{tcolorbox}

output

therefore for the box in question:

\documentclass[10pt,a4paper]{article}
\usepackage[most]{tcolorbox} 
\begin{document} 
\begin{tcolorbox}[enhanced,attach boxed title to top left={xshift=5mm,yshift=-3mm,yshifttext=-1mm}, colback=white,colframe=black,colbacktitle=white,coltitle=black,title={\LARGE Scattering probability},halign=flush center,fonttitle=\bfseries, boxed title style={size=small,colframe=white}] 
$f_{ij}=\frac{\alpha_S^2(Q^2)}{2}\log^2[\frac{r_{14}r_{23}}{r_{24}r_{13}}]$ 
\end{tcolorbox} 
\end{document}

enter image description here

vi pa
  • 3,394
tachyon
  • 316