Skip to content

横排图表

mohuangrui edited this page Dec 10, 2019 · 6 revisions

论文中应尽量避免横排图表的使用。在此提供横排图表的两种实现方式:

使用 landscape 环境

  1. 在 Thesis.tex 中启用 artratex.sty 的 lscape 环境:
\usepackage[authoryear,list,lscape]{Style/artratex}% document settings
  1. 使用 landscape 环境放置图table放置表figure
\begin{landscape}% 横排页环境
\begin{table}%
    \bicaption{这是一个横排样表。}{This is a rotated sample table.}
    \label{tab:rotatedsamplelscape}
    \centering
    \begin{tabular}{lcccccccc}
        \hline
        \textbf{Type} & Avg1 & Avg2 & Avg3 & Avg4 & Avg5 & Avg6 & Avg7 & Avg8 \\
        \hline
        BS & 79.24 & 84.33 & 77.75 & 80.50 & 51.90 & 49.20 & 9.10 & 100.00 \\
        BC & 77.83 & 77.30 & 75.81 & 77.92 & 55.80 & 46.30 & 12.30 & 100.00 \\
        CE & 90.96 & 83.29 & 87.44 & 91.19 & 84.90 & 29.70 & 14.70 & 100.00 \\
        CHES & 94.84 & 83.97 & 82.16 & 95.22 & 72.40 & 42.90 & 15.30 & 100.00 \\
        CA & 86.68 & 81.16 & 83.76 & 86.07 & 76.80 & 40.90 & 18.50 & 100.00 \\
        DER & 87.82 & 62.03 & 73.37 & 86.96 & 64.40 & 37.20 & 4.50 & 100.00 \\
        EC & 84.62 & 85.43 & 85.43 & 84.97 & 60.00 & 38.20 & 13.60 & 100.00 \\
        GI & 74.12 & 69.83 & 68.95 & 74.12 & 59.90 & 40.80 & 15.10 & 100.00 \\
        HR & 72.62 & 73.39 & 63.39 & 69.54 & 49.30 & 49.30 & 13.10 & 100.00 \\
        HEP & 86.25 & 85.00 & 81.25 & 86.25 & 71.70 & 43.40 & 17.80 & 100.00 \\
        IS & 97.19 & 97.23 & 95.80 & 97.14 & 70.60 & 27.60 & 15.90 & 100.00 \\
        ION & 94.02 & 93.45 & 93.17 & 93.73 & 52.50 & 47.50 & 12.90 & 100.00 \\
        IRS & 95.33 & 93.33 & 84.00 & 96.00 & 54.20 & 26.90 & 9.50 & 100.00 \\
        \hline
    \end{tabular}
\end{table}
\end{landscape}
  1. 效果如下图,此方式通过横置页面实现横排,从而不妨碍阅读,对于图也是只需用 landscape 环境放置即可,打印后图表顶部都朝左。
ls1
  1. 如果需要将页眉页脚也横排,可以启用 \pagestyle{lscape} 样式:
\begin{landscape}% 横排页环境
\pagestyle{lscape}% 横排页眉页脚样式
\begin{table}%
    \bicaption{这是一个横排样表。}{This is a rotated sample table.}
    \label{tab:rotatedsamplelscape}
    \centering
    \begin{tabular}{lcccccccc}
        \hline
        \textbf{Type} & Avg1 & Avg2 & Avg3 & Avg4 & Avg5 & Avg6 & Avg7 & Avg8 \\
        \hline
        BS & 79.24 & 84.33 & 77.75 & 80.50 & 51.90 & 49.20 & 9.10 & 100.00 \\
        BC & 77.83 & 77.30 & 75.81 & 77.92 & 55.80 & 46.30 & 12.30 & 100.00 \\
        CE & 90.96 & 83.29 & 87.44 & 91.19 & 84.90 & 29.70 & 14.70 & 100.00 \\
        CHES & 94.84 & 83.97 & 82.16 & 95.22 & 72.40 & 42.90 & 15.30 & 100.00 \\
        CA & 86.68 & 81.16 & 83.76 & 86.07 & 76.80 & 40.90 & 18.50 & 100.00 \\
        DER & 87.82 & 62.03 & 73.37 & 86.96 & 64.40 & 37.20 & 4.50 & 100.00 \\
        EC & 84.62 & 85.43 & 85.43 & 84.97 & 60.00 & 38.20 & 13.60 & 100.00 \\
        GI & 74.12 & 69.83 & 68.95 & 74.12 & 59.90 & 40.80 & 15.10 & 100.00 \\
        HR & 72.62 & 73.39 & 63.39 & 69.54 & 49.30 & 49.30 & 13.10 & 100.00 \\
        HEP & 86.25 & 85.00 & 81.25 & 86.25 & 71.70 & 43.40 & 17.80 & 100.00 \\
        IS & 97.19 & 97.23 & 95.80 & 97.14 & 70.60 & 27.60 & 15.90 & 100.00 \\
        ION & 94.02 & 93.45 & 93.17 & 93.73 & 52.50 & 47.50 & 12.90 & 100.00 \\
        IRS & 95.33 & 93.33 & 84.00 & 96.00 & 54.20 & 26.90 & 9.50 & 100.00 \\
        \hline
    \end{tabular}
