4
  • I am trying to make a template for gym workouts (a table that fills a whole page, see here if you are interested, German website).
  • Problem one is that the German umlauts (e. g. Ü) have too little space to the cell border.
  • Problem two is that the cell color is leaving the cell when the I use @{} in the column definition.
  • Apparently, I used the wrong search terms -- I could have bet that I am not the first person that encounters these problems.

\documentclass{article}

% For "Umlauts"
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}

\usepackage[
    a4paper,
    margin = 5mm,
    landscape,
    %showframe,
    ]
    {geometry}

% Table stuff
\usepackage{tabularx}

% Loads also "colortbl"
\usepackage[table]{xcolor}    

% Nice sans serif font :)
\usepackage[sfdefault]{cabin}

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{@{}l|l|X|X@{}}
\hline
Übung & Parameter & \\
\hline
\cellcolor{blue!25} Color Cell & \cellcolor{blue!25} Color Cell  \\
\hline
\end{tabularx}

\end{document}

enter image description here

1 Answers1

3

You can play with the optional arguments of \colorcolumn. For the umlauts problem, a simple \extrarowheight will do. I took the liberty of changing the input encoding to utf8, which is understood by all OSes and modern editors.

\documentclass{article}

% For "Umlauts"
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[
    a4paper,
    margin = 5mm,
    landscape,
    %showframe,
    ]
    {geometry}

% Table stuff
\usepackage{tabularx}


% Loads also "colortbl"
\usepackage[table]{xcolor}

% Nice sans serif font :)
\usepackage[sfdefault]{cabin}

\begin{document}

\noindent\setlength\extrarowheight{3pt}
\begin{tabularx}{\textwidth}{@{}>{\columncolor{blue!25}[0pt][\tabcolsep]}l|>{\columncolor{blue!25}}l|X|X@{}}
\hline
\rowcolor{white}Übung & Parameter & \\
\hline
Color Cell & Color Cell & & \\
\hline
\end{tabularx}

\end{document} 

enter image description here

Bernard
  • 271,350
  • +1 for changing the inputenc option to utf8. :-) – Mico Apr 21 '17 at 21:44
  • Thanks! Maybe I wasn't clear in my example. I want to change the row color manually for some rows. In your code I need to change it to white in many rows ;). – Dr. Manuel Kuehner Apr 21 '17 at 21:45
  • @Mico I still like to use latin1:). – Dr. Manuel Kuehner Apr 21 '17 at 21:45
  • 1
    @Dr.ManuelKuehner - If you've set up your editor to use latin1 as the input encoding system, you automatically make your code unusable and unsuitable for processing by XeLaTeX and LuaLaTeX. Even if you don't anticipate having to use either of these two LaTeX formats for the foreseeable future, why would you deliberately create an incompatibility that will be quite tedious to undo if and when you decide to switch to a more modern LaTeX format? Put differently, why do you not wish to use utf8 input encoding? – Mico Apr 21 '17 at 21:51
  • 1
    I tried first using the optional arguments for row colours, but this leaves white spaces in the internal cells, due to this dissymmetry in \tabcolsep, so I don't see a way to obtain what you want at the row level. – Bernard Apr 21 '17 at 21:52
  • @Mico I wasn't serious -- you are right, of course. It's just a habit. – Dr. Manuel Kuehner Apr 21 '17 at 21:53