MWE(包含完整包裹清单)
\documentclass[english, bibliography=totoc]{scrreprt}
%%% PAGE DIMENSIONS
\usepackage{geometry}
\geometry{verbose,a4paper,tmargin=3.5cm,bmargin=2.5cm,lmargin=2.6cm,rmargin=2.6cm,headheight=1.3cm,headsep=1cm}
\pagestyle{headings}
%%% PACKAGES
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
\usepackage{amsmath, amsthm, amssymb, url}
\usepackage{enumitem}
\usepackage{mathrsfs}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{tabu,longtable,booktabs,caption}
\usepackage[pdftex]{graphicx,color}
\usepackage{scrpage2,datetime,tikz}
\usepackage[unicode=true]{hyperref}
\usepackage[numbered]{bookmark}
\usepackage{makecell}
%%% OPTIONS
\bibliographystyle{plain}
\setcounter{secnumdepth}{3}
\setlength{\parindent}{1em}
%\setlist{nolistsep}
\tabulinesep=^1.5mm_1.5mm
\tikzset{>=latex}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=black,
urlcolor=black
}
%%% DEFINITIONS
\newenvironment{myfont}{\fontfamily{phv}\selectfont}{\par}
\renewcommand{\dateseparator}{.}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\Wrap}{Wrap}
\begin{document}
{\centering
\begin{longtabu} to \linewidth {|[1.5pt] X[1,m,c] |[1.5pt] >{\centering\arraybackslash}m{5cm} |[1.5pt] >{\centering\arraybackslash}m{5cm} |[1.5pt]}
\tabucline[1.5pt]{-} \endhead
\tabucline[1.5pt]{-} \multicolumn{3}{|[1.5pt]c|[1.5pt]}{{Continued on next page}} \\ \tabucline[1.5pt]{-} \endfoot
\endlastfoot
\diaghead{\hskip\hsize}{Relative Distance}{Turn Direction}
& \begin{tikzpicture} \draw [->] (0,0) arc [radius=0.5, start angle=180, end angle= -90]; \draw [->] (2,0) arc [radius=0.5, start angle=180, end angle= -90]; \end{tikzpicture}
& \begin{tikzpicture} \draw [->] (0,0) arc [radius=0.5, start angle=180, end angle= -90]; \draw [->] (2.5,-0.5) arc [radius=0.5, start angle=-90, end angle= 180]; \end{tikzpicture} \\ \tabucline[1.5pt]{-}
& & \\ \tabucline[1.5pt]{-}
\end{longtabu}}
\end{document}
我最终得到:
我的问题是:
- 对角线太细
- 对角线不接触单元格的角
有人能建议如何实现我的愿望吗?我已经检查过了这里这就是我找到makecell
包和的方法\diaghead
,但结果却很差,正如你所见。
答案1
根据我对另一个问题的回答,我必须在这里使其适应环境longtabu
。
对于这种情况,不需要指定对角线单元格的宽度,因为它已由 预先计算tabu
。只有垂直尺寸是必要的。
将以下宏定义添加到您的序言中:
\newcommand\diag[4][line cap=round, line width=1.5pt]{%
% #1 diagonal line style (optional), #2 vertical size of the cell, #3 and #4 labels
$\vcenter{\begin{tikzpicture}[baseline=0,anchor=south west,inner sep=1pt]
\path[use as bounding box] (0,0) rectangle (\linewidth,#2);
\node[minimum width=\linewidth,
minimum height=#2] (box) {};
\draw[#1] (box.north west) -- (box.south east);
\node[anchor=south west] at (box.south west) {#3};
\node[anchor=north east] at (box.north east) {#4};
\end{tikzpicture}}$}
并改变你的线路:
\diaghead{\hskip\hsize}{Relative Distance}{Turn Direction}
到
\diag{1.2cm}{Relative Distance}{Turn Direction}
得到这个:
当然,您可以尝试不同的垂直尺寸,甚至通过第一个可选参数更改对角线的样式:
\diag[thick, gray]{1.2cm}{Relative Distance}{Turn Direction}%
如您所见,对角线没有到达单元格的角落。这是因为tabu
总是在单元格内容周围添加填充,而我找不到存储这些尺寸的变量的名称。不过,目前看起来还不错。