{framed} is about framed document elements, e.g., boxes and environments. A popular package is {mdframed}.

learn more… | top users | synonyms

76
votes
4answers
88k views

How to add border for an image?

I use \includegraphics command to insert image to the document. But how can I add a border around this image w/o any margin between border lines and image? It seems to be very easy, but I can't find ...
48
votes
8answers
14k views

Highlight elements in the matrix

I have a matrix and need to highlight some elements in the matrix. I have found how to highlight a single element (I want to put the cell in the square): $$ A = \begin{bmatrix} \fbox{0} & ...
31
votes
3answers
14k views

Can I have framed blocks in beamer?

Is there a simple way to have the body of a block environment in beamer to have a frame around it, rather than having a background colour? I tried putting a \fbox inside the block, but it just wrote ...
26
votes
2answers
54k views

Attractive Boxed Equations

I often used \boxed{...} from the AMS math package to place a box around important equations. However, this approach often produces somewhat awkward looking output. Consider \documentclass{article} ...
25
votes
1answer
3k views

How to place a shaded box around a section label and name

In working with a publisher, I need to format section headings like this (using ASCII art): +-----+-------------------------------------+ | 1.2 | Section name | ...
23
votes
5answers
10k views

Draw true page border

Is there a way to draw a rectangle around every page? The problem is that my document (a Ph.D. thesis) is in a funny format (16x24cm). So to print it centered on A4 paper (for reviewing) I played ...
21
votes
1answer
1k views

framed or mdframed? (Pros/Cons)

I'm currently thinking about using shaded and framed sections in my document. But for now, I couldn't clarify the differences between framed and mdframed (or other packages). Although the ...
20
votes
1answer
849 views

Highlight equations in a typographically correct manner

I am presenting a model composed of a dozens of equations, some of them requiring a somewhat lengthy derivation. The equation that continue the actual model appears progressively along the derivation ...
19
votes
6answers
56k views

How to put a framed box around text + math enviroment

I am looking for something like \fbox but it seems that you cannot use it when a math environment is included. However its not only a math environment (then you could use \boxed I know) but also text, ...
19
votes
2answers
4k views

Box around minted environment

I'm using the minted package to produce nice looking java-code but I would like to make a box around the code so it is easier to separate the code from the rest of the document. What is the easiest ...
19
votes
1answer
2k views

Draw custom frame around text

I would like to obtain a custom frame, which is different from the ones given by mdframed. Here is the image comes from the package fancytikzposter, which consists in a minipage inside a tikzpicture ...
18
votes
6answers
7k views

Text in squared box

I'd like to bot a square box around some text. I'd like to denote a labelled object of size 1, in combinatorics this is often symbolised by something like \boxed{1}. It would be nicer if the box was a ...
18
votes
1answer
11k views

How to draw frame with rounded corners around box

