5
votes
2answers
156 views

Coloured box with tikz

I'd like to break a coloured box when the page which contains it breaks... here is an example which shows this issue: \documentclass[11pt]{report} \usepackage[explicit]{titlesec} ...
3
votes
1answer
92 views

background color of colorbox doesnt fill enclosing framebox entirely?

I am using a colorbox (that contains a parbox) inside a framebox. Inside the parbox there is an itemize environment I need some paddding around the text so I put fboxsep for the colorbox to 6pt ...
7
votes
4answers
176 views

Set size of \colorbox for a single character

my question is simple (or not) I want to set the size of the \colorbox command or \fcolorbox command for a single character. The problem is the next: As seen in the image, the height and width are ...
2
votes
1answer
107 views

Make a text box with color?

I'm new user in LaTeX, and I would like to know which is the better code to do a colored squared round box with text in a page? I would like to show important notes for example. Best Regards.
3
votes
1answer
291 views

Colorbox with complex content in Beamer

Here is my problem. I try to create a macro that displays a colored background for "any" kind of elements in a beamer presentation. Here is what I did : \documentclass{beamer} \usepackage{xcolor} ...
7
votes
1answer
93 views

Color bleeding when using \vsplit for a box with colored text

I want to \vsplit a box with quite arbitrary content. If the content does some color changes, strange things happen. The following MWE demonstrates the problem. The example text changes font and ...
4
votes
1answer
82 views

how can I make an fbox like command with certain color, shape and width of border?

I am using a style file that has a certain color for section headers. I want to create a macro, which will behave the same like fbox, only: There will be some (predefined) padding below, above, ...
4
votes
1answer
174 views

Making Inline Code Printing Pretty

I have to include small code snippets like method and class names within continuous text. I do not want to display those snippets as complete seperated listings, they should be displayed inline, ...
2
votes
1answer
180 views

Grid of colorful boxes with shade

How can I reproduce this in Latex?
3
votes
2answers
777 views

Coloured shadowed boxes around equations

When I want to highlight some important result, I traditionnally put my equations in boxes: \begin{equation} boxed{\Delta = b^2-4ac} \end{equation} I would like to have a more fancy thing: to be ...
7
votes
2answers
275 views

title of a colored box

