Groups | Search | Server Info | Login | Register


Groups > comp.text.pdf > #2568

Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}

From Ulrich D i e z <ud.usenetcorrespondence@web.de>
Newsgroups de.comp.text.pdf, comp.text.pdf, sci.lang
Subject Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Followup-To comp.text.tex
Date 2024-07-25 22:51 +0200
Message-ID <v7udpc$bej4$2@solani.org> (permalink)
References <v7ctni$2rpmu$1@dont-email.me> <04520287-5836-4139-93af-4f11e085b4c9@lisse.NA> <v7u7ce$2dgbr$1@dont-email.me>

Cross-posted to 3 groups.

Followups directed to: comp.text.tex

Show all headers | View raw


[Followup-To: comp.text.tex]

HenHanna wrote:

> On 7/25/2024 8:37 AM, Eberhard W Lisse wrote:
>> I don't think crossposting to 5 groups two of which not in English will
>> help.
>> 
>> el
>> 
>> On 19/07/2024 07:31, HenHanna wrote:
>>> i want 2 lines to stay together... How do i do it?
>> 
>>          [...]
> 
> 
> if i want 2 words to stay together...   First~Second
>                                          (and/or \mbox{...} )
> Shouldn't there be an easy way to do that for 2 lines?

If you want to avoid clubs and/or widows while TeX is in horizontal mpde
where it does the line-breaking for you, you can do

\widowpenalty=10000
\clubpenalty)10000

But when TeX is in the situation of having to choose between several
infinitely bad possibilities of page-breaking it might choose the one
where you get a widow or a club anyway.

If you want lines of an entire paragraph to not be broken across pages,
with LaTeX put that paragraph into a minipage environment or into a
\parbox and specify, e.g.,  the width \textwidth or \linewidth.With
LaTeX there is also an environment samepage.

With plain-TeX you can put that paragraph into a \vbox. Inside the \vbox
you may need to say s.th. like

\hsize=<width of lines of text inside the \vbox when TeX does the
line-breaking automatically>

Sincerely

Ulrich

Back to comp.text.pdf | Previous | NextPrevious in thread | Find similar


Thread

(LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} HenHanna <HenHanna@devnull.tb> - 2024-07-18 22:31 -0700
  Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Sirius <sirius@trudheim.com> - 2024-07-19 09:20 +0200
    Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} "Carlos E.R." <robin_listas@es.invalid> - 2024-07-27 23:54 +0200
  Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Ulrich D i e z <ud.usenetcorrespondence@web.de> - 2024-07-19 15:02 +0200
  Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Jeff Barnett <jbb@notatt.com> - 2024-07-19 21:41 -0600
    Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Axel Berger <Spam@Berger-Odenthal.De> - 2024-07-20 09:37 +0200
      Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Ulrich D i e z <ud.usenetcorrespondence@web.de> - 2024-07-20 14:42 +0200
  Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Peter Flynn <peter@silmaril.ie> - 2024-07-24 10:31 +0100
    Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Antonio Marques <no_email@invalid.invalid> - 2024-07-24 14:02 +0000
  Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Eberhard W Lisse <nospam@lisse.NA> - 2024-07-25 17:37 +0200
    Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} HenHanna <HenHanna@devnull.tb> - 2024-07-25 12:00 -0700
      Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line} Ulrich D i e z <ud.usenetcorrespondence@web.de> - 2024-07-25 22:51 +0200

csiph-web