2

I have the following code:

\usepackage{tabularx,array}
\usepackage{tabu}
\begin{tabular}{| c | c | c | c | }
    \hline
    $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$  & $\boxtimes$ / $\Box$ \\ \hline
    $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
$-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
$-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
$-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
$-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
 \end{tabular}

I have two problems here.

  1. I need to increase the row height as my second column consists of fraction coordinates and the space looks so tight. I tried using \vspace unfortunately it leaves quite a gap which does not look proper.

  2. My table consist of 4 column. Some how since the data on the third column is too long, it get cuts off. I tried using \\ at the end of the data but it seems to be sending the behind part of the data to a different column. Is there a way of making it look better?

A picture is attached as well.enter image description here

  • 1
    Please make your code snipped compilable. At least add used package! – Zarko Jan 15 '16 at 7:46
  • I wondering, why you have between packages tabu if you don't willing use it? And ny the way, you not mentioned amsmath and amssymb which is used in your code snipped? – Zarko Jan 15 '16 at 14:05
0

I suggest you insert (typographic) struts in the numerator and denominator terms; one strut each per row suffices.

enter image description here

\documentclass{article}

%% Define a few struts
%% (from code by Claudio Beccari in TeX and TUG News, Vol. 2, 1993)
\newcommand\Tstrut{\rule{0pt}{2.9ex}}       % "top" strut
\newcommand\Bstrut{\rule[-1.3ex]{0pt}{0pt}} % "bottom" strut
\newcommand\TBstrut{\Tstrut\Bstrut}         % "top and bottom" strut

\usepackage{amsmath,amssymb}
\usepackage[a4paper,margin=1in]{geometry} % set page parameters
\usepackage{rotating} % for "sideways" environment

\begin{document}
\begin{sideways} % switch to landscape mode
\noindent
$\begin{array}{| c | c | c | c | }
    \hline
    n\TBstrut & nP_\star=(x_n,y_n) & z(nP_\star)  & \boxtimes / \Box \\ \hline
    \vdots & \vdots & \vdots & \boxtimes \\ \hline
-10 & \biggl(\dfrac{\Tstrut56424579}{\Bstrut207025}, \dfrac{414903626892}{94196375}\biggr) & 2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953 & \boxtimes \\ \hline
-9 & \biggl(\dfrac{\Tstrut{-1094394}}{\Bstrut18769}, \dfrac{500465142}{2571353}\biggr) & 2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169 & \boxtimes \\ \hline
-8 & \biggl(\dfrac{\Tstrut32971}{\Bstrut361}, \dfrac{-4894012}{6859}\biggr) & 2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937 & \boxtimes \\ \hline
-7 & \biggl(\dfrac{\Tstrut20499}{\Bstrut1369}, \dfrac{418284}{50653}\biggr) & 2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873 & \boxtimes \\ \hline
 \end{array}$
\end{sideways}
\end{document}
  • Thank you this worked fine for me. By the way I am unable to put a caption below the table. Any idea where the caption should go. – shahrina ismail Jan 15 '16 at 11:40
  • @Sharina - To insert a caption below the table, replace the sideways environment with a sidewaystable environment, and add a \caption instruction after \end{array}$. – Mico Jan 15 '16 at 13:06
2

Put into the preamble:

\usepackage{tabls}

enter image description here

\documentclass[landscape]{article}
\usepackage{amsmath}
\usepackage{amssymb,geometry}
\usepackage{tabls}
\begin{document}

\begin{tabular}{| c | c | c | c | }
    \hline
    $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$  & $\boxtimes$ / $\Box$ \\ \hline
    $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
    $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot  19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
    $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
    $-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
    $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
\end{tabular}

\end{document}
  • I did but it didn't change anything. do i need to edit the code anywhere. the picture you attach is exactly what I want. – shahrina ismail Jan 15 '16 at 8:49
  • see my edited answer, it show the code – user2478 Jan 15 '16 at 9:45
0