Is it possible to simply draw a frame around a box which has rounded corners, and be able to control frame width, frame color, frame radius, box background colour (preferably without having to use the ...
18
votes
2answers
558 views

How to make mdframed ignore descenders in last line

How can we make mdframed to ignore the descenders of the last line in the calculation of the innerbottomsep. In my eyes there are two reasons to desire this: Inner margin The optical bottom sep is ...
17
votes
2answers
784 views

Is it possible to create an adaptable golden ratio frame around equations?

I would like to create special frame around my equations. This frame should obey to the golden ratio rule. This means that its width divided by its height should give 1.61803398875. If possible, the ...
17
votes
4answers
514 views

Frame with only crosses in two opposite corners

Is there one package to produce frames looking like the one above in the following ASCII example ? I don't want dashed lines. | ...
17
votes
3answers
11k views

What is the easiest way to get borders around a page in LaTeX?

I want my document to have borders in all pages. I imagine I can do that using TikZ, but is there an easier way to do it? I also asked this question here, but as the main question was something ...
16
votes
2answers
1k views

A special example environment

How can I define an environment named "example" so that: can be broken over pages has a horizontal line above "Example \chap.\no" (e.g. Example 4.10), and vertical line that is spread to the whole ...
16
votes
3answers
1k views

create a framed environment for a margin note

What am trying to achieve is the following: Of course, if this can be done so that there is a switch between even and odd pages. Currently I am only interested in the not appearing on the LHS ...
16
votes
1answer
2k views

How to choose which sides of the border to draw in a `framebox`?

If, for example, you only want to draw the top and bottom border of a box, or perhaps the left and bottom only, is there a simple package to do this or must one resort to using tables or heavy-weight ...
16
votes
2answers
13k views

Source code listing with frame around code?

I'd like to make my code listing looking more sexy. I found a good example on SO, but one problem is remaining: I would like to not only have a horizontal line at the bottom of the listing but also ...
15
votes
4answers
1k views

Creating stackoverflow like tags

I'm trying to create stackoverflow like tags. Currently I'm using an \fbox{text} to create the tags, which works, but not all boxes have the same height (it seems that letters like 'p' make a box take ...
15
votes
3answers
2k views

How can I construct a page layout with framed boxes?

For a report I'm writing, I have got an MS Word template for a page that needs to be included. The page looks like this (print screen from Word): However, there are a few things that makes me not ...
15
votes
1answer
3k views

Box around a few items in an itemize environment

I'm using beamer and want to call out a few items in a list by drawing a box around them, and, ideally, having a small comment appear next to the box, like this:
14
votes
2answers
8k views

How to highlight important parts (with a gray background)

In the below link http://www.math.uiowa.edu/~goodman/algebrabook.dir/bookmt.pdf the author highlights anything which is important using a greyish color background. For example, if you see ...
14
votes
4answers
12k views

box around theorem statement

Is there an easy way to put a box around a theorem in LaTeX? For example to state an important theorem. I tried using page 20 of the ntheorem documentation ...
13
votes
2answers
1k views

How to create Multilevel Colored Boxes using tcolorbox/any other package?

tcolorbox Manual provides the following example: Can anybody please suggest me how to create exactly this type of box - The no. of rows to add must be flexible(It seems that tcolorbox has no option ...
13
votes
4answers
7k views

LaTeX is putting a border around my figures

I'm trying to embed a few images in a figure, but LaTeX keeps putting a border around three of the sides. Is there any way for me to keep it from adding this border? The code that I used to create ...
13
votes
3answers
17k views

How to draw a colored framebox without filling the background?

I like to draw a \fbox{..} which is colored. The xcolor package gives \fcolorbox{<frame color>}{<background color>}{<text>} But this forces me to set a background color. I like ...
13
votes
1answer
634 views

Design that imitate Google browser

I would like to write some tutorials about HTML, and I would like to do it efficiently without using too many screenshots. What I would like to obtain is a frame which looks like a web browser, such ...
13
votes
4answers
6k views

lstlistings: framed code [closed]

I use lstlistings to write Pascal Code. I'd like my code to be numbered and framed. Here is what I have as of now : \lstset{numbers=left, numberstyle=\small, numbersep=8pt, frame = single, ...
13
votes
1answer
6k views

Framing cells in a table

I want to add borders to a set of cells in a table. But not just a border for the single cells because then I imagine I could just put the cell content in an fbox. Instead I want a frame which ...
13
votes
3answers
23k views

Border or frame around figure

I'd like to place a border / frame around my figure. The figure is a bunch of equations: \begin{figure}[ht] \[ eqn 1 \] \[ eqn 2 \] \[ eqn 3 \] \caption{\label{myfig} My caption.} ...
12
votes
3answers
16k views

Change border color of \fbox [duplicate]

Possible Duplicate: Is there an \arrayrulecolor-like command to change the rule color of \fbox? I'm using an \fbox to have a border around a minipage. \fbox{ ...
12
votes
1answer
711 views

Page Bordering with an image?

I want a custom border for my document. I was thinking of doing something like this, creating a border with a graphics tool(only the outer frame) and then placing it in the beginning of the document, ...
12
votes
2answers
1k views

Gray box around figure with a separate gray box around caption

My university requires that all figures in a thesis follow this pattern: I'm very new to LaTeX, so far my best attempt has been this: \begin{SCfigure} \colorbox{darkgray}{ ...
11
votes
3answers
2k views

Framing section headings

I'm attempting to put a frame around my section headings. I am using the package mdframed which adds functionality to the framed package. It basically draws a box around an object, in an ...
11
votes
2answers
1k views

Different colorcoded theorems

I'm using this code to frame my theorems: \documentclass[a4paper,12pt]{scrreprt} \usepackage[table]{xcolor} \usepackage{latexsym} \usepackage{amsmath} \usepackage[amsmath,thmmarks,framed]{ntheorem} ...
11
votes
3answers
503 views

How do you put a character in the margin (using an environment)

I'm using framed to create a little callout box for tips and other information in a book. So for it's going well however I cannot get the icon (using ding) to sit in the margin. It currently looks ...
11
votes
4answers
6k views

Creating Page Border for Single Page only

I am digitizing a book and there is only a single page which has page border as shown in the attached image. How can I create border to a single page? Is there a library where I can choose a border ...
11
votes
6answers
2k views

Suggestions on how to place a sentence of text inside a box with a border around it

I have an "XYZ's Law" quote that I'd like to show somewhere on a page vertically centered in a box with some form of simple border around it. Basically I'm trying to achieve the LaTeX equivalent of ...
11
votes
2answers
5k views

Regarding the leftbar environment

Does anyone know how to control the width and color of the left bar in the leftbar environment?
11
votes
3answers
16k views

How to draw a frame box around an arbitrary large piece of text/figures/whatever?

The command fbox{...} can be used to draw a box around a piece of text, and apparently also a figure. However, I've not been able to use it if the "text" contains environments such as minipages and ...
11
votes
4answers
1k views

Put a box around an item (homework)

I am using the enumerate environment to do homework. In the following, first I write out the question, then I write out the answers to the first two parts. What I'd like to do is have a box around ...
11
votes
2answers
5k views

How to continue the framed text box on multiple pages?

I am using framed package to create text boxes using begin{framed} and end{framed}. My problem is that my framed box goes on for two pages, and I don't want the text box to complete itself at the end ...
10
votes
5answers
903 views

Is there any package similar to verbatim but with support for icons?

I am looking for a package that provides verbatim environments but also supports different background color, frame style and icons (tips, error, warning etc.) shown on the upper-left corner.
10
votes
3answers
393 views

Boxed equation with number

My minimum working example: \documentclass{report} \usepackage{amsmath} \begin{document} \begin{center} \boxed{K_{k+1}=P_ka_{k+1}^T(a_{k+1}P_ka_{k+1}^T+I_N)^{-1}} \end{center} \end{document} ...
10
votes
5answers
12k views

How to draw box around text that contains a verbatim block?

Typically, to box in some text, I use the following: \fbox { \parbox{\linewidth}{ This is some text! Blah blah blah... } } However, say I have a verbatim block within that. It will ...
10
votes
4answers
555 views

Creating simple frames

I want some of my text to be "framed". So far, I have horizontal lines generated by the \separate command in the following MWE: \documentclass{article} \newcommand\separate{\medskip\hrule\medskip} % ...
10
votes
2answers
303 views

Multi-line box around a sentence in a paragraph

I am trying to draw a polygon box around a sentence within a paragraph. This box would wrap over multiple lines and terminate exactly at the end of the sentence (i.e. without white space filling the ...