LaTeX forum ⇒ Generaltext division

LaTeX specific issues not fitting into one of the other forums of this category.
blaf
Posts: 4
Joined: Sat Apr 26, 2008 12:19 pm

text division

Postby blaf » Sat Apr 26, 2008 12:35 pm

Hi all,
I have little problem.

I have text:
Scenario:
\begin{enumerate}
\item some text
\item some other text
\end{enumerate}

Sometimes Tex prints text Scenario: at the end of the page and the enumeration on the next page.
How can I tell him to give the Scenerio text to the next page?

thanx blaf

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sat Apr 26, 2008 4:26 pm

Insert a \newpage command right in front of it or put a minipage environment around that group.


Best regards
Thorsten¹
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

User avatar
Stefan Kottwitz
Site Admin
Posts: 9597
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sat Apr 26, 2008 5:19 pm

Hi blaf,

welcome to the LaTeX Community board!
I want to mention one alternative to Thorstens solutions, because inserting a \newpage may be not so good if the pages can still change, whereas the minipage environment does not allow any pagebreak inside that group, so the text (enumerate) may reach into the bottom.
I recommend to use the needspace package. You tell LaTeX with \needspace{...} how many space is needed. If there's not enough free space left on the page then a pagebreak will be inserted, otherwise not. Example:
  1. \usepackage{needspace}
  2. ...
  3. \needspace{3\baselineskip}
  4. Scenario:
  5. \begin{enumerate}
  6. \item some text
  7. ...
  8. \item some other text
  9. \end{enumerate}

Stefan
LaTeX.org admin

blaf
Posts: 4
Joined: Sat Apr 26, 2008 12:19 pm

Postby blaf » Sat Apr 26, 2008 9:17 pm

the needspace package is what i need

thanks so much

blaf
Posts: 4
Joined: Sat Apr 26, 2008 12:19 pm

Postby blaf » Sat Apr 26, 2008 10:02 pm

so it works fine but there is a side effect

i have latex code:
\subsection{Správa èíselníkù}
%Následující text se zabývá popisem funkcí týkajících se správy èíselníkových tabulek.
Protože jsou všechny scénáøe velmi podobné scénáøùm uvedeným v sekci~\ref{subsec:spravaUzivatelu}
tak zde nebudou popisovány. Jedinou vyjímku tvoøí pøípad UC~6.1.2:~Vytvoøení/editace lékaøe
a~proto bude dále popsán. Základní pøehled poskytuje obrázek~\ref{fig:images/ciselnikyUC}.
\fig[width=140mm]{images/ciselnikyUC}{Use case diagram - Správa èíselníkù}
\\\\
% UC 6.1.2:~Vytvoøení/editace lékaøe
\needspace{1\baselineskip}
{\bf UC 6.1.2:~Vytvoøení/editace lékaøe}\label{par:editaceLekareUCDesc}\\
Popis: Umožòuje vytváøet resp. editovat nové resp. existující lékaøe.\\
Oprávnìní: Pøístup je poskytnut uživateli disponujícímu oprávnìním Spravovat èíselníky.
\needspace{1\baselineskip}Scénáø:
\begin{enumerate}
\item Zobrazení formuláøe pro editaci lékaøe.
\item V pøípadì existujícího lékaøe jsou pole formuláøe vyplnìna údaji o~lékaøi.
\item Vyplnìní/zmìna údajù o~lékaøi.
\item Zobrazení seznamu ústavù.
\item Výbìr ústavu pro lékaøe.
\item Kliknutí na tlaèítko Uložit.
\item Kontrola zadaných dat.
\item Uložení informací o lékaøi.
\item Zobrazení seznamu lékaøù.
\end{enumerate}
\needspace{1\baselineskip}
Vyjímky:
\begin{itemize}
\item V pøípadì chybnì vyplnìných údajù (napø. nevyplnìní povinné položky) je zobrazen stejný formuláø s~chybovou zprávou.
\end{itemize}

problem is that the bold text UC 6.1.2:~Vytvoøení/editace lékaøe and Scénáø: are intended. They should be aligned the same way as texts Popis: and Vyjimky

do you know where is the problem?

i've attached pdf file with the text

thx blaf
Attachments
dipl.pdf
(47.03 KiB) Downloaded 223 times

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Postby gmedina » Sat Apr 26, 2008 11:31 pm

Use a \noindent command to prevent undesired indentations.
  1. \noindent\textbf{UC 6.1.2:~Vytvoøení/editace lékaøe}\label{par:editaceLekareUCDesc}

By the way, the \bf command is obsolete, you can use \textbf{...} as I suggested, ot the global switch \bfseries. Further information can be found in l2tabu.
1,1,2,3,5,8,13,21,34,55,89,144,233,...

blaf
Posts: 4
Joined: Sat Apr 26, 2008 12:19 pm

Postby blaf » Sun Apr 27, 2008 2:24 am

now it works as I want, thx

I already have one other question

I have table and I'd like to merge several cells in one column
so it should look like:

--------------------------
|sdfsd|asdasdasdasda|
|sdfsd|-----------------|
|sdfsd|asdasdasdasda|
--------------------------

can i do that?

blaf

User avatar
Stefan Kottwitz
Site Admin
Posts: 9597
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Apr 27, 2008 2:28 am

Hi blaf,

you could use \multicolumn.

Stefan
LaTeX.org admin

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Postby gmedina » Sun Apr 27, 2008 2:39 am

On the other hand, to produce an entry that spans over saveral rows, you can use the \multirow command provided by the multirow package.

A little example of \multicolumn and \multirow:
  1. \documentclass{report}
  2. \usepackage{multirow}
  3.  
  4. \begin{document}
  5.  
  6. \begin{tabular}{|c|c|}
  7. \hline
  8. \multicolumn{2}{|c|}{Entry spanning several columns}\\ \hline
  9. column 1a & column 2a \\
  10. column 1a & column 2a \\ \hline
  11. \end{tabular}
  12.  
  13. \vspace{1cm}
  14.  
  15. \begin{tabular}{|c|c|}
  16. \hline
  17. \multirow{3}{*}{Entry spanning several rows}
  18. & column 1b \\
  19. & column 2b \\
  20. & column 3b \\ \hline
  21. \end{tabular}
  22.  
  23. \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...


Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests