0

I have a number of problems with this table.

(1) Presently it does not span two pages, I'm aware I need to use the longtable package but I am aware there is a problem with this in the APA7 document class package.

longtable: If you must use long tables (exceeding one page in length), try this option (but it may not work in all contexts). Do not load longtable yourself because of precedence requirements with the endfloat package. Copy the file APA7endfloat.cfg from the “config” folder of your apa installation to the working folder of your document (not in your texmf tree), and re- name it to endfloat.cfg so that endfloat will recognize it. The supplied APA7endfloat.cfg file will also be necessary in conjunction with the rotating package (and its \sideways command) to produce rotated tables; this works for man and stu mode only. For rotated tables in jou or doc mode, the ro- tating package may be used. If sideways tables get pushed to the end of your document with the floatsintext option, try using the ph! placement specifier for your sideways table(s); for example, \begin{sidewaystable}[ph!].

(2) I would like the numbers in N column to be in line with the Themes column and centred.

\documentclass[man, biblatex, floatsintext, hidelinks, 12pt, draftfirst]{apa7}
\usepackage[style=apa, sortcites=true,sorting=nyt]{biblatex}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{pdflscape}
\usepackage{csquotes}
\usepackage{multirow}
\usepackage[formats]{listings}
\addbibresource{thesis.bib}


\begin{table}[htpb]
    \caption{Sub-themes and quotes}
    \label{tab:themes-proto}
    \begin{tabular}{p{0.35\linewidth} p{0.05\linewidth} p{0.55\linewidth}} 
    
    \toprule
    
    \multicolumn{1}{c}{Themes} & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Sub-themes} \\
    
    \hline
    -
    \multirow{5}{\linewidth}{1. Personal Characteristics and Dispositions} & 47 & 1a. Detachment, robustness and emotional maturity\\
  
    & ~ & 1b. Interpersonal skills\\
    & ~ & 1c. Openness and mental flexibility\\
    & ~ & 1d. Moderation in personality\\
    & ~ & 1e. Effective communication, calmness and confidence\\
       
    \noalign{\bigskip}
    
    \multirow{6}{\linewidth}{2. Crew Coordination and Cohesion} & 41 & 2a. Shared motivations and experiences\\
    
    & ~ & 2b. Hierarchy and work culture\\
    & ~ & 2c. Construction of mental model\\
    & ~ & 2d. Collective decision-making\\
    & ~ & 2e. Debriefing as a mechanism to evaluate decisions\\
    & ~ & 2f. Communication facilitates coordination\\

    \noalign{\bigskip}
    
    \multirow{6}{\linewidth}{3. Adaptive Planning} & 39 & 3a. Resource Awareness\\
    
    & ~ & 3b. Constant information gathering practice\\
    & ~ & 3c. Dealing with changes in circumstance\\
    & ~ & 3d. Creative and flexible approaches\\
    & ~ & 3e. Formulation of a working plan\\
    & ~ & 3f. Adopting a mental picture of the plan\\

    \noalign{\bigskip}
    
    \multirow{5}{\linewidth}{4. Domain Expertise and Currency} & 38 & 4a. Proficiency through time and experience\\
    
    & ~ & 4b. Constant information gathering practice\\
    & ~ & 4c. Training to maintain currency\\
    & ~ & 4d. Standard procedures as a foundation for automaticity\\
    & ~ & 4e. Cognitive availability as a product of familarity\\
    & ~ & 4f. Shared understanding of experience and perspective\\
    
    \noalign{\bigskip}
    
    \multirow{3}{\linewidth}{5. Metacognition and Workload Management} & 37 & 5a. Awareness of cognitive limitations\\
    
    & ~ & 5b. Strategies for maintaining alertness\\
    & ~ & 5c. Availability of cognitive badwidth\\
    
    \noalign{\bigskip}
    
    \multirow{3}{\linewidth}{6. Threat Assessment and Management} & 34 & 6a. Strategies for managing risk\\
    
    & ~ & 6b. Awareness of external factors and threats\\
    & ~ & 6c. Crew and environmental factors\\

    \end{tabular}
    \tablenote{N refers to number times a theme presented in the data set}
\end{table}
2
  • 1
    Welcome to TeX.SE. Please augment your code snippet to make it compilable without having to guess which package(s) may need to be loaded. A question: Are you allowed to use the xltabular package and its eponymous environment? The xltabular environment is built on, and is fully compatible with, both the longtable and the tabularx environments. Please advise.
    – Mico
    Commented Mar 21 at 10:30
  • Thanks @Mico, I have tried to use this package and this did not work. I followed the instructions in the APA7 documentation to add the endfloat.cfg file to the working directory and this tells me longtable* is already defined. I'm not too familiar with TeX as a whole and this appears to be quite a headache. I have also added the packages I am loading to the code snippet
    – Dylan
    Commented Mar 21 at 10:53

1 Answer 1

