# horizontal margin in tabu

I have this code ;

\documentclass[oneside]{oblivoir}
\usepackage{amsmath,amssymb,amsthm,mathrsfs,amsthm}
\usepackage{paralist,kotex,caption,mdframed,tabu,graphicx}

\begin{document}

$$g$$ is a holomorphic function on the compact set $$\triangle$$.
By the maximum modulus theorem, $$|g|$$ attains its maximum on the boundary of $$\triangle$$.
By symmetry of $$\triangle$$, $$|g|$$ attains its maximum on the segment $$ab$$, where the segment can be parametrized by $$\gamma(t):[-1,1]\to\mathbb C$$ as follows;
$\gamma(t)=t\quad(-1\le t\le1)$
The value of $$g$$ on the segment can be written as
$g(\gamma(t))=(t^2-1)(t-\sqrt3i)=t(t^2-1)-\sqrt3(t^2-1)i$
and
$\left|g(\gamma(t))\right|^2=t^2(t^2-1)^2+3(t^2-1)^2=(t^2-1)^2(t^2+3).$
Since
$\frac{d}{dt}\left|g(\gamma(t))\right|^2 =2(t^2-1)\cdot2t(t^2+3)+(t^2-1)^2\cdot2t=2t(t^2-1)(3t^2+5)$
$$\left|g(\gamma(t))\right|^2$$ has critical values(local maximum and local minimum) at $$t=-1$$, $$t=0$$, $$t=1$$ where
\begin{center}
\tabulinesep=5pt
\begin{tabu}to.9\textwidth{X[1.5$c]|X[$c]|X[$c]|X[$c]|X[$c]|X[$c]}\toprule
t                           &-1                     &\cdots     &0          &\cdots     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &\vbox{local minimum}   &\nearrow   &\vbox{ local maximum}  &\searrow   &\vbox{ local minimum}\\\bottomrule
\end{tabu}
\end{center}
Therefore, $$|g|$$ has maximum value $$\sqrt3$$ on the whole triangle $$\triangle$$.
\end{document}


with the ugly result looks like

I don't want to enlarge the width of the second column, but want the word 'local minimum' be written in two lines, not three lines.

I tried to change the size of the font(normalsize, small, footnotesize, scriptsize, tiny), unsuccessfully even when the size is 'tiny'.

Is there any parameter like 'tabulinesep' or 'extrarowsep' to set the horizontal(not vertical) margin inside the cell?