From your preamble follows that your document you also use package tabu. So you can exploit this. By use of tabu and \extrarowsep macro, for example:

{
\extrarowsep=2ex
\begin{tabu}{|c | c | c | c | }
...
\end{tabu}
}

you obtain (shown is only left part of table):

enter image description here

0

The cellspace package is made for that: it defines a minimal vertical spacing between a cell and the above and below cells, somewhat like tabls, but without its drawbacks. Alternatively, you can use only horizontal lines with booktabsand its \addlinespace command between rows:

\documentclass{article}
\usepackage[hmargin=1cm]{geometry}
\usepackage{cellspace}
\setlength\cellspacetoplimit{4pt}
\setlength\cellspacebottomlimit{4pt}

\usepackage{booktabs}
\setlength\defaultaddspace{2ex}
\usepackage{amssymb, amsmath}
\usepackage{tabularx,array}
\usepackage{tabu}

\begin{document}

\footnotesize
\begin{tabular}{| *{4}{Sc|}}
  \hline
  $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$ & $\boxtimes$ / $\Box$ \\ \hline
  $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\ \hline
  $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot 19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\ \hline
  $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\ \hline
  $-8$ & $\bigg(\dfrac{32971}{361}, \dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\ \hline
  $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\ \hline
\end{tabular}
\vskip1cm

\begin{tabular}{ *{4}{c}}
  \toprule
  $n$ & $nP_\star=(x_n,y_n)$ & $z(nP_\star)$ & $\boxtimes$ / $\Box$ \\
  \midrule
  $\vdots$ & $\vdots$ & $\vdots$ & $\boxtimes$ \\
  \addlinespace
  $-10$ & $\bigg(\dfrac{56424579}{207025}, \dfrac{414903626892}{94196375}\bigg)$ & $2^{24} \cdot 3^{36} \cdot 5^{-32} \cdot 7^{-32} \cdot 13^{-32} \cdot 19^2 \cdot 29 \cdot 41 \cdot 83^2 \cdot 137^4 \cdot 661 \cdot 2677 \cdot 107581 \cdot 165713^{12} \cdot 631292953$ & $\boxtimes$ \\
  \addlinespace
  $-9$ & $\bigg(\dfrac{-1094394}{18769}, \dfrac{500465142}{2571353}\bigg)$ & $2^{36} \cdot 3^{48} \cdot 11^{12} \cdot 13 \cdot 19^4 \cdot 37^2 \cdot 127^{12} \cdot 137^{-32} \cdot 9377 \cdot 96181 \cdot 1997236169$ & $\boxtimes$ \\
  \addlinespace
  $-8$ & $\bigg(\dfrac{32971}{361}, \bigg(\dfrac{-4894012}{6859}\bigg)$ & $2^{28} \cdot 3^6 \cdot 11^2 \cdot 19^{-32} \cdot 37^4 \cdot 61^{12} \cdot 101^{12} \cdot 397 \cdot 1061 \cdot 21937$ & $\boxtimes$ \\
  \addlinespace
  $-7$ & $\bigg(\dfrac{20499}{1369}, \dfrac{418284}{50653}\bigg)$ & $2^{32} \cdot 3^{44} \cdot 5^{14} \cdot 7^{14} \cdot 13^{12} \cdot 37^{-32} \cdot 41 \cdot 433 \cdot 101873$ & $\boxtimes$ \\
  \bottomrule
\end{tabular}

\end{document} 

enter image description here

  • This worked great too.. by the way I tried placing a caption below the table but it gives an error. do you know where the caption should go – shahrina ismail Jan 15 '16 at 23:27
  • Usually table captions go above the table for a simple reason: a table can break across pages. That said, you can put it where you want, and the caption package will add automatically the correct vertical spacing between caption and table (which basic latex can't do). However, you must insert the table and its caption inside a (floating) table environment, or use the \captionof{table}{…} command if you don't want the table to float. – Bernard Jan 15 '16 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.