Graphics, Figures & TablesBox with Title

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Box with Title

Post by Stefan Kottwitz »

Hi Kostao!

You have an older version of the tcolorbox package on your computer. Perhaps your whole TeX installation is not up to date. Update at least tcolorbox. Do you have MiKTeX or TeX Live? I would update that too.

Stefan
LaTeX.org admin

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

I try to update TexLive sudo apt-get install texlive-full, but texlive-full is already the newest version.
How can I update tcolorbox package (Linux Mint 17.2)?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Box with Title

Post by Stefan Kottwitz »

It seems that Mint doesn't provide the newest TeX version.

You could download tcolorbox from CTAN and put it into the TeX tree or just in your document folder.

Or uninstall the Mint TeX and install the original TeX Live via the Internet.

Stefan
LaTeX.org admin
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

Ok, all works, thanks.
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

How I can reduce this size?
box.jpg
box.jpg (62.22 KiB) Viewed 6944 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Box with Title

Post by Stefan Kottwitz »

You could insert size=small here in your \newtcolorbox definition. Is this ok you do you need to adjust it in more detail?

boxed title style={size=small, frame code={...

Stefan

PS: you can post attachments here, such as images. So I took the image from hostingkartinok.com and made it an attachment to your post. External image hosters are not reliable.
LaTeX.org admin
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

I need big letter size and small intervals as shown in previous post.
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

And other question, how do boxes in box (see image)?
Attachments
delete.jpg
delete.jpg (52.71 KiB) Viewed 6930 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Box with Title

Post by Stefan Kottwitz »

You could use classic \parbox commands or minipage environments, possibly together with \fbox or other line commands.

Or use tabular or tabularx. Or take TikZ, such as with a TikZ matrix of nodes and drawing lines there, or with nodes and the fitting library.

Stefan
LaTeX.org admin
kostao
Posts: 16
Joined: Tue Jan 10, 2017 8:48 pm

Box with Title

Post by kostao »

How make rounded corners and dotted lines?

Code: Select all

\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{varwidth}
\usepackage{lipsum}
 
\newtcolorbox
{mybox}[2][]{enhanced,
before skip=2mm,after skip=2mm,
colback=black!5,colframe=black!50,boxrule=0.2mm,
attach boxed title to top left={xshift=1cm,yshift*=1mm-
\tcboxedtitleheight
},
varwidth boxed title*=-3cm,
boxed title style={frame code={
\path[fill=tcbcol@back!30!black]
([yshift=-1mm,xshift=-1mm]frame.north west)
arc[start angle=0,end angle=180,radius=1mm]
([yshift=-1mm,xshift=1mm]frame.north east)
arc[start angle=180,end angle=0,radius=1mm];
\path[left color=tcbcol@back!60!black,right color=tcbcol@back!60!black,
middle color=tcbcol@back!80!black]
([xshift=-2mm]frame.north west) -- ([xshift=2mm]frame.north east)
[rounded corners=1mm]-- ([xshift=1mm,yshift=-1mm]frame.north east)
-- (frame.south east) -- (frame.south west)
-- ([xshift=-1mm,yshift=-1mm]frame.north west)
[sharp corners]-- cycle;
},interior engine=empty,
},
fonttitle=\bfseries,
title={#2},#1}
 
\begin{document}
\begin{mybox}[colbacktitle=green]{My title}
              % t b c - parbox [] param
\parbox[]{7cm}{
				\fbox{
                		\parbox[]{6.5cm}{Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 }
                     }
                \fbox{
                		\parbox[]{6.5cm}{Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 }
                     }
			  }
\parbox[]{4cm}{
				\fbox{
                		\parbox[]{3.5cm}{Some text 3 Some text 3 Some text 3 Some text 3  }
                     }
                \fbox{
                		\parbox[]{3.5cm}{Some text 4 Some text 4 Some text 4 Some text 4 Some text 4 Some text 4 Some text 4 Some text 4}
                     }
              }
\end{mybox}


\begin{mybox}[colbacktitle=red]{My title}
\fbox{
               % t b c - parbox [] param
		\parbox[]{4cm}{Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some 			text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1 Some text 1}
}
\fbox{
		\parbox[]{6cm}{Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2 Some text 2}
}
\fbox{
		\parbox[]{7cm}{Some text 3 }
}
\fbox{
		\parbox[]{3cm}{Some text 4 }
}
\end{mybox}
\end{document}
Post Reply