Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

LaTeX Help - This table looks like shit.

Folken FanelFolken Fanel J.2CWhen's KoFRegistered User regular
edited July 2008 in Help / Advice Forum
Hey all, I'm trying to make a table in LaTeX, but I can't get it to look nice. LaTeX automatically formats the sizes of each row and column based on the content in that cell. I know there are ways to manipulate cell size, but I can't get it to look exactly how I want it.

LaTeX_table.jpg

For example, in the table above the cells are so small that you can barely tell if I had typed an "x" or an "x-bar." I just want to make the cells a little bigger. Any suggestions?

Folken Fanel on

Posts

  • Premier kakosPremier kakos Registered User, ClubPA regular
    edited July 2008
    Try using \hspace{width} and \vspace{height} to insert extra space into a cell. The auto-sizing will take the spaces into account when it renders everything.

    SuperKawaiiWillSig.jpg
  • CyvrosCyvros Look behind you, a catharsis of spurious morality!Registered User regular
    edited July 2008
    Just a stab in the dark since my LaTeX knowledge is fairly limited - would using \displaystyle on the contents of the Test Statistic column work?

  • Folken FanelFolken Fanel J.2C When's KoFRegistered User regular
    edited July 2008
    Adding \vspace command gives me this:

    LaTeX_tableShit.jpg

    ...even though I'm adding the vertical space in the same area that I'm typing the test stat.

    \displaystyle doesn't help because the fraction looks exactly how I want it to, I just wish the table was a little larger than the absolute minimum.

    Thanks though.

  • CyvrosCyvros Look behind you, a catharsis of spurious morality!Registered User regular
    edited July 2008
    Well, I'm out. :D I've never written a full LaTeX document before - I mainly use it for equations in other contexts.

  • ecco the dolphinecco the dolphin Registered User regular
    edited July 2008
    Hmmm... according to this handy, handy site:

    http://texnik.de/cgi-bin/mainFAQ.cgi?file=table/table#table3

    Adding this in the preamble:

    \renewcommand\arraystretch{MyValue}% (MyValue=1.0 is for standard spacing)

    might be what you want.

    Penny Arcade Developers at PADev.net.
  • ZeonZeon Registered User
    edited July 2008
    Ive never written in latex before, but do you have any control over the rowspacing? In most code based editors, thats how id go about fixing that problem, add a few more points of space to the row. Im assuming the grid in the table is auto generated so it will realign itself around the taller rows.

    The other option if that doesnt work would be to put blank lines on each stub entry to fake more space, if possible you could drop the point size on the placeholder text to achieve the space youre looking for. For example, the first row would look something like this:

    [blank character][hard return]
    Proportion[hard return]
    [blank character]

    Again ive never written in latex so im not exactly sure how much control you have over the tabular mode. But one of those 2 options should be possible. If you throw up the code used to create the table including the definition and the first row, i might be able to figure something out.

    btworbanner.jpg
    Check out my band, click the banner.
  • Folken FanelFolken Fanel J.2C When's KoFRegistered User regular
    edited July 2008
    eecc wrote: »
    Hmmm... according to this handy, handy site:

    http://texnik.de/cgi-bin/mainFAQ.cgi?file=table/table#table3

    Adding this in the preamble:

    \renewcommand\arraystretch{MyValue}% (MyValue=1.0 is for standard spacing)

    might be what you want.

    Sweet, this worked perfectly, creating the extra space I needed between the top of my fractions and the top line. Thanks!

    TestStatsBest.jpg

    For those interested in the code:
    Spoiler:
    Zeon wrote:
    Ive never written in latex before, but do you have any control over the rowspacing? In most code based editors, thats how id go about fixing that problem, add a few more points of space to the row. Im assuming the grid in the table is auto generated so it will realign itself around the taller rows.

    The other option if that doesnt work would be to put blank lines on each stub entry to fake more space, if possible you could drop the point size on the placeholder text to achieve the space youre looking for. For example, the first row would look something like this:

    [blank character][hard return]
    Proportion[hard return]
    [blank character]

    Again ive never written in latex so im not exactly sure how much control you have over the tabular mode. But one of those 2 options should be possible. If you throw up the code used to create the table including the definition and the first row, i might be able to figure something out.

    I tried adding black space but all I got was post #4 in this thread. I'm sure there are ways to manipulate the tables more efficiently, but I was looking for something like what eecc posted where it was just a simple one-line piece of code that did everything I needed.

    I'm always open to other suggestions though, so if anyone has any alternate methods, I'd still like to hear them!

  • ZeonZeon Registered User
    edited July 2008
    Looking at your code string, im guessing the \\ breaks the lines, and \hline gives you the horizontal rules, and the vertical rules are being generated by the pipes in your table def | c | c | etc.

    Could you not for example do this:

    \hline

    \\

    \textbf{Parameter} & \textbf{Symbol} & \textbf{Test Statistic} & \textbf{Degrees of Freedom} \\

    \\ \hline

    ?

    Im assuming that would give you one blank line above and below your actual line of text. Again ive never worked with latex, and i dont have a copy (its 540 megs... i was going to download it to try it but screw waiting) but from what i can see i think that would work...

    but eecc's method looks like it did it exactly how you wanted.

    btworbanner.jpg
    Check out my band, click the banner.
  • Folken FanelFolken Fanel J.2C When's KoFRegistered User regular
    edited July 2008
    Zeon wrote: »
    Looking at your code string, im guessing the \\ breaks the lines, and \hline gives you the horizontal rules, and the vertical rules are being generated by the pipes in your table def | c | c | etc.

    Yes this is exactly how the tables are generated.

    Zeon wrote:
    Could you not for example do this:

    \hline

    \\

    \textbf{Parameter} & \textbf{Symbol} & \textbf{Test Statistic} & \textbf{Degrees of Freedom} \\

    \\ \hline

    ?

    Im assuming that would give you one blank line above and below your actual line of text. Again ive never worked with latex, and i dont have a copy (its 540 megs... i was going to download it to try it but screw waiting) but from what i can see i think that would work...

    but eecc's method looks like it did it exactly how you wanted.

    The funny thing about TeX is that what you see is not what you get. For example, creating that extra space in the code does not create extra space in the table.

    Also, for example, in TeX I could write:
    I       want        to               make a      sandwich. 
    

    That code would show up as:
    I want to make a sandwich.

    Alternatively, I could write
    I    want
    to           make a
    sandwich.
    

    and the code would show up as
    I want to make a sandwich.

    If I wanted to skip a line, I would have to skip down 2 lines in the code, and those are just rules for regular text, so you can see that making manual space within the code does nothing.

    Instead, you add vertical space with the \vspace{size} command and horizontal space with the \hspace{size} command. Premier kakos suggested doing this earlier, and I got the result that I posted in post number 4 of this thread.

    Thanks though!

Sign In or Register to comment.