1
  1. Have you tried the recipe that AP7 gives (copying the file APA7endfloat.cfg)? If you do, it works.
  2. I would advise to use \multirow{<n>}{=} instead of \multirow{<n>}{\linewidth}, because that's the normal idiom for this in multirow.
  3. To also vertically center the numbers in the N column, put them in the same \multirow as the first entry in the row.
  4. Some "blocks" in the rightmost column get line breaks, and then the total number of lines in that block becomes larger than the number in the \multirow in the first column. This causes the left column cell no longer to be correctly vertical centered. Correct the \multirow number to be equal to the actual number of lines the the right column.
  5. In order to prevent the page break to fall in the middle of a "block" (e.g. in this case somewhere between 4a and 4f) end all rows of the block, except the last one with \\* instead of \\. I would advise to do this for all such blocks, as you don't know where the page breaks will fall in the final document.
  6. Don't include the \usepackage{biblatex} yourself, but include biblatex and its options in the documentclass options.

This brings me to the following solution.

\documentclass[man, longtable, biblatex, floatsintext, hidelinks, 12pt, draftfirst,style=apa, sortcites=true,sorting=nyt]{apa7}
%\usepackage[style=apa, sortcites=true,sorting=nyt]{biblatex}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{pdflscape}
\usepackage{csquotes}
\usepackage{multirow}
\usepackage[formats]{listings}
\addbibresource{thesis.bib}
\usepackage{lipsum}

\title{My Title}
\shorttitle{Title}

\begin{document}

\lipsum[1]

\begin{longtable}{p{0.35\linewidth} p{0.05\linewidth} p{0.55\linewidth}}
    \caption{Sub-themes and quotes}
    \label{tab:themes-proto}\\
    
    \toprule
    
    \multicolumn{1}{c}{Themes} & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Sub-themes} \\
    
    \hline
    \endfirsthead

    \caption{Sub-themes and quotes (continued)}\\
    
    \toprule
    
    \multicolumn{1}{c}{Themes} & \multicolumn{1}{c}{N} & \multicolumn{1}{c}{Sub-themes} \\
    
    \hline
    \endhead
    
    \multirow{7}{=}{1. Personal Characteristics and Dispositions} & \multirow{7}{=}{47} & 1a. Detachment, robustness and emotional maturity\\*
  
    & ~ & 1b. Interpersonal skills\\*
    & ~ & 1c. Openness and mental flexibility\\*
    & ~ & 1d. Moderation in personality\\*
    & ~ & 1e. Effective communication, calmness and confidence\\
       
    \noalign{\bigskip}
    
    \multirow{6}{=}{2. Crew Coordination and Cohesion} & \multirow{6}{=}{41} & 2a. Shared motivations and experiences\\*
    
    & ~ & 2b. Hierarchy and work culture\\*
    & ~ & 2c. Construction of mental model\\*
    & ~ & 2d. Collective decision-making\\*
    & ~ & 2e. Debriefing as a mechanism to evaluate decisions\\*
    & ~ & 2f. Communication facilitates coordination\\

    \noalign{\bigskip}
    
    \multirow{6}{=}{3. Adaptive Planning} & \multirow{6}{=}{39} & 3a. Resource Awareness\\*
    
    & ~ & 3b. Constant information gathering practice\\*
    & ~ & 3c. Dealing with changes in circumstance\\*
    & ~ & 3d. Creative and flexible approaches\\*
    & ~ & 3e. Formulation of a working plan\\*
    & ~ & 3f. Adopting a mental picture of the plan\\

    \noalign{\bigskip}
    
    \multirow{8}{=}{4. Domain Expertise and Currency} & \multirow{8}{=}{38} & 4a. Proficiency through time and experience\\*
    
    & ~ & 4b. Constant information gathering practice\\*
    & ~ & 4c. Training to maintain currency\\*
    & ~ & 4d. Standard procedures as a foundation for automaticity\\*
    & ~ & 4e. Cognitive availability as a product of familarity\\*
    & ~ & 4f. Shared understanding of experience and perspective\\
    
    \noalign{\bigskip}
    
    \multirow{3}{=}{5. Metacognition and Workload Management} & \multirow{3}{=}{37} & 5a. Awareness of cognitive limitations\\*
    
    & ~ & 5b. Strategies for maintaining alertness\\*
    & ~ & 5c. Availability of cognitive badwidth\\
    
    \noalign{\bigskip}
    
    \multirow{3}{=}{6. Threat Assessment and Management} & \multirow{3}{=}{34} & 6a. Strategies for managing risk\\*
    
    & ~ & 6b. Awareness of external factors and threats\\*
    & ~ & 6c. Crew and environmental factors\\

    \tablenote{N refers to number times a theme presented in the data set}
\end{longtable}

\end{document}

enter image description here enter image description here

3
  • That’s very helpful thank you @Pieter van Oostrum, the only thing remaining for me is the positioning of the table. The [H] parameter doesn’t appear to do anything, have you got any advice in this case?
    – Dylan
    Commented Mar 23 at 7:55
  • The apa7 documentclass requires that all tables, figures etc. go to the end of the article. That is what the endfloat.cfg does. If you don’t copy that file, maybe it stays where you put it, but they may object to it. Commented Mar 23 at 11:29
  • That appears to work, with no errors too. Perfect, thanks again.
    – Dylan
    Commented Mar 23 at 21:33

You must log in to answer this question.

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