KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당 › tabu패키지 오류(해결)

smj1 | 2019.02.17 19:15:30 | 메뉴 건너뛰기 쓰기

업데이트 때문인지 갖은 충돌이 일어나고 있습니다.

어제 texlive 2018을 설치하였는데 tabu에서 xcolor및 color패키지와 충돌이 발생하는 것입니다.

\documentclass{article}
\usepackage{tabu,booktabs}
\usepackage[table]{xcolor}
 
\begin{document}
 
\setlength\tabulinesep{5pt}
\taburulecolor{blue}
\tabulinestyle{1pt blue}
\taburowcolors{blue!25..blue!5}
\begin{center}
    \begin{tabu}{X X}
        \toprule
        \taburowcolors[1]3{red..blue}
        Row1 & 1 \\
        Row2 & 2 \\
        Row3 & 3 \\
        \bottomrule
    \end{tabu}
\end{center}
\end{document}

위와 같이 하면 선 부분만 색 변화가 적용되고 taburowcolors의 지정은 무시가 됩니다.

tabu에 spread를 지정하면 전에 없던 오류가 나기도 합니다. \usepackage{xcolor}부분을 주석처리해보면 또 제대로 동작합니다.

Missing } inserted.
<inserted text>
                }
l.20     \end{tabu} 
 
Missing \cr inserted.
<inserted text>
                \cr
l.20     \end{tabu}
                  
Misplaced \cr.
<inserted text> \cr
                   
l.20     \end{tabu}

=========================================

해결방법을 찾았습니다. 혹시 같은 문제를 겪을 분들이 있을지 몰라 공유합니다.

https://github.com/tabu-fixed/tabu 에서 최신 release를 내려받고 cmd에서 

> xetex tabu.dtx

을 시행하여 생성된 tabu.sty 파일을 원래 tabu.sty파일이 있는 위치(C:\usr\texlive\2018\texmf-dist\tex\latex\tabu)에 덮어쓰기 합니다.

그리고 다음 패치를 적용합니다.

\usepackage{etoolbox}
\makeatletter
\patchcmd\tabu@startpboxmeasure
  {\aftergroup\tabu@endpboxmeasure}
  {\aftergroup\tabu@endpboxmeasure
   \color@begingroup
  }{\typeout{tabu patched}}{\typeout{tabu patch failed!}}
\patchcmd\tabu@LT@startpbox
  {\bgroup}{\bgroup\color@begingroup}
  {\typeout{tabu patched}}{\typeout{tabu patch failed!}}
\makeatother

(해당 패치의 출처는 https://tex.stackexchange.com/questions/466147/tabu-very-recently-stopped-working-with-color-xcolor-or-with-fancyvrb 입니다.)

댓글 [2]

댓글 쓰기

목록 삭제

KTUG 한국 텍 사용자 그룹