1

i need to make a list of symbols based on a multiple-page table or another way as long as produce the same. And yes, i've read : List of Tables?. But it's too complicated for a beginner like me. I just need to input the cell column by myself one by one and not automatic. Here is my requirements:

  1. My table might break the page since i have a lot of symbols. I need something like longtable but supports two columns.
  2. Two columns here means the table fills the left column first, then fills the right column, break the page, start from left column, to the right column, etc.
  3. Each left and right column has the same width size.
  4. Repeated head of the table.

This is not really an attempt, but here's my MWE using longtable, if the cells are not long enough to demonstrate page breaking, please repeat some rows:

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{longtable}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\begin{document}
\chapter*{\textbf{LIST OF SYMBOLS}}

\begin{longtable}{p{1cm}p{.5cm}p{3cm}} \multicolumn{1}{c}{\centering \textbf{Symbol}} & \multicolumn{1}{c}{\centering \textbf{}} & \multicolumn{1}{c}{\centering \textbf{Meaning}}\ \endfirsthead \multicolumn{1}{c}{\centering \textbf{Symbol}} & \multicolumn{1}{c}{\centering \textbf{}} & \multicolumn{1}{c}{\centering \textbf{Meaning}}\ \endhead $a$ &=& This is letter $a$\ $b$ &=& This is letter $b$\ $c$ &=& This is letter $c$\ $d$ &=& This is letter $d$\ $e$ &=& This is letter $e$\ $f$ &=& This is letter $f$\ $g$ &=& This is letter $g$\ $h$ &=& This is letter $h$\ $i$ &=& This is letter $i$\ $j$ &=& This is letter $j$\ $k$ &=& This is letter $k$\ $l$ &=& This is letter $l$\ $m$ &=& This is letter $m$\ $n$ &=& This is letter $n$\ $o$ &=& This is letter $o$\ $p$ &=& This is letter $p$\ $q$ &=& This is letter $q$\ $r$ &=& This is letter $r$\ $s$ &=& This is letter $s$\ $t$ &=& This is letter $t$\ $u$ &=& This is letter $u$\ $v$ &=& This is letter $v$\ $w$ &=& This is letter $w$\ $x$ &=& This is letter $x$\ $y$ &=& This is letter $y$\ $z$ &=& This is letter $z$\ $a$ &=& This is letter $a$\ $b$ &=& This is letter $b$\ $c$ &=& This is letter $c$\ $d$ &=& This is letter $d$\ $e$ &=& This is letter $e$\ $f$ &=& This is letter $f$\ $g$ &=& This is letter $g$\ $h$ &=& This is letter $h$\ $i$ &=& This is letter $i$\ $j$ &=& This is letter $j$\ $k$ &=& This is letter $k$\ $l$ &=& This is letter $l$\ $m$ &=& This is letter $m$\ $n$ &=& This is letter $n$\ $o$ &=& This is letter $o$\ $p$ &=& This is letter $p$\ $q$ &=& This is letter $q$\ $r$ &=& This is letter $r$\ $s$ &=& This is letter $s$\ $t$ &=& This is letter $t$\ $u$ &=& This is letter $u$\ $v$ &=& This is letter $v$\ $w$ &=& This is letter $w$\ $x$ &=& This is letter $x$\ $y$ &=& This is letter $y$\ $z$ &=& This is letter $z$ \end{longtable} \end{document}

Hope you can help me. Thanks in advance!

1 Answers1

1

With the help of supertabular you can achieve a page-breaking table that also works inside of a twocolumn page:

enter image description here

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{supertabular}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage{lipsum} % just for dummy text. Do not use in actual document.
\begin{document}
\lipsum

