\documentclass[a4paper,12pt]{report}
\usepackage[american]{babel}
\usepackage{amsfonts,amssymb,amsmath,amsthm}
\usepackage[table]{xcolor}
\usepackage{pifont}
\usepackage{marvosym}
\usepackage{fancybox,fancyhdr}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{yfonts}
\usepackage{pdfsync}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dvips]{epsfig}
\usepackage{caption,subcaption}
\usepackage{algorithmicx}
\usepackage[ruled]{algorithm}
\usepackage{algpseudocode}
\usepackage[backend=biber,style=apa]{biblatex}
\usepackage{booktabs, collcell, makecell, tabularx, threeparttable}
\newcommand{\tclr}[1]{\textcolor{black!70!black}{#1}}
\newcolumntype{L}{>{\collectcell\tclr\raggedright}X<{\endcollectcell}}
\renewcommand\TPTtagStyle{\bfseries} % optional
\usepackage{siunitx}
\usepackage{xparse}
\NewExpandableDocumentCommand\mcc{O{1}m}
{\multicolumn{#1}{c}{#2}}
\newcommand\tot{\mathrm{tot}}
begin{document}
\begin{table}%[!htp]
\small
\sisetup{table-format=6.2e-1,per-mode=symbol}
\setlength\tabcolsep{3pt}
\caption{The QPSO update equations for different potential energy types}\label{3wavfun}
\centering
\begin{threeparttable}
\begin{tabularx}{\textwidth}{@{} L l *{3}{>{$}l<{$}S} @{}}
\toprule
{\bf Delta potential} & {\bf QPSO update equation}\\
\midrule
Delta potential well & $x_i(t+1)=p(t)\pm\frac{\ln(1/u)}{2q\ln\sqrt{2}}\parallel x_i(t)-p(t)\parallel$\\
\midrule
Harmonic oscillator & $x_i(t+1)=p(t)\pm\frac{\sqrt{\ln1/u}}{0.47694q}\parallel x_i(t)-p(t)\parallel$\\
\midrule
Square well & $x_i(t+1)=p(t)+\frac{0.6574}{\xi q}\cos^{-1}(\pm\sqrt u)\parallel x_i(t)-p(t)\parallel$\\
\bottomrule
\end{tabularx}
\end{threeparttable}
\end{table}
\end{document}
答案1
你在評論中寫道,
我需要將「表 1:」加粗以遵守 APA 格式
那麼,您需要做的就是\captionsetup{labelfont=bf}
在序言中添加指令——後載入caption
包。
然而,你自己(和你的讀者)應該做的遠不止這些。為了使程式碼更易於維護,您應該刪除大量程式碼。您還應該透過在顯示數學模式下渲染第二列中的方程式來使其更具可讀性。請不要使用\parallel
-至少在這種情況下不要使用;使用\lVert
and\rVert
代替。更好的是,定義一個\norm
巨集。最後,不要過度使用粗體字。
您應該清理並簡化文件的序言。我強烈懷疑您是否需要目前正在加載的許多軟體包。例如,該yfonts
軟體包提供文字模式 Fraktur-type 字體——您真的需要它們嗎?
\documentclass[a4paper,12pt]{report}
\usepackage[american]{babel}
\usepackage[T1]{fontenc}
\usepackage{booktabs,tabularx}
\usepackage{mathtools}
\DeclarePairedDelimiter{\norm}{\lVert}{\rVert}
\usepackage{caption}
\captionsetup{labelfont=bf,skip=0.5\baselineskip,
justification=raggedright,
singlelinecheck=false}
\begin{document}
\begin{table}[!ht]
\caption{The QPSO update equations for different potential energy types}
\label{3wavfun}
\begin{tabularx}{\textwidth}{@{} >{\raggedright\arraybackslash}X >{$\displaystyle}l<{$} @{}}
\toprule
Delta potential
& $QPSO update equation$\\
\midrule
Delta potential well
& x_i(t+1)=p(t)\pm \frac{\ln(1/u)}{2q\ln\sqrt{2}} \norm{x_i(t)-p(t)}\\[3ex]
Harmonic oscillator
& x_i(t+1)=p(t)\pm \frac{\sqrt{\ln(1/u)}}{0.47694q} \norm{x_i(t)-p(t)}\\[3ex]
Square well
& x_i(t+1)=p(t)+ \frac{0.6574}{\xi q}\cos^{-1}(\pm\sqrt{u}\,) \norm{x_i(t)-p(t)}\\
\bottomrule
\end{tabularx}
\end{table}
\end{document}