3

This is the first time I make a table with chemistry formulae inside cells. I'm having trouble improving its readability.

Questions

  1. How do I make all rows vertically centered?
  2. How do I remove page numbering? The number is overlapping with the table
  3. How do I make the table use all available horizontal space? This is an A4 paper in landscape mode, it should be using all the space.
  4. The formulae in the second column are too near. It would be awesome if it were possible to offset them in some way, so that they don't overlap.
  5. The generate pdf is two pages long, but the first one is blank. What's the point of adding another page if the content fits in one anyway?

Here is the code:

\documentclass{article}
\usepackage[landscape,a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[version=3]{mhchem}
\usepackage{chemfig}
\usepackage{array}

\begin{document}
\thispagestyle{empty}
\section*{Principali composti organici} % (fold)
\label{sec:org}
\setatomsep{2em}
\begin{tabular}{l c c c l}
    \toprule
    Nome & $\lambda$ & Formula bruta & Suffisso & Esempio \\
    \midrule
    Alcani & & \ce{C_nH_{2n+2}} & \textit{-ano} &
        Metano: \ce{CH4}\\
    Alcheni & \chemfig{C(-[:135])(-[:225])=C(-[:45])(-[:315])} &
        \ce{C_nH_{2n}} & \textit{-ene} &
        Etene: \ce{H2C=CH2}\\
    Alchini & \chemfig{-C=C-} & \ce{C_nH_{2n-2}} & \textit{-ino} &
        Etino: \ce{HC#CH}\\
    Areni & \chemfig{**6(------)} & & \textit{-benzene} & $1,3$-dimetilbenzene\\
    \midrule
    Alogenuri organici & \chemfig{-X} & & & Bromoetano: \ce{CH3-CH2-Br}\\
    Alcoli & \chemfig{C(-[:90])(-[:180])(-[:270])-OH} & & \textit{-olo} &
        Etanolo: \ce{CH3-CH2-OH}\\
    Aldeidi & \chemfig{R-[:30]C(=[:90]O)-[:330]H} & & \textit{-ale} &
        Metanale (formaldeide): \ce{H-CHO}\\
    Chetoni & \chemfig{R_1-[:30]C(=[:90]O)-[:330]R_2} & & \textit{-one} &
        Propanone (acetone): \ce{CH3-CO-CH3}\\
    Acidi carbossilici & \chemfig{R-[:30]C(=[:90]O)-[:330]O-[:30]H} & &
        \textit{-oico} & Acido metanoico (formico): \ce{H-COOH}\\
    Esteri & \chemfig{R_1-[:30]C(=[:90]O)-[:330]O-[:30]R_2} & &
        \textit{-oato} & Etanoato di etile: \ce{CH3COOCH2CH3}\\
    Eteri & \chemfig{R_1-[:330]O-[:30]R_2} & & etere &
        Dietil etere: \ce{CH3CH2-O-CH2CH3}\\
    Ammine & \chemfig{C(-[:90])(-[:180])(-[:270])-N} & & \textit{-ammina} &
        Etilammina: \ce{CH3CH2NH2}\\
    Ammidi & \chemfig{C(=[:90]O)(-[:180])-N(-[:45])(-[:315])} & &
        \textit{-ammide} & Etanammide: \ce{CH3CONH2}\\
    Nitrili & \chemfig{-C~N} & & \textit{-nitrile} & Etanonitrile: \ce{CH3CN}\\
    \bottomrule
\end{tabular}
% section org (end)
\end{document}

This is how it looks: table

Bernard
  • 271,350
rubik
  • 771
  • Are you sure you want to use landscpage mode? It would be easier to use portrait mode, and break across two pages. – Bernard Feb 18 '15 at 14:16
  • @Bernard: It's that I want to print it, so one page would be best. Sorry for not including this information in the post. – rubik Feb 18 '15 at 14:57

1 Answers1

2

You can vertically center the chemical formulas including them in a tabular; some vertical space should also be added between rows. The alignment is not really good for one line \chemfig objects, but it's probably a different problem.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}

\usepackage[landscape,a4paper,top=1cm,bottom=1cm]{geometry}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[version=3]{mhchem}
\usepackage{chemfig}
\usepackage{array}

\newcommand{\tabce}[1]{\begin{tabular}{@{}c@{}}\ce{#1}\end{tabular}}
\newcommand{\tabchemfig}[1]{\begin{tabular}{@{}c@{}}\chemfig{#1}\end{tabular}}

\begin{document}
\thispagestyle{empty}
\section*{Principali composti organici} % (fold)
\label{sec:org}
\setatomsep{2em}
\begin{tabular}{l c c c l}
    \toprule
    Nome & $\lambda$ & Formula bruta & Suffisso & Esempio \\
    \midrule
    Alcani & & \tabce{C_nH_{2n+2}} & \textit{-ano} &
        Metano: \tabce{CH4}\\\addlinespace
    Alcheni & \tabchemfig{C(-[:135])(-[:225])=C(-[:45])(-[:315])} &
        \tabce{C_nH_{2n}} & \textit{-ene} &
        Etene: \tabce{H2C=CH2}\\\addlinespace
    Alchini & \tabchemfig{-C=C-} & \tabce{C_nH_{2n-2}} & \textit{-ino} &
        Etino: \tabce{HC#CH}\\\addlinespace
    Areni & \tabchemfig{**6(------)} & & \textit{-benzene} & $1,3$-dimetilbenzene\\
    \midrule
    Alogenuri organici & \tabchemfig{-X} & & & Bromoetano: \tabce{CH3-CH2-Br}\\\addlinespace
    Alcoli & \tabchemfig{C(-[:90])(-[:180])(-[:270])-OH} & & \textit{-olo} &
        Etanolo: \tabce{CH3-CH2-OH}\\\addlinespace
    Aldeidi & \tabchemfig{R-[:30]C(=[:90]O)-[:330]H} & & \textit{-ale} &
        Metanale (formaldeide): \tabce{H-CHO}\\\addlinespace
    Chetoni & \tabchemfig{R_1-[:30]C(=[:90]O)-[:330]R_2} & & \textit{-one} &
        Propanone (acetone): \tabce{CH3-CO-CH3}\\\addlinespace
    Acidi carbossilici & \tabchemfig{R-[:30]C(=[:90]O)-[:330]O-[:30]H} & &
        \textit{-oico} & Acido metanoico (formico): \tabce{H-COOH}\\\addlinespace
    Esteri & \tabchemfig{R_1-[:30]C(=[:90]O)-[:330]O-[:30]R_2} & &
        \textit{-oato} & Etanoato di etile: \tabce{CH3COOCH2CH3}\\\addlinespace
    Eteri & \tabchemfig{R_1-[:330]O-[:30]R_2} & & etere &
        Dietil etere: \tabce{CH3CH2-O-CH2CH3}\\\addlinespace
    Ammine & \tabchemfig{C(-[:90])(-[:180])(-[:270])-N} & & \textit{-ammina} &
        Etilammina: \tabce{CH3CH2NH2}\\\addlinespace
    Ammidi & \tabchemfig{C(=[:90]O)(-[:180])-N(-[:45])(-[:315])} & &
        \textit{-ammide} & Etanammide: \tabce{CH3CONH2}\\\addlinespace
    Nitrili & \tabchemfig{-C~N} & & \textit{-nitrile} & Etanonitrile: \tabce{CH3CN}\\
    \bottomrule
\end{tabular}
% section org (end)
\end{document}

enter image description here

Why are you getting two pages? When \section is processed, TeX is instructed to have absolutely no break between the title and the two lines that follow; in your case there's only one line (the tabular), but the section title and the tabular don't fit in a page. So an empty page is issued and then an overfull one.

egreg
  • 1,121,712
  • Wow, you are awesome... Thank you so much! Now I have to understand the commands you've created! ;) – rubik Feb 18 '15 at 13:01
  • Just in case someone needs it: to use all the width I switched to tabular* and added @{\extracolsep{\fill}} as outlined in this answer. It works splendidly. – rubik Feb 18 '15 at 13:05