4

How to set box title as rounded corners using tcolorbox, please find my MWE file below:

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

\makeatletter

\definecolor{algborder}{cmyk}{0.85,0.38,0,0}
\definecolor{algtitlebgcolor}{cmyk}{0.33,0.16,0,0}
\definecolor{algbgcolor}{cmyk}{0.09,0.06,0,0}


\newenvironment{boxone}[1][]{
\begin{tcolorbox}[enhanced,
breakable,rounded corners=southeast,%%
titlerule=1pt,toptitle=6pt,bottomtitle=7pt,
title=#1,%titlerule style={algborder,line width=1pt,arc=8pt},
coltitle=black,colbacktitle=algtitlebgcolor,
boxed title style={arc=8pt,outer arc=20pt,boxrule=0.5pt,boxsep=0pt,top=6pt,left=6pt,right=6pt,bottom=6pt,},
before skip=10pt,boxrule=1pt,boxsep=0pt,left=12pt,right=12pt,top=6.5pt,bottom=12pt,arc=8pt, %%
colframe=algborder,colback=algbgcolor,%
]}{\end{tcolorbox}}


\makeatother


\begin{document}
\begin{boxone}[Box Title: There exist two main approaches to optimal
control [36] and dynamic games and dynamic gamesand dynamic games ]
There exist two main approaches to optimal
control [36] and dynamic games: the calculus of variations
(making use of the maximum principle) and
dynamic programming (making use of the principle of optimality) [37], [38]. In this section, it is shown how to
use RL, which is basically an approximate dynamic programing
approach, to solve different multiplayer games
arising from the regulation of dynamical systems. RL
allows optimal solutions to be learned using measured
data online and without requiring complete knowledge
of the system dynamics.
\end{boxone}
\end{document}

enter image description here

1 Answer 1

7

Welcome! There are issues with too many [ and ] such that the parser does not know what is what. So you need to add braces to help the parser. And I recommend using \newtcolorbox, and to make use of attach boxed title to top. (Of course I hope you do not really use [36] in a real document but rather use \cite along with bibtex or some similar tool.)

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

\definecolor{algborder}{cmyk}{0.85,0.38,0,0} 
\definecolor{algtitlebgcolor}{cmyk}{0.33,0.16,0,0} 
\definecolor{algbgcolor}{cmyk}{0.09,0.06,0,0}

\newtcolorbox{boxone}[1][]{enhanced, breakable,rounded corners=southeast,%% 
toptitle=6pt,bottomtitle=7pt,title=#1,
attach boxed title to top,
          boxed title style={colframe=algborder,rounded corners},
titlerule style={algborder,line width=1pt,rounded corners=8pt}, 
coltitle=black,colbacktitle=algtitlebgcolor, 
before skip=10pt,boxrule=1pt,boxsep=0pt,left=12pt,right=12pt,top=6.5pt,
bottom=12pt,arc=8pt, %% colframe=algborder,colback=algbgcolor,% 
}


\begin{document} 
\begin{boxone}[{{Box Title: There exist two main approaches to optimal control
[36] and dynamic games and dynamic gamesand dynamic games }}]
 There exist two main
approaches to optimal control [36] and dynamic games: the calculus of variations
(making use of the maximum principle) and dynamic programming (making use of the
principle of optimality) [37], [38]. In this section, it is shown how to use RL,
which is basically an approximate dynamic programing approach, to solve
different multiplayer games arising from the regulation of dynamical systems. RL
allows optimal solutions to be learned using measured data online and without
requiring complete knowledge of the system dynamics. 
\end{boxone} 
\end{document}

enter image description here

1
  • Thank you for your comments, this is we want exact output.
    – Balaji K
    Commented Oct 4, 2019 at 6:58

You must log in to answer this question.

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