23 votes
Accepted

Boxes for SMS Conversation

Here's one option using tcolorbox: The code: \documentclass{article} \usepackage[many]{tcolorbox} \usetikzlibrary{shadows} \definecolor{mybluei}{RGB}{66,134,218} \definecolor{mygray}{RGB}{213,216,...
Gonzalo Medina's user avatar
20 votes
Accepted

Inspired beautiful box from Indesign

Here's one way to do it with Tikz. I only tested it with regular text, but being a node, it should work with other graphic elements as well. Edit: I have applied a fix for your equation (and possible ...
Alenanno's user avatar
  • 37.1k
16 votes
Accepted

mdframed and skipbelow

The fix was indeed applied, but the new version has never been pulled. \documentclass[11pt]{article} \usepackage[framemethod=TikZ]{mdframed} \usepackage{xpatch} \makeatletter \xpatchcmd{\endmdframed}...
egreg's user avatar
  • 1.1m
16 votes
Accepted

Color box with rounded corners

tcolorbox, with use in math environment(s): \documentclass[dvipsnames]{article} \usepackage[most]{tcolorbox} \colorlet{LightLavender}{Lavender!40!} \tcbset{on line, boxsep=4pt, left=0pt,right=...
Zarko's user avatar
  • 289k
14 votes

Inspired beautiful box from Indesign

Following code shows how to define these boxes with tcolorbox instead of TiKZ (like in Alenanno's solution). This way boxes can break between pages. \documentclass[a4paper]{article} \usepackage{...
Ignasi's user avatar
  • 135k
12 votes
Accepted

How do I add a colored box around my theorems?

Use tcolorbox: \documentclass{article} \usepackage{tcolorbox} \usepackage{amssymb} \tcbuselibrary{theorems} \newtcbtheorem []% init options {definition}% name {Definition}% title {% ...
Henri Menke's user avatar
10 votes
Accepted

How to remove vertical spacing below mdframed boxes?

Setting skipabove and skipbelow to 0pt globaly with the \mdfsetup command does the trick (mdframed version 1.9b). \documentclass[a4paper,8pt]{article} \usepackage{mdframed} \mdfsetup{skipabove=0pt,...
Alain Remillard's user avatar
10 votes

Inspired beautiful box from Indesign

Box with Tikz \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[x11names,usenames,dvipsnames,svgnames,table]{xcolor} \usepackage{tikz} \...
sayyidd25's user avatar
  • 156
9 votes

Tight box around text using mdframed

You can use the mdframed options align=center,userdefinedwidth=.... \documentclass{article} \usepackage{mdframed,lipsum} \begin{document} \mdfdefinestyle{MyFrame}{% linecolor=black, ...
gernot's user avatar
  • 48.3k
9 votes
Accepted

Draw box for text

I have tried getting something from where you can work from, using tcolorbox. Of course, I haven't matched your fonts... but that shouldn't be difficult \documentclass[10pt]{article} \usepackage{...
Alex Recuenco's user avatar
9 votes
Accepted

How to reproduce some attractive pseudo-code

You could try something entirely different. article (report, or book) document classes \documentclass{article} \usepackage{minted} \usepackage[many]{tcolorbox} \tcbuselibrary{skins} \tcbset{ arc=...
phil-elkabat's user avatar
  • 1,925
8 votes

Alignment of environment inside enumeration

You can control the desired spacing with leftmargin=-3pt, innerleftmargin=3pt, innerrightmargin=0pt, Code: \documentclass{scrartcl} \usepackage{blindtext} \usepackage{showframe} \usepackage{...
Peter Grill's user avatar
8 votes

How to make a twocolumn breakable colored environment in book template

tcolorbox can be used inside a multicols environment and boxes will break accordingly. But a multicol environment can only be used inside non breakable tcolorboxes. But with magazine and raster ...
Ignasi's user avatar
  • 135k
8 votes

How can I insert a background image in mdframed

I would drop mdframed. With tcolorbox it is much easier to insert such a background image: \documentclass{article} \usepackage{graphicx,tikz} \usepackage{lipsum} \usepackage[many]{tcolorbox} \begin{...
Ulrike Fischer's user avatar
7 votes
Accepted

Make nested boxes have a darker background color

You could define the fill transparency. You have to switch of the background of the frame for this. % arara: pdflatex \documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} ...
LaRiFaRi's user avatar
  • 43.5k
7 votes
Accepted

Modified proof environment

My impression is that the issue arises when a proof ends too near to the end of a page, so mdframed tries to break it. The tcolorbox package seems more robust under this respect. \documentclass{...
egreg's user avatar
  • 1.1m
7 votes
Accepted

Getting a partially framed mdframed

Here's a tcolorbox version. Just adjust the 2cm to your liking. \documentclass{article} \usepackage[skins]{tcolorbox} \newtcolorbox{mybox}{enhanced,sharp corners=all,colback=white,colframe=gray,...
TeXnician's user avatar
  • 33.3k
7 votes
Accepted

Environment to change background color of a portion of the page, vertically defined by the height of the contents of the environment?

You can try simulating it with a tcolorbox environment instead -- it offers more options for customization instead of mdframed. It's especially useful for surrounding the list item with a box/...
Troy's user avatar
  • 13.7k
6 votes

How to make a twocolumn breakable colored environment in book template

\twocolumn inside a box doesn't make sense. But outside it works fine with tcolorbox. You can also use multicols inside a tcolorbox but only if this is not breakable. If you want a frame around both ...
Ulrike Fischer's user avatar
6 votes
Accepted

create new environment with mdframed and listing

You have to use \lstnewenvironment: \documentclass{scrreprt} \usepackage{listings} \usepackage[framemethod=TikZ]{mdframed} \lstnewenvironment{lst}[2] {% \mdframed[roundcorner=5pt]% \lstset{ ...
egreg's user avatar
  • 1.1m
6 votes
Accepted

mdframed minted on several pages: LaTeX long to respond and 100% CPU

mdframed and tcolorbox should be able to be applied quite the same. But, if your content is really long, using breakable=unlimited for tcolorbox may solve your problem: \documentclass[a4paper,12pt,...
Thomas F. Sturm's user avatar
6 votes
Accepted

How can I insert a background image in mdframed

The console output clearly describes the problem and suggests the solution. This information will also be in your .log file. This is what this output is for: to tell you useful stuff! Package ...
cfr's user avatar
  • 189k
6 votes
Accepted

mdframed in a itemize environment

I would use tcolorbox. It behaves much better than mdframed. \documentclass[a4paper]{article} \usepackage[many]{tcolorbox} \newtcolorbox {myframe} {left skip = 2cm-\csname @totalleftmargin\...
Ulrike Fischer's user avatar
6 votes

Creating Beautiful box

I hope it goes well with blue!70! It is only a bit of code. \documentclass{article} \usepackage{tikz,lipsum,lmodern} \usepackage[most]{tcolorbox} \usepackage{wrapfig} \usepackage{lipsum} \usepackage{...
Sebastiano's user avatar
  • 52.6k
6 votes
Accepted

different color shading for each theorem type

Just include \colorlet{shadecolor}{orange!15} in the definition of your different environments, only using the respective colors. In detail: Old code: \colorlet{shadecolor}{orange!15} % global ...
Tiuri's user avatar
  • 7,659
6 votes
Accepted

Drawing lines on both sides with mdframed and TikZ (or tcolorbox)

O and P are the two opposite corners of the frame O=south west and P=north east your example changed for line from south west -- south east \documentclass{article} \usepackage{kantlipsum} \...
js bibra's user avatar
  • 20.2k
6 votes
Accepted

Nice output for examination

I hope I understood everything correctly since you seem to ask multiple things at once, but you could maybe start with this approach: (Thanks to @dexteritas for his suggestion for improvement!) \...
Jasper Habicht's user avatar
5 votes

How to store an mdframe in a savebox?

As David has commented in his answer, you need a minipage. If you switch to tcolorbox, you can do this in a simpler (and shorter) way using the capture key which allows you to capture the box in a ...
Gonzalo Medina's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible