Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will be recognized and honored as a community leader.


comp / comp.text.pdf / Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}

SubjectAuthor
* (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}HenHanna
+* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Sirius
|`- Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Carlos E.R.
+- Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Ulrich D i e z
+* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Jeff Barnett
|`* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Axel Berger
| `- Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Ulrich D i e z
+* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Peter Flynn
|`- Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Antonio Marques
`* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Eberhard W Lisse
 `* Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}HenHanna
  `- Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}Ulrich D i e z

1
Subject: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: HenHanna
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Organization: A noiseless patient Spider
Date: Fri, 19 Jul 2024 05:31 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Thu, 18 Jul 2024 22:31:29 -0700
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v7ctni$2rpmu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 19 Jul 2024 07:31:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="98c675f6a227daccea9a85d6011b05c3";
logging-data="3008222"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+p3M2pGgG2PrE5CJtHiy1SiiR3H8k2YEw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ZclCj4XvtOAG6TiDw6Zu5HRkTJU=
Content-Language: en-US
View all headers

i want 2 lines to stay together... How do i do it?

This apparently doesn't work.

\mbox{ First Line \\
Second Line}

___________________________
in Comp.Text.Tex ... i only see CTAN (update) announcements

can i ask LaTeX questions?

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Sirius
Newsgroups: comp.text.pdf
Organization: Trudheim InterNetNews
Date: Fri, 19 Jul 2024 07:20 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!newsfeed.bofh.team!photonic.trudheim.com!.POSTED.photonic.trudheim.com!not-for-mail
From: sirius@trudheim.com (Sirius)
Newsgroups: comp.text.pdf
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Fri, 19 Jul 2024 09:20:13 +0200
Organization: Trudheim InterNetNews
Message-ID: <6ucuq2gmyb77gny2phbjcrabkjcoxsx53udiakmg6mitsrxtuh@vmdj4o5vzouq>
References: <v7ctni$2rpmu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: photonic.trudheim.com; posting-host="photonic.trudheim.com:2001:470:28:a8::5";
logging-data="26739"; mail-complaints-to="usenet@photonic.trudheim.com"
Content-Disposition: inline
In-Reply-To: <v7ctni$2rpmu$1@dont-email.me>
View all headers

On tor, 2024/07/18 at 22:31:29 -0700, HenHanna wrote:
> i want 2 lines to stay together... How do i do it?
>
> This apparently doesn't work.
>
> \mbox{ First Line \\
> Second Line}

WFM.

❯ cat test.tex
\documentclass[11pt,twoside,a4paper]{article}%
\begin{document}

\mbox{ Line1 \\
Line2 }

\end{document}
❯ latex test.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-05-27>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./test.aux)
[1] (./test.aux) )
Output written on test.dvi (1 page, 256 bytes).
Transcript written on test.log.
❯ xdvi test.dvi

Shows "Line1 Line2" on the page.

https://tex.stackexchange.com/questions/146909/what-does-mbox-do

--
Kind regards,

/S

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Ulrich D i e z
Newsgroups: de.comp.text.pdf, comp.text.pdf, sci.lang
Followup: comp.text.tex
Date: Fri, 19 Jul 2024 13:02 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ud.usenetcorrespondence@web.de (Ulrich D i e z)
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: Fri, 19 Jul 2024 15:02:19 +0200
Message-ID: <v7do23$2eh8$1@solani.org>
References: <v7ctni$2rpmu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 19 Jul 2024 13:00:51 -0000 (UTC)
Injection-Info: solani.org;
logging-data="80424"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.9.0
Cancel-Lock: sha1:6nymYNSw1rBYtVDgOeYOyJSZ+AM=
In-Reply-To: <v7ctni$2rpmu$1@dont-email.me>
X-User-ID: eJwFwQkRwEAIBDBLPMsyyKEc+JfQJJzKSTCIuDj5UtoklbneNRw+wz34GiC3bXul5fAIW/0BEagQlg==
Content-Language: de-DE
View all headers

[Follow-up to: comp.text.tex]

HenHanna wrote:

> i want 2 lines to stay together... How do i do it?
>
> This apparently doesn't work.
>
> \mbox{ First Line \\
> Second Line}

[ de.comp.pdf and de.comp.tex actually are German-language newsgroups. ]

\mbox creates a box.

TeX switches the typesetting-mode to "restricted horizontal mode" for
creating the content of the box.
TeX switches the typesetting-mode to "horizontal mode" for placing the
created box into the surrounding text.

The further typesetting-mode is the typesetting-mode where TeX does no
line-breaking at all but creates a box where material is typeset
horizontally/from left to right.
The latter typesetting-mode is the typesetting-mode where TeX creates
paragraphs and hereby breaks text into lines automatically.

The circumstance that the content of the box produced by \mbox is
typeset in restricted horizontal mode implies that no things are done
that concern vertical adjustment as is the case, e.g., with line-breaking.
Thus no line-breaking is done with things that are typeset in the
typesetting-mode "restricted horizontal mode".

Different commands for producing boxes and switching the typesettig-mode
when placing them into the document's surrounding text are explained at
Tex - LaTeX Stack Exchange - question "What are the different kinds of
boxes in (La)TeX?":
https://tex.stackexchange.com/a/83936

With your scenario I suggest placing two \hboxes holding single lines of
text into \vtop or \vcenter or \vbox. Due to \vtop/\vcenter/\vbox the
single \hboxes are typeset in internal vertical mode, i.e. atop each other.

The box itself, whose content consists of the two \hboxes that are
typeset atop each other, is to be placed into the surrounding text.

With \vtop the baseline of the first line/the baseline of the top line
of that box itself is aligned with the baseline of the line of the
surrounding text which TeX is about to produce.
With \vbox the baseline of the last line/the baseline of the bottom line
of that box itself is aligned with the baseline of the line of the
surrounding text which TeX is about to produce.
With \vcenter the vertical center of that box itself is aligned with the
math-axis of the line of the surrounding text which TeX is about to
produce. (The math axis of a line of text, simplified speaking, is the
vertical position where in the line of text in question the bar of a
fraction would occur.)
Although the box produced by `\vcenter` is typeset in internal vertical
mode (where you can use \hbox{...} for having Tex switch to restricted
horizontal mode), you need to have TeX to switch to math-mode for
placing that box into the line of ttext of the surrounding text.

\documentclass {article}

\begin{document}

Text
\fbox{%
\vtop{%
\hbox{First Line}%
\hbox{Second Line}%
}%
} Text

Text
\fbox{%
$\vcenter{%
\hbox{First Line}%
\hbox{Second Line}%
}$%
} Text

Text
\fbox{%
\vbox{%
\hbox{First Line}%
\hbox{Second Line}%
}%
} Text

\end{document}

> ___________________________
> in Comp.Text.Tex ... i only see CTAN (update) announcements
>
> can i ask LaTeX questions?

Yes, of course you can ask questions related to LaTeX at comp.text.tex.

The traffic at comp.text.tex has reduced over the years because many
people nowadays ask their LaTeX-related questions at
TeX - LaTeX Stack Exchange: https://tex.stackexchange.com/ .

Many of the regulars of comp.text.tex and many developers of LaTeX
packages and members of the LaTeX Project Team also are at
TeX - LaTeX Stack Exchange.

TeX - LaTeX Stack Exchange in my humble opinion is much more welcoming
than other communities of the Stack Exchange netwok. Also the
downvoting-policy is different from that of many other communities of
the Stack Exchange netwok: At TeX - LaTeX Stack Exchange people are
rather reluctant in the matter of downvoting because a harsh
downvoting-policy would scare off people unnecessarily.

However, TeX - LaTeX Stack Exchange is a question-answer platform and
not intended for dialogue while when starting out with LaTeX, you might
like to have the opportunity to have dialogues and ask questions that
are related to answers you have received. There is a chat at Tex - LaTeX
Stack Exchange also, which is sort of separate from the
question-answer-thingie, but I think I think comp.text.tex is more
suitable for this.

Sincerely

Ulrich

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Jeff Barnett
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Organization: A noiseless patient Spider
Date: Sat, 20 Jul 2024 03:41 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Fri, 19 Jul 2024 21:41:37 -0600
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <v7fblk$3cfe1$1@dont-email.me>
References: <v7ctni$2rpmu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
Injection-Date: Sat, 20 Jul 2024 05:41:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="bca0229d300f87a6c801d08474d1dd46";
logging-data="3554753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fydskuMC1DxslF5Jd1zh2HaTTVK9m6Ak="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:2L4ZVrU2LI8jbyReybR95wMeVxY=
X-Antivirus: AVG (VPS 240719-10, 7/19/2024), Outbound message
Content-Language: en-US
In-Reply-To: <v7ctni$2rpmu$1@dont-email.me>
X-Antivirus-Status: Clean
View all headers

On 7/18/2024 11:31 PM, HenHanna wrote:
> i want 2 lines to stay together... How do i do it?
>
> This apparently doesn't work.
>
>             \mbox{ First Line \\
>                    Second Line}
>
>
>
> ___________________________
> in Comp.Text.Tex   ...  i only see CTAN (update) announcements
>
>             can i ask   LaTeX  questions?
Look up the environment minipage.
--
Jeff Barnett

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Axel Berger
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Date: Sat, 20 Jul 2024 07:37 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Spam@Berger-Odenthal.De (Axel Berger)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Sat, 20 Jul 2024 09:37:05 +0200
Lines: 12
Message-ID: <669B6921.5C7A8448@Berger-Odenthal.De>
References: <v7ctni$2rpmu$1@dont-email.me> <v7fblk$3cfe1$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: individual.net jpY++H8DXOdRb4Rq3bJRSgM5frjmcmf4iAYXVoIZipNH+yvMj5
Cancel-Lock: sha1:E3Tp8188Z+Saa2VbeXmW8rcFMMU= sha256:XYbWyONLhe9n5sU+9GKEVQRoSpI16Xt/+1Qf14KaYCs=
X-Mailer: Mozilla 4.8 [en] (Win98; U)
X-Accept-Language: en,de,nl,es,fr
View all headers

Jeff Barnett wrote:
> Look up the environment minipage.

Or in this case perhaps parbox

--
/¯\ No | Dipl.-Ing. F. Axel Berger Tel: +49/ 221/ 7771 8067
\ / HTML | Roald-Amundsen-Straße 2a Fax: +49/ 221/ 7771 8069
 X in | D-50829 Köln-Ossendorf http://berger-odenthal.de
/ \ Mail | -- No unannounced, large, binary attachments, please! --

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Ulrich D i e z
Newsgroups: de.comp.text.pdf, comp.text.pdf, sci.lang
Followup: comp.text.tex
Date: Sat, 20 Jul 2024 12:42 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ud.usenetcorrespondence@web.de (Ulrich D i e z)
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: Sat, 20 Jul 2024 14:42:04 +0200
Message-ID: <v7gb7u$3n63$2@solani.org>
References: <v7ctni$2rpmu$1@dont-email.me> <v7fblk$3cfe1$1@dont-email.me>
<669B6921.5C7A8448@Berger-Odenthal.De>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 20 Jul 2024 12:40:30 -0000 (UTC)
Injection-Info: solani.org;
logging-data="122051"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.9.0
Cancel-Lock: sha1:ltmuerL4CMijsXFJ2U7wnwvKIHA=
In-Reply-To: <669B6921.5C7A8448@Berger-Odenthal.De>
Content-Language: de-DE
X-User-ID: eJwFwYEBwCAIA7CXhkBx51Sw/59gkg5DVyARqdSQ5t+WuMrIy+NY6nHoWja2/mDqtE81oAc7XRJM
View all headers

[Followup-To: comp.text.tex]

Axel Berger wrote:

> Jeff Barnett wrote:
>> Look up the environment minipage.
>
> Or in this case perhaps parbox

In case you want the box with the first and the second line to have the
natural width of the widest of the two lines, minipage-environment and
\parbox-command, where you are to specify the desired width explicitly,
might turn out cumbersome.

Sincerely

Ulrich

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Peter Flynn
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Organization: Usenet Labs Bozon Detector Facility
Date: Wed, 24 Jul 2024 09:31 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter@silmaril.ie (Peter Flynn)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Wed, 24 Jul 2024 10:31:34 +0100
Organization: Usenet Labs Bozon Detector Facility
Lines: 17
Message-ID: <lgbvvnFgtedU1@mid.individual.net>
References: <v7ctni$2rpmu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net e9bngZTEHWJJTaEuZU647g7IqoW9PEdj2YdOkRQfxniu9aCuxA
Cancel-Lock: sha1:T25mms5rFagO82RgB5Us8aM739w= sha256:9ijnnYWkTrdfV0/1jyiBUPLEg6vs/1pM1cp0PyjRH1A=
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <v7ctni$2rpmu$1@dont-email.me>
View all headers

On 19/07/2024 06:31, HenHanna wrote:
> i want 2 lines to stay together... How do i do it?
>
> This apparently doesn't work.
>
>             \mbox{ First Line \\
>                    Second Line}

That's because \\ is for prematurely ending a line, not for combining them.

It's also used (differently) in tabular setting to signal the end of a row.

Can you explain what you want to do, with a worked example?
"want 2 lines to stay together" doesn't give enough information.

Peter

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Antonio Marques
Newsgroups: sci.lang, comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf
Organization: A noiseless patient Spider
Date: Wed, 24 Jul 2024 14:02 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Antonio Marques)
Newsgroups: sci.lang,comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Wed, 24 Jul 2024 14:02:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <v7r1gr$1p3a6$1@dont-email.me>
References: <v7ctni$2rpmu$1@dont-email.me>
<lgbvvnFgtedU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 24 Jul 2024 16:02:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8a9fd0fdabec10322f533837992691d3";
logging-data="1871174"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wyUYmbxxOkEWZlGO3IoHppuFyNBvcmk3yUq6VJz0Y7g=="
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:otV/UKGGBrcpmvGWTWBkWcrOuGc=
sha1:HnCuV4pskJQcygjtjSNjjkNrlmQ=
View all headers

Peter Flynn <peter@silmaril.ie> wrote:
> On 19/07/2024 06:31, HenHanna wrote:
>> i want 2 lines to stay together... How do i do it?
>>
>> This apparently doesn't work.
>>
>>             \mbox{ First Line \\
>>                    Second Line}
>
> That's because \\ is for prematurely ending a line, not for combining them.
>
> It's also used (differently) in tabular setting to signal the end of a row.
>
> Can you explain what you want to do, with a worked example?
> "want 2 lines to stay together" doesn't give enough information.
>

It's very difficult to get information out of the OP, but from what I've
seen elsewhere the main issue was widow / orphan control.

(That would indicate that anything focusing on those specific two lines is
wrong from the start, as layout should work automatically before needing to
be manual.)

Not having touched latex for 20 years now, I have no idea where to look,
but I'm reasonably sure it shouldn't be difficult.

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Eberhard W Lisse
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Date: Thu, 25 Jul 2024 15:37 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: nospam@lisse.NA (Eberhard W Lisse)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Thu, 25 Jul 2024 17:37:36 +0200
Lines: 9
Message-ID: <04520287-5836-4139-93af-4f11e085b4c9@lisse.NA>
References: <v7ctni$2rpmu$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: individual.net F4LZ8SvyhX4aOVO8xjXaOgwti1Ww59R3ogojvx/b9ZIe+Kw5gg
Cancel-Lock: sha1:srd/zJERwFg4D5bGklQHIFU91ps= sha256:4APTPmCYpm7ndIuU0CRleImSUr1+LuWDl++pOntOOME=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:115.0)
Gecko/20100101 Betterbird/115.13.0
Content-Language: en-US
In-Reply-To: <v7ctni$2rpmu$1@dont-email.me>
View all headers

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?

[...]

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: HenHanna
Newsgroups: comp.text.tex, de.comp.text.pdf, de.comp.text.tex, comp.text.pdf, sci.lang
Organization: A noiseless patient Spider
Date: Thu, 25 Jul 2024 19:00 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.text.tex,de.comp.text.pdf,de.comp.text.tex,comp.text.pdf,sci.lang
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Thu, 25 Jul 2024 12:00:29 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v7u7ce$2dgbr$1@dont-email.me>
References: <v7ctni$2rpmu$1@dont-email.me>
<04520287-5836-4139-93af-4f11e085b4c9@lisse.NA>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 25 Jul 2024 21:00:31 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="be2b234bfa2143e0550cef89b86e2090";
logging-data="2539899"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g+Mdvdx4DMzyp4wAkFQBjfaJNl+Xq+W4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:QPpeWWlCc2KL/VRbv6ySzdgZjps=
Content-Language: en-US
In-Reply-To: <04520287-5836-4139-93af-4f11e085b4c9@lisse.NA>
View all headers

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?

actually... i like studying German (and French)...
so i wouldn't mind getting a short response in German.

Fritzchen geht traurig zur Mama: "Mama! Nie glaubt mir jemand etwas!"
"Nein Bua! Des glaub ich Dir jetzt gar nicht!"

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Ulrich D i e z
Newsgroups: de.comp.text.pdf, comp.text.pdf, sci.lang
Followup: comp.text.tex
Date: Thu, 25 Jul 2024 20:51 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: ud.usenetcorrespondence@web.de (Ulrich D i e z)
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: Thu, 25 Jul 2024 22:51:18 +0200
Message-ID: <v7udpc$bej4$2@solani.org>
References: <v7ctni$2rpmu$1@dont-email.me>
<04520287-5836-4139-93af-4f11e085b4c9@lisse.NA>
<v7u7ce$2dgbr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 25 Jul 2024 20:49:49 -0000 (UTC)
Injection-Info: solani.org;
logging-data="375396"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101
Thunderbird/60.9.0
Cancel-Lock: sha1:u7Q57iB4DzkIQuFqo4e8C3uRMvU=
In-Reply-To: <v7u7ce$2dgbr$1@dont-email.me>
X-User-ID: eJwFwQkBwCAMBEFLebgtyAkB/EvojBKnv4EYenowWUk0m6qs7fNGVy4zKUzdutszbNTkHH4LXhCQ
Content-Language: de-DE
View all headers

[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

Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
From: Carlos E.R.
Newsgroups: comp.text.pdf
Date: Sat, 27 Jul 2024 21:54 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: robin_listas@es.invalid (Carlos E.R.)
Newsgroups: comp.text.pdf
Subject: Re: (LaTeX) This doesn't work -- \mbox{ First Line \\ Second Line}
Date: Sat, 27 Jul 2024 23:54:26 +0200
Lines: 96
Message-ID: <it6gnkx4em.ln2@Telcontar.valinor>
References: <v7ctni$2rpmu$1@dont-email.me>
<6ucuq2gmyb77gny2phbjcrabkjcoxsx53udiakmg6mitsrxtuh@vmdj4o5vzouq>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 2vXUMImeyUeoqVc3l8AJZA7m/W78le2ZEv83NjFk6uilVsSF8+
X-Orig-Path: Telcontar.valinor!not-for-mail
Cancel-Lock: sha1:oCFmfd931Dq/NW3pGWUo9H+x2X8= sha256:lkiSsULzECxmUYwUtchHGm0Y0X4fEXCZvEcO6CYa+lc=
User-Agent: Mozilla Thunderbird
Content-Language: es-ES, en-CA
In-Reply-To: <6ucuq2gmyb77gny2phbjcrabkjcoxsx53udiakmg6mitsrxtuh@vmdj4o5vzouq>
View all headers

On 2024-07-19 09:20, Sirius wrote:
> On tor, 2024/07/18 at 22:31:29 -0700, HenHanna wrote:
>> i want 2 lines to stay together... How do i do it?
>>
>> This apparently doesn't work.
>>
>> \mbox{ First Line \\
>> Second Line}
>
> WFM.
>
> ❯ cat test.tex
> \documentclass[11pt,twoside,a4paper]{article}%
> \begin{document}
>
> \mbox{ Line1 \\
> Line2 }
>
> \end{document}
> ❯ latex test.tex
> This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=latex)
> restricted \write18 enabled.
> entering extended mode
> (./test.tex
> LaTeX2e <2024-06-01> patch level 2
> L3 programming layer <2024-05-27>
> (/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
> Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
> (/usr/local/texlive/2024/texmf-dist/tex/latex/base/size11.clo))
> (/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
> (./test.aux)
> [1] (./test.aux) )
> Output written on test.dvi (1 page, 256 bytes).
> Transcript written on test.log.
> ❯ xdvi test.dvi
>
> Shows "Line1 Line2" on the page.

Seems so simple I'll try. My first tex file.

cer@Telcontar:~/samples/tex> xdvi test.dvi
Warning: Missing charsets in String to FontSet conversion
Warning: Unable to load any usable fontset
Error: Aborting: no fontset found

cer@Telcontar:~/samples/tex>

cer@Telcontar:~/samples/tex> latex test.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/TeX Live
for SUSE Linux) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size11.clo))
(/usr/share/texmf/tex/latex/l3backend/l3backend-dvips.def)
No file test.aux.
[1] (./test.aux) )
Output written on test.dvi (1 page, 256 bytes).
Transcript written on test.log.
cer@Telcontar:~/samples/tex> l
total 20
drwxr-xr-x 2 cer users 70 Jul 27 23:48 ./
drwxr-xr-x 5 cer users 4096 Jul 27 23:47 ../
-rw-r--r-- 1 cer users 32 Jul 27 23:48 test.aux
-rw-r--r-- 1 cer users 256 Jul 27 23:48 test.dvi
-rw-r--r-- 1 cer users 2489 Jul 27 23:48 test.log
-rw-r--r-- 1 cer users 112 Jul 27 23:48 test.tex
cer@Telcontar:~/samples/tex>

cer@Telcontar:~/samples/tex> cat test.aux
\relax
\gdef \@abspage@last{1}
cer@Telcontar:~/samples/tex>

>
> https://tex.stackexchange.com/questions/146909/what-does-mbox-do
>

--
Cheers, Carlos.

1

rocksolid light 0.9.8
clearnet tor