1

I am currently trying to create a simple 4-column table and I've been trying to sort out the wrapping issue.

\begin{table}[ht]
    \centering
    \caption{- Main silicate HFSE-hosting minerals from major ore deposits}
    \begin{tabular}[t]{p{0.1\textwidth}m{0.4\textwidth}m{0.3\textwidth}m{0.2\textwidth}}
        \toprule
        Mineral&Formula&HFSE-hosting sites&Ref.\\
        \midrule
        allanite (epidote) & $A_{2}M_{3}Si_{3}O_{12}[OH]$ & A = REE$^{3+}$; B = U$^{4+}$, Th$^{4+}$, Zr$^{4+}$ & citation\\
        chevkinite & $A_{4}BC_{2}D_{2}(Si_{2}O_{7})_{2}O_{8}$ & A = REE$^{3+}$; B = Zr$^{4+}$, Ti$^{4+}$; C = Ti$^{4+}$, Nb$^{5+}$ & citation\\
        eudialyte & $N_{15-16}[M1]_{6}[M2]_{3}[M3][M4]Z_{3}Si_{24}O_{66-73}(W)_{0-9}(X)_{2}$ & N \& M1 = REE$^{3+}$; M2 = Zr$^{4}$, Ta$^{5+}$, Ti$^{4+}$; M3/4 = Nb$^{5+}$, Ti$^{4+}$; Z = Zr$^{4+}$, Ti$^{4+}$, Nb$^{5+}$ & citation\\
                
        \bottomrule
    \end{tabular}
\end{table}

producing this

enter image description here

2 questions (apologies, I realise it's supposed to deal with 1 issue at a time): a) how can I make the long-string in the 2nd column wrap down according to the column width? b) what needs to change in the caption setup to separate the number from the caption text? at the moment I've put in the hyphen trying to circumvent it, but obviously LaTeX ignores spaces

4
  • 1
    It's impossible to answer the second question without knowing your setup.
    – campa
    Commented Dec 7, 2020 at 19:33
  • 2
    Do please share with us some pertinent pieces of information, such as the document class that's in use, which fonts you employ, and how wide the text block is.
    – Mico
    Commented Dec 7, 2020 at 19:34
  • 1
    While it doesn't answer either question, you should look at the chemformula package. Commented Dec 7, 2020 at 20:40
  • My apologies. Document class is a custom thesis template after overleaf.com/latex/templates/template-for-reports-from-agh/qftddmhknmpw, which I've tailored for my PhD. I believe root is a report class. How could I clarify fonts? Not 100% on how big the text block is, but the page is a4 paper with the following margins: \geometry{lmargin=30mm, rmargin=20mm, tmargin=25mm, bmargin=25mm, foot=10mm, head=10mm}
    – Wolfe79
    Commented Dec 7, 2020 at 21:07

1 Answer 1

4

Regarding your first question, I suggest you employ judiciously chosen \newline directives. Regarding your second question, I suggest you load the caption package and employ a suitable value for the labelsep option.

Whatever else you do, though, I strongly recommend you load one of several possible chemical formula packages and use their macros to typeset chemical compounds. For sure, I would hope that you'll agree that the output of \ce{A2M3Si3O12[OH]} is a lot better-looking than that of $A_{2}M_{3}Si_{3}O_{12}[OH]$.

enter image description here

\documentclass[a4paper]{report} % I don't have access to your custom LaTeX class
\usepackage{geometry}
\geometry{lmargin=30mm, rmargin=20mm, vmargin=25mm, foot=10mm, head=10mm}
\usepackage{newtxtext,newtxmath} % Times Roman clone
\usepackage{array,booktabs,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\hangafter=1\hangindent=1em}p{#1}} % automatic hanging indentations
\usepackage{mhchem} % provides \ce macro to typeset chemical formulas
\usepackage[skip=0.333\baselineskip,labelfont=sc,labelsep=endash]{caption}
\begin{document}

\begin{table}[ht]
\centering
\caption{Main silicate HFSE-hosting minerals from major ore deposits}
\begin{tabular}{ @{} 
   >{\RaggedRight}p{\dimexpr0.12\textwidth-1\tabcolsep\relax}
   P{\dimexpr0.40\textwidth-2\tabcolsep\relax}
   P{\dimexpr0.35\textwidth-2\tabcolsep\relax}
   P{\dimexpr0.13\textwidth-1\tabcolsep\relax} 
     @{} }
\toprule
Mineral & Formula & HFSE-hosting sites & Ref.\\
\midrule
allanite (epidote) 
  & \ce{A2M3Si3O12[OH]} 
  & A = \ce{REE^3+}; B = \ce{U^4+}, \ce{Th^4+}, \ce{Zr^4+} 
  & citation\\
chevkinite 
  & \ce{A4BC2D2(Si2O7)2O8}  
  & A = \ce{REE^3+}; B = \ce{Zr^4+}, \ce{Ti^4+}; C = \ce{Ti^4+}, \ce{Nb^5+} 
  & citation\\
eudialyte 
  & \ce{N_{15-16}[M{1}]6[M{2}]3[M{3}][M{4}]Z3Si24\newline O_{66-73}(W)_{0-9}(X)2}
  & N \& M1 = \ce{REE^3+}; M2 = \ce{Zr^4+}, \ce{Ta^5+}, \ce{Ti^4+}; 
    M3/4 = \ce{Nb^5+}, \ce{Ti^4+}; Z = \ce{Zr^4+}, \ce{Ti^4+}, \ce{Nb^5+}
  & citation\\
\bottomrule
\end{tabular}
\end{table}
\end{document} 
1
  • This looks a lovely solution. I certainly do agree about the chemical formula package. Many thanks!
    – Wolfe79
    Commented Dec 8, 2020 at 0:00

You must log in to answer this question.

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