如何将此表更改为行左对齐(1. 列可以左对齐)以及如何使用 CFF 在单元格中留出空间?是否可以将文本垂直居中在单元格中?谢谢
\documentclass[12pt,a4paper]{report}
\setlength\textwidth{145mm}
\setlength\textheight{247mm}
\setlength\oddsidemargin{15mm}
\setlength\evensidemargin{15mm}
\setlength\topmargin{0mm}
\setlength\headsep{0mm}
\setlength\headheight{0mm}
\let\openright=\clearpage
\usepackage[a-2u]{pdfx}
\usepackage[czech]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, graphicx}
\usepackage{array}
\usepackage{caption}
\usepackage[output-decimal-marker={,}]{siunitx}
\NewDocumentCommand{\anote}{}{\makebox[0pt][l]{$^*$}}
\usepackage[usenames]{xcolor}
\usepackage{amsfonts}
\usepackage{makecell,threeparttable}
\usepackage{amssymb}
\usepackage{dcolumn}
\setlength\heavyrulewidth{0.25ex}
\usepackage{multirow, tabularx}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
\usepackage{ragged2e}
\newcolumntype{d}[1]{D{.}{,}{#1}}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcommand\stack[1]{\multicolumn{1}{c}{\shortstack{#1}}}
\newcommand{\angstrom}{\mbox{\normalfont\AA}}
\newcolumntype{C}{>{\Centering\arraybackslash\hspace{0pt}}X}
\newcommand\mytab[1]{%
\bgroup%
\setlength\extrarowheight{0pt}%
\smash{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}%
\egroup}
%%% code block to handle the OP's follow-up question -- see
%%% https://tex.stackexchange.com/a/112002/5001 for the source
\usepackage{regexpatch}
\makeatletter
% Change the `-` delimiter to an active character
\xpatchparametertext\@cline{-}{\cA-}{}{}
\makeatother
\hfuzz=99pt
\begin{document}
\begin{table}[ht!]
\scriptsize
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{2pt} % default: 6pt
\begin{threeparttable}
\begin{tabularx}{\textwidth}{|*{5}{C|}>{\hsize=1.6\hsize}C| >{\hsize=0.4\hsize}C| *{3}{C|}}
\hline
\multirowcell{4}{Veličina} & \multicolumn{3}{c|}{[1]} & \multicolumn{2}{c|}{[2]} & [3] & \multicolumn{3}{c|}{[4]} \\
\cline{2-10}
\multicolumn{1}{|c|}{} &\multicolumn{3}{c|}{\multirowcell{1.5}{PHOEBE fotometrie a RV}}
& \multirow{3}{=}{\centering POWR analýza} & %
\multirow{3}{=}{\centering Řešení světelných křivek a RV} &
\multirowcell{3}{CFF }& \multirow{3}{=}{\centering Model malá hmotnost} & \multirow{3}{=}{\centering Model střední hmotnost} & \multirow{3}{=}{\centering Model velká hmotnost} \\[1ex]
\cline{2-4}
& \multirowcell{1.5}{Řešení I} & \multirowcell{1.5}{Řešení II} &\multirowcell{1.5}{Řešení III} & & & & & &\\ [1.5ex]
\hline
\end{tabularx}\vskip 0.3ex
\begin{tabularx}{\textwidth}{C|*{4}{C} >{\hsize=1.3\hsize}C >{\hsize=0.7\hsize}C *{3}{C}}
\hline
$P$ (dny) & & & & & & & & \\
$T_0$ (RJD) & & & & & & & & \\
$e$ ( ) & & & & & & & & \\
$\omega$ (\si{\degree}) & & & & & & & & \\
$K_1$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$K_2$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$a$ ($\mathrm{M}_{\odot}$) & & & & & & & & \\
$i$ (\si{\degree}) & & & & & & & \\
$T_1$ (\si{\kelvin}) & & & & & & & \\
$T_2$ (\si{\kelvin}) & & & & & & & \\
$\Omega_1$ (\si{\degree}) & & & & & & & \\
$\Omega_2$ (\si{\degree}) & & & & & & & \\
$q = \dfrac{M_2}{M_1}$ & & & & & & & \\
$M_1$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$M_2$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$R_1$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$R_2$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$V_{\gamma}$ (\si{\kilo\meter\per\second}) & & & & & & & \\
\end{tabularx}
\begin{tablenotes}[para,flushleft]
[1] \\
[2] \\
[3] \\
[4] \\
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
编辑
\documentclass[12pt,a4paper]{report}
\setlength\textwidth{145mm}
\setlength\textheight{247mm}
\setlength\oddsidemargin{15mm}
\setlength\evensidemargin{15mm}
\setlength\topmargin{0mm}
\setlength\headsep{0mm}
\setlength\headheight{0mm}
\let\openright=\clearpage
\usepackage[a-2u]{pdfx}
\usepackage[czech]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, graphicx,threeparttable}
\usepackage{array}
\usepackage{caption}
\usepackage[output-decimal-marker={,}]{siunitx}
\NewDocumentCommand{\anote}{}{\makebox[0pt][l]{$^*$}}
\usepackage[usenames]{xcolor}
\usepackage{amsfonts} % matematické fonty
\usepackage{amsthm} % sazba vět, definic apod.
\usepackage{bbding} % balíček s nejrůznějšími symboly
% (čtverečky, hvězdičky, tužtičky, nůžtičky, ...)
\usepackage{bm} % tučné symboly (příkaz \bm)
\usepackage{fancyvrb} % vylepšené prostředí pro strojové písmo
\usepackage{indentfirst} % zavede odsazení 1. odstavce kapitoly
\usepackage{natbib} % zajištuje možnost odkazovat na literaturu
% stylem AUTOR (ROK), resp. AUTOR [ČÍSLO]
\usepackage[nottoc]{tocbibind} % zajistí přidání seznamu literatury,
\usepackage{icomma}
\usepackage{booktabs} % lepší vodorovné linky v tabulkách
\usepackage{paralist} % lepší enumerate a itemize
\usepackage{makecell}
\usepackage{amssymb}
\usepackage{dcolumn}
\setlength\heavyrulewidth{0.25ex}
\usepackage{multirow, tabularx}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
\usepackage{ragged2e}
\newcolumntype{d}[1]{D{.}{,}{#1}}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcommand\stack[1]{\multicolumn{1}{c}{\shortstack{#1}}}
\newcommand{\angstrom}{\mbox{\normalfont\AA}}
\newcolumntype{C}{>{\Centering\arraybackslash\hspace{0pt}}X}
\newcommand\mytab[1]{%
\bgroup%
\setlength\extrarowheight{0pt}%
\smash{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}%
\egroup}
%%% code block to handle the OP's follow-up question -- see
%%% https://tex.stackexchange.com/a/112002/5001 for the source
\usepackage{regexpatch}
\makeatletter
% Change the `-` delimiter to an active character
\xpatchparametertext\@cline{-}{\cA-}{}{}
\makeatother
\hfuzz=99pt
\begin{document}
\begin{table}[ht!]
\scriptsize
\renewcommand{\cellset}{\renewcommand{\arraystretch}{0.75}\scriptsize}
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{2pt} % default: 6pt
\begin{threeparttable}
\begin{tabularx}{\textwidth}{C|*{2}{C} >{\hsize=0.7\hsize}C >{\hsize=1.3\hsize}Cc*{3}{C}}
\Xhline{0.8pt}\noalign{\vskip 0.4ex}\Xhline{0.8pt}%
\multirowcell{4}{Veličina} & \multicolumn{2}{c|}{[1]} & \multicolumn{2}{c|}{[2]} & \multicolumn{1}{c|}{[3]} & \multicolumn{3}{c|}{[4]} \\[0.4ex]
\cline{2-9}
\multicolumn{1}{|c|}{} &\multicolumn{2}{c|}{\multirowcell{1.5}{PHOEBE fotometrie a RV}}
&\multicolumn{1}{c|}{\multirowcell{3}{POWR\\ analýza}} & %
\multicolumn{1}{c|}{\multirowcell{3}{Řešení\\ světelných\\ křivek a RV}} &
\multicolumn{1}{c|}{ \multirowcell{3}{CFF }}&\multicolumn{1}{c|}{ \multirowcell{3}{Model\\malá\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ střední\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ velká\\ hmotnost}} \\[1ex]
\cline{2-3}
& \multicolumn{1}{c|}{\multirowcell{1.5}{Řešení II}} & \multicolumn{1} `{c|}{\multirowcell{1.5}{Řešení III}} & \multicolumn{1}{c|}{}& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} \\ [1.5ex]`
\Xhline{0.8pt}%
$P$ (dny) & & & & & & & \\
$T_0$ (RJD) & & & & & & && \\
$e$ ( ) & & & & & & & \\
$\omega$ (\si{\degree}) & & & & & & & \\
$K_1$ (\si{\kilo\meter\per\second}) & & & & & & & \\
$K_2$ (\si{\kilo\meter\per\second}) & & & & & & & \\
$a$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$i$ (\si{\degree}) & & & & & & & \\
$T_1$ (\si{\kelvin}) & & & & & & & \\
$T_2$ (\si{\kelvin}) & & & & & & & \\
$\Omega_1$ (\si{\degree}) & & & & & & & \\
$\Omega_2$ (\si{\degree}) & & & & & & & \\
$q = \dfrac{M_2}{M_1}$ & & & & & & & \\
$M_1$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$M_2$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$R_1$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$R_2$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$V_{\gamma }$ (\si{\kilo\meter\per\second}) & & & & & & & \\
\end{tabularx}
\begin{tablenotes}[para,flushleft]
\item[]\\{[1]} \\
{[2]} \\
{[3]} \\
{[4]} \\
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
答案1
这更符合您的要求吗?我稍微修改了 的值\hsize
,使用了单个值tabularx
,并将您的页面尺寸调整为geometry
(但不确定这是否正是您想要的。请检查):
\documentclass[12pt, a4paper]{report}
\usepackage[textwidth=145mm, textheight=247mm, nohead, showframe]{geometry}
\let\openright=\clearpage
%\usepackage[a-2u]{pdfx}
\usepackage[czech]{babel}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, graphicx}
\usepackage{array}
\usepackage{caption}
\usepackage[output-decimal-marker={,}]{siunitx}
\NewDocumentCommand{\anote}{}{\makebox[0pt][l]{$^*$}}
\usepackage[usenames]{xcolor}
\usepackage{amsfonts}
\usepackage{makecell,threeparttable}
\usepackage{amssymb}
\usepackage{dcolumn}
%\setlength\heavyrulewidth{0.25ex}
\usepackage{multirow, tabularx}
\newcommand{\mc}[1]{\multicolumn{1}{c}{#1}}
\usepackage{ragged2e}
\newcolumntype{d}[1]{D{.}{,}{#1}}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\newcommand\stack[1]{\multicolumn{1}{c}{\shortstack{#1}}}
\newcommand{\angstrom}{\mbox{\normalfont\AA}}
\newcolumntype{C}{>{\Centering\arraybackslash\hspace{0pt}}X}
\newcommand\mytab[1]{%
\bgroup%
\setlength\extrarowheight{0pt}%
\smash{\begin{tabular}[t]{@{}c@{}} #1 \end{tabular}}%
\egroup}
%%% code block to handle the OP's follow-up question -- see
%%% https://tex.stackexchange.com/a/112002/5001 for the source
\usepackage{regexpatch}
\makeatletter
% Change the `-` delimiter to an active character
\xpatchparametertext\@cline{-}{\cA-}{}{}
\makeatother
\hfuzz=99pt
\begin{document}
\begin{table}[ht!]
\scriptsize
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{2pt} % default: 6pt
\begin{threeparttable}
\begin{tabularx}{\textwidth}{|*{5}{C|}>{\hsize=1.5\hsize}C| >{\hsize=0.5\hsize}C| *{3}{C|}}
\hline
\multirowcell{4}{Veličina} & \multicolumn{3}{c|}{[1]} & \multicolumn{2}{c|}{[2]} & [3] & \multicolumn{3}{c|}{[4]} \\
\cline{2-10}
\multicolumn{1}{|c|}{} &\multicolumn{3}{c|}{\multirowcell{1.5}{PHOEBE fotometrie a RV}}
& \multirow{3}{=}{\centering POWR analýza} & %
\multirow{3}{=}{\centering Řešení světelných křivek a RV} &
\multirowcell{3}{CFF }& \multirow{3}{=}{\centering Model malá hmotnost} & \multirow{3}{=}{\centering Model střední hmotnost} & \multirow{3}{=}{\centering Model velká hmotnost} \\[1ex]
\cline{2-4}
& \multirowcell{1.5}{Řešení I} & \multirowcell{1.5}{Řešení II} &\multirowcell{1.5}{Řešení III} & & & & & &\\ [1.5ex]
\hline\noalign{\vskip 0.5ex}
\hline
$P$ (dny) & & & & & & & & \\
$T_0$ (RJD) & & & & & & & & \\
$e$ ( ) & & & & & & & & \\
$\omega$ (\si{\degree}) & & & & & & & & \\
$K_1$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$K_2$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$a$ ($\mathrm{M}_{\odot}$) & & & & & & & & \\
$i$ (\si{\degree}) & & & & & & & \\
$T_1$ (\si{\kelvin}) & & & & & & & \\
$T_2$ (\si{\kelvin}) & & & & & & & \\
$\Omega_1$ (\si{\degree}) & & & & & & & \\
$\Omega_2$ (\si{\degree}) & & & & & & & \\
$q = \dfrac{M_2}{M_1}$ & & & & & & & \\
$M_1$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$M_2$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$R_1$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$R_2$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$V_{\gamma}$ (\si{\kilo\meter\per\second}) & & & & & & & \\
\end{tabularx}
\begin{tablenotes}[para,flushleft]
\item[]\\{[1]} \\
{[2]} \\
{[3]} \\
{[4]} \\
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}
如果您不想在表格的第二部分出现垂直线,这里有一个实现它的代码:
\begin{table}[ht!]
\scriptsize
\renewcommand{\cellset}{\renewcommand{\arraystretch}{0.75}\scriptsize}
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{2pt} % default: 6pt
\begin{threeparttable}
\begin{tabularx}{\textwidth}{|C|*{3}{C} >{\hsize=0.7\hsize}C >{\hsize=1.3\hsize}Cc*{3}{C}}
\hline
\multirowcell{4}{Veličina} & \multicolumn{3}{c|}{[1]} & \multicolumn{2}{c|}{[2]} & \multicolumn{1}{c|}{[3]} & \multicolumn{3}{c|}{[4]} \\
\cline{2-10}
\multicolumn{1}{|c|}{} &\multicolumn{3}{c|}{\multirowcell{1.5}{PHOEBE fotometrie a RV}}
&\multicolumn{1}{c|}{\multirowcell{3}{POWR\\ analýza}} & %
\multicolumn{1}{c|}{\multirowcell{3}{Řešení\\ světelných\\ křivek a RV}} &
\multicolumn{1}{c|}{ \multirowcell{3}{CFF }}&\multicolumn{1}{c|}{ \multirowcell{3}{Model\\malá\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ střední\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ velká\\ hmotnost}} \\[1ex]
\cline{2-4}
&\multicolumn{1}{c|}{ \multirowcell{1.5}{Řešení I}} & \multicolumn{1}{c|}{\multirowcell{1.5}{Řešení II}} & \multicolumn{1}{c|}{\multirowcell{1.5}{Řešení III}} & \multicolumn{1}{c|}{}& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} \\ [1.5ex]
\hline\noalign{\vskip 0.5ex}
\hline
$P$ (dny) & & & & & & & & \\
$T₀$ (RJD) & & & & & & & & \\
$e$ ( ) & & & & & & & & \\
$\omega$ (\si{\degree}) & & & & & & & & \\
$K₁$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$K₂$ (\si{\kilo\meter\per\second}) & & & & & & & & \\
$a$ ($\mathrm{M}_{\odot}$) & & & & & & & & \\
$i$ (\si{\degree}) & & & & & & & \\
$T₁$ (\si{\kelvin}) & & & & & & & \\
$T₂$ (\si{\kelvin}) & & & & & & & \\
$\Omega₁$ (\si{\degree}) & & & & & & & \\
$\Omega₂$ (\si{\degree}) & & & & & & & \\
$q = \dfrac{M₂}{M₁}$ & & & & & & & \\
$M₁$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$M₂$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$R₁$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$R₂$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$V_{γ}$ (\si{\kilo\meter\per\second}) & & & & & & & \\
\end{tabularx}
\begin{tablenotes}[para,flushleft]
\item[]\\{[1]} \\
{[2]} \\
{[3]} \\
{[4]} \\
\end{tablenotes}
\end{threeparttable}
\end{table}
编辑:这是您最后一个要求的代码:
\begin{table}[ht!]
\scriptsize
\renewcommand{\cellset}{\renewcommand{\arraystretch}{0.75}\scriptsize}
\setlength\extrarowheight{2pt}
\setlength\tabcolsep{2pt} % default: 6pt
\begin{threeparttable}
\begin{tabularx}{\textwidth}{C|*{2}{C} >{\hsize=0.7\hsize}C >{\hsize=1.3\hsize}Cc*{3}{C}}
\Xhline{0.8pt}\noalign{\vskip 0.4ex}\Xhline{0.8pt}%
\multirowcell{4}{Veličina} & \multicolumn{2}{c|}{[1]} & \multicolumn{2}{c|}{[2]} & \multicolumn{1}{c|}{[3]} & \multicolumn{3}{c|}{[4]} \\[0.4ex]
\cline{2-9}
\multicolumn{1}{|c|}{} &\multicolumn{2}{c|}{\multirowcell{1.5}{PHOEBE fotometrie a RV}}
&\multicolumn{1}{c|}{\multirowcell{3}{POWR\\ analýza}} & %
\multicolumn{1}{c|}{\multirowcell{3}{Řešení\\ světelných\\ křivek a RV}} &
\multicolumn{1}{c|}{ \multirowcell{3}{CFF }}&\multicolumn{1}{c|}{ \multirowcell{3}{Model\\malá\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ střední\\ hmotnost}} & \multicolumn{1}{c|}{\multirowcell{3}{Model\\ velká\\ hmotnost}} \\[1ex]
\cline{2-3}
& \multicolumn{1}{c|}{\multirowcell{1.5}{Řešení II}} & \multicolumn{1} `{c|}{\multirowcell{1.5}{Řešení III}} & \multicolumn{1}{c|}{}& \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} & \multicolumn{1}{c|}{} \\ [1.5ex]`
\Xhline{0.8pt}%
$P$ (dny) & & & & & & & \\
$T_0$ (RJD) & & & & & & && \\
$e$ ( ) & & & & & & & \\
$\omega$ (\si{\degree}) & & & & & & & \\
$K_1$ (\si{\kilo\meter\per\second}) & & & & & & & \\
$K_2$ (\si{\kilo\meter\per\second}) & & & & & & & \\
$a$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$i$ (\si{\degree}) & & & & & & & \\
$T_1$ (\si{\kelvin}) & & & & & & & \\
$T_2$ (\si{\kelvin}) & & & & & & & \\
$\Omega_1$ (\si{\degree}) & & & & & & & \\
$\Omega_2$ (\si{\degree}) & & & & & & & \\
$q = \dfrac{M_2}{M_1}$ & & & & & & & \\
$M_1$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$M_2$ ($\mathrm{M}_{\odot}$) & & & & & & & \\
$R_1$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$R_2$ ($\mathrm{R}_{\odot}$) & & & & & & & \\
$V_{\gamma }$ (\si{\kilo\meter\per\second}) & & & & & & & \\
\end{tabularx}
\begin{tablenotes}[para,flushleft]
\item[]\\{[1]} \\
{[2]} \\
{[3]} \\
{[4]} \\
\end{tablenotes}
\end{threeparttable}
\end{table}