TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make a command to automate the creation of a box? This box would enclose texts or statements, questions and the like when the command is used. Example:

command and desired output

share|improve this question
Perhaps a simple \fbox or something more sophisticated using mdframed? – cmhughes Nov 13 '12 at 16:30

Using tikz, mdframed, \fbox and \framebox:

\node[draw,rectangle,rounded corners=4pt,line width =1.5pt,text width=5cm,minimum width=5cm,minimum height=3cm]{#1};
\mybox{Text is placed here}
\myboxmd{Text is placed here}
\myboxframe{Text is placed here}
\fbox{Text is placed here}

enter image description here

share|improve this answer
when i compile this it gives me this error "! LaTeX Error: File `mdframed.sty found". – Kayla Nov 14 '12 at 10:01
@kayla: Did you install mdframed? – Harish Kumar Nov 14 '12 at 13:02
i tried to install in terminal Ubuntu by tlmgr install mdframed but it says: " No command tlmgr found, did you mean: Command vlmgr from package 'qdbm-util' (universe) Command 'rlmgr' from package 'qdbm-util' (universe) tlgmr: command not found". – Kayla Nov 15 '12 at 1:25
@kayla: Search this site for installing such packages. I think you are using a tex distribution that came with your OS and not texlive. Refer to tex.stackexchange.com/questions/55437/… also – Harish Kumar Nov 15 '12 at 1:27
I installed Tex Live 2009/Debian kpathsea version 5.0.0 in ubuntu 1204. How should i properly make the code above compile.. – Kayla Nov 15 '12 at 1:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.