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,...
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 ...
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}...
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=...
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{...
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
{%
...
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,...
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}
\...
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,
...
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{...
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=...
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{...
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 ...
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{...
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}
...
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{...
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,...
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/...
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 ...
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{
...
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,...
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 ...
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\...
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{...
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 ...
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}
\...
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!)
\...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mdframed × 798tikz-pgf × 76
page-breaking × 57
spacing × 53
tcolorbox × 50
theorems × 50
framed × 49
environments × 43
boxes × 35
footnotes × 25
floats × 23
color × 22
thmtools × 22
margins × 20
graphics × 19
tikz-styles × 17
tables × 16
vertical-alignment × 16
minipage × 16
beamer × 15
captions × 15
multicol × 15
amsthm × 14
table-of-contents × 13
sectioning × 13