## LaTeX forum ⇒ Text Formatting ⇒ No Pagebreak for a certain group of paragraphs Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am

### No Pagebreak for a certain group of paragraphs

Hello all! Happy New Year 2015! Hope that all your wishes and dreams become true - finally this year!

I have a long list of SMS Data with groups, which I have put into the environment "samepage" , to hinder a page break:

\begin{samepage}
Date - Time (centered)
Person: Text Message
\end{samepage}

But this is not working ! I tried already with \nopagebreak[4] - etc to no avail. I put up a long example to demonstrate the problem: between page 2 and 3 it is not working

As a little add: if you as professionals have suggestions for a nicer formatting, I would be grateful for every suggestion - for example make the Person name float to the left perhaps?

Best greetings to all from Munich

yours marek


Tags:

Johannes_B
Site Moderator
Posts: 4118
Joined: Thu Nov 01, 2012 4:08 pm
I think you are looking for minipages.
%s/begin{samepage}/begin{minipage}{\\textwidth}/g%s/samepage/minipage/
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am
Thank you Johannes_B! Should have had the idea for myself!

Do you have some hints for a nicer layout?

In any case thank you for the nice forum and best wishes to you and the forum for the new year 2015 ...

marek

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi Marek,

happe new year! And greetings from Hamburg to Munich.

By the way, if you would prefer to write in German, I gladly invite you to our German partner site TeXwelt.de. It has a special interface with voting and sorting by votes and detailed tagging, for building an optimal knowledge database built on questions and answers.

Best regards,

Stefan

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Now that I read further, some ideas:

• Load microtype for better justification: \usepackage{microtype}

• Use xcolor instead of color

• Define a consistent style for persons once, instead of each time for each single person, such as

This makes changes easier and consistent.

• A \parskip of 0.2em looks a bit strange, more like an error than a design element if I see that very small extra skip between the lines. Btw. the class provides options such as halfparskip for this.

• I would not do physical things such as \fontsize{10pt}{10pt}\selectfont in the document. Instead, I would define a macro for this in the preamble, calling only that macro in the document. This is especially meaningful if there would be some more size changes.

• A line skip with the same value like the font height is not so well readable. Letters may nearly touch each other.

marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am
Thank you Stefan_K

I am very happy, that you took so much time, to answer my supplemental questions about formatting the SMS-messages.

I read carefully all docs connected to your suggested packages. Concerning the \selectfont and the \fontsize, I only wanted to go back to the default settings of my doctype: \documentclass[...]{scrreprt}, because in the chapter before I am using an other fancy font of the package aurical - \Fontlukas\fontsize{6mm}{6mm}\selectfont I only need to come back to the default font and shape. \selectfont\normalfont seems not to work (the font is very big).

If you could give me a hint, I would be very grateful.

Greetings again from Munich - we have a holiday here in Bavaria (Drei Heilige Könige).

marek

Johannes_B
Site Moderator
Posts: 4118
Joined: Thu Nov 01, 2012 4:08 pm
If you want to keep stuff localized, use groups. I don't know your exact setup, but it should look a bit like the following:
%contents of a normal chapter\begingroup%switch to fancy font\chapter{Fancy Chapter}with fancy text\clearpage\endgroup \chapter{Back to normal}

With (La)TeX you can keep things local using groups, this is a bit like a fence where the font switch rabbit cannot break out

Not sure if the clearpage at the end will be necessary, but it will do no harm.

By the way, concerning the fonts, the first value determines the size of the font, the second value gives the skip between two baselines and should therefore be a bit larger.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 9557
Joined: Mon Mar 10, 2008 9:44 pm
Hi Marek,

you could simply use the command \normalsize.

Stefan

Johannes_B
Site Moderator
Posts: 4118
Joined: Thu Nov 01, 2012 4:08 pm
In the following example, the font switches are trapped inside the minipages
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

marek_step
Posts: 27
Joined: Sun Aug 19, 2012 8:48 am
)

This time so fast! Thank you!