TransWikia.com

conflict between arydshln and makecell packages. How to resolve

TeX - LaTeX Asked on March 8, 2021

I am using answer in how-to-place-a-vertical-dashed-line-between-columns-of-a-matrix
to add dashed lines in a matrix.

But I also load package makecell to fix another problem with tables as given in this answer gap-between-toprule-and-vertical-lines-in-tabular

It turns out when loading makecell then arydshln does not work. I get error from Latex.

Is there a way to use both packages at same time?

Here is MWE

documentclass[12pt]{article}
usepackage{arydshln}
usepackage{mathtools}
usepackage{makecell}
begin{document}

[ left[
begin{array}{c:c}
1 &  2  
3 & 4 
5 & 6  
end{array} right] ]
end{document}

Compiling using lualatex gives this error

>lualatex foo3.tex
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)
 restricted system commands enabled.
(./foo3.tex
LaTeX2e <2020-02-02> patch level 5
 L3 programming layer <2020-08-07> (/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size12.clo)) (/usr/local/texlive/2020/texmf-dist/tex/latex/arydshln/arydshln.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/mathtools/mathtools.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/tools/calc.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/mathtools/mhsetup.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))) (/usr/local/texlive/2020/texmf-dist/tex/latex/makecell/makecell.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/tools/array.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def) (./foo3.aux) (/usr/local/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/luatex.def (/usr/local/texlive/2020/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
))) (/usr/local/texlive/2020/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)))

! Package array Error:  Illegal pream-token (:): `c' used.

See the array package documentation for explanation.
Type  H <return>  for immediate help.
 ...edor <@tempd changed to !{..}or Only one column-spec. allowed.fi .

See the array package documentation for explanation.
Type  H <return>  for immediate help@err@
                                                                                                                                          
l.15 begin{array}{c:c}

?

How to resolve this conflict?

TL 2020

One Answer

How to resolve this conflict?

Change the order of loading package. Load makecell before arydshln.

This works

documentclass[12pt]{article}
usepackage{makecell} %make sure this is before arydshln
usepackage{arydshln}
usepackage{mathtools}
begin{document}

[ left[
begin{array}{c:c}
1 &  2  
3 & 4 
5 & 6  
end{array} right] ]
end{document}

Answered by Nasser on March 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP