Page LayoutExclude Cover and Title Page from Setup for Page Layout

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Cloud
Posts: 4
Joined: Tue Mar 04, 2014 9:25 pm

Exclude Cover and Title Page from Setup for Page Layout

Post by Cloud »

Hello everybody

I have following problem:

I want to use my personal page layout, like margins, text width, etc. But except the cover and the title page.

I think that the best solution for setting the page layout is to use is this (correct me if i am wrong).

Code: Select all

\usepackage{geometry}
\geometry{...}
It works fine, but I really don't want to use the same page layout for the cover and the title page - the blank geometry is the best for cover and title page.

My code looks like this.

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{setspace}
\linespread{1.5}

\usepackage{titlesec}     
\titleformat{\chapter}    
  {\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

\usepackage{cite}
\usepackage{indentfirst}

\usepackage{geometry}

 \geometry{ a4paper, total={210mm,297mm}, left=40mm, right=20mm, top=20mm, bottom=20mm, }

\begin{document}

\include{cover}
\include{title_page}

\chapter{Introduction}
....
\end{document}
Last edited by localghost on Tue Mar 04, 2014 9:55 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Exclude Cover and Title Page from Setup for Page Layout

Post by hugovdberg »

Did you take a look at the geometry manual? It is perfectly fine to change your geometry at almost any point in the document. So you could do something like this:

Code: Select all

\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{setspace}
\linespread{1.5}

\usepackage{titlesec}     
\titleformat{\chapter}    
  {\normalfont\LARGE\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}

\usepackage{cite}
\usepackage{indentfirst}

% Include geometry code, but don't change anything just yet.
\usepackage{geometry}

\usepackage{blindtext}
\begin{document}

\chapter{cover} %% I cant include your files, but this forces a new page for each
\chapter{title page} %% I cant include your files, but this forces a new page for each
% After title page set the geometry for the rest of the document
\newgeometry{total={210mm,297mm}, left=40mm, right=20mm, top=20mm, bottom=20mm,}

\blinddocument
\end{document}
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Cloud
Posts: 4
Joined: Tue Mar 04, 2014 9:25 pm

Re: Exclude Cover and Title Page from Setup for Page Layout

Post by Cloud »

Many thanks, it worked :)

And what about my question if it is the best way to define the page layout? I am really amateur with latex and i don't know if i will have some problem in future with some king of formatting. The reason why i am asking is that i have found a lot of different commands for set the amrgins, text with etc and lot of them doesn't work because they are limited by default values of other commands.

Thanks again :)
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Exclude Cover and Title Page from Setup for Page Layout

Post by hugovdberg »

There are many ways to similar results, but the geometry package is definitely an "accepted" way to change the page layout. It also depends on the documentclass you use, since for example the KOMA-script classes and memoir class have some formatting options included of their own, so it is really hard to answer your question in general.
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Cloud
Posts: 4
Joined: Tue Mar 04, 2014 9:25 pm

Re: Exclude Cover and Title Page from Setup for Page Layout

Post by Cloud »

I have one more question about the indent of paragraph. The first paragraph is not intended as default. I would like to indent every paragraph including the first. Simple solution is \usepackage{indentfirst}, but it obviously indent cover, title page and every chapter. I would like to start intending the first paragraph from the introduction of my thesis. One of the solution seems to be paste \noindent in every chapter, section and included files, where i dont want it, but is there a simpler way?? Or in general, is there a way to use package from exact point in document??
hugovdberg
Posts: 133
Joined: Sat Feb 25, 2012 6:12 pm

Exclude Cover and Title Page from Setup for Page Layout

Post by hugovdberg »

Next time please open a new topic when asking for this new question since this question is not tightly related to the original geometry question, this keeps topics clean.

I tested with the code below and it seems to work fine, the title is not indented. I suspect this is something in your cover/title_page files. You can't include the package halfway through the document, but if you take a look at the indentfirst manual it really consists of two lines only, which you could use at any place in the document, provided you enclose it between \makeatletter and \makeatother. To make this all a little easier I made two commands which you could use to switch indentation on and off.

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage{titlesec}

\makeatletter
\let\@backupafterindentfalse\@afterindentfalse
\newcommand{\indentfirst}{
   \let\@afterindentfalse\@afterindenttrue
   \@afterindentfalse
   }
\newcommand{\noindentfirst}{
   \let\@afterindentfalse\@backupafterindentfalse
   \@afterindentfalse
   }
\makeatother

\title{this is a long, in fact, really very long test title to see it the indentation of the title is really off}
\author{me}
\begin{document}
\maketitle
\section{no indent}
\blindtext

\blindtext

\blindtext

\section{indent}
\indentfirst
\blindtext

\blindtext

\blindtext

\section{no indent}
\noindentfirst
\blindtext

\blindtext

\blindtext
\end{document}
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit
Cloud
Posts: 4
Joined: Tue Mar 04, 2014 9:25 pm

Re: Exclude Cover and Title Page from Setup for Page Layout

Post by Cloud »

Thanks a lot, everything worked fine. You are king!!! :)
Post Reply