Results 1 to 9 of 9

Math Help - Boxing and spacing problems

  1. #1
    Banned
    Joined
    Oct 2009
    Posts
    769

    Boxing and spacing problems

    Trying to set up the following magic square using boxing.

    The square is: 16 02 03 13
    ....................05 11 10 08
    ....................09 07 06 12
    ....................04 14 15 01

    The first problem is that I want to set up the entire square inside of one box using the \box function instead of using several boxes. Various things happen except what I want. For example when I try:

    \boxed {16\ 02\ 03\ 13\
    05\ 11\ 10\ 08}, I get:

    \boxed {16\ 02\ 03\ 13\<br />
                                          05\ 11\ 10\ 08}

    which isn't what I want and when I try:

    \boxed {16\ 02\ 03\ 13\\
    05\ 11\ 10\ 08}, I get:

    \boxed {16\ 02\ 03\ 13\\<br />
                     05\ 11\ 10\ 08}

    The other problem is with the spacing as I can only get up to one space between the characters. Any suggestions?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    I would use the table function then.

    \begin{array}{|c|c|c|}\hline
    16 & 02 & 03 \\ \hline
    05 & 11 & 10 \\ \hline
    09 & 07 & 06 \\ \hline
    \end{array}

    \begin{array}{|c|c|c|}\hline<br />
16 & 02 & 03  \\ \hline<br />
05 & 11 & 10  \\ \hline<br />
09 & 07 & 06  \\ \hline<br />
\end{array}

    \begin{array} \end{array} mark the start and the end of the table.
    {c} denotes the number of columns. In my example, I have 3 c's and hence, 3 columns
    {|c|} would mean one column sandwiched between two vertical lines. If I put {|c} then, I would have only one vertical line on the left.
    & switches column
    \\ as you know changes row
    \hline I think means headline or something similar which inserts an upper horizontal line above the row.
    Last edited by Unknown008; October 2nd 2010 at 10:42 AM. Reason: Put legend
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Banned
    Joined
    Oct 2009
    Posts
    769

    Much work remains to be done

    Quote Originally Posted by Unknown008 View Post
    I would use the table function then.

    \begin{array}{|c|c|c|}\hline
    16 & 02 & 03 \\ \hline
    05 & 11 & 10 \\ \hline
    09 & 07 & 06 \\ \hline
    \end{array}

    \begin{array}{|c|c|c|}\hline<br />
16 & 02 & 03  \\ \hline<br />
05 & 11 & 10  \\ \hline<br />
09 & 07 & 06  \\ \hline<br />
\end{array}

    \begin{array} \end{array} mark the start and the end of the table.
    {c} denotes the number of columns. In my example, I have 3 c's and hence, 3 columns
    {|c|} would mean one column sandwiched between two vertical lines. If I put {|c} then, I would have only one vertical line on the left.
    & switches column
    \\ as you know changes row
    \hline I think means headline or something similar which inserts an upper horizontal line above the row.
    I've discovered the array command before you reached me.

    The horizontal and vertical lines are a nice touch which I also have to test out along with the box command.

    The reason why I'm going through all this is that when I do a preview with Hotmail (which I use for testing purposes), I'm not getting wysiwig so I figured that boxing the numbers would hold them steady.

    Thanks
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Banned
    Joined
    Oct 2009
    Posts
    769

    Making progress

    I've gotten this far:

    \boxed{{\begin{array}{cccc}16&02&03&13\\<br />
05&11&10&08\\<br />
09&07&06&12\\<br />
04&14&15&01\end{array}}\\<br />
Figure 1}

    I'm trying to get Figure 1 two spaces below the numbers (with a space between figure and 1) while keeping the rectangle around the numbers and Figure 1. What adjustment should I make?
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    Maybe insert it into another column?

    <br />
\boxed{{\begin{array}{ccccc}16&02&03&13&\\<br />
05&11&10&08&\\<br />
09&07&06&12&\\<br />
04&14&15&01&Figure\ 1\end{array}}\\}<br />

    Like this perhaps?

    \boxed{{\begin{array}{ccccc}16&02&03&13&\\
    05&11&10&08&\\
    09&07&06&12&\\
    04&14&15&01&Figure\ 1\end{array}}\\}

    '\ ' leaves a space between two characters.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Banned
    Joined
    Oct 2009
    Posts
    769

    Getting closer

    Quote Originally Posted by Unknown008 View Post
    Maybe insert it into another column?

    <br />
\boxed{{\begin{array}{ccccc}16&02&03&13&\\<br />
05&11&10&08&\\<br />
09&07&06&12&\\<br />
04&14&15&01&Figure\ 1\end{array}}\\}<br />

    Like this perhaps?

    \boxed{{\begin{array}{ccccc}16&02&03&13&\\
    05&11&10&08&\\
    09&07&06&12&\\
    04&14&15&01&Figure\ 1\end{array}}\\}

    '\ ' leaves a space between two characters.
    I've tried this:

    \boxed{{\begin{array}{cccc}16&02&03&13\\<br />
05&11&10&08\\<br />
09&07&06&12\\<br />
04&14&15&01&\\Figure\ 1\end{array}}\\}<br />

    which creates an unwanted space between the first and second columns, but does move Figure 1 the desired two spaces below the numbers, but needs to be centered with respect to the numbers. This still needs some massaging and I'm confident a solution is at hand.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    Oh! Now I get what you are wanting to do. Hm... maybe make another array, within the box.

    That was not easy, but I'm satisfied! I used two tables, one into the other

    \boxed{
    \begin{array}{c}
    \begin{array}{cccc}
    16 & 02 & 03 & 13 \\
    05 & 11 & 10 & 08 \\
    09 & 07 & 06 & 12 \\
    04 & 14 & 15 & 01 \end{array}
    & Figure\ 1 \\
    \end{array}}

    \boxed{\begin{array}{c}<br />
\begin{array}{cccc}<br />
16 & 02 & 03 & 13 \\<br />
05 & 11 & 10 & 08 \\<br />
09 & 07 & 06 & 12 \\<br />
04 & 14 & 15 & 01  \end{array}<br />
& Figure\ 1 \\<br />
\end{array}}
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by wonderboy1953 View Post
    The other problem is with the spacing as I can only get up to one space between the characters. Any suggestions?
    Without spaces, from above

    \begin{array}{|c|c|c|}\hline<br />
16 & 02 & 03 \\ \hline<br />
05 & 11 & 10 \\ \hline<br />
09 & 07 & 06 \\ \hline<br />
\end{array}

    With spaces

    \begin{array}{|c|c|c|}\hline<br />
\ \ 16\ \ & \ \ 02\ \ & \ \ 03\ \  \\ \hline<br />
05 & 11 & 10  \\ \hline<br />
09 & 07 & 06  \\ \hline<br />
\end{array}

    another way

    \begin{array}{|c|c|c|}\hline<br />
\hspace{1em} 16\hspace{1em} & \hspace{1em} 02\hspace{1em} & \hspace{1em} 03\hspace{1em} \\ \hline<br />
05 & 11 & 10  \\ \hline<br />
09 & 07 & 06  \\ \hline<br />
\end{array}

    Some more options

    Lesson 5:Typesetting Math in LaTeX
    Follow Math Help Forum on Facebook and Google+

  9. #9
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    We can even introduce multiple columns, some of which we keep empty:

    \begin{array}{|ccc|ccc|ccc|}\hline<br />
& 16 &&& 02 &&& 03 &\\ \hline<br />
& 05 &&& 11 &&& 10 &\\ \hline<br />
& 09 &&& 07 &&& 06 &\\ \hline<br />
\end{array}

    I get my basics here:

    mimetextutorial.html

    Though it's a little different (I think some functions there don't work on here)
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Birthday Spacing test
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: August 1st 2010, 10:02 PM
  2. Spacing in laTex
    Posted in the LaTeX Help Forum
    Replies: 4
    Last Post: April 6th 2010, 06:11 PM
  3. How to make sentence with spacing
    Posted in the LaTeX Help Forum
    Replies: 4
    Last Post: January 31st 2010, 02:46 AM
  4. Images and spacing
    Posted in the LaTeX Help Forum
    Replies: 1
    Last Post: September 23rd 2008, 10:25 AM
  5. Vertical Spacing
    Posted in the LaTeX Help Forum
    Replies: 4
    Last Post: January 25th 2008, 06:13 AM

Search Tags


/mathhelpforum @mathhelpforum