3

Is there a way to leave a small gap at the end of a tabular? Something similar to the CSS property padding-bottom

\documentclass[16pt]{article}
\usepackage{microtype}
\usepackage[a4paper]{geometry}
\geometry{a4paper,margin=15mm,bindingoffset=2mm,heightrounded,}
\usepackage{chemfig}
\usepackage[version=3]{mhchem}
\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage{changepage}
\usepackage{array,amsmath,booktabs}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\definecolor{lightgray}{HTML}{EFEFEF}

\begin{document}
\renewcommand{\arraystretch}{1.6}

\begingroup\setlength{\fboxsep}{0pt}
\def\arraystretch{2.0}
\colorbox{lightgray}{%
\begin{tabular}[t]{l}

DERIVATE\\
\newcommand\B{\rule[6.2ex]{6pt}{7pt}}
$\bullet \; \displaystyle \frac{d}{dx}\;a= 0$ \\

\textcolor{blue}{$\bullet\;\displaystyle \frac{d}{dx}\;x= 1$ }\\

$\bullet \; \displaystyle \frac{d}{dx}\;ax^n= a\cdot nx^{n-1}$ \\

\textcolor{blue}{$\bullet\; \displaystyle \frac{d}{dx}\;ln\;x= \frac{1}{x},\; x > 0$ }\\

$\bullet \; \displaystyle \frac{d}{dx}\;log_{a}\;x= \frac{1}{x\;ln\;a} = \frac{log_{a}\;e}{x}, \;x > 0$ \\

\textcolor{blue}{$\bullet\; \displaystyle \frac{d}{dx}\;sen\;x = cos\;x$ }\\

$\bullet \; \displaystyle \frac{d}{dx}\;cos\;x = -sen\;x$\\

\end{tabular}%
}\endgroup
\quad

\end{document}

The tabular is the one with the gray background The tabular is the one with the gray background

1

2 Answers 2

5

You're using the wrong tools. Be careful with \;: when you use it more than one time in a document there's something to fix. In this case, the problem is you're not employing the proper commands.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[
  a4paper,
  margin=15mm,
  bindingoffset=2mm,
  heightrounded,
]{geometry}

\usepackage{amsmath}
\usepackage{microtype}
\usepackage{xcolor}
\usepackage{varwidth}
\usepackage{enumitem}
\usepackage{hyperref}

\definecolor{lightgray}{HTML}{EFEFEF}
\DeclareMathOperator{\sen}{sen}

\begin{document}

\begingroup\setlength{\fboxsep}{6pt}
\colorbox{lightgray}{%
  \begin{varwidth}{\textwidth}
  DERIVATE
  \begin{itemize}[leftmargin=*]

  \item $\dfrac{d}{dx}a= 0$

  \item \textcolor{blue}{$\dfrac{d}{dx}x = 1$}

  \item $\dfrac{d}{dx}ax^n = anx^{n-1}$

  \item \textcolor{blue}{$\dfrac{d}{dx}\ln x = \dfrac{1}{x}$, $x > 0$}

  \item $\dfrac{d}{dx}\log_{a}x = \dfrac{1}{x\ln a} = \dfrac{\log_{a}e}{x}$, $x > 0$

  \item \textcolor{blue}{$\dfrac{d}{dx}\sen x = \cos x$}

  \item $\dfrac{d}{dx}\cos x = -\sen x$

  \end{itemize}
  \end{varwidth}%
}\endgroup

\end{document}

enter image description here

3

You can add a negative strut in the last row:

enter image description here

\documentclass{article}

\usepackage{array,amsmath,xcolor}

\definecolor{lightgray}{HTML}{EFEFEF}

\newcommand{\dx}{\mathrm{d}x}
\newcommand{\ddx}{\frac{\mathrm{d}}{\dx}}

\begin{document}

\setlength{\fboxsep}{0pt}%
\renewcommand{\arraystretch}{2}%
\colorbox{lightgray}{%
  $\begin{array}{ >{\bullet~\displaystyle} l }
    \multicolumn{1}{l}{\mbox{DERIVATE}} \\
    \ddx a = 0 \\
    \color{blue} \ddx x = 1 \\
    \ddx a x^n = a \cdot n x^{n - 1} \\
    \color{blue} \ddx \ln x = \frac{1}{x},\ x > 0 \\
    \ddx \log_a x = \frac{1}{x \ln a} = \frac{\log_a e}{x},\ x > 0 \\
    \color{blue} \ddx \sin x = \cos x \\
    \ddx \cos x = -\sin x
    \rule[-1.2\normalbaselineskip]{0pt}{0pt}% negative strut to have bottom row extend further down
  \end{array}$%
}

\end{document}

I removed all the manual spacing (in lieu of TeX's natural spacing around operators/operands) and made the table-like formatting automatic (insertion of the bullet).

You must log in to answer this question.

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