How to draw such a box in Latex? According to google, I tried the below method. When multi-line text appears, the text cannot be displayed left-aligned. And the distance between the text and the upper and lower borders is also very large.
Is there any way? Thanks! ! !
\fbox{%
\parbox{0.42\textwidth}{%
\begin{center}
\raggedleft
This is a test.
\end{center}
}%
}

\raggedleftmeans right-aligned. Get rid of it. Andcenterdoes what it says. Left aligned is the default in a\parbox. – barbara beeton Jan 13 '23 at 04:50centeralso adds space above and below. In this case, it is used purely to add extra space (see also \fboxsep). Thetrivlistenvironment would have been simpler. Does google actually provide LaTeX help or just point you to bad (but popular) advice? – John Kormylo Jan 13 '23 at 16:57