我想知道如何删除长表标题的边距(\captionsetup[longtable]{margin=0pt}
),而不越过给出的边距展示架包裹。
实际上,我认为我的标题已移到页面的左侧,因为它具有页面的预期宽度。
参见下图。
我的电脑上出现了这个问题,但背面。
我的版本是Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex 2016.4.19)
。
Overleaf 致力于Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Debian) (preloaded format=pdflatex 2017.11.22)
。
\documentclass[12pt,french]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{xspace}
\usepackage{longtable}
\usepackage{showframe}
\usepackage{lipsum}
\usepackage{babel}
\usepackage{caption}
\captionsetup[longtable]{margin=4pt}
\begin{document}
\lipsum[1]
\begin{longtable}{c}
\multicolumn{1}{c}{Item} \\ \hline
\endfirsthead
\multicolumn{1}{c}%
{{\bfseries \tablename\ \thetable{} -- suite}} \\
\hline \multicolumn{1}{c}{Item} \\ \hline
\endhead
\hline %\multicolumn{3}{|r|}{{Continued on next page}} \\ \hline
\endfoot
\hline % \hline
\caption{Test test test test test test test test test test test test test test test test.Test test test test test test test test test test test test test test test test.}
\label{tableau1}
\endlastfoot
1 \\
2\\
\end{longtable}
\lipsum[1]
\end{document}
答案1
问题在于 \caption 命令后的虚假空格。它们将标题稍微向左推:
\documentclass[12pt,french]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{xspace}
\usepackage{longtable}
\usepackage{showframe}
\usepackage{lipsum}
\usepackage{babel}
\usepackage{caption}
\captionsetup[longtable]{margin=0pt}
\begin{document}
\lipsum[1]
\begin{longtable}{c}
\caption{Test test test test test test test test test test test test test
test test test.Test test test test test test test test test
test test test test test test test.}%<---
\label{tableau1}%<----
\endlastfoot
1 \\
2\\
\end{longtable}
\begin{longtable}{c}
\caption{Test test test test test test test test test test test test test
test test test.Test test test test test test test test test
test test test test test test test.} %<---
\label{tableau1} %<----
\endlastfoot
1 \\
2\\
\end{longtable}
\lipsum[1]
\end{document}