LaTeX forum ⇒ Page LayoutRemove vertical space in \parbox Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Polina
Posts: 2
Joined: Wed Jul 04, 2018 8:19 pm

Remove vertical space in \parbox

Postby Polina » Wed Jul 04, 2018 8:27 pm

Hello all,

I am writing and article documentclass and my \parbox is adding extra vertical space between all lines, instead of the normal spacing. I have two parboxes next to each other:

\fbox {\parbox{8cm}{ \Large{FIRST FRAME}\\\\
\begin{normalsize}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{normalsize}}}~~~~~~~~~
\fbox {\parbox{8cm}{ \Large{SECOND FRAME}\\\\
\begin{normalsize}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{normalsize}}}


Can you please help me to figure out which command to use so that the boxes get a bit collapsed?
Thank you very much
Polina

rais
Posts: 159
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Wed Jul 04, 2018 9:43 pm

Hi,
the vertical space isn't introduced by the parbox, but by your misuse of \Large: it doesn't require a parameter, hence the line spacing is matched to \Large until the end of the \parbox.
Try it like this
  1. \fbox {\parbox{8cm}{{\Large FIRST FRAME\par}\bigskip
  2. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  3. }}

(note the opening brace encompasses the \Large switch, now the size switches back to \normalsize all by itself)

KR
Rainer

Polina
Posts: 2
Joined: Wed Jul 04, 2018 8:19 pm

Postby Polina » Thu Jul 05, 2018 10:40 pm

Hi Rainer,
thank you so much! It worked!
Have a nice day
Polina


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 2 guests