2

I am trying to create a rotated table in the following way, which is almost what I want:

\documentclass[smallextended]{svjour3} % onecolumn (second format)
\smartqed % flush right qed marks, e.g. at end of proof

\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage{caption}

%\captionof{table}{Integrated background levels in the 2-10 keV energy band. Numbers are in units of $[\times10^{-3}~p~cm^{-2}~s^{-1}~keV^{-1}]$}
\begin{document}

\begin{adjustbox}{angle=90}

\begin{tabularx}{1.2\textheight}{X|X|X|X|X|X|X|X|X|X}
\label{tab:2}

  Background [2-12 keV]     & 250 $\mu m$ Kapton    & 250 $\mu m$ Kapton + 10 $\mu m$ W     &  250 $\mu m$ Kapton + 20 $\mu m$ Bi + 10 $\mu m$ W    & 250 $\mu m$ Kapton + 250 $\mu m$ SiC + 10 $\mu m$ W   & 250 $\mu m$ Kapton + 300 $\mu m$ $Si_{3}N_{4}$ + 10 $\mu m$ W     &  10 $\mu m$ W + 300 $\mu m$ $Si_{3}N_{4}$     & 250 $\mu m$ Kapton + 1.3 $mm$ $Si_{3}N_{4}$   & 250 $\mu m$ Kapton +  20 $\mu m$ Bi   & 250 $\mu m$ Kapton + 1 $mm$ SiC \\
    \hline
Total               & 10            & 7.6                   & 8.8                           & 8.4                           & 8.1                                   & 7.8                       & 7.4                       & 8                 & 7.3 \\
\hline
Photons             & 2         & 1.7                   & 1.7                           & 1.4                           & 1.3                                   & 1                     & 1.2                       & 1.9                   & 1.4 \\
\hline
Electrons           & 8         & 5.9                   & 7.1                           & 7                         & 6.8                                   & 6.8                       & 6.2                       & 6.1                   & 5.9 \\
\hline
Lines?              & E.P.          & W: 8.4 keV, 9.6 keV           & Bi: 10.8 keV                      & No                            & No                                    & Si:1.72 keV                   & No                        & Bi:10.8 keV               & E.P. \\

  \end{tabularx}
\end{adjustbox}

\end{document}

I would like so solve a few issues however:

  • I would like the cells to be aligned to the center (both horizontally and vertically)
  • I need to insert the commented caption above the table, which is currently generating several errors
  • any other suggestion to make the table look more pleasant is welcomed

I have searched a long time without any results, I really need some help from more experienced latex users

Thanks

1

I haven't svjour3 package, so instead with it I use article with page layout determined by geometry package. For rotate table rather use package rotating. Its environment sidewaystable rotate page content and also center it on tex area. Rotating is simpler, if you limit table width to \textheight. As you can see from table image, this is suficient for table width. Its extension for 20% is not smart idea, table probably will protrude page size.

Off-topic: table will look better if cells contents is ragged right (flush to left). I didn't do further possible improvements like (i) delete vertical rules, (ii) use toprile, midlerule and \bottomrule from package booktabs, (iii) increase row separation with for example \renewcommand\arraystreatch{1.2}, etc:

enter image description here

\documentclass{article}%[smallextended]{svjour3} % onecolumn (second format)
%\smartqed % flush right qed marks, e.g. at end of proof

\usepackage{graphicx}
\usepackage{tabularx}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{adjustbox, rotating}
\usepackage{caption}

\usepackage[showframe,% don't use this option in real document
            margin=25mm]{geometry}

\begin{document}

%\begin{adjustbox}{angle=90}
\begin{sidewaystable}
\captionof{table}{Integrated background levels in the 2-10 keV energy band. Numbers are in units of $[\times10^{-3}~p~cm^{-2}~s^{-1}~keV^{-1}]$}
\begin{tabularx}{1\textheight}{L|L|L|L|L|L|L|L|L|L}
\label{tab:2}

Background [2-12 keV]     & 250 $\mu m$ Kapton    & 250 $\mu m$ Kapton + 10 $\mu m$ W     &  250 $\mu m$ Kapton + 20 $\mu m$ Bi + 10 $\mu m$ W    & 250 $\mu m$ Kapton + 250 $\mu m$ SiC + 10 $\mu m$ W   & 250 $\mu m$ Kapton + 300 $\mu m$ $Si_{3}N_{4}$ + 10 $\mu m$ W     &  10 $\mu m$ W + 300 $\mu m$ $Si_{3}N_{4}$     & 250 $\mu m$ Kapton + 1.3 $mm$ $Si_{3}N_{4}$   & 250 $\mu m$ Kapton +  20 $\mu m$ Bi   & 250 $\mu m$ Kapton + 1 $mm$ SiC \\
    \hline
Total               & 10            & 7.6                   & 8.8                           & 8.4                           & 8.1                                   & 7.8                       & 7.4                       & 8                 & 7.3 \\
\hline
Photons             & 2         & 1.7                   & 1.7                           & 1.4                           & 1.3                                   & 1                     & 1.2                       & 1.9                   & 1.4 \\
\hline
Electrons           & 8         & 5.9                   & 7.1                           & 7                         & 6.8                                   & 6.8                       & 6.2                       & 6.1                   & 5.9 \\
\hline
Lines?              & E.P.          & W: 8.4 keV, 9.6 keV           & Bi: 10.8 keV                      & No                            & No                                    & Si:1.72 keV                   & No                        & Bi:10.8 keV               & E.P. \\

  \end{tabularx}
\end{sidewaystable}
\end{document}

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.