5

I'm trying this:

\documentclass{article}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}[boxrule=0pt,frame hidden]
Hello, world!
\end{tcolorbox}
\end{document}

But still, can see a thin frame around it.

yegor256
  • 12,021
  • 3
    you code doesn't compile. you are missing the skins library. Beside this: \begin{tcolorbox}[enhanced,boxrule=0pt,frame hidden] should work. – Ulrike Fischer Sep 24 '21 at 11:08

2 Answers2

6

What Ulrike suggested (add enhanced option and skins library) is the best solution.

Alternatively, you could try with frame empty, without any library.

\documentclass{article}
\usepackage{tcolorbox}
\begin{document}
\begin{tcolorbox}[boxrule=0pt, frame empty]
Hello, world!
\end{tcolorbox}
\end{document}

Or with opacityframe=0, skins library is needed here:

\documentclass{article}
\usepackage[skins]{tcolorbox}
\begin{document}
\begin{tcolorbox}[boxrule=0pt, opacityframe=0]
Hello, world!
\end{tcolorbox}
\end{document}

In both cases, the result is:

enter image description here

CarLaTeX
  • 62,716
0

Full customized box: enter image description here

\documentclass{book}
\usepackage[english]{babel} %
\usepackage{graphicx} %
\usepackage{xcolor}
\usepackage{pgfkeys}
\usepackage{tcolorbox}

% \setlength{\unitlength}{1mm} %

\definecolor{DarkRed}{rgb}{0.45,0.00,0.00} \definecolor{LightGrey}{rgb}{0.96,0.96,0.96}

% define the options \pgfkeys{% /mybox/.is family, /mybox/.cd, background color/.code={\colorlet{bgcolor}{#1}}, frame color/.code={\colorlet{framecolor}{#1}}, frame sep/.code={\setlength{\fboxsep}{#1}}, frame width/.code={\setlength{\fboxrule}{#1}}, % initialize colors background color=white, frame color=black } % universal box \newcommand{\mybox}[2][]{% \begingroup \pgfkeys{mybox,#1}% \fcolorbox{framecolor}{bgcolor}{#2}% \endgroup } \newcommand{\redbox}[1]{% \mybox[frame width=0.75pt, frame sep=4.8pt, frame color=white, background color=red!40]{#1}}

\begin{document}

\noindent \redbox{Some ordinary text $+\hspace{1.2pt}x^{\hspace{0.6pt}2}$} \end{document}

WinnieNotThePooh
  • 3,008
  • 1
  • 7
  • 14