TransWikia.com

How to keep section heading and footnotes on a landscape table

TeX - LaTeX Asked by AntVal on October 25, 2020

I have a wide table and I’m trying to include both footnotes and the section heading in the same page. Ideally it would also be great to keep the page number in the bottom and not on the side (I included thispagestyle{empty} to address that.
Here’s what I have:

documentclass[12pt]{article}

usepackage{amssymb,amsmath,
    amsfonts,eurosym,geometry,ulem,
    graphicx,caption,color,setspace,
    sectsty,comment,footmisc,caption,
    pdflscape,subfigure,array,hyperref, 
    longtable, tabularx, url, lipsum, 
    array, scrlayer, lscape}

begin{document}

pagebreak newpage
section{Time table} 
begin{flushleft}
begin{landscape}

thispagestyle{empty}

begin{table}[htbp]
        small
        begin{tabular}{|c|c|c|c|c|c|}
            hline
             & Mar/20 - Aug/20 & Sept/20 - Feb/21 & Mar/21 - Aug/21 & Sept/21 - Feb/22 footnote{Conditional on XX, I expect YYYYY} &Mar/22 - Aug/22
             & Aug/20 & Feb/21 & Aug/21 &  Feb/22 &Aug/22hline
               Course Work and & $sqrt{}$&$sqrt{}$&&&
                Summer Schools &  &  &  &  &  
            hline
         Paper 1: & $sqrt{}$ &  &  &  &  
                 Data collection &  &  &  &  & hline
               Paper 1: Data & $sqrt{}$ & $sqrt{}$&  &  &  
               analysis and writing & & &  &  &  
            hline
               Paper 1: Presenting & &$sqrt{}$&$sqrt{}$&&
               and submission &   &  &  &  &   
              hline
            Paper 3: & $sqrt{}$ & $sqrt{}$ &  &  &  
            Data collection &&  &  &  & hline
            Paper 3: Data &  & $sqrt{}$ & $sqrt{}$ &  &  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 3: Presenting & &&$sqrt{}$&$sqrt{}$&
            and submission &   &  &  &  &   
            hline
            Paper 2: &  & $sqrt{}$ &$sqrt{}$&&  
            Data collection &  &  &  &  & hline
            Paper 2: Data &  &  &$sqrt{}$&$sqrt{}$&  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 2: Presenting &  &  &&$sqrt{}$& $sqrt{}$ 
                           and submission &   &  &  &  &   
                                  hline
          Teaching seminar &&&$sqrt{}$&&  
                                              hline
          Preparation of &&&&$sqrt{}$& $sqrt{}$
          final manuscript &&&&&  
                                              hline 
         Dissertation manuscript &&&&& $sqrt{}$
         submission &&&&&  
                                                                                            hline                             
        end{tabular}
        caption{Project timetable.}
        label{tab:Project timetable}
    end{table}
end{landscape}
end{flushleft}



pagebreak newpage

end{document}

Any idea on how to keep the footnote in and the section all in the landscaped page?

Many thanks!

One Answer

These solutions use two minipages. The first spans the entire page, while the second is only as wide as the tabular (which is wider than linewidth). Adding section also made it too tall.

To fit the footnote text into the smaller minipage I had to use separate footnotemark and footnotetext. Note that these are not automatically hyperlinked nor use the same format/counter inside a minipage.

This solution prints the section in landscape.

documentclass[12pt]{article}
usepackage{geometry}
usepackage{amssymb,amsmath,
    amsfonts,eurosym,ulem,
    graphicx,caption,color,setspace,
    sectsty,comment,footmisc,caption,
    pdflscape,subfigure,array,hyperref, 
    longtable, tabularx, url, lipsum, 
    array, scrlayer}

begin{document}
Normal page.

begin{landscape}
  thispagestyle{empty}
  ifoddvalue{page}relax
    dimen0=oddsidemargin
  else
    dimen0=evensidemargin
  fi
  noindenthspace{dimexpr 1in+topmargin+headheight+headsep+linewidth-paperheight}% left edge
  raisebox{0pt}[dimexpr height-1in-dimen0][0pt]{rlap{%
  begin{minipage}[c][paperwidth][c]{paperheight}% spans entire page
    defthefootnote{{itshapealph{footnote}}}%
    sbox0{% measure width of tabular
        letthempfn=thempfootnote
        small
        begin{tabular}[t]{|c|c|c|c|c|c|}
            hline
             & Mar/20 - Aug/20 & Sept/20 - Feb/21 & Mar/21 - Aug/21 & Sept/21 - Feb/22 hyperlink{mpfoot.1}{footnotemark[1]} &Mar/22 - Aug/22
             & Aug/20 & Feb/21 & Aug/21 &  Feb/22 &Aug/22hline
               Course Work and & $sqrt{}$&$sqrt{}$&&&
                Summer Schools &  &  &  &  &  
            hline
         Paper 1: & $sqrt{}$ &  &  &  &  
                 Data collection &  &  &  &  & hline
               Paper 1: Data & $sqrt{}$ & $sqrt{}$&  &  &  
               analysis and writing & & &  &  &  
            hline
               Paper 1: Presenting & &$sqrt{}$&$sqrt{}$&&
               and submission &   &  &  &  &   
              hline
            Paper 3: & $sqrt{}$ & $sqrt{}$ &  &  &  
            Data collection &&  &  &  & hline
            Paper 3: Data &  & $sqrt{}$ & $sqrt{}$ &  &  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 3: Presenting & &&$sqrt{}$&$sqrt{}$&
            and submission &   &  &  &  &   
            hline
            Paper 2: &  & $sqrt{}$ &$sqrt{}$&&  
            Data collection &  &  &  &  & hline
            Paper 2: Data &  &  &$sqrt{}$&$sqrt{}$&  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 2: Presenting &  &  &&$sqrt{}$& $sqrt{}$ 
                           and submission &   &  &  &  &   
                                  hline
          Teaching seminar &&&$sqrt{}$&&  
                                              hline
          Preparation of &&&&$sqrt{}$& $sqrt{}$
          final manuscript &&&&&  
                                              hline 
         Dissertation manuscript &&&&& $sqrt{}$
         submission &&&&&  
         hline                             
     end{tabular}}%
    centering
    begin{minipage}{dimexpr wd0+ht1+dp1}
      section{Time table}
      usebox0raisebox{ht0}{rotatebox{-90}{rlap{usebox1}}}
      hypertarget{mpfoot.1}{footnotetext[1]{Conditional on XX, I expect YYYYY}}
      captionof{table}{Project timetable.}
      label{tab:Project timetable}
    end{minipage}
  end{minipage}}}%paperheight

end{landscape}

end{document}

This version rotates the section back into its normal position.

documentclass[12pt]{article}
usepackage{geometry}
usepackage{amssymb,amsmath,
    amsfonts,eurosym,ulem,
    graphicx,caption,color,setspace,
    sectsty,comment,footmisc,caption,
    pdflscape,subfigure,array,hyperref, 
    longtable, tabularx, url, lipsum, 
    array, scrlayer}

begin{document}
Normal page.

begin{landscape}
  thispagestyle{empty}
  ifoddvalue{page}relax
    dimen0=oddsidemargin
  else
    dimen0=evensidemargin
  fi
  dimen1=textwidth
  noindenthspace{dimexpr 1in+topmargin+headheight+headsep+linewidth-paperheight}% left edge
  raisebox{0pt}[dimexpr height-1in-dimen0][0pt]{rlap{%
  begin{minipage}[c][paperwidth][c]{paperheight}
    defthefootnote{{itshapealph{footnote}}}%
    sbox0{% measure width of tabular
        letthempfn=thempfootnote
        small
        begin{tabular}[t]{|c|c|c|c|c|c|}
            hline
             & Mar/20 - Aug/20 & Sept/20 - Feb/21 & Mar/21 - Aug/21 & Sept/21 - Feb/22 hyperlink{mpfoot.1}{footnotemark[1]} &Mar/22 - Aug/22
             & Aug/20 & Feb/21 & Aug/21 &  Feb/22 &Aug/22hline
               Course Work and & $sqrt{}$&$sqrt{}$&&&
                Summer Schools &  &  &  &  &  
            hline
         Paper 1: & $sqrt{}$ &  &  &  &  
                 Data collection &  &  &  &  & hline
               Paper 1: Data & $sqrt{}$ & $sqrt{}$&  &  &  
               analysis and writing & & &  &  &  
            hline
               Paper 1: Presenting & &$sqrt{}$&$sqrt{}$&&
               and submission &   &  &  &  &   
              hline
            Paper 3: & $sqrt{}$ & $sqrt{}$ &  &  &  
            Data collection &&  &  &  & hline
            Paper 3: Data &  & $sqrt{}$ & $sqrt{}$ &  &  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 3: Presenting & &&$sqrt{}$&$sqrt{}$&
            and submission &   &  &  &  &   
            hline
            Paper 2: &  & $sqrt{}$ &$sqrt{}$&&  
            Data collection &  &  &  &  & hline
            Paper 2: Data &  &  &$sqrt{}$&$sqrt{}$&  
            analysis and writing &  &  &  &  &  
                        hline
            Paper 2: Presenting &  &  &&$sqrt{}$& $sqrt{}$ 
                           and submission &   &  &  &  &   
                                  hline
          Teaching seminar &&&$sqrt{}$&&  
                                              hline
          Preparation of &&&&$sqrt{}$& $sqrt{}$
          final manuscript &&&&&  
                                              hline 
         Dissertation manuscript &&&&& $sqrt{}$
         submission &&&&&  
         hline                             
       end{tabular}}%
  sbox1{parbox{dimen1}{section{Time table}}}%
  centering
    begin{minipage}{dimexpr wd0+ht1+dp1}
      usebox0raisebox{ht0}{rotatebox{-90}{rlap{usebox1}}}
      hypertarget{mpfoot.1}{footnotetext[1]{Conditional on XX, I expect YYYYY}}
      captionof{table}{Project timetable.}
      label{tab:Project timetable}
    end{minipage}
  end{minipage}}}%paperheight

end{landscape}

end{document}

Answered by John Kormylo on October 25, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP