tags:

views:

489

answers:

5

Hello. Maybe there is a package to do this, but I have not been able to find it. If it doesn't exist, I would appreciate ideas as to how to do ithis. Basically, I need something that would box characters. Something like this:

-------
| A| L|
-  -  - ...
| 2| 3|
-------

Knuth has something like this in TAOCP, when he discusses MIX's word... without the bottom part, though.

So, a character, and some other char or chars below. Any idea? (I'm foreseeing a tumbleweed)...

Thanks.

+1  A: 

Hi Dervin

If tabular is not what you want, and I think crunchdog is right and it is what you want, perhaps fbox is. Both are well described in the usual sources of LaTeX information.

Regards

Mark

High Performance Mark
Hi! Thanks. Problem is: If I do this char by char, even if I write on monospace (which is fine), the fbox will very its height wrt the character. So, a 't' will have a box with a greater hight than an 'e', for instance.
Dervin Thunk
Does it work if you do something like \fbox{\vspace{\lineheight}text}?
moxn
If you are going to use fboxes then you might want to use struts to set a common height. Struts are (if memory serves well) vertical rules with zero width. Again, let documentation be your friend.
High Performance Mark
+1  A: 

Sorry, but I have too little rep to leave a comment. So what you need is a box around each letter without disturbing the text flow? What about a

\framebox{x}?

I don't know enough about latex, but you should look into building your own Latex makro where this is done for each letter that you pass to your new command. Admittedly this is kind of brute force...

moxn
+1 so you can comment! (and because it works)
Jefromi
+1  A: 

You can use \raisebox to fix the vertical height. See the example at the end of this discussion of boxes. Since you can put boxes inside boxes, I think something like this is the answer (gives me a something that looks like your example).

Some text.
\framebox[1.1\width][s]{
    \parbox[b]{7.2ex}{
        \raisebox{2.0ex}{
            \framebox[1.6\width][s]{A}
            \framebox[1.6\width][s]{L}
        }
        \raisebox{0ex}{
            \framebox[1.6\width][s]{2}
            \framebox[1.6\width][s]{3}
        }
    }
}
Some more text.
ire_and_curses
A: 

My instinct is to go with \framebox for single instances or small groups, and to use the tabular environment for more complicated situation (which would usually mean setting up a table).

dmckee
+2  A: 

Here's a basic loop that boxes each character (actually each token, so it won't work if there are macros within that take arguments):

\documentclass{article}
\makeatletter
\newcommand\eachboxed[1]{%
  \@tfor\@ii:=#1\do{%
    \fbox{\strut\@ii}%
  }%
}
\makeatother
\begin{document}
\eachboxed{hello}
\end{document}

Not sure if this addresses your problem, however.

Will Robertson