• First of all, I'd recommend to stay away from the tabu package since it is unmaintained and buggy (github.com/tabu-issues-for-future-maintainer/tabu). Could you please also make your code compilable by adding the documentclass as well as the relevant packages. Do you use the geometry package? If so, please also include these settings. Dec 1 '19 at 9:32
• (i) you should be aware, that tabu is not maintained (ii) some fixes are available at github (iii) for help you we need to provide an MWE (small complete document, with your table, which reproduce your problem. Dec 1 '19 at 9:35
• Also, don't combine horizontal rules from the booktabs package with vertical lines as they are incompatible (See teh small gap around the vertical lines) Dec 1 '19 at 9:35
• @leandriis I thought tabu is good package, since an expert recommended it (six years ago). I didn't know tabu is outdated. I edited the question so that the codes in the preamble is visible. (I was using oblivoir, which I think is not that good package for english documents ; A korean expert recommended this class, on which we can use things related to Korean language) Dec 1 '19 at 9:44
• tabu never was a really good package - it has nice ideas but it patches too much internals - and 6 years ago it was already known that the maintainer has abandoned it. Dec 1 '19 at 10:24

As already mentioned in the comments, I'd recomment to not use tabu. Instead, here are a bunch of different versions of your table. In these I have kept the combination of horizontal and vertical lines. With the help of cellspace I have added some vertical space around the horizontal lines.

In the first three examples, I have used a simple tabular environment and manually determined the required width for the cells. Since you seem to prefer a more automated solution, I have added another set of three examples all making use of tabularx which also allows to specify an overall width of the resulting table.

\documentclass[oneside]{oblivoir}

\usepackage{cellspace}
\setlength\cellspacetoplimit{6pt}
\setlength\cellspacebottomlimit{6pt}

\begin{document}

\begin{center}
\setlength{\tabcolsep}{5.5pt}
\begin{tabular}{|>{$}Sc<{$}|Sc*{2}{|>{$}Sc<{$}|Sc}|}
\hline
t                           &-1                     &\cdots     &0          &\cdots     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &local minimum   &\nearrow   & local maximum  &\searrow   & local minimum\\\hline
\end{tabular}
\end{center}

\begin{center}
\setlength{\tabcolsep}{5.5pt}
\begin{tabular}{|>{$}Sc<{$}*{5}{|>{\raggedright\arraybackslash}S{p{1.53cm}}}|}
\hline
t                           &-1                     & $\cdots$     &0          & $\cdots$     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &local minimum   & $\nearrow$   & local maximum  & $\searrow$   & local minimum\\\hline
\end{tabular}
\end{center}

\begin{center}
\setlength{\tabcolsep}{5.5pt}
\begin{tabular}{|>{$}Sc<{$}*{5}{|>{\centering\arraybackslash}S{m{1.53cm}}}|}
\hline
t                           &-1                     & $\cdots$     &0          & $\cdots$     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &local minimum   & $\nearrow$   & local maximum  & $\searrow$   & local minimum\\\hline
\end{tabular}
\end{center}

\begin{center}
\setlength{\tabcolsep}{0pt}
\begin{tabularx}{0.8\textwidth}{|>{$}Sc<{$}*{5}{|>{\centering\arraybackslash}X}|}
\hline
t                           &-1                     & $\cdots$     &0          & $\cdots$     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &local minimum   & $\nearrow$   & local maximum  & $\searrow$   & local minimum\\\hline

\end{tabularx}
\end{center}

\begin{center}
\setlength{\tabcolsep}{3pt}
\begin{tabularx}{0.8\textwidth}{|>{$}Sc<{$}*{5}{|>{\centering\arraybackslash}X}|}
\hline
t                           &-1                     & $\cdots$     &0          & $\cdots$     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                & \footnotesize local minimum   & $\nearrow$   & \footnotesize local maximum  & $\searrow$   & \footnotesize local minimum\\\hline

\end{tabularx}
\end{center}

\begin{center}
\setlength{\tabcolsep}{5.5pt}
\begin{tabularx}{\textwidth}{|>{$}Sc<{$}*{5}{|>{\centering\arraybackslash}X}|}
\hline
t                           &-1                     & $\cdots$     &0          & $\cdots$     &1  \\\hline
\frac d{dt}|g(\gamma(t))|^2 &0                      &+          &0          &-          &0  \\\hline
|g(\gamma(t))|^2                &local minimum   & $\nearrow$   & local maximum  & $\searrow$   & local minimum\\\hline

\end{tabularx}
\end{center}
\end{document}

• Thanks a lot. So you used tabular environment together with packages like booktabs, makecell, cellspace. I understand that you used \toprule and \bottomrule, instead of my vertical line commands. But frankly speaking, I prefer tabu environment which scales the width of the column automatically when the entire horizontal size is given. Can you let me know the reason tabular is better than tabu except tabu is not maintained longer? Dec 1 '19 at 10:07
• @shyzealot: I have updated my answer with respect to the updated example table and your request for a more automatic solution. Hope this helps. Dec 1 '19 at 10:20

In case, that you still persist to use tabu, than the following solution may help you:

\documentclass{article} % I haven't your document class
\usepackage{tabu} % used is version v2.9

\begin{document}
\begin{center}
\tabulinesep=5pt
\setlength\tabcolsep{4pt}
\begin{tabu}to.8\textwidth{X[1.5$c]|X[1.5$cm]|X[$c]|X[$c]|X[$c]|X[$c]}
\tabucline [1pt]{-}
t                           &-1             &\cdots     & 0 & \cdots    &1  \\
\hline
\frac d{dt}|g(\gamma(t))|^2 &0              &+          & 0 & -         &0  \\
\hline
|g(\gamma(t))|^2            & \vbox{local
minimum}& \nearrow  &   & \searrow  &\\
\tabucline [1.5pt]{-}
\end{tabu}
\end{center}
\end{document}


Addendum: With tabularx instead of tabu, using makecell with fix for use in m column types and mathtools for defining delimiters, considering edited question, the above solution can be rewritten into:

\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\usepackage{makecell}
\makeatletter %% fix of incompability between \makegapedcells and m column type
%% provided by Ulrike Fisher: http://tex.stackexchange.com/questions/319768/
\renewcommand\mcell@classz{\@classx
\@tempcnta \count@
\prepnext@tok
\ifcase\@chnum
\hfil
\mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
\hskip1sp
\mcell@agape{\d@llarbegin\insert@column\d@llarend}\hfil \or
\hfil\hskip1sp
\mcell@agape{\d@llarbegin \insert@column\d@llarend}\or
\mcell@agape{$\vcenter \@startpbox{\@nextchar}\insert@column\@endpbox$}\or
\mcell@agape{\vtop
\@startpbox{\@nextchar}\insert@column\@endpbox}\or
\mcell@agape{\vbox
\@startpbox{\@nextchar}\insert@column\@endpbox}%
\fi
\global\let\mcell@left\relax\global\let\mcell@right\relax
}\prepnext@tok}
\makeatletter
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
\begin{center}
\setcellgapes{5pt}
\makegapedcells
\setlength\tabcolsep{4pt}
\renewcommand\tabularxcolumn[1]{m{#1}}  % <---
\begin{tabularx}{.9\textwidth}{@{} >{$}c<{$} | C | >{$}C<{$} | C | >{$}C<{$} | C @{}} % <---
\Xhline{1pt}
t       & $-1$          & \cdots    & 0             & \cdots    & 1             \\
\hline
\frac{d}{dt}\abs{g(\gamma(t))}^2
& 0             & +         & 0             & -         & 0             \\
\hline
\abs*{g(\gamma(t))}^2
& local minimum & \nearrow  & local minimum & \searrow  & local minimum \\
\Xhline{1pt}
\end{tabularx}
\end{center}
\end{document}


which gives:

• Thanks a lot! So, tabcolsep is the parameter that I wanted. Really appreciate your answer. Dec 1 '19 at 10:18