I am new to Tex and using below code to create a long table. I am creating a book using this where each verse's words are explained in the table format shown below. my document has large number of such tables.



I was wondering if there is a way to shorten it with 1.5cm & 3.5 cm being variables and 0.05 cm as constant cells. This is just a flexibility for later editing. I tried to write something like this.


but could not get any success. I was not sure what I was doing either, just a try. I am attaching a screenshot of how the table looks like. thanks for your helpenter image description here

  • 1
    Will the variable lengths vary for each table? Or is this just to allow you to play with different lengths, and all the variable lengths will end up has having some fixed value at the end? Also, will the second column always contain an = sign?
    – Alan Munn
    Aug 20, 2011 at 22:54
  • @Alan, Typically the length will not vary but for any given verse lets say the explanation is longer than the word then I should be able to change it for that particular instance. thats why I did not want to do hard code the length. Yes the second column will always contain "=" sign
    – Aku
    Aug 21, 2011 at 2:53
  • Will the widths for the three columns for the words and the three columns for their explanations be the same or do you want then to vary? Aug 21, 2011 at 3:16

2 Answers 2


In addition to Werner's suggestion, you can also use the @{decl.} syntax (which suppresses inter-column space and inserts decl. instead) so you don't have to explicitly typeset the equal signs in the rows of the table:

\usepackage[margin=1cm]{geometry}% just to make room for the table

\setlength\word{1.5cm}% Word width is 1.5cm
\setlength\worddef{3.5cm}% Word definition width is 3.5cm
\setlength\eqsep{\tabcolsep}% Space before and after the equal sign


word1  & some text & word2  & some text  & word3  & some text  \\
word4  & some text & word5  & some text  & word6  & some text  \\


enter image description here


Yes, you can define lengths to your own liking, storing them in "variables". For example,

\setlength{\word}{1.5cm}% Word width is 1.5cm
\setlength{\equal}{0.05cm}% Equal sign width is 0.05cm
\setlength{\worddef}{3.5cm}% Word definition width is 3.5cm

and then use


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .