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

I made through creating the boxes inside a box with help of an expert by this link Is three boxes inside a box posibble in latex

Now im being troubled on how will i put into command to align this three boxes together with a text horizontally without a box?

Sample output would be like:

sample output will be

share|improve this question
up vote 5 down vote accepted

Below I have defined \UnboxedQuestion, which changes the style to be inline, and the first optional parameter defines the style to be used for the boxes:

enter image description here

The default text width is set to 6.0cm (as shown above). However, this can be adjusted via the second optional parameter:

enter image description here



\newcommand*{\HorizontalSpacing}{\hfill}% equally spaced boxes
%\newcommand*{\HorizontalSpacing}{\hspace*{2.0cm}}% fixed space boxes


    % #1 = box draw/fill options
    % #2 = text
    \begin{tikzpicture}[baseline, inner sep=2pt, outer sep=0]
            \node [#1] (Origin) {#2};
            \draw [thick, draw=black, #1] 
                (Origin.south west) rectangle (Origin.north east) ;

\tikzset{Inner Box Style/.style={
    inner sep=2pt, yshift=0.7ex, 
    text width=1ex, minimum height=2ex

\NewDocumentCommand{\UnboxedQuestion}{O{} O{6.0cm} m m m m}{%
    % #1 = optional draw options for inner boxes
    % #2 = text of question
    % #3 = choice 1
    % #4 = choice 2
    % #5 = choice 3
        \begin{enumerate}[series=UnboxedLists, resume=UnboxedLists]%
            \item #3\strut%
    \hfill\hspace*{\InnerSep}\Boxed[Inner Box Style, #1]{}\,#4%
    \HorizontalSpacing\Boxed[Inner Box Style, #1]{}\,#5%
    \HorizontalSpacing\Boxed[Inner Box Style, #1]{}\,#6%

\newcommand{\ShortTitle}{Is this what you are looking for?}
\newcommand{\LongTitle}{Is this what you are looking for? 
    But what happens if the text is much longer?
    Well in that case I guess it should wrap.}

    {Is this what you are looking for?}

\UnboxedQuestion[draw=blue, fill=yellow!50]

    [solid, draw=blue, fill=orange!50][5.0cm]

    [solid, ultra thick, draw=blue, fill=orange!50][7.5cm]
share|improve this answer
Sir, This is exactly the form i want but why is it when I add some more text to Is this what you are looking for the 3 boxes went down the line. I somehow want the three small boxes in static. Like the number 2 in the sample output i indicated above :) – Kayla Nov 25 '12 at 10:33
Sir I changed \UnboxedQuestion {Is this what you are looking for?} to \UnboxedQuestion {Is this what you are looking for? e text here text here text here text here text here} See what happens to the three small boxes.. :) – Kayla Nov 25 '12 at 10:36
I updated the solution a few minutes ago, please try the new version and let me know if that solves you problem. If not, please compose a fully compilable MWE including \documentclass and the appropriate packages that illustrates the problem. – Peter Grill Nov 25 '12 at 10:36
Oh,and no need to use "Sir".. Makes me feel old, not that I am not... :-) – Peter Grill Nov 25 '12 at 10:37
I think this will be the solution to my prob. I'll just adjust the spaces. Thanks! – Kayla Nov 25 '12 at 10:41

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.