1
\documentclass[a4paper,12pt]{article}

\usepackage[english]{babel}
\usepackage{scalerel}
\usepackage{stackengine}
\usepackage{xcolor}
\usepackage{scalerel}
\usepackage{tcolorbox}


\usepackage{amscd}
\usepackage[all,cmtip]{xy}
\usepackage{calrsfs}

\usepackage[all]{xy}
\textheight=22.75truecm \textwidth=17cm \evensidemargin=-0.5cm
\oddsidemargin=-0.5cm \voffset-1.5cm

\pagestyle{headings}
\def\Spec{{\mathrm{Spec}\,}}
\def\Hom{{\mathrm{Hom}}}
\def\bHom{{\mathbf{Hom}}}
\def\bAut{{\mathbf{Aut}}}
\def\End{{\mathrm{End}}}
\def\Ext{{\mathrm{Ext}^1}}
\def\FEt{{\mathrm{FEt}}}
\def\Sets{{\mathrm{Sets}}}



\newenvironment{pf}
{\begin{proof}}
{ \end{proof}}

\newenvironment{function}
{\begin{center}
\begin{tabular}{rl}}
{\end{tabular}
\end{center}}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

 \begin{document}
\begin{tcolorbox}[colback=white!5!white,colframe=white!50!black,  colbacktitle=white!75!black]
 \begin{flushleft}
  \textbf{\underline{How can we test whether a given set of polynomials $G$ is a Gröbner basis or not?}}
  \end{flushleft}

   \end{tcolorbox}
   \end{document}

How do I fix this ? My writing is going outside the t-color box.

imnothere
  • 14,215
smita
  • 113
  • 1
    This seems to not be the fault of the tcolorbox, but of the underline. You can find an explanation for this here or in the TeX FAQ for example. – epR8GaYuh Jul 08 '21 at 05:48
  • Yeah I fixed it . – smita Jul 08 '21 at 05:55
  • @smita Off-topic: do you know tcolorbox has options for flush left the text halign=flush left? – CarLaTeX Jul 08 '21 at 05:58
  • @CarLaTex No. I also want a breakable t-color box , something that is there continuing in 2 pages.How do i do that? – smita Jul 08 '21 at 06:04
  • I wanted to write paragraphs inside the t-color boxes? Will "halign=flush" left help me ? – smita Jul 08 '21 at 06:06
  • @smita Zarko already answered for the breakable tcolorbox. For the paragraphs there is no problem, usually, please ask another question with an example of what you are not able to get. – CarLaTeX Jul 08 '21 at 06:22

1 Answers1

2
  • Instead of \underline try tu use \ul defined in the package soul.
  • for breakable box you need to load breakable library:
\documentclass[a4paper,12pt]{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable} % <---
\usepackage{soul}

\begin{document} \begin{tcolorbox}[colback=white!5!white,colframe=white!50!black, colbacktitle=white!75!black, fontupper=\bfseries, halign=left, breakable ] \ul{How can we test whether a given set of polynomials $G$ is a Gröbner basis or not?} \end{tcolorbox} \end{document}

enter image description here

Edit: In the case that you prefer to use the ulem package, than in code you need to replace \ul with \uline:

\documentclass[a4paper,12pt]{article}
\usepackage{tcolorbox}
\tcbuselibrary{breakable}
\usepackage{ulem}

\begin{document} \begin{tcolorbox}[colback=white!5!white,colframe=white!50!black, colbacktitle=white!75!black, fontupper=\bfseries, halign=left, breakable ] \uline{How can we test whether a given set of polynomials $G$ is a Gröbner basis or not?} \end{tcolorbox} \end{document}

Result is the same as before. The both MWE are compiled by XeLaTeX engine.

Zarko
  • 296,517
  • Thank you for the answer I used the ulem package and it is working now – smita Jul 08 '21 at 06:07
  • For breakable box, one also need to explicitly use the breakable option. – muzimuzhi Z Jul 09 '21 at 22:35
  • @muzimuzhiZ, you are right. Adding this library is not sufficient, you also need to ad it to box definition. I will correct answer ASAP. – Zarko Jul 09 '21 at 22:42
  • @Zarko A standalone \tcbset{breakable} works as well, if user wants every box to be breakable. – muzimuzhi Z Jul 09 '21 at 23:59
  • @muzimuzhiZ, you are right again, however, I do not know, if OP like that all tcolorboxes are breakable. If yes, your suggestion is right way to go. – Zarko Jul 10 '21 at 00:18