In an another post, beamer style text box, I've seen a box that I'm interested in making it. However, I would like to use it in a book, and I would like before the title to write: Definition (or ...
6
votes
2answers
861 views

How to edit the length of a color box?

I've typed my Resume and Im using a color box, with a line underneath it. However the grey colored box doesn't reach the full length of the page width. \documentclass[letterpaper,11pt]{article} ...
5
votes
2answers
659 views

Getting a particular kind of page border using background package

I am doing my project report using latex, and the format requires a particular kind of page border around each page. (Its a black thick box enclosing a thin box). I saw this question, Multiple border ...
3
votes
1answer
3k views

Set the width of a fcolorbox

Hi a very basic question I'm sure, but is there a way to tell \fcolorbox in xcolor to draw the box of a certain width. For example with \fbox I would do \documentclass{article} \usepackage{xcolor} ...
4
votes
1answer
826 views

lstlisting in a box?

My problem is that I am trying to write a document with coloured sections for examples. Examples can contain code listings. Somehow I can't seem to combine a background colouring with a listing, or ...
14
votes
5answers
7k views

How to draw a square of 1cm in LaTeX filled with color?

How to draw a square of 1cm in LaTeX filled with colour? I found mdframed and framebox does this, but there need to write text inside it. I just need to draw a box.
4
votes
1answer
5k views

Set background color of a box with predefined width

I would like to have something like a minipage with colored background, i.e. a box where you can predefine the width and the background color. My attempt \colorbox{green}{\begin{minipage}{\slwidth} ...
4
votes
2answers
130 views

How can I set the color of an \sbox / \usebox?

In the following code, I want to produce a coloured shape, for example a \rule{1em}{1em}. If I use the \rule as is, it works as expected. However, putting it in an \sbox somehow breaks colouring and I ...
3
votes
2answers
119 views

Why does xcolor not like \fbox (or vice versa)?

This document would not compile and a rather cryptic ! Illegal unit of measure (pt inserted) pops up. Here's the MnWE: \documentclass{article} \usepackage{xcolor} \renewcommand{\fboxrule}{0.9pt} ...
10
votes
1answer
1k views

A few words in a coloured/grey background box

How can I write a few words with a grey highlighting box in the background, as shown in the picture below ("TEXT 4")?
3
votes
2answers
510 views

multicols within colorbox

i'm trying to get a gray background for an entire multicols environment and get errors with this "minimal" working example: \documentclass[11pt,a4paper]{article} \usepackage[utf8]{inputenc} ...
4
votes
2answers
989 views

Remove space before colorbox

I've made the command \newcommand{\pink}[1]{\colorbox{red!20}{#1}} to highlight in pink. It works fine for words and sentences, but if I want to highlight a subpart of a word, e.g. laugh\pink{ing} ...
6
votes
1answer
644 views

Page header with gray background and without margin

After finishing my thesis in LaTeX (I am an absolute newcomer) I've been asked to format it in a specific design matching a doc-file I received. I've managed to change titles and fonts and margins ...
13
votes
2answers
685 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 ...
5
votes
1answer
834 views

Equations in fancy boxes

I've checked the post here, where the package empheq is used for embedding equations into coloured boxes. With that idea, I wrote in my file the following: % in the preambule \usepackage{empheq} ...
5
votes
1answer
308 views

How to Create Colored Text Boxes with DIFFERENT colors using “\leftbar” command?

I am using the following code to generate a Colored Box in Latex: \renewenvironment{leftbar}[1][\hsize]% {% \def\FrameCommand% {% ...
16
votes
4answers
4k views

How to construct a coloured box with rounded corners

Here is the specs of the box. Color of the bar rule should be: \definecolor{mycolor}{rgb}{0.122, 0.435, 0.698} Radius of the 4 corners of the box: 4pt Thick line = 0.5pt Text should be 6pt ...
5
votes
1answer
1k views

How to keep transparent fcolor box?

I am using \fcolorbox on a background that is itself colored; I don't need color inside the box, and I want its background to be transparent so that the background color shows through. The ...
28
votes
3answers
9k views

How to highlight an entire paragraph?

I'd like to highlight paragraphs such that the highlight color appears as one whole rectangle underlying the entire paragraph. I have looked around but nothing gives me the desired effect so far. For ...
2
votes
1answer
402 views

Background color of breakable box with thin blank lines

The purpose of the mybox environment in the following document is to typeset a box in a blue background. The box may be split by page breaks. The algorithm used is similar to the one found in the ...
3
votes
1answer
379 views

Color box with outline but some difference

\begin{boxedlaw}{6.4in} \colorbox[HTML]{F8E0E0}{ \begin{minipage}[c]{380px} \begin{center} \begine{verbatim} \# define LM_ENCA 18 //Port0 \# define LM_ENCB 17 ...
7
votes
1answer
577 views

LuaTeX colored boxes with rounded corners

What is the simplest way to make coloured boxes with rounded corners in luatex? With xelatex I used pstricks and it was simple, but with luatex it is not working.
14
votes
2answers
5k 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 ...
10
votes
3answers
11k 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{ ...
2
votes
2answers
145 views

Smaller font sizes in boitecoloriee environment gives bad result

The boites package defines environments that allow page breaks inside framed boxes whose edges may be variously fancy. The bundle includes a few examples (shaded box, box with a wavy line on its side, ...
19
votes
1answer
861 views

Caption parbox 6.0 pt too wide

For my listings, I use this caption setup: \usepackage{caption} \DeclareCaptionFont{white}{\color{white}} \DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}} ...
7
votes
3answers
4k views

Best way to create colored text boxes

I am retyping some old exams into LaTeX, and I encountered the page below Now with some clever commands, and whatnot I was able to create something almost identical. Though the spacing is a tad ...
9
votes
3answers
4k views

A version of colorbox that works inside math environments

I'd like to highlight particular parts of an amsmath environment. Here's a minimal working example: \documentclass{article} \usepackage{amsmath,color} \newcommand{\abs}[1]{\lvert#1\rvert} ...
3
votes
2answers
3k views

Draw box with colored background and linebreaks which adjusts to the text width?

I want to draw labels on a photograph. The labels will only contain 1..3 words, and sometimes there shall be a linebreak, e. g. Big House \newline (empty) Is it possible to create a box which draws ...
6
votes
1answer
2k views

Rounded corner colored box around figure

I'm trying to get Rounded corner grey-colored box around figures. One solution would be to use \usepackage{float} \floatstyle{boxed} \restylefloat{figure} but this results in black box around a ...
9
votes
4answers
6k views

Colored box in new environment

I have a problem, I'm fairly new to LaTeX but I think I got the basics. My problem is that wants to create a environment that can create a minipage with a background color and some text in it. I can ...
6
votes
1answer
8k views

\colorbox{color}{text} without increasing the height and width of the cell in a table

When using \colorbox{color}{text} to put background color for the text in a table, the text with background color seems to take more space and makes the respective cell higher and wider. Is there a ...
13
votes
3answers
13k 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 ...
5
votes
1answer
536 views

How to put fixed-height shading around text (inline)?

I have a chunk of code in an alltt environment and I want to highlight elements that are auto-generated (two colours for different methods): \newcommand{\gen}[1]{\colorbox{DGray}{#1}} ...
6
votes
2answers
1k views

How to access toc entries with titletoc

I'm bit lost with the content of titletoc.sty. I'd like to access toc entries, meaning chapter title, section title and so on to put them in a colorbox. I think it is somewhere in the ...
2
votes
2answers
1k views

Draw a rectangle

How to draw a highlighted box around a bulleted item.
7
votes
3answers
1k views

amsthm environment and colorbox

I'd like to customize the amsthm command a little bit but I cannot find the relevant lines in the (undocumented?) .sty. How can I put a colorbox on the name of the environment ...
8
votes
5answers
2k views

Set \strut height

I'm using quite a few \colorbox and \colorfbox in a document but they weren't sitting at the same heights (because some words contained g and this seemed to push the box down. The solution I found ...
6
votes
3answers
6k views

Change border color of a \boxed equation?

I recently asked this question. The solution worked for me but I have a problem. cropped images are as small as possible. I would like to have a gif that bounds to borders of box of the equation. so I ...
5
votes
1answer
2k views

Preparing a beamer poster: how to create a border box?

I am preparing a poster with LaTeX using beamerposter, following the examples of the beamerposter site. In these examples, the title is themed with a background color. I would like to have the title ...