长表中的文本不正确

长表中的文本不正确

晚上好

我想要更改的是第三行第三列的绿色文本。问题在于大小 - 文本在右侧,左侧是空白。我想将所有空白用作第三列第一行的红色文本(下图)。该怎么做?

感谢帮助。

    \documentclass[10pt,a6paper]{book}

    \usepackage[utf8]{inputenc}
    \usepackage[main=english,slovak]{babel}
    \usepackage[cm]{fullpage}
    \usepackage[a6paper, top=10mm, left=10mm, right=10mm, bottom=10mm,foot=5mm,marginparsep=0mm,showframe]{geometry}
    %showframe
    \usepackage{tipa}
    \usepackage{tabularx,booktabs}
    \usepackage{multirow}
    \usepackage{rotating}
    \usepackage{graphicx}
    \usepackage{array}
    \usepackage{color}
    \usepackage[dvipsnames]{xcolor}
    \usepackage{longtable}
    \usepackage{lscape}

    \usepackage{enumitem}
    \usepackage{tabularx,booktabs}
    \usepackage{enumitem}
    \usepackage{mathtools}

    \begin{document}

    {\small
    \begin{longtable}{|l|p{2cm}|p{3cm}|}
      \hline
      {\color{red} some text}           & {\color{red} some text}         & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
                                        &                                 & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
      {\color{Brown} some text}         & {\color{Brown} some text}       & \foreignlanguage{slovak}{{\color{Brown} - some long text some long text some long text some long text}}\\ 
      {\color{ForestGreen} some}        & {\color{ForestGreen} some text} & \setlist{nosep,topsep=0sp,label=--}
                                                                            \vspace{-\baselineskip}
                                                                            \begin{itemize}
                                                                              \item[-] \foreignlanguage{slovak}{{\color{ForestGreen} some long text some long text some long text some long text}}
                                                                              \item[-] \foreignlanguage{slovak}{{\color{ForestGreen} some long text some long text some long text some long text}}
                                                                            \end{itemize}\\  
  \hline                                                                
\end{longtable}}
\end{document}

在此处输入图片描述

答案1

也许你想要其中一个?

 \documentclass[10pt,a6paper]{book}

    \usepackage[utf8]{inputenc}
    \usepackage[main=english,slovak]{babel}
    \usepackage[cm]{fullpage}
    \usepackage[a6paper, margin=10mm, foot=5mm, marginparsep=0mm,showframe]{geometry}
    %showframe
    \usepackage{tipa}
    \usepackage{tabularx, booktabs}
    \usepackage{multirow}
    \usepackage{rotating}
    \usepackage{graphicx}
    \usepackage{array}
    \usepackage{color}
    \usepackage[dvipsnames]{xcolor}
    \usepackage{longtable}
    \usepackage{lscape}

    \usepackage{enumitem}
    \usepackage{mathtools}

    \begin{document}

    {\small\setlist[itemize]{nosep, ,label=--, wide = 0pt, before=\color{ForestGreen}}
    \begin{longtable}{|l|p{2cm}|p{3cm}|}
      \hline
      {\color{red} some text} & {\color{red} some text} & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
      & & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
      {\color{Brown} some text} & {\color{Brown} some text} & \foreignlanguage{slovak}{{\color{Brown} - some long text some long text some long text some long text}}\\
      {\color{ForestGreen} some} & {\color{ForestGreen} some text} &
      \vspace{-\baselineskip}
      \begin{itemize}
      \item \foreignlanguage{slovak}{some long text some long text some long text some long text}
      \item \foreignlanguage{slovak}{some long text some long text some long text some long text}
      \end{itemize}\\
  \hline
\end{longtable}}
\newpage
    {\small\setlist[itemize]{nosep , label=--, wide = 0pt, labelsep=.25em, leftmargin=*, before=\color{ForestGreen}}
    \begin{longtable}{|l|p{2cm}|p{3cm}|}
      \hline
      {\color{red} some text} & {\color{red} some text} & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
      & & \foreignlanguage{slovak}{{\color{red} - some long text some long text some long text some long text}}\\
      {\color{Brown} some text} & {\color{Brown} some text} & \foreignlanguage{slovak}{{\color{Brown} - some long text some long text some long text some long text}}\\
      {\color{ForestGreen} some} & {\color{ForestGreen} some text} &
      \vspace{-\baselineskip}
      \begin{itemize}
      \item \foreignlanguage{slovak}{some long text some long text some long text some long text}
      \item \foreignlanguage{slovak}{some long text some long text some long text some long text}
      \end{itemize}\\
  \hline
\end{longtable}}

\end{document} 

在此处输入图片描述 在此处输入图片描述

答案2

A. Ellett 的回答将项目定位到表格左侧在 itemize 中设置 leftmargin。我尝试使用 1em 和 0.5em 来解决您的问题,效果很好。(0.5em 可以更好地利用空间。1em 可以使文本与列中其余未逐项列出的单元格更好地对齐。)

相关内容