As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

LaTeX Help - This table looks like shit.

Folken FanelFolken Fanel anime afWhen'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?

Twitter: Folken_fgc Steam: folken_ XBL: flashg03 PSN: folken_PA SFV: folken_
Dyvim Tvar wrote: »
Characters I hate:

Everybody @Folken Fanel plays as.
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.

    Premier kakos on
  • CyvrosCyvros 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?

    Cyvros on
  • Folken FanelFolken Fanel anime af 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.

    Folken Fanel on
    Twitter: Folken_fgc Steam: folken_ XBL: flashg03 PSN: folken_PA SFV: folken_
    Dyvim Tvar wrote: »
    Characters I hate:

    Everybody @Folken Fanel plays as.
  • CyvrosCyvros 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.

    Cyvros on
  • 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.

    ecco the dolphin on
    Penny Arcade Developers at PADev.net.
  • ZeonZeon Registered User regular
    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.

    Zeon on
    btworbanner.jpg
    Check out my band, click the banner.
  • Folken FanelFolken Fanel anime af 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:
    \documentclass{letter}
    
    \begin{document}
    
    \renewcommand\arraystretch{2.0}% (MyValue=1.0 is for standard spacing)
    
    \begin{tabular} { | c | c | c | c | }
    
      \hline
      
      \textbf{Parameter} & \textbf{Symbol} & \textbf{Test Statistic} & \textbf{Degrees of Freedom} \\ \hline
      Proportion & $p$ & $ z = \frac{\hat{p}-p}{\sqrt{\frac{pq}{n}}}$ & -  \\  \hline
      Mean ($\sigma$ known) & $\mu$ & $z = \frac{\bar{x}-\mu}{\sigma/\sqrt{n}}$ & -  \\ \hline
      Mean ($\sigma$ unknown) & $\mu$ &  $t = \frac{\bar{x}-\mu}{s/\sqrt{n}}$ & $n - 1$ \\ \hline
      Standard Deviation or Variance &   $\sigma$, $\sigma^2$    & $\chi^2 = \frac{(n-1)s^2}{\sigma^2}$ & $n - 1$ \\  \hline
    
    \end{tabular}
    
    \end{document}
    
    
    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!

    Folken Fanel on
    Twitter: Folken_fgc Steam: folken_ XBL: flashg03 PSN: folken_PA SFV: folken_
    Dyvim Tvar wrote: »
    Characters I hate:

    Everybody @Folken Fanel plays as.
  • ZeonZeon Registered User regular
    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.

    Zeon on
    btworbanner.jpg
    Check out my band, click the banner.
  • Folken FanelFolken Fanel anime af 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!

    Folken Fanel on
    Twitter: Folken_fgc Steam: folken_ XBL: flashg03 PSN: folken_PA SFV: folken_
    Dyvim Tvar wrote: »
    Characters I hate:

    Everybody @Folken Fanel plays as.
Sign In or Register to comment.