0

i want to add quote in longtable, but some difficult. Please help.

Error: "Extra }, or forgotten \endgroup. \egroup

l.47 \end {fancyquotes} " And can not see quote in table. Thanks you

My code:

My new code

\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}

And more one question about more than one sentence in quote. Ex: \begin{fancyquotes} The knowledge that we consider knowledge proves itself in action. \

What we now mean by knowledge is information in action, information focused on results - Peter F Drucker. \end{fancyquotes}

How can line break after each sentence in quote? Thanks

enter image description here

  • Welcome to TeX.SX! Could you elaborate a bit more what the actual problem is by editing your question? Maybe also what would be the expected result? This makes it much easier that everybody is talking about the same thing. Thank you. – Stefan Pinnow Mar 1 '18 at 14:50
  • @Stefan. thank for your help i just added image and error. – Ti Saigon Mar 1 '18 at 15:00
  • please, ask new question, not edit this one. this one (in original version) is solved. in new question you use obtained solution and show us, where you suck with new request. i must confess, that i'm now lost in your question :-( – Zarko Mar 4 '18 at 2:32
1
\begin{fancyquotes}
Everything's got a moral, if only you can find it - Lewis Carroll.\\
\end{fancyquotes}

you are starting the enviornment in one cell then ending the cell (and table row) with \\ so get the error. Just delete the \\

  • Just a minor note: You missed to closing } at the end of \end{fancyquotes}. – Stefan Pinnow Mar 1 '18 at 16:01
  • @StefanPinnow will fix (I never mind if people edit away typos:-) – David Carlisle Mar 1 '18 at 16:02
  • Ok, I'll remember that for the next time ;) – Stefan Pinnow Mar 1 '18 at 16:03
  • @StefanPinnow in the unlikely event I make typo – David Carlisle Mar 1 '18 at 16:05
  • Thank David & Stefan. i update my new code, fixed but quote in table is over the column. Please see above. Many thanks – Ti Saigon Mar 1 '18 at 21:18
1

edit: i correct table code

try the following:

\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}

however, your table (with code from your mwe) now spill out of right page border (but this problem is not part of yours question).

enter image description here

  • thanks Zarko. some better than my code.Can you improve your code to 2 quote fit in 2 columns? (not over table) – Ti Saigon Mar 1 '18 at 21:25
  • awasome. and can you help, how can i fix column width \begin{longtable}{p{7.8cm}|p{8.5cm}} in your above code? thanks – Ti Saigon Mar 2 '18 at 1:02
  • but i show you, what can be done. with your columns widths your table is wider than text width. for test add to document preamble \usepackage{showframe} and you will see page layout and will be able compare my solution with yours. – Zarko Mar 2 '18 at 1:15
  • Thank @Zarko, it work well. how can i change background color of quote - box colour? – Ti Saigon Mar 2 '18 at 16:30
  • thank. i can change color with \definecolor{orange}{RGB}{224,215,188} – Ti Saigon Mar 2 '18 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.