4

I write a chemical structure as a table. Please help me understand, How can I reduce the distances between the rows and columns in a table? This is the structure of the zeolite and would like to make it look more compactly at vertical and horizontal axes.

enter image description here

\begin{table}[h]
\begin{tabular}{ccccccccccccccccccccccccccc}
\multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} \\
 & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  \\
 &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  &  \\
 &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  \\
 &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  &  \\
 & O &  &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  &  & O &  \\
 &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  & 
\end{tabular}
\end{table}
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – user31729 Jul 1 '14 at 8:30
  • 2
    Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. As such, your document is not complete, since \diagdown and \diagup are not defined – user31729 Jul 1 '14 at 8:32
  • @EvgenyChem You have chemfig in case it helps you. – Manuel Jul 1 '14 at 8:36
4

Please do not use tables to draw chemical structures. There's the already mentioned chemfig package and a few alternatives available for drawing chemical structures and schemes, see Can you make chemical structure diagrams in LaTeX? and the posts tagged .

Also there's no need to use a tikzpicture for positioning the compounds. It's far easier to use invisible bonds by passing the TikZ setting draw=none? to a bond's TikZ-Option ([,,,,]) andchemfig`'s powerful scheme-mechansim.

The basic molecule here is easily drawn by creating a O-Si-O-Al-O-Si-O chain:

\chemfig{
  O-[:-30]
  Si-[:30]
  O-[:-30]
  Al-[:30]
  O-[:-30]
  Si-[:30]
  O-[:-30]
  Al-[:30]
  O
}

The charges can be put above the Al atoms with \chemabove:

\chemfig{
  O-[:-30]
  Si-[:30]
  O-[:-30]
  \chemabove{Al}{-}-[:30]
  O-[:-30]
  Si-[:30]
  O-[:-30]
  \chemabove{Al}{-}-[:30]
  O
}

Now we can add the side chains to the missing Os using chemfig's (...) syntax:

\chemfig{
  O-[:-30]
  Si(-[:-120]O)(-[:-60]O)-[:30]
  O-[:-30]
  \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)-[:30]
  O-[:-30]
  Si(-[:-120]O)(-[:-60]O)-[:30]
  O-[:-30]
  \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)-[:30]
  O
}

Last but not least let's draw invisible bonds from the Als to the ammonium ions:

\chemfig{
  O-[:-30]
  Si(-[:-120]O)(-[:-60]O)-[:30]
  O-[:-30]
  \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]NH_4^+)-[:30]
  O-[:-30]
  Si(-[:-120]O)(-[:-60]O)-[:30]
  O-[:-30]
  \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]NH_4^+)-[:30]
  O
}

The complete scheme as seen in @EvgenyChem's answer can then best be created using

\schemestart
  <compound>
  \arrow
  <compound>
\schemestop

In this case a vertical arrangement seems to make sense so we choose the default angle -90 for the scheme with the optional argument of \schemestart[-90]. Here's an example for a possible complete scheme:

\documentclass{article} 
\usepackage{chemfig}

\begin{document}

\begin{figure}
  \centering
  \small
  \schemestart[-90]
    \chemfig{
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]NH_4^+)-[:30]
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]NH_4^+)-[:30]
      O
    }
    \arrow
    \chemfig{
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]H^+)-[:30]
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)(-[2,,,,draw=none]H^+)-[:30]
      O
    }
    \arrow
    \chemfig{
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O(-[2]H)-[:-30,,,,draw=none]
      Al(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O(-[2]H)-[:-30,,,,draw=none]
      Al(-[:-120]O)(-[:-60]O)-[:30]
      O
    }
    \arrow
    \chemfig{
      O-[:-30]
      Si(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Al}{-}(-[:-120]O)(-[:-60]O)-[:30]
      O-[:-30]
      \chemabove{Si}{+}(-[:-120]O)(-[:-60]O)-[:30,,,,draw=none]
      -[:-30,,,,draw=none]
      Al(-[:-120]O)(-[:-60]O)-[:30]
      O
    }
  \schemestop
  \caption{Caltination of zeolites} \label{fig:Caltination}
\end{figure}

\end{document}

enter image description here

3

I recommend using chemfig instead of trying to accomplish your task with tables. It will give you the structure you need, and it's not too difficult to learn.

\documentclass{article} 
\usepackage[paperwidth=300pt, paperheight=150pt]{geometry} % for this example only
\usepackage{chemfig}

\begin{document}
\begin{tikzpicture}

\node at (-1.4,-1.5) (nh1) {%
\chemfig{NH_4^+}};

\node at (1.6,-1.5) (nh2) {%
\chemfig{NH_4^+}};

\node at (0,-3) (zeolite) {%
\chemfig{%
Si((-[:135]O)(-[:225]O)(-[:300]O)(-[:45]O(-[:315]Al((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:315]Al((-[:135]O)(-[:240]O)(-[:315]O)(-[:45]O)))))))))))
}};

\end{tikzpicture}
\end{document}

Here's the result. You can specify bond angles and more.

