我的代码:

我的代码:

我想在 longtable 中添加引用,但有些困难。请帮忙。

错误: “额外 },或忘记了 \endgroup。\egroup

l.47 \end {fancyquotes} " 表格中没有看到报价。谢谢

我的代码:

我的新代码

\documentclass{article}
\usepackage{lipsum}
\usepackage[many]{tcolorbox}

\usepackage{longtable}

\usepackage{natbib}
\usepackage{graphicx}

\newtcolorbox{fancyquotes}{%
    enhanced jigsaw, 
    breakable,      % allow page breaks
    frame hidden,   % hide the default frame
    left=0cm,       % left margin
    right=0cm,      % right margin
    overlay={%
        \node [scale=8,
            text=black,
            inner sep=0pt,] at ([xshift=-1cm,yshift=-1cm]frame.north west){``}; 
        \node [scale=8,
            text=black,
            inner sep=0pt,] at ([xshift=1cm]frame.south east){''};  
            },
        % paragraph skips obeyed within tcolorbox
                parbox=false,
}

\begin{document}
%\lipsum[1]

\begin{fancyquotes}
    \lipsum[1]
\end{fancyquotes}


\begin{longtable}{p{7.8cm}|p{8.5cm}}
A & B \\
%\hline
\endhead

\textbf{quote A.} & \textbf{quote B.}\\

abcd. & cdef \\

\begin{fancyquotes}
People who throw kisses are hopelessly lazy - Bob Hope.
\end{fancyquotes}
&
\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.
\end{fancyquotes}

People who throw kisses are hopelessly lazy. &
Everything's got a moral, if only you can find it\\

%\hline
%\midrule[0.1pt]

\end{longtable}

\begin{fancyquotes}
People who throw kisses are hopelessly lazy - Bob Hope.
\end{fancyquotes}

\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.
\end{fancyquotes}
\lipsum[1]

\end{document}

还有关于引用中多个句子的一个问题。例如:\begin{fancyquotes} 我们认为的知识在行动中证明了自己。\

我们现在所说的知识是行动中的信息,注重结果的信息 - 彼得·德鲁克。\end{fancyquotes}

引用中每句话后如何换行?谢谢

在此处输入图片描述

答案1

\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.\\
\end{fancyquotes}

您在一个单元格中启动环境,然后以结束单元格(和表格行),\\因此会出现错误。只需删除\\

答案2

编辑: 我更正了表格代码

请尝试以下操作:

\documentclass{article}
\usepackage{lipsum}
\usepackage[many]{tcolorbox}

\usepackage{longtable}

\usepackage{natbib}
\usepackage{graphicx}

\newtcolorbox{fancyquotes}{%
    enhanced jigsaw,
    breakable,      % allow page breaks
    frame hidden,   % hide the default frame
    left=0cm,       % left margin
    right=0cm,      % right margin
    overlay={%
        \node [scale=8,
            text=black,
            inner sep=0pt,] at ([xshift=-2em,yshift=-1cm]frame.north west){``};
        \node [scale=8,
            text=black,
            inner sep=0pt,] at ([xshift=2em]frame.south east){''};
            },
  % paragraph skips obeyed within tcolorbox
    parbox=false,
}

\begin{document}
%\lipsum[1]

\begin{fancyquotes}
    \lipsum[1]
\end{fancyquotes}

\setlength\tabcolsep{3em}
    \begin{longtable}{@{}p{\dimexpr0.5\linewidth-2\tabcolsep\relax}|
                         p{\dimexpr0.5\linewidth-2\tabcolsep\relax}
                       @{}}
A & B \\
%\hline
\endhead
\textbf{quote A.} & \textbf{quote B.}\\
abcd. & cdef \\
\parbox{\linewidth}{
\begin{fancyquotes}
People who throw kisses are hopelessly lazy - Bob Hope.
\end{fancyquotes}
}
&
\parbox{\linewidth}{
\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.
\end{fancyquotes}
}   \\
People who throw kisses are hopelessly lazy. &
Everything's got a moral, if only you can find it   \\

%\hline
%\midrule[0.1pt]
    \end{longtable}

\begin{fancyquotes}
People who throw kisses are hopelessly lazy - Bob Hope.
\end{fancyquotes}

\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.
\end{fancyquotes}
\lipsum[1]

\end{document}

但是,您的表格(使用来自 mwe 的代码)现在溢出了右页面边框(但这个问题不是您的问题的一部分)。

在此处输入图片描述

相关内容