長い表、キャプション、メモの位置を調整する必要があります - 幅調整は機能しません

長い表、キャプション、メモの位置を調整する必要があります - 幅調整は機能しません

論文を提出したいのですが、ジャーナルが提供するテンプレートを使用する必要があり、左側の大きなオフセットなど、複数の制限があります。今、複数のページにまたがる表を作成したいのですが (表環境を使用できません)、正しい方法で調整できません。キャプションと表の注釈は、オフセットなしで左側から開始する必要があります。表自体は中央に配置する必要があります。現在、表の注釈も表と同じ環境内にありません。誰かが解決策を持っていることを願っています。

表 1 は、それがどのように見えるかを示しています。表 2 は、それが現在どのように見えるかを示しています。

ここに私のサンプルコードがあります:

\documentclass[10pt,letterpaper]{article}
\usepackage[top=0.85in,left=2.75in,footskip=0.75in]{geometry}
\usepackage{changepage}
% Text layout
\raggedright
\setlength{\parindent}{0.5cm}
\textwidth 5.25in 
\textheight 8.75in

% Captions will be left justified
\usepackage[aboveskip=1pt,labelfont=bf,labelsep=period,justification=raggedright,singlelinecheck=off]{caption}

% Header and Footer
\usepackage{fancyhdr}
\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}
\setlength{\headheight}{27.023pt}
\rfoot{\thepage/\pageref{LastPage}}
\renewcommand{\footrule}{\hrule height 2pt \vspace{2mm}}
\fancyheadoffset[L]{2.25in}
\fancyfootoffset[L]{2.25in}

% ltablex package
\usepackage{ltablex}

\begin{document}

This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout. \\

\begin{table}[!ht]
    \begin{adjustwidth}{-2.25in}{0in}
        \centering
        \caption{
            {\bf Table caption... This is how it should look like.}}
        \begin{tabular}{|l|l|l|l|l|l|l|l|}
            \hline
            \multicolumn{4}{|l|}{\bf Heading 1} & \multicolumn{4}{|l|}{\bf Heading 2}\\
            \hline
            $cell1 row1$ & cell2 row 1 & cell3 row 1 & cell4 row 1 & cell5 row 1 & cell6 row 1 & cell7 row 1 & cell8 row 1\\ \hline
            $cell1 row2$ & cell2 row 2 & cell3 row 2 & cell4 row 2 & cell5 row 2 & cell6 row 2 & cell7 row 2 & cell8 row 2\\ \hline
            $cell1 row3$ & cell2 row 3 & cell3 row 3 & cell4 row 3 & cell5 row 3 & cell6 row 3 & cell7 row 3 & cell8 row 3\\ \hline
        \end{tabular}
            \begin{flushleft} Table notes...
            \end{flushleft}
        \label{table1}
    \end{adjustwidth}
\end{table}

\begin{longtable}{|l|l|l|l|l|l|l|}%{@{\extracolsep{\fill}}|l+l|l|l|l|l|l|@{}}
    \caption{
    \bf{Table caption... This is how it looks like.}} \\
    \hline
    & \multicolumn{3}{l}{Top Heading 1} \vline & \multicolumn{3}{l}{Top Heading 2} \vline \\
Heading 1                 & Heading 2   & Heading 3   & Heading 4   & Heading 5 & Heading 6 & Heading 7 \\ 
    \hline
    \endfirsthead
    \multicolumn{7}{l}
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
    \hline
    & \multicolumn{3}{l}{Top Heading 1} \vline & \multicolumn{3}{l}{Top Heading 2} \vline \\
Heading 1                 & Heading 2   & Heading 3   & Heading 4   & Heading 5 & Heading 6 & Heading 7 \\ 
    \hline
    \endhead
    \hline \multicolumn{7}{r}{\textit{Continued on next page}} \\
    \endfoot
    \hline
    \endlastfoot
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6        \\
    Text                   & 1         & 2     & 3          & 4       & 5       & 6             \label{table2}
\end{longtable}
Table notes...


\end{document}

よろしくお願いします!

答え1

負の値を使用して、長テーブルを余白内へ移動できます\LTleft。キャプションcaptionもパッケージと負の余白を使用して移動できます。

\usepackage{ltablex} 
\usepackage{caption}
\captionsetup[longtable]{margin=-2.25in}
\setlength{\LTleft}{-2.25in}

ここに画像の説明を入力してください

答え2

編集: 下のコメントで質問を明確にした後、longtable右端にはみ出さない幅広のものを希望していることも明らかになりました。これに対する解決策の1つは、ウルリケ以下に回答があるので、ここにいくつかの変更を追加します (長いテーブルはadjustwidth環境内のテーブルと同じ幅になります)。

MWE の次の変更が受け入れられるかどうかを確認してください。

\documentclass{article}
\usepackage[letterpaper,
            top=0.85in,left=2.75in,footskip=0.75in]{geometry}
\usepackage{changepage}
% Text layout
\raggedright
\setlength{\parindent}{0.5cm}
%\textwidth 5.25in
%\textheight 8.75in

% Captions will be left justified
\usepackage[aboveskip=1pt,labelfont=bf,labelsep=period,
            justification=raggedright,singlelinecheck=off]{caption}

% Header and Footer
\usepackage{fancyhdr}
\pagestyle{myheadings}
\pagestyle{fancy}
\fancyhf{}
\setlength{\headheight}{27.023pt}
\rfoot{\thepage/\pageref{LastPage}}
\renewcommand{\footrule}{\hrule height 2pt \vspace{2mm}}
\fancyheadoffset[L]{2.25in}
\fancyfootoffset[L]{2.25in}

