I'm using the glossaries package to allow for managing acronyms in a document of mine. Separately, I've also defined a very specific table format (accessed via the \doctable command) which forces all tables in the document to have the same formatting for consistency and allows for defining tables more simply by only providing the content.

I was then able to integrate these two feature together by forcing the glossaries acronym style to use that table to output the acronym table. The problem I'm running into now is in cases when I've got so many acronyms that my table runs longer than a single page (see image below). How do I handle such a case? Can I somehow break up the table when it is too long?

Note, I've seen things like this question which suggest using ltablex but for my case this doesn't seem to work since the table uses column width formatting.


Sorry for the long example, but I had to add enough glossary entries to get the effect I wanted to show.


%%% PREAMBLE %%%

% Use packages

\usepackage[table,dvipsnames]{xcolor}   % Provides coloring for tables and text
\usepackage{tabularx}                   % Customized table formatting
\usepackage{environ}                    % Used to define custom table environment
\usepackage[acronym]{glossaries}        % Handles acronym and abbreviation creations and usage

% Table preamble

% Defines an environment to create a table in the document according to
% a common formatting. This uses the environ package.
            \rowcolor{greyblue} \setrow{\bfseries} % Make the header row bold and colored grey-blue

\definecolor{greyblue}{rgb}{0.6353,0.6863,0.7686} % Define a color used in the tables
\newcommand\setrow[1]{\gdef\rowmac{#1}#1\ignorespaces} % Used for making a row bold
\newcommand\clearrow{\global\let\rowmac\relax} \clearrow % Used for clearing a row formatting
\newcolumntype{C}[1]{>{\hsize=#1\hsize\rowmac\centering\arraybackslash}X} % Centered column, input is relative width of page
\newcolumntype{L}[1]{>{\hsize=#1\hsize\rowmac\raggedright\arraybackslash}X} % Left-aligned column, input is relative width of page
\newcolumntype{R}[1]{>{\hsize=#1\hsize\rowmac\raggedleft\arraybackslash}X} % Right-aligned column, input is relative width of page
\newcolumntype{T}{} % Define a new column type which is temporary

% Define a set of commands for redfining a column type, to be used to redefine the temporary T column type.
\newcommand{\undefcolumntype}[1]{\expandafter\let\csname NC@find@#1\endcsname\relax}

% Glossary preamble

\makenoidxglossaries % Create our glossaries

% The style to use in creating the acronym table
        Acronym & Description \\
    % Don't do anything between letter groups
    % Set display for each the acronym entry
        \glstarget{##1}{\glsentryshort{##1}}% short form
        \glsentrylong{##1}% long form
        \\% end of row


%%% DOCUMENT %%%


    \gls{abc1} \gls{abc2} \gls{abc3} \gls{abc4} \gls{abc5} \gls{abc6} \gls{abc7} \gls{abc8} \gls{abc9} \gls{abc10} \gls{abc11} \gls{abc12} \gls{abc13} \gls{abc14} \gls{abc15} \gls{abc16} \gls{abc17} \gls{abc18} \gls{abc19} \gls{abc20} \gls{abc21} \gls{abc22} \gls{abc23} \gls{abc24} \gls{abc25} \gls{abc26} \gls{abc27} \gls{abc28} \gls{abc29} \gls{abc30} \gls{abc31} \gls{abc32} \gls{abc33} \gls{abc34} \gls{abc35} \gls{abc36} \gls{abc37} \gls{abc38} \gls{abc39} \gls{abc40} \gls{abc41} \gls{abc42} \gls{abc43} \gls{abc44} \gls{abc45} \gls{abc46} \gls{abc47} \gls{abc48} \gls{abc49} 



enter image description here

1 Answer 1


Your problem is simply the use of a float. Using ltablex and the following code solves your problem.

Update: As zephyr found out one of ltablex's features is to eliminate the layout of the X column type to not conflict with other layout options. So you need to issue \keepXColumns to preserve the desired layout.

            \rowcolor{greyblue} \setrow{\bfseries} % Make the header row bold and colored grey-blue
  • Great! That solves one problem, but introduces another one. My table's width is no longer \linewidth. It's now just the minimum width. Any idea why that might be?
    – zephyr
    Feb 10, 2017 at 17:34
  • That's a problem with your column format. Try for example p{0.2\linewidth}|p{0.75\linewidth}<{\clearrow}.
    – TeXnician
    Feb 10, 2017 at 17:36
  • That would unfortunately undo all the usability of my custom table environment. The way it works now is the table is set to \linewidth (although in general the user can input whatever width they want) and the rows are set to fractions of the table width. That was the point of the custom defined columns. Why does the \hsize=#1\hsize get ignored now?
    – zephyr
    Feb 10, 2017 at 17:53
  • @zephyr I do not exactly know why. Probably that is an issue with ltablex. Maybe that improper definition of the width is the problem. I'm not an expert in that spacing topic.
    – TeXnician
    Feb 10, 2017 at 17:55
  • Well its a step in the right direction I hope. I'll wait to see if anyone else can come up with something.
    – zephyr
    Feb 10, 2017 at 17:57

You must log in to answer this question.

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