enter image description here

  • Your answer is more professional, only that chemfig seems to load tikz automatically (because it is based on it). – skpblack Jul 1 '14 at 16:33
  • @skpblack - thanks for pointing out the redundancy. I've removed the line to load tikz. – Michael S Taylor Jul 1 '14 at 18:23
  • Thank you, @3cat. I just drew the structure of the Al-Si-structure and thought how to fix ammonium ions on the oxygen atoms. But without connection (-) it did not keep. – EvgenyChem Jul 2 '14 at 2:24
2

A possible way is to redefine the commands \arraystretch and \tabcolsep within the table environment.

\tabcolsep controls the spacing between before and after the column type specifier (c) in this case. \arraystretch controls the spacing between rows.

You should use the values which suits your needs. My values were just initial guesses to show it works.

\documentclass{scrartcl}
\usepackage{MnSymbol}

\begin{document}




\begin{table}[h]
\renewcommand{\arraystretch}{0.6}
\renewcommand{\tabcolsep}{1pt}
\begin{tabular}{ccccccccccccccccccccccccccc}
\multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} \\
 & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  \\
 &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  &  \\
 &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  \\
 &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  &  \\
 & O &  &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  &  & O &  \\
 &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  & 
\end{tabular}
\end{table}

\begin{table}[h]
\begin{tabular}{ccccccccccccccccccccccccccc}
\multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} &  &  &  & \multicolumn{3}{c}{$\rm NH_4^+$} &  &  &  & \multicolumn{3}{c}{} \\
 & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  &  &  &  &  & O &  \\
 &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  &  \\
 &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  &  & Si &  &  &  &  &  & Al &  &  &  &  \\
 &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  & \multicolumn{2}{c}{$\diagup$} &  & \multicolumn{2}{c}{$\diagdown$} &  &  \\
 & O &  &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  & \multicolumn{3}{c}{OO} &  &  &  &  & O &  \\
 &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  &  & 
\end{tabular}
\end{table}



\end{document}

enter image description here

  • Thank you very much, Christian. Now I will use a minimal working example. – EvgenyChem Jul 1 '14 at 8:45
  • Please don't promote this as a good idea! For chemical structures and schemes there are dedicated packages available which are far better suited for the task. – cgnieder Aug 16 '14 at 15:02
  • @cgnieder: Of course there are better ways to draw such formulas, but the initial OP's request was about tables, not about chemfig etc. – user31729 Aug 17 '14 at 9:01
  • @ChristianHupfer I don't mind your answer (good that you undeleted it :) ). I'd just like to see a hint that it's better to look for an alternative since the “table“-approach will fail very soon for otherwise quite simple chemical structures – cgnieder Aug 17 '14 at 9:16
0

Thanks for all. I upgrade the @cat3's code and that's what we have now:

enter image description here

\documentclass{article} 
\usepackage{chemfig}

\begin{document}


\begin{figure}[!h]
\begin{center}
\setchemrel{}{}{2em}
\small 
\noindent % Подавление красной строки
\chemfig{%
Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{NH_4^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{NH_4^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
}
\chemrel{-stealth}
\chemfig{%
Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{H^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{H^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
}
\chemrel{-stealth}

\vspace{\baselineskip} %Вставка пустой строки

\noindent % Подавление красной строки
\chemrel{-stealth}
\chemfig{%
Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90]H)(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90]H)(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
}
\chemrel{-stealth}
\chemfig{%
Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]\chemabove{Si}{\scriptstyle{+}}((-[:240]O)(-[:300]O)(-[:45,,,,draw=none]{}(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
}
\caption{Caltination of zeolites} \label{fig:Caltination}
\end{center}
\end{figure}
\normalsize

\end{document}
0

How to align this two lines to the left edge? I want shift the second line to left.

enter image description here

\documentclass{article} 
\usepackage{chemfig}

\begin{document}

\begin{figure}[!h]
%\begin{center}
    \small % шрифт
    \schemestart
    \noindent
    \chemfig{%
        Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{NH_4^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{NH_4^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
    }
    \arrow{->[][][-15pt]}[,0.8]
    \chemfig{%
        Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{H^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]{H^+})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
    }
    \arrow{->[][][-15pt]}[,0.8]
    \schemestop
    \vspace{\baselineskip}
    \schemestart
    \noindent
    \arrow{->[][][-15pt]}[,0.8]
    \chemfig{%
        Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90]H)(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O(-[:315]Si((-[:240]O)(-[:300]O)(-[:45]O(-[:90]H)(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
    }
    \arrow{->[][][-15pt]}[,0.8]
    \chemfig{%
        Si((-[:135]O)(-[:240]O)(-[:300]O)(-[:45]O(-[:90,1,1,,draw=none]\phantom{H})(-[:315]\chemabove{Al}{\scriptstyle{-}}((-[:240]O)(-[:300]O)(-[:45]O(-[:315]\chemabove{Si}{\scriptstyle{+}}((-[:240]O)(-[:300]O)(-[:45,,,,draw=none]{}(-[:315,,,,draw=none]Al((-[:240]O)(-[:300]O)(-[:45]O)))))))))))
    }
    \schemestop
    \caption{Text} \label{fig:Caltination}
%\end{center}
\end{figure}
\normalsize

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.