% ltablex package
\usepackage{makecell, % for two line column headers, macro  \thead{...\\...}
            ltablex}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}

\begin{document}

This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout. \\

\begin{table}[!ht]
    \begin{adjustwidth}{-2.25in}{0in}
        \centering
        \caption{Table caption... This is how it should look like.}
        \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                                    |l|l|l|l|l|l|l|l|}
            \hline
            \multicolumn{4}{|l|}{\textbf{Heading 1}} & \multicolumn{4}{l|}{\textbf{Heading 2}}\\
            \hline
            $cell1 row1$ & cell2 row 1 & cell3 row 1 & cell4 row 1 & cell5 row 1 & cell6 row 1 & cell7 row 1 & cell8 row 1\\ \hline
            $cell1 row2$ & cell2 row 2 & cell3 row 2 & cell4 row 2 & cell5 row 2 & cell6 row 2 & cell7 row 2 & cell8 row 2\\ \hline
            $cell1 row3$ & cell2 row 3 & cell3 row 3 & cell4 row 3 & cell5 row 3 & cell6 row 3 & cell7 row 3 & cell8 row 3\\ \hline
        \end{tabular*}

        \raggedright
        Table notes...
        \label{table1}
    \end{adjustwidth}
\end{table}

{\setlength{\LTleft}{-2.25in}
 \setlength{\LTright}{0in}
 \setlength{\LTcapwidth}{\dimexpr\linewidth+4.5in\relax}
    \begin{longtable}{@{\extracolsep{\fill}}
                      |l|l|l|l|l|l|l|}

    \caption{Table caption... This is how it looks like.}
    \label{tab:my long table}\\
    \hline
    & \multicolumn{3}{l|}{Top Heading 1}
        & \multicolumn{3}{l|}{Top Heading 2}        \\
Heading 1 & Heading 2 & Heading 3 & Heading 4 & Heading 5 & Heading 6 & Heading 7 \\
    \hline
    \endfirsthead
    \caption{ -- \textit{Continued from previous page}} \\
    \hline
    & \multicolumn{3}{l|}{Top Heading 1} & \multicolumn{3}{l|}{Top Heading 2}        \\
Heading 1 & Heading 2 & Heading 3 & Heading 4 & Heading 5 & Heading 6 & Heading 7   \\

    \hline
    \endhead
    \hline \multicolumn{7}{r}{\textit{Continued on next page}} \\
    \endfoot
    \hline
    \endlastfoot
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6
\end{longtable}
}
Table notes...

\end{document}

結果は次のようになります(最初のページの上部)。

ここに画像の説明を入力してください

(2ページ目上部):

ここに画像の説明を入力してください

  • 表のメモに関しては、threparttable(またはthreparttablex) が表のメモの書き方を改善できるかどうかを確認します。
  • booktabsパッケージのルールを使用し、垂直方向のルールを省略すると、よりプロフェッショナルな外観のテーブルが得られます。

ここに画像の説明を入力してください

上記のmweの変更点は次のとおりです。

...
\usepackage{booktabs,
            ltablex}

\begin{document}

This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout.
This is just a dummy text to show the general text layout. \\

\begin{table}[!ht]
    \begin{adjustwidth}{-2.25in}{0in}
        \centering
        \caption{Table caption... This is how it should look like.}
        \begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}
                                     lll lll ll}
            \toprule
            \multicolumn{4}{l}{\textbf{Heading 1}} & \multicolumn{4}{l}{\textbf{Heading 2}}\\
            \midrule
            $cell1 row1$ & cell2 row 1 & cell3 row 1 & cell4 row 1 & cell5 row 1 & cell6 row 1 & cell7 row 1 & cell8 row 1\\ 
            $cell1 row2$ & cell2 row 2 & cell3 row 2 & cell4 row 2 & cell5 row 2 & cell6 row 2 & cell7 row 2 & cell8 row 2\\ 
            $cell1 row3$ & cell2 row 3 & cell3 row 3 & cell4 row 3 & cell5 row 3 & cell6 row 3 & cell7 row 3 & cell8 row 3\\ 
            \bottomrule
        \end{tabular*}

        \raggedright
        Table notes...
        \label{table1}
    \end{adjustwidth}
\end{table}

{\setlength{\LTleft}{-2.25in}
 \setlength{\LTright}{0in}
 \setlength{\LTcapwidth}{\dimexpr\linewidth+4.5in\relax}
    \begin{longtable}{@{\extracolsep{\fill}}
                      lll lll l
                      }
    \caption{Table caption... This is how it looks like.}
    \label{tab:my long table}\\
    \hline
    & \multicolumn{3}{l}{Top Heading 1}
        & \multicolumn{3}{l}{Top Heading 2}        \\
    \cmidrule(lr){2-4}\cmidrule(lr){5-7}
Heading 1 & Heading 2 & Heading 3 & Heading 4 & Heading 5 & Heading 6 & Heading 7 \\
    \toprule
    \endfirsthead
    \caption{ -- \textit{Continued from previous page}} \\
    \midrule
    & \multicolumn{3}{l}{Top Heading 1} & \multicolumn{3}{l|}{Top Heading 2}        \\
    \cmidrule(lr){1-4}\cmidrule(lr){5-7}
Heading 1 & Heading 2 & Heading 3 & Heading 4 & Heading 5 & Heading 6 & Heading 7   \\
    \midrule
    \endhead
    \midrule[\heavyrulewidth]
    \multicolumn{7}{r}{\textit{Continued on next page}} \\
    \endfoot
    \bottomrule
    \endlastfoot
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    \addlinespace
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    \addlinespace
    Text        & 1     & 2     & 3     & 4     & 5     & 6\\
    ...

関連情報