LateX 表中兩個單字之間的空格

LateX 表中兩個單字之間的空格

我正在嘗試設定一個表格,其中包含一些圖片。我嘗試了不同型號的桌子,但我有兩個問題: 1. 桌子真的很長,一頁放不下。我找不到在哪裡修改它(以及如何修改=))。 2.我的表格中單字之間沒有空格(例如,寫為“AmphoredeKos”而不是“Amphore de Kos”)。我不知道如何修改這個。

如果有人可以幫助我,那就太好了!非常感謝=)!

Table 1 : Liste des échantillons prélevés au DRASSM 25.02.2019 textbf{-Partie 1-}

\newcolumntype{C}{>{$\displaystyle}Sc<$}
\cellspacetoplimit=2pt
\cellspacebottomlimit=2pt

\begin{center}
    \begin{tabular}{|l|*{7}{C|}} \hline \hline
    Ref.  &  Photo  &  Typologie  &  Informations sur l'\acute{e}chantillon  &  Poix  &  Tesson  & Objet \\ \hline \hline

    6545    &  
        \begin{minipage}{.13\textwidth}
        \includegraphics[width=20mm, height=20mm]{IMG_0716_min}
        \end{minipage} 
        &   Dressel 5    & Amphore de Kos  &   &   &  X \\ \hline

6828A   & 
\begin{minipage}{.13\textwidth}
      \includegraphics[width=20mm, height=20mm]{IMG_0718_min}
    \end{minipage}
    &                &   & X & X &  \\ 
    \hline

答案1

以下 MWE 包含表格的三個不同版本。

在第一個版本中,我使用了該valign=t選項來將圖像與相鄰單元格中的文字對齊。此外,我還使用該cellspace套件來處理一些垂直空白,並調整影像周圍的水平空白以匹配垂直空白。我還使用該makecell包將第四列的列標題分成兩行,以便表格更窄並且可以適合文字寬度。為了獲得標題,我將table環境與\caption命令結合使用。

在第二個表中,我使用了該tabularx套件以使表格與文字寬度一樣寬。如果第四列包含較長的文本,這可能很有用。

在第三個範例中,我刪除了垂直線,並用套件中的規則取代了水平線booktabs

在此輸入影像描述

\documentclass{article}
\usepackage{geometry}

\usepackage[demo]{graphicx} % Remove the demo option in your real document.
\usepackage{cellspace}
\usepackage[export]{adjustbox}

\usepackage{makecell} % Only for the first table

\usepackage{tabularx} % Only fr the second and third table

\usepackage{booktabs} % Only for the third table
\begin{document}

\begin{table}
\caption{Liste des échantillons prélevés au DRASSM 25.02.2019 \textbf{-Partie 1-}}
\cellspacetoplimit=2pt
\cellspacebottomlimit=2pt
\centering
    \begin{tabular}{|l|@{\hspace{2pt}}Sc@{\hspace{2pt}}|*{6}{c|}} \hline \hline
    Ref.  &  Photo  &  Typologie  & \makecell[cc]{ Informations \\ sur l'échantillon}  &  Poix  &  Tesson  & Objet \\ \hline \hline

    6545    &  
        \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0716_min}
        &   Dressel 5    & Amphore de Kos  &   &   &  X \\ \hline

6828A   & 
      \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0718_min}
    &                &   & X & X &  \\ 
    \hline
    \end{tabular}
\end{table}


\begin{table}
\caption{Liste des échantillons prélevés au DRASSM 25.02.2019 \textbf{-Partie 1-}}
\cellspacetoplimit=2pt
\cellspacebottomlimit=2pt
\centering
    \begin{tabularx}{\textwidth}{|l|@{\hspace{2pt}}Sc@{\hspace{2pt}}|c|X|*{3}{c|}} \hline \hline
    Ref.  &  Photo  &  Typologie  & Informations sur l'échantillon  &  Poix  &  Tesson  & Objet \\ \hline \hline

    6545    &  
        \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0716_min}
        &   Dressel 5    & Amphore de Kos  &   &   &  X \\ \hline

6828A   & 
      \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0718_min}
    &                &   & X & X &  \\ 
    \hline
    \end{tabularx}
\end{table}

\begin{table}
\caption{Liste des échantillons prélevés au DRASSM 25.02.2019 \textbf{-Partie 1-}}
\cellspacetoplimit=2pt
\cellspacebottomlimit=2pt
\centering
    \begin{tabularx}{\textwidth}{l@{\hspace{2pt}}Sc@{\hspace{2pt}}cX*{3}{c}} 
    \toprule
    Ref.  &  Photo  &  Typologie  & Informations sur l'échantillon  &  Poix  &  Tesson  & Objet \\ \midrule

    6545    &  
        \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0716_min}
        &   Dressel 5    & Amphore de Kos  &   &   &  X \\ 

6828A   & 
      \includegraphics[width=20mm, height=20mm,valign=t]{IMG_0718_min}
    &                &   & X & X &  \\ 
    \bottomrule
    \end{tabularx}
\end{table}
\end{document}

相關內容