For the following MWE

% arara: lualatex: { options: [ '-synctex=1', '-shell-escape' ]}
% arara: makeglossaries
% arara: lualatex: { options: [ '-synctex=1', '-shell-escape' ]}



\sisetup{load-configurations = abbreviations}
xindy={codepage=utf8, language=greek, glsnumbers=false}



        \raggedright\glstarget{##1}{\glossentryname{##1}} & 
        \centering\glossentrysymbol{##1} &


\newglossaryentry{Cp}{name={Cp},description={specific heat}, symbol={[\si{\J\per\kg\per\K}]}}

\journal{Journal name}












In this line \setlength{\glsdescwidth}{\linewidth-\glsnamewidth-\glsunitwidth-2\tabcolsep}, intuitively, I need to subtract 2\tabcolsep in order to make the description field span the whole line width, however, subtracting 4\tabcolsep results in the following correctly aligned right margin of the glossary table:

enter image description here

while subtracting 2\tabcolsep results in the following overflown right margin of the glossary table:

enter image description here

So, how to accurately calculate the needed number of \tabcolsep to be subtracted without trial and error?


This actually has nothing to do with glossaries, it is just how tabular works:

\tabcolsep is the margin that is inserted on either side of every column in the table. Thus, in the example

\begin{tabular}{ c c c }
  a & b & c \\

MWE output

the table extends \tabcolsep to the left of a and to the right of c (you can see the width of the table using the \hlines), while there is a space of 2\tabcolsep between a and b as well as b and c.

In your example, you remove the separations at the edges of the table using @{} and you have three columns. That makes 2 * 2\tabcolsep = 4\tabcolsep between them.

  • Thanks for your explanation. Off topic question: how to remove both separations on each side of the first column in your example while keeping all the other ones? – Diaa Jul 24 at 11:06
  • @Diaa You can use { @{} c @{\hspace{\tabcolsep}} c c } as the column specifier. – schtandard Jul 24 at 11:10
  • Thanks for help. I am always in rush and struggle a lot with latex basics :) – Diaa Jul 24 at 11:21

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.