Can somebody tell me why I can't move to next line with command \newline or \\ ?
It works perfectly in main body, but inside \mbox or \caption I can't
force it to do what I ask.
I have even installed livetex-full under Ubuntu (ealier was installed default).I'm beginner so I have put that information just incase it is important.
The same problem is under windows miktex. At the begining I thought that something is mising.
Code:
\documentclass[a4paper,10pt]{report}
\usepackage[utf8x]{inputenc}
\begin{document}
Here moving to \\next line works
\mbox{Here it \\ doesn't}
\end{document}
I used pdflatex and latex command under console (I have got the same effect).
It's what i have got after pdflatex:
http://fatcat.ftj.agh.edu.pl/~pradera/xx.pdf
Text Formatting ⇒ \newline doesn't work inside \mbox{}
NEW: TikZ book now 40% off at Amazon.com for a short time.

\newline doesn't work inside \mbox{}
That's perfectly normal. \mbox-es are typeset in LR mode, not paragraph mode. Try a parbox instead.
Code: Select all
Code, edit and compile here:
\documentclass[a4paper,10pt]{report}\usepackage[utf8x]{inputenc}\begin{document}Here moving to \\next line works\parbox[t]{3cm}{Here it \\ also does}\end{document}
Re: \newline doesn't work inside \mbox{}
Thank you. It helped.
Re: \newline doesn't work inside \mbox{}
And regarding \caption: You can use \\ inside \caption if either the caption package will be used or the text of the caption will be longer than a single line.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
\newline doesn't work inside \mbox{}
If so, please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).rogozyn wrote:Thank you. It helped.
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10