如何在 LaTeX 中重新建立這兩個表?

如何在 LaTeX 中重新建立這兩個表?

在這種情況下,真實的文本是無關緊要的;我對它的格式和佈局感興趣。

我迫不及待地想研究你的想法!提前致謝。

表 1,無彩色背景

表 2,具有彩色背景的交替行

答案1

這是一次嘗試。不過您可以調整顏色。

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{array}
\usepackage{booktabs}
\usepackage{caption}
\captionsetup[table]{font=sf,labelfont={color=red,bf,sf},textfont=sf,labelsep=space}
\newcolumntype{G}{>{\raggedright\arraybackslash}p{\dimexpr0.25\textwidth-2\tabcolsep\relax}}

%% \arrayrulecolor{magenta}  %%% uncomment this to have all rules in this color
\begin{document}
  \begin{table}[htb]
    \centering
    \caption[Some table]{This is my table}\label{tab:mytab}
    \begin{tabular}{*{3}{G}>{\textcolor{green!40!blue}\bgroup\arraybackslash}G<{\egroup}}
    \arrayrulecolor{magenta}\toprule
      \scshape Some text & \scshape Some text here & \scshape Some text & \multicolumn{1}{G}{\scshape
          And some more text here} \\\midrule
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\\bottomrule
    \end{tabular}
  \end{table}

  \begin{table}[htb]
    \centering
    \rowcolors{2}{}{gray!25}
    \caption[Some table]{This is my table}\label{tab:myothertab}
    \begin{tabular}{*{4}{G}}\arrayrulecolor{magenta}\toprule
      \scshape Some text & \scshape Some text here & \scshape Some text & \scshape And some more text
           here \\\midrule
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\
      Some text & Some text here & some text & and some more text here \\\bottomrule
    \end{tabular}
  \end{table}
\end{document}

在此輸入影像描述

答案2

這是盡可能忠實重現OP第一個表的程式碼。主要需要載入captionand floatrow(對於標題的位置),加上microtype,xpatchmakecell

        \documentclass{article}
        \usepackage[utf8]{inputenc}

        \usepackage{springer}

        \usepackage[showframe, nomarginpar, textwidth = 15cm]{geometry}
        \usepackage[svgnames, x11names]{xcolor}
        \usepackage{array, booktabs, colortbl}
        \usepackage{caption, floatrow}
        \usepackage{makecell}
        \usepackage[tracking]{microtype}
        \usepackage{xpatch}
        \xapptocmd{\toprule}{\addlinespace[-1pt]}{}{}
        \xpretocmd{\midrule}{\addlinespace[-3pt]}{}{}
        \xapptocmd{\midrule}{\addlinespace[5pt]}{}{}

        \setlength{\tabcolsep}{4pt}
        \renewcommand{\lightrulewidth}{0.06em}

        \DeclareCaptionFormat{leftmargin}{\captionsetup{textfont={small, sf, md, up}, labelfont={small, sf, md, up}, labelsep=space, position = above, slc = off} \raggedright\textls*[150]{\MakeUppercase{#1 #2}}#3}%

        \floatsetup{captionskip = 4pt}%

        \renewcommand{\theadfont}{\SetTracking{encoding= *, shape= sc}{180}\color{black}\rmfamily\scshape}%
        \renewcommand{\theadalign}{tl}

        \begin{document}
        \setcounter{table}{3}

        \begin{table}[!h]
        \centering\arrayrulecolor{DeepPink3!50!DeepPink2}\captionsetup{format = leftmargin, font = {color ={DeepPink3!50!DeepPink2}} }
        \ttabbox[\FBwidth]{\caption{Properties of everyday  -- or Galilean -- velocity.}}%
        {%
        \begin{tabular}{@{}*{3}{l} >{\color{SeaGreen2!45!Cyan4}\sffamily}l@{}}
        \toprule%
        \thead{Velocities\\can} &   \thead{Physical \\ properties}  &  \thead{Mathematical \\ name} & \thead{Definition}\\
        \midrule
        \addlinespace[0.25ex]
        Be distinguished  & distinguibility  & element of set  & Vol.  III,  page 242 \\
        Change gradually  & continuum & real vector space & \makecell[tl]{Page 77, Vol.  V,  \\ page 349} \\
        Point somewhere, direction & vector space,  dimensionality & Page 77 \\
        Be compared & measurability & metricity & Vol. V, page 340 \\
        Be added  & additivity & vector space  & Page 77 \\
        Have defined angles  &  direction & Euclidean vector space  & Page 77 \\
        Exceed any limit & infinity & unboundedness  & Vol.  III,  page 243 \\
        \addlinespace
        \bottomrule
        \end{tabular}
        }%
        \end{table}

        \end{document} 

在此輸入影像描述

相關內容