Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[colortbl] "breaks" '\hdotsfor' command #2

Open
vp1981 opened this issue May 3, 2016 · 3 comments
Open

[colortbl] "breaks" '\hdotsfor' command #2

vp1981 opened this issue May 3, 2016 · 3 comments

Comments

@vp1981
Copy link

vp1981 commented May 3, 2016

Hello,
I noticed that colortbl "breaks" '\hdotsfor' command from amsmath package. Please consider the following two examples.

First example without package 'colortbl':

\documentclass{article}

\usepackage{amsmath}

\begin{document}

This is an example borrowed from the amsmath package documentation:
\begin{equation}
  \begin{pmatrix}
    D_1t&-a_{12}t_2&\dots&-a_{1n}t_n\\
    -a_{21}t_1&D_2t&\dots&-a_{2n}t_n\\
    \hdotsfor[2]{4}\\
    -a_{n1}t_1&-a_{n2}t_2&\dots&D_nt
  \end{pmatrix}
\end{equation}

\end{document}

Second example, with package 'colortbl'

\documentclass{article}

\usepackage{colortbl}
\usepackage{amsmath}

\begin{document}

This is an example borrowed from the amsmath package documentation:
\begin{equation}
  \begin{pmatrix}
    D_1t&-a_{12}t_2&\dots&-a_{1n}t_n\\
    -a_{21}t_1&D_2t&\dots&-a_{2n}t_n\\
    \hdotsfor[2]{4}\\
    -a_{n1}t_1&-a_{n2}t_2&\dots&D_nt
  \end{pmatrix}
\end{equation}

\end{document}

The second example shows that '\hdotsfor' command works differently when the 'colortbl' package is used.

@davidcarlisle
Copy link
Owner

Hmm yes, colortbl does document that any commands that add stretchable glue to an array cell need adjusting, however I agree it isn't obvious that colortbl is being used here (it modifies the underlying array/tabular implementation so affects all arrays even if they do not use colour) I'll see what I can do

@davidcarlisle
Copy link
Owner

davidcarlisle commented May 3, 2016 via email

@vp1981
Copy link
Author

vp1981 commented May 4, 2016

Thank you,
that '\AtBeginDocument' magic works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants