Page Layout ⇒ Latex doing newpage inexplicably (for me)
-
- Posts: 6
- Joined: Fri Sep 10, 2010 4:55 pm
Latex doing newpage inexplicably (for me)
In the middle of a paragraph, i get a new page if the paragraph gets beyond 3 lines. Why is this happen ? I've no clue at all.
Sample
\newcommand{\tab}{\hspace*{27pt}}
\section{ Section1}
\subsection{SubSection1}
{\scriptsize \bfseries \tab Title \\}
{\tab texttextexttext}
{\\ \tab }
{\scriptsize \bfseries \tab Title2 \\}
{\tab if this text gets to long (4 lines) i get a new page. But i'm in the middle of the page, at most! }
\subsection{SubSection1}
....
Thanks in advance for any help.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Latex doing newpage inexplicably (for me)
-
- Posts: 6
- Joined: Fri Sep 10, 2010 4:55 pm
Latex doing newpage inexplicably (for me)
Sorry again, i'll do it.
Thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Latex doing newpage inexplicably (for me)
How is that possible? The rules are actually very clear in that point. But there are some other things to be noticed [1].albuquerque wrote:sorry, i got the wrong impression that we should try to put the less code possible, not a minimal working example.[…]
And please explain what you are after with this horrible piece of code. This is not the way of writing documents with LaTeX.
[1] View topic: Avoidable mistakes
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 6
- Joined: Fri Sep 10, 2010 4:55 pm
Re: Latex doing newpage inexplicably (for me)
i'm really sorry to have bothered you.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Latex doing newpage inexplicably (for me)
In which way do I have to understand that? Simply post a small example that reproduces the undesired behaviour. From what you have provided so far nothing can be done to give specific help. And if you explain what you want to achieve, we are in a better position to help you.albuquerque wrote:I was going to post the working (well, almost working) code, but i think it's better not to annoy you with it. If i can't get help from the start, six months from now i can write perfect code but i won't need your help any more.
i'm really sorry to have bothered you.
I especially don't understand what you are aiming at with this \tab command. Seems to me like you want an indentation for every single paragraph. Do you want to change the margins or something similar? At the moment I have more questions than answers.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
-
- Posts: 6
- Joined: Fri Sep 10, 2010 4:55 pm
Latex doing newpage inexplicably (for me)

But then, here it is. Please don't call me awful things

Thanks
If i remove the section4, everything works fine.
Code: Select all
\documentclass[10pt,titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\geometry{a4paper}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{paralist}
\usepackage{verbatim}
\usepackage{subfig}
\usepackage{makeidx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\lhead{Title}\chead{}\rhead{\thepage}
\lfoot{}\cfoot{}\rfoot{}
\newcommand{\tab}{\hspace*{27pt}}
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape}
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[titles,subfigure]{tocloft}
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape}
\title{Title\\*\Huge Subtitle}
\author{A}
\begin{document}
\maketitle
\newpage
\newpage
\section{ Produção}
\subsection{Falta de controlo de algumas matérias primas e/ou subsidiárias}
{\scriptsize \bfseries \tab Descrição \\}
{\tab Não é possível identificar a quantidade e qualidade da \textbf{tinta} usada em cada FP. Invalida a sua gestão cirúrgica e permanente. Os \textbf{rolos} usados no enrolamento das etiquetas também não são objecto de inventariação permanente, bem como as \textbf{caixas} de embalar. São estas as \textbf{três} principais falhas encontradas relativas ao controlo de todos as matérias usadas na produção.}
{\scriptsize \bfseries \tab Resolução \\}
{\tab A maior dificuldade para a solução destas falhas prende-se com a questão da \textbf{tinta}. Já várias soluções foram equacionadas em ocasiões anteriores. A solução ideal seria o completo automatismo da mistura de tintas e do seu consumo, através de uma máquina externa com ligações ao sistema da FPE. As soluções de compromisso implicariam um esforço extra de cada impressor, procedendo ele próprio à pesagem das misturas e respectivas sobras.}
{\\ \tab O controle das \textbf{caixas} de embalar reveste-se de alguma simplicidade quando comparado com matérias como o \textbf{papel} ou as \textbf{tintas}. Dado que o processo de entrada em stock já está controlado e a sua codificação feita, o embalador terá apenas de registar o \textbf{código da caixa} (via scanner de código de barras ou manualmente) no momento em que efectua o registo de envio da encomenda. Com os \textbf{rolos} o processo é análogo, com a diferença que a sua entrada e codificação ainda não está efectuada e, mais importante ainda, existe uma especifidade própria que consiste no facto de dois (ou até mais) rolos poderem ser conjugados dando origem a outro.}
{\scriptsize \bfseries \tab Implementação \\}
{\tab Here the new page happens, i don't know why}
\subsection{Geolocalização do stock de etiquetas}
\subsection{Registos de controle de qualidade}
\subsection{Previsões de produção}
\section{Section2}
\subsection{Criação processos de terceiros}
\subsection{Encomendas a fornecedores}
\subsection{Registo documentos de fornecedores}
\subsection{Gestão de cobranças}
\subsection{Tratamento de reclamações}
\subsection{Automatização de orçamentos}
\section{Section3}
\subsection{Página}
\subsection{Encomendas online}
\section{Section4}
\subsection{Rever descrição interna de papéis}
\subsection{Rever descrição do "artigo" etiquetas}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Latex doing newpage inexplicably (for me)
I don't know which tutorials you have read, but you should do again some basic reading [1]. And templates you got somewhere from the net should always be used with caution. Most of them are not up to date.albuquerque wrote:[…] I read some latex tutorials yesterday, look at some templates, choose one, start writing my first tex text today. Maybe i should read the entire manual first and look at some real life samples before starting making questions here. I just added some sections to a template and start write. […]
See below for an example based on your code. I added some important packages, also dropped some and replaced them with other ones. The comments shall guide you. Please read the manuals of the involved packages.
Code: Select all
\documentclass[10pt,a4paper,titlepage]{article}
\usepackage[T1]{fontenc} % Enable Cork Encoding for better hyphenation
\usepackage[utf8]{inputenc} % Direct insertion of specail charaters
\usepackage[portuges]{babel} % Setup for language Portuges
\usepackage{geometry} % Setup for page dimensions
\usepackage{graphicx} % Inclusion of external graphics files
\usepackage{booktabs} % Nice looking tables
\usepackage{array} % Extension of »table« and »array« environments
\usepackage{paralist} % Enable Lists in paragraph mode
\usepackage{verbatim} % Extensions to the »verbatim« environment
\usepackage{subfig} % Dividing figure into sub-figures
\usepackage{makeidx} % Generation of an index
\usepackage[%
indentfirst, % Indent first paragraph after a heading
pagestyles, % Enable declaration of new page styles
raggedright, % Headings appear flushed to the left without hyphenation
sf % Headings appear in sans serif font
]{titlesec} % Setting up headings, pagestyles and other formatting options
\usepackage[%
nottoc, % ToC not in Table of Contents
notlof, % LoF not in Table of Contents
notlot % LoT not in Table of Contents
]{tocbibind}
\usepackage[%
subfigure, % Only necessary when used together with »subfigure« (or »subfig«) package
titles % list titles typeset with default settings
]{tocloft}
% ToC formatting (tocloft)
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape}
% Setup for headers and footers
\newpagestyle{main}{%
\sethead[\thepage][][Title]{Title}{}{\thepage}
\setfoot[][][]{}{}{}
\headrule
}
\pagestyle{main}
\title{Title\\*\Huge Subtitle}
\author{albuquerque}
\makeindex
\begin{document}
\maketitle
\tableofcontents
\newpage
\section{Produção}
\subsection{Falta de controlo de algumas matérias primas e/ou subsidiárias}
\textbf{\scriptsize Descrição}
Não é possível identificar a quantidade e qualidade da \textbf{tinta} usada em cada FP. Invalida a sua gestão cirúrgica e permanente. Os \textbf{rolos} usados no enrolamento das etiquetas também não são objecto de inventariação permanente, bem como as \textbf{caixas} de embalar. São estas as \textbf{três} principais falhas encontradas relativas ao controlo de todos as matérias usadas na produção.
\medskip
\textbf{\scriptsize Resolução}
A maior dificuldade para a solução destas falhas prende-se com a questão da \textbf{tinta}. Já várias soluções foram equacionadas em ocasiões anteriores. A solução ideal seria o completo automatismo da mistura de tintas e do seu consumo, através de uma máquina externa com ligações ao sistema da FPE. As soluções de compromisso implicariam um esforço extra de cada impressor, procedendo ele próprio à pesagem das misturas e respectivas sobras.
O controle das \textbf{caixas} de embalar reveste-se de alguma simplicidade quando comparado com matérias como o \textbf{papel} ou as \textbf{tintas}. Dado que o processo de entrada em stock já está controlado e a sua codificação feita, o embalador terá apenas de registar o \textbf{código da caixa} (via scanner de código de barras ou manualmente) no momento em que efectua o registo de envio da encomenda. Com os \textbf{rolos} o processo é análogo, com a diferença que a sua entrada e codificação ainda não está efectuada e, mais importante ainda, existe uma especifidade própria que consiste no facto de dois (ou até mais) rolos poderem ser conjugados dando origem a outro.
\medskip
\textbf{\scriptsize Implementação}
Here the new page happens, i don't know why. The undesired page break won't appear if you fill the sections and sub-sections that follow with some text.
\end{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Latex doing newpage inexplicably (for me)
About the defined \tab command: I happen to know that the rtf2latex2e converter does something a lot like that. It drives me crazy, and I always have to strip them out afterwards. Did you get this code from conversion? If so, that kind of thing is nice to know.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Latex doing newpage inexplicably (for me)
A very interesting note. But if this converter is also responsible for all the other weird things, it should be used with caution. This would require a lot of post-processing to get proper code for the document.frabjous wrote:[…] About the defined \tab command: I happen to know that the rtf2latex2e converter does something a lot like that. It drives me crazy, and I always have to strip them out afterwards. Did you get this code from conversion? If so, that kind of thing is nice to know.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10