I was wondering how to create several rows in a box using the fbox command in latex
This is a very basic question, but I cant find the answer to this question.... I would like to create a box that looks like:
___________________
|hello开发者_高级运维1 |
|hello2 |
|hello3 |
|__________________|
I have tried the fbox command in Latex. However I only get the text on one line and not several.
\fbox
puts a frame round its content, but is not a paragraph box. So you need a \parbox
inside an \fbox
\documentclass{article}
\begin{document}
\fbox{\parbox{\textwidth}{%
hello1\\
hello2\\
hello3
}}
\end{document}
Also, if you append \noindent before \fbox , i.e.
\documentclass{article}
\begin{document}
\noindent \fbox{\parbox{\textwidth}{%
hello1\\
hello2\\
hello3
}}
\end{document}
you can prevent indentation of the box.
精彩评论