0
\documentclass{article}
\usepackage{booktabs,threeparttable}
\hyphenpenalty=2000
\exhyphenpenalty=2000
\begin{document}
 \begin{minipage}{\marginparwidth}
    \centering
    \begin{tabular}{r r r}
      & {\small \textbf{sample 1}}
      & {\small \textbf{sample 2} \\
    Acquired \tnote{a}  & 22 & 44 \\
    Optimal \tnote {b} & 22 & 16 \\

    \end{tabular}
     \begin{tablenotes}\tiny
        \item[a] This is sample 1.
      \end{tablenotes}\begin{tablenotes}\tiny
        \item[b] This is sample two. 
      \end{tablenotes}
  \end{minipage}
\end{document}

Considering above TeX code above, notes a and b only appear below the minipage without symbols and there is no a and b inside the table to indicates that which note belongs to which entity. Moreover, this minipage is meant to be in the margin and it exceeds the boundary. How do I solve these?

1 Answer 1

0

Your tabular and table notes must be enclosed in the threeparttable environment, and you don't need a minipage. For the overflow you can aither set the font size to footnotesize, and rotate the column heads, or enlarge \marginparwidth. Here is an example of the first solution. As @Zarko points out in his comment, showframe is loaded only to demonstrate the table fits the width assigned for margin notes:

\documentclass{article}
\usepackage[flushleft]{threeparttable}
\usepackage{booktabs}
\usepackage{showframe, rotating}
\hyphenpenalty=2000
\exhyphenpenalty=2000
\usepackage{lipsum}

\begin{document}

\lipsum[2]
\marginpar{ \centering\scriptsize\setlength{\tabcolsep}{3.5pt}
  \begin{threeparttable}[flushleft]
    \begin{tabular}{@{}l r r@{}}
      & \turnbox{90}{\textbf{sample 1}}
      & \turnbox{90}{\textbf{sample 2} }\\
      Acquired\tnote{a} & 22 & 44 \\
      Optimal\tnote{b} & 22 & 16 \\
    \end{tabular}
    \begin{tablenotes}\tiny\smallskip\raggedright
      \item[a] This is sample 1.
    \item[b] This is sample two.
    \end{tablenotes}
  \end{threeparttable}}
  \lipsum[3]

\end{document} 

enter image description here

2
  • How to get rid of borders you added? It ruins the template that I am using.
    – lonesome
    Commented Jan 2, 2016 at 2:42
  • Remove package showframe. Its goal is only to show page layout.
    – Zarko
    Commented Jan 2, 2016 at 2:45

You must log in to answer this question.

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