How do I make this table?
In stackexchange, if you type ">" at the first of the sentence, you get the above quotation.
I tried to do the same thing on LaTeX, but it did not work.
How do I make that?
\documentclass{article}
\makeatletter
\renewenvironment{quote}{%
\vskip 10\p@
\parindent\z@
\d@ublerule
\list{}{\rightmargin\leftmargin}%
\item\relax
}{%
\endlist
\d@ublerule
}
\def\d@ublerule{\hrule\@width\hsize\kern 1.5\p@\hrule\@width\hsize}
\makeatother
\begin{document}
\begin{quote}
How do I make this table?
\end{quote}
\end{document}
If the background should be colored you can use the tcolorbox
package:
\renewenvironment{quote}{%
\vskip 10\p@
\parindent\z@
\tcolorbox[
sharp corners,
boxrule=\z@,
boxsep=\z@,
left=\z@,
right=\z@,
top=\z@,
bottom=\z@
]
\d@ublerule
\vskip 5\p@
\list{}{\rightmargin\leftmargin}%
\item\relax
}{%
\endlist
\d@ublerule
\endtcolorbox
}
The final version could then be:
\documentclass{article}
\usepackage{xcolor}
\definecolor{sx-yellow}{RGB}{249,245,233}
\definecolor{sx-orange}{RGB}{224,215,188}
\usepackage[most]{tcolorbox}
\makeatletter
\renewenvironment{quote}{%
\vskip 10\p@
\parindent\z@
\tcolorbox[
breakable, sharp corners,
boxrule=\z@, boxsep=\z@,
left=\z@, right=\z@,
top=\z@, bottom=\z@,
colback=sx-yellow
]
{\color{sx-orange}\d@ublerule}
\vskip 5\p@
\list{}{\rightmargin\leftmargin}%
\item\relax
}{%
\endlist
{\color{sx-orange}\d@ublerule}
\endtcolorbox
\vskip 5\p@
}
\def\d@ublerule{\hrule\@width\hsize\kern 1.5\p@\hrule\@width\hsize}
\makeatother
\begin{document}
\begin{quote}
How do I make this table?
\end{quote}
\end{document}
\lipsum[1-n]\begin{quote} How do I make this table? \end{quote}\lipsum
and I can't really see what you possibly mean. Can you explain a little bit further what does not look good in your opinion?
\begin{quote}\lipsum[1-5]\end{quote}
. So that the page break is inside the quote environment.
Another possibility would be to solely use the package tcolorbox
and define a custom environment with it. If it is not a requirement to redefine quote
environment, this solution is imho easier to read and adjust than @Ruben's solution. Apart from that it introduces a small padding at the beginning and end when the box is too big, that a page break is necessary. Have a look at the second screenshot to get an idea what that will look like.
\documentclass{article}
\usepackage[most]{tcolorbox}
\definecolor{background}{HTML}{F9F5E9}
\definecolor{linecolor}{HTML}{E0D7BC}
\newtcolorbox{QuoteBox}{%
breakable,
enhanced,
sharp corners,
colback=background,
colframe=background,
borderline north={0.5pt}{0pt}{linecolor},
borderline north={0.5pt}{1.5pt}{linecolor},
borderline south={0.5pt}{0pt}{linecolor},
borderline south={0.5pt}{1.5pt}{linecolor},
}
\begin{document}
\begin{QuoteBox}
How do I make this table?
\end{QuoteBox}
\end{document}
OUTPUT:
\usepackage[T1]{fontenc}
problem, resulting in strange output from<
when used in text mode?<
but in the question you use>
but I think you do not want either you want a quotation such as\begin{quote}....\end{quote}
the markdown syntax for a quote is>
at the beginning of a line but there is essentially no similarity between markdown and latex