3

How to go about getting the text to have minimal spacing to the outline of a tcolorbox:

enter image description here

I would like to know how to adjust this spacing shown in red. Thank you!

CODE

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage[table]{xcolor}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{amssymb,amsthm}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\advance\topmargin-1in
\advance\textheight3in
\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}

\begin{document}

\begin{multicols*}{3}

\newtcolorbox{mybox}[2][]{text width=0.97\textwidth,fontupper=\scriptsize,
fonttitle=\bfseries\sffamily\scriptsize, colbacktitle=black,enhanced,
attach boxed title to top left={yshift=-2mm,xshift=3mm},
boxed title style={sharp corners},top=3pt,bottom=2pt,
  title=#2,colback=white}

%%------------ AM: Double Sideband Large Carrier ---------------
\hspace*{0.07cm}
\begin{minipage}{0.30\textwidth}

    \begin{mybox}{AM: Double Sideband Large Carrier [DSB-LC\text{]}}
\lipsum[2]

    \end{mybox}
\end{minipage}

\end{multicols*}
\end{document}
3

One possibility is to adjust the left margin with the left=2pt parameter and the right margin with the right=2pt parameter.

What produces:

tcolorbox

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage[table]{xcolor}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{amssymb,amsthm}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\advance\topmargin-1in
\advance\textheight3in
\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}

\begin{document}

\begin{multicols*}{3}

\newtcolorbox{mybox}[2][]{text width=0.97\textwidth,fontupper=\scriptsize,
fonttitle=\bfseries\sffamily\scriptsize, colbacktitle=black,enhanced,
attach boxed title to top left={yshift=-2mm,xshift=3mm},
boxed title style={sharp corners},top=3pt,bottom=2pt,left=2pt,right=2pt,
  title=#2,colback=white}

%%------------ AM: Double Sideband Large Carrier ---------------
\hspace*{0.07cm}
\begin{minipage}{0.30\textwidth}

    \begin{mybox}{AM: Double Sideband Large Carrier [DSB-LC\text{]}}
\lipsum[2]

    \end{mybox}
\end{minipage}

\end{multicols*}
\end{document}
1

You can play with left andright`, like this:

\documentclass{article}
\usepackage[landscape]{geometry}
\usepackage[table]{xcolor}
\usepackage{mathtools}
\usepackage{multicol}
\usepackage{amssymb,amsthm}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}

\advance\topmargin-1in
\advance\textheight3in
\advance\textwidth3in
\advance\oddsidemargin-1.5in
\advance\evensidemargin-1.5in
\parindent0pt
\parskip2pt
\newcommand{\hr}{\centerline{\rule{3.5in}{1pt}}}

\begin{document}

\begin{multicols*}{3}

\newtcolorbox{mybox}[2][]{text width=0.97\textwidth,fontupper=\scriptsize,
fonttitle=\bfseries\sffamily\scriptsize, colbacktitle=black,enhanced,
attach boxed title to top left={yshift=-2mm,xshift=3mm},
boxed title style={sharp corners},top=3pt,bottom=2pt,
  title=#2,colback=white, left=4pt, right=2pt}

%%------------ AM: Double Sideband Large Carrier ---------------
\hspace*{0.07cm}
\begin{minipage}{0.30\textwidth}

    \begin{mybox}{AM: Double Sideband Large Carrier [DSB-LC\text{]}}
\lipsum[2]

    \end{mybox}
\end{minipage}

\end{multicols*}

\end{document} 

enter image description here

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.