Home > Archive > Tex > October 2006 > Vertical text in a Latex column
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Vertical text in a Latex column
|
|
| 418928@cepsz.unizar.es 2006-10-22, 7:10 pm |
| Hi everybody,
is there any way to set the direction of text in the header of a Latex
table vertically? The heading to show in each column in my table is a
long word, and I would like it to appear in the vertical direction
(instead of horizontally); in this way, it will take up less space and
the column will not have an excessive size in order to accomodate just
the text in the header (the entries within the table are short
strings). I have something like this:
WordLong1 WordLong2 ... WordLongn
X1 X2
and I want "WordLong1", ... "WordLongn" to be read from top to bottom
(vertically) while X1, X2, etc. would be read normally (they must
appear in horizontal, so they are read from left to right).
I guess a "by hand" possibility would be to put each letter of each
word in the header in a different row. But this would be quite
cumbersome. Is there any easier way?
Thanks in advance for any suggestion!
S.
| |
| Luc Mercier 2006-10-22, 7:10 pm |
| 418928@cepsz.unizar.es wrote:
> Hi everybody,
>
> is there any way to set the direction of text in the header of a Latex
> table vertically? The heading to show in each column in my table is a
> long word, and I would like it to appear in the vertical direction
> (instead of horizontally); in this way, it will take up less space and
> the column will not have an excessive size in order to accomodate just
> the text in the header (the entries within the table are short
> strings). I have something like this:
>
> WordLong1 WordLong2 ... WordLongn
> X1 X2
>
> and I want "WordLong1", ... "WordLongn" to be read from top to bottom
> (vertically) while X1, X2, etc. would be read normally (they must
> appear in horizontal, so they are read from left to right).
>
> I guess a "by hand" possibility would be to put each letter of each
> word in the header in a different row. But this would be quite
> cumbersome. Is there any easier way?
>
> Thanks in advance for any suggestion!
>
> S.
>
Well, a possibility which produces something similar but not identical
is to do a \usepackage{graphicx} and then use the command \rotatebox
which can be used to rotate text by 90 deg. This is different than what
you ask, but personnaly I think that a rotated text is much easier to
read than a text with a vertical flow of horizontal characters.
Even better I think is to rotate by 60 deg only and then to put negative
spaces between the columns to allow some overlap.
Luc.
| |
| 418928@cepsz.unizar.es 2006-10-30, 7:43 pm |
| Thanks, Luc, that's a very useful suggestion. However, I cannot
completely achieve my purpose because Latex does not consider the real
space occupied when rotating the text but the space that it would take
up if it were in horizontal (or maybe is the padding? if so, can I
reduce it?). Therefore, the size of the table does not decrease. Is
there any way to solve this? Can I set "by hand" the size of each
column? I don't completely understand either your idea about using a
negative space between columns (shouldn't it be a positive space in
order to center the text shown in a diagonal?).
Thanks in advance,
S.
Luc Mercier wrote:
> 418928@cepsz.unizar.es wrote:
>
>
> Well, a possibility which produces something similar but not identical
> is to do a \usepackage{graphicx} and then use the command \rotatebox
> which can be used to rotate text by 90 deg. This is different than what
> you ask, but personnaly I think that a rotated text is much easier to
> read than a text with a vertical flow of horizontal characters.
>
> Even better I think is to rotate by 60 deg only and then to put negative
> spaces between the columns to allow some overlap.
>
> Luc.
| |
|
| Hi,
[color=darkred]
I always use \usepackage{rotating} for this kind of stuff:
\begin{turn}{60}
Text rotated by 60 degrees
\end{turn}
But I've never tried it with tables.
Cheers
Michael
| |
| christophelambrechts@gmail.com 2006-10-30, 7:43 pm |
|
On Oct 24, 6:12 pm, "takrl" <m.e...@erco.com> wrote:
> Hi,
>
>
>
> \begin{turn}{60}
> Text rotated by 60 degrees
> \end{turn}
>
> But I've never tried it with tables.
>
I tried it and it works
| |
| Robin Fairbairns 2006-10-30, 7:43 pm |
| "418928@cepsz.unizar.es" <418928@cepsz.unizar.es> top-posts:
>Thanks, Luc, that's
using \rotatebox
> a very useful suggestion. However, I cannot
>completely achieve my purpose because Latex does not consider the real
>space occupied when rotating the text but the space that it would take
>up if it were in horizontal (or maybe is the padding? if so, can I
>reduce it?). Therefore, the size of the table does not decrease. Is
>there any way to solve this? Can I set "by hand" the size of each
>column? I don't completely understand either your idea about using a
>negative space between columns (shouldn't it be a positive space in
>order to center the text shown in a diagonal?).
i'm not sure what you're getting at. as i understood it, your
original request was for vertical text; a 90-degree rotated box
will have width precisely box height + box depth; in a centred column
that will work just fine.
perhaps we need an example of what you're trying -- see
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
--
Robin Fairbairns, Cambridge
| |
| 418928@cepsz.unizar.es 2006-10-30, 7:44 pm |
| Thanks to all your suggestions. I finally got what I wanted by manually
specifying the width of each column. I think it was just a padding
problem.
S.
Robin Fairbairns wrote:
> "418928@cepsz.unizar.es" <418928@cepsz.unizar.es> top-posts:
>
> using \rotatebox
>
>
> i'm not sure what you're getting at. as i understood it, your
> original request was for vertical text; a 90-degree rotated box
> will have width precisely box height + box depth; in a centred column
> that will work just fine.
>
> perhaps we need an example of what you're trying -- see
> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
> --
> Robin Fairbairns, Cambridge
|
|
|
|
|