\end{table}
\end{landscape}
  1. 效果如下图(至于页眉页脚微调位置,居中还是居左,请自行调整):

image

  1. 源于 caijun,issue #420,thuthesis中的讨论,如果需要通过“将表格放在 \minipage 环境中,而且将表格的宽度设置为 \minipage 的宽度”的方法添加脚注,因似乎在 landscape 环境中 \minipage 无法正确处理 \textwidth\textheight。修正方法为使用 \paperheight (注:landscape 环境内 widthheight 需要置换),即使用:
\begin{landscape}% 横排页环境
\pagestyle{lscape}% 横排页眉页脚样式
\begin{table}%
    \bicaption{这是一个横排样表。}{This is a rotated sample table.}
    \label{tab:rotatedsamplelscape}
    \centering
    \begin{minipage}[t]{0.45\paperheight}
        \begin{tabular}{lcccccccc}
            \hline
            \textbf{Type} & Avg1 & Avg2 & Avg3 & Avg4 & Avg5 & Avg6 & Avg7 & Avg8 \\
            \hline
            BS$^a$ & 79.24 & 84.33 & 77.75 & 80.50 & 51.90 & 49.20 & 9.10 & 100.00 \\
            BC & 77.83 & 77.30 & 75.81 & 77.92 & 55.80 & 46.30 & 12.30 & 100.00 \\
            CE & 90.96 & 83.29 & 87.44 & 91.19 & 84.90 & 29.70 & 14.70 & 100.00 \\
            CHES$^b$ & 94.84 & 83.97 & 82.16 & 95.22 & 72.40 & 42.90 & 15.30 & 100.00 \\
            CA & 86.68 & 81.16 & 83.76 & 86.07 & 76.80 & 40.90 & 18.50 & 100.00 \\
            DER & 87.82 & 62.03 & 73.37 & 86.96 & 64.40 & 37.20 & 4.50 & 100.00 \\
            EC & 84.62 & 85.43 & 85.43 & 84.97 & 60.00 & 38.20 & 13.60 & 100.00 \\
            GI & 74.12 & 69.83 & 68.95 & 74.12 & 59.90 & 40.80 & 15.10 & 100.00 \\
            HR & 72.62 & 73.39 & 63.39 & 69.54 & 49.30 & 49.30 & 13.10 & 100.00 \\
            HEP & 86.25 & 85.00 & 81.25 & 86.25 & 71.70 & 43.40 & 17.80 & 100.00 \\
            IS & 97.19 & 97.23 & 95.80 & 97.14 & 70.60 & 27.60 & 15.90 & 100.00 \\
            ION$^c$ & 94.02 & 93.45 & 93.17 & 93.73 & 52.50 & 47.50 & 12.90 & 100.00 \\
            IRS & 95.33 & 93.33 & 84.00 & 96.00 & 54.20 & 26.90 & 9.50 & 100.00 \\
            \hline
        \end{tabular}
        \par\medskip\footnotesize
        注:$^a$流行开始和结束时间的周数是以每年的第35周作为一个流感监测年度的第1周计数。\\
        $^b$开始强度和结束强度分别表示流感流行开始和结束时流感活动强度。\\
        $^c$每个流感监测年度的流感病毒优势亚型信息来自文献\citep{lamport1986document}
    \end{minipage}
