0

How can I add an macro "Loi giai" which is bold and center below this tcolorbox and add contents after it (if needed).

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[most]{tcolorbox}
\begin{tcolorbox}[colframe=blue,colback=white]
\end{tcolorbox}

\begin{document}
\begin{vd}%[2D1B1]
    Đề bài
    \loigiai{
        lời giải
    }
\end{vd}
\end{document}
1

You can make use of the before lower option and use \tcblower to create an upper and a lower part in your box. tcolorbox allows you to customise how the upper and lower boxes look, including the line between them (see §4.4 of the manual).

\documentclass{article}
\usepackage[utf8]{vietnam}
\usepackage{tcolorbox}

\newtcolorbox{qa}{%
  colframe=blue, colback=white,
  before lower=\begin{center}\textbf{\textcolor{blue}{lời giải}}\end{center}
}

\begin{document}
\begin{qa}
  Đề bài
  \tcblower
  lời giải
\end{qa}
\end{document}

MWE output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.