\twocolumn \chapter*{LIST OF SYMBOLS} \tablehead{ \multicolumn{1}{c}{\textbf{Symbol}} & \multicolumn{1}{c}{\textbf{}} & \multicolumn{1}{c}{\textbf{Meaning}}\ } \begin{supertabular}{p{1cm}p{.5cm}p{3cm}} $a$ &=& This is letter $a$\ $b$ &=& This is letter $b$\ $c$ &=& This is letter $c$\ $d$ &=& This is letter $d$\ $e$ &=& This is letter $e$\ $f$ &=& This is letter $f$\ $g$ &=& This is letter $g$\ $h$ &=& This is letter $h$\ $i$ &=& This is letter $i$\ $j$ &=& This is letter $j$\ $k$ &=& This is letter $k$\ $l$ &=& This is letter $l$\ $m$ &=& This is letter $m$\ $n$ &=& This is letter $n$\ $o$ &=& This is letter $o$\ $p$ &=& This is letter $p$\ $q$ &=& This is letter $q$\ $r$ &=& This is letter $r$\ $s$ &=& This is letter $s$\ $t$ &=& This is letter $t$\ $u$ &=& This is letter $u$\ $v$ &=& This is letter $v$\ $w$ &=& This is letter $w$\ $x$ &=& This is letter $x$\ $y$ &=& This is letter $y$\ $z$ &=& This is letter $z$\ $a$ &=& This is letter $a$\ $b$ &=& This is letter $b$\ $c$ &=& This is letter $c$\ $d$ &=& This is letter $d$\ $e$ &=& This is letter $e$\ $f$ &=& This is letter $f$\ $g$ &=& This is letter $g$\ $h$ &=& This is letter $h$\ $i$ &=& This is letter $i$\ $j$ &=& This is letter $j$\ $k$ &=& This is letter $k$\ $l$ &=& This is letter $l$\ $m$ &=& This is letter $m$\ $n$ &=& This is letter $n$\ $o$ &=& This is letter $o$\ $p$ &=& This is letter $p$\ $q$ &=& This is letter $q$\ $r$ &=& This is letter $r$\ $s$ &=& This is letter $s$\ $t$ &=& This is letter $t$\ $u$ &=& This is letter $u$\ $v$ &=& This is letter $v$\ $w$ &=& This is letter $w$\ $x$ &=& This is letter $x$\ $y$ &=& This is letter $y$\ $z$ &=& This is letter $z$\ $a$ &=& This is letter $a$\ $b$ &=& This is letter $b$\ $c$ &=& This is letter $c$\ $d$ &=& This is letter $d$\ $e$ &=& This is letter $e$\ $f$ &=& This is letter $f$\ $g$ &=& This is letter $g$\ $h$ &=& This is letter $h$\ $i$ &=& This is letter $i$\ $j$ &=& This is letter $j$\ $k$ &=& This is letter $k$\ $l$ &=& This is letter $l$\ $m$ &=& This is letter $m$\ $n$ &=& This is letter $n$\ $o$ &=& This is letter $o$\ $p$ &=& This is letter $p$\ $q$ &=& This is letter $q$\ $r$ &=& This is letter $r$\ $s$ &=& This is letter $s$\ $t$ &=& This is letter $t$\ $u$ &=& This is letter $u$\ $v$ &=& This is letter $v$\ $w$ &=& This is letter $w$\ $x$ &=& This is letter $x$\ $y$ &=& This is letter $y$\ $z$ &=& This is letter $z$\ \end{supertabular} \onecolumn

\lipsum \end{document}


Here is a slightly different approach with a table that automatically adjusts to the width of the column. I also assumed, all contents of the first column are supposed to be in math mode, so I automatically added that. I also added the = between the first and last column, so there is no need to repeat it over and over.

\documentclass[a4paper,12pt,oneside,openany]{book}
\usepackage{supertabular}
\usepackage{array, calc}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage{lipsum} % just for dummy text. Do not use in actual document.
\begin{document}
\lipsum

\twocolumn \chapter*{LIST OF SYMBOLS} \tablehead{ \multicolumn{1}{c}{\textbf{Symbol}} & \multicolumn{1}{c}{\textbf{Meaning}}\ } \newlength{\mycolwidth} \setlength{\mycolwidth}{\widthof{\textbf{Symbol}}} \begin{supertabular}{>{(}wl{\mycolwidth}<{)}@{\hspace{\tabcolsep}=\hspace{\tabcolsep}}p{\dimexpr\columnwidth-4\tabcolsep-\mycolwidth-1em}} a & This is letter $a$ This is letter $a$ This is letter $a$ This is letter $a$ This is letter $a$ \ b & This is letter $b$\ c & This is letter $c$\ d & This is letter $d$\ \end{supertabular} \onecolumn

\lipsum \end{document}

leandriis
  • 62,593
  • Thank you so much for your answer! – user516076 Jan 31 '21 at 10:45
  • @user516076: I updated my answer and removed the superfluous \centering inside of the \multicolumn{1}{c} commands. Since you used c, the contents are already horizontally centered. I also included a second alternative approach with semi-automatically calculated column widths and a slightly simples input of the actual contents of the table. – leandriis Jan 31 '21 at 10:55
  • Very nice. But i have a problem when i use \linespread{1.5} on my preamble to set the whole document becomes one half spacing. And then i want to reduce the array stretch by putting \renewcommand{\arraystretch}{.5} above the \begin{supertabular}. Can you help me 1 more time to fix the issue about your second alternative when dealing with long text? Each row is reduced, but the text after line breaking is not. Maybe i'm asking too much, but you are really helpful. I can't stop thanks for you. Hope you can help me. – user516076 Jan 31 '21 at 12:14
  • I'd replace \linespread{1.5} with \usepackage{setspace} \onehalfspacing and use \twocolumn {\singlespacing \chapter*..... and \end{supertabular}} \onecolumn to get a single spaced table. (Notice the \singlespacing command and the extra set of {}.) – leandriis Jan 31 '21 at 12:57
  • What does "Each row is reduced, but the text after line breaking is not."? Could you probably prepare a sketch of the desired output? In which column do you use the "long text"? – leandriis Jan 31 '21 at 12:57
  • i got it. It solved by setting \begin{spacing}{.5}....\end{spacing} on each row. Even tough it's not efficient to squeeze text each cell. Thanks, cz this came to mind when you mentioned about setspace package, – user516076 Jan 31 '21 at 13:07
  • @user516076: Sorry, this does not really sound like a good solution to me. Do you really want to squeeze the text that much? Did you try the suggestion in my previous comment? – leandriis Jan 31 '21 at 13:12
  • i did it as your advice. :) somehow i want to differentiate the spacing between each column and the spacing of the long text inside one cell. – user516076 Jan 31 '21 at 13:14
  • You could add \usepackage{booktabs} to the preamble and use \\ \addlinespace instead of \\ between each table row. – leandriis Jan 31 '21 at 13:18
  • i see. Thank you so much. Can't imagine spending one night again to thinking about this, without your answer. Really, thanks. – user516076 Jan 31 '21 at 13:27