\end{table}
\end{landscape}
  1. 效果如下图,取决于表的横向长度,有时需适当修正 0.45\paperheight 中的 0.45 以使表格居中。

image

使用 sideways 环境

  1. 在 Thesis.tex 中启用 artratex.sty 的 table 环境:
\usepackage[authoryear,list,table]{Style/artratex}% document settings
  1. 使用 sidewaystable 替换图table 和使用 sidewaysfigure 替换表figure 。此方案只横排图表不横排页,从而需扭头观看:
\setupctable{captionsleft}% 标题朝向
\begin{sidewaystable}% 横排表环境
    \bicaption{这是一个横排样表。}{This is a rotated sample table.}
    \label{tab:rotatedsamplesideway}
    \centering
    \begin{tabular}{lcccccccc}
        \hline
        \textbf{Type} & Avg1 & Avg2 & Avg3 & Avg4 & Avg5 & Avg6 & Avg7 & Avg8 \\
        \hline
        BS & 79.24 & 84.33 & 77.75 & 80.50 & 51.90 & 49.20 & 9.10 & 100.00 \\
        BC & 77.83 & 77.30 & 75.81 & 77.92 & 55.80 & 46.30 & 12.30 & 100.00 \\
        CE & 90.96 & 83.29 & 87.44 & 91.19 & 84.90 & 29.70 & 14.70 & 100.00 \\
        CHES & 94.84 & 83.97 & 82.16 & 95.22 & 72.40 & 42.90 & 15.30 & 100.00 \\
        CA & 86.68 & 81.16 & 83.76 & 86.07 & 76.80 & 40.90 & 18.50 & 100.00 \\
        DER & 87.82 & 62.03 & 73.37 & 86.96 & 64.40 & 37.20 & 4.50 & 100.00 \\
        EC & 84.62 & 85.43 & 85.43 & 84.97 & 60.00 & 38.20 & 13.60 & 100.00 \\
        GI & 74.12 & 69.83 & 68.95 & 74.12 & 59.90 & 40.80 & 15.10 & 100.00 \\
        HR & 72.62 & 73.39 & 63.39 & 69.54 & 49.30 & 49.30 & 13.10 & 100.00 \\
        HEP & 86.25 & 85.00 & 81.25 & 86.25 & 71.70 & 43.40 & 17.80 & 100.00 \\
        IS & 97.19 & 97.23 & 95.80 & 97.14 & 70.60 & 27.60 & 15.90 & 100.00 \\
        ION & 94.02 & 93.45 & 93.17 & 93.73 & 52.50 & 47.50 & 12.90 & 100.00 \\
        IRS & 95.33 & 93.33 & 84.00 & 96.00 & 54.20 & 26.90 & 9.50 & 100.00 \\
        \hline
    \end{tabular}
\end{sidewaystable}
sidetable
\setupctable{captionsleft}% 标题朝向
\begin{sidewaysfigure}[!htbp]
    \centering
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_a}
      \caption{}
      \label{fig:oaspl_a}
    \end{subfigure}%
    ~% add desired spacing
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_b}
      \caption{}
      \label{fig:oaspl_b}
    \end{subfigure}
    \\% line break
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_c}
      \caption{}
      \label{fig:oaspl_c}
    \end{subfigure}%
    ~% add desired spacing
    \begin{subfigure}[b]{0.35\textwidth}
      \includegraphics[width=\textwidth]{oaspl_d}
      \caption{}
      \label{fig:oaspl_d}
    \end{subfigure}
    \bicaption{总声压级。(a) 这是子图说明信息,(b) 这是子图说明信息,(c) 这是子图说明信息,(d) 这是子图说明信息。}{OASPL.(a) This is the explanation of subfig, (b) This is the explanation of subfig, (c) This is the explanation of subfig, (d) This is the explanation of subfig.}
    \label{fig:oaspl}
\end{sidewaysfigure}
sidefig
Clone this wiki locally