1

I'm writing my thesis with LaTeX, I didn't find the right solution for the following questions,maybe someone can help me with them:

  1. somehow i got an empty page before the title page, how can I remove it? And I have found out that, if I delete the graph I have include in the title page, this empty page will be gone and also the header, but I need this graph in my title page.

  2. How to remove the header for the title page?

  3. In the table of contents, how can i include declaration and abbreviation table with roman numerals into table of contents? I have tried with \frontmatter, but it said ! Undefined control sequence. \frontmatter. in table of contents, it didn't include declaration or abbreviation, but just starts with "contents........v", I want declaration and abbreviation also list in table of contents.

Below is the script I write in TexMaker.
Thank you for your help!!!
(Sorry it's my first time post here, maybe you can also tell me how to show my script in a nicer way :) )

\documentclass[a4paper, 12pt, english,headsepline, DIV=12,twoside]{report}
\usepackage{lmodern}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{array}
\usepackage{float}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{figure/}}
\usepackage{esint}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{microtype}
\usepackage[backend=bibtex,
            style=authoryear,
            natbib=true, 
            style=numeric-comp
            ]{biblatex}
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
    \text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}

\providecommand{\tabularnewline}{\\}
\floatstyle{ruled}
\newfloat{algorithm}{tbp}{loa}[chapter]
\providecommand{\algorithmname}{Algorithm}
\floatname{algorithm}{\protect\algorithmname}

% \usepackage{ae,aecompl}
\usepackage {marvosym}
\usepackage{rotating}
\usepackage[nottoc]{tocbibind}
% \pagenumbering{roman}
\usepackage{parskip}
% \usepackage{a4wide}
\usepackage{makeidx}
\usepackage{url}
\usepackage[english]{babel}

\usepackage{scrpage2}     
\pagestyle{scrheadings}   
\clearscrheadfoot         
\automark[section]{chapter}   
\ohead{\pagemark}              
\ihead{\headmark}      
\usepackage[BCOR1cm]{typearea}        
\usepackage[normalem]{ulem}
\usepackage{blindtext}

\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}

\title{
\thispagestyle{plain}
 \centering
 \includegraphics[width=0.5\textwidth]{logo_cropped}\\
   \rule{0pt}{20mm}
   \text{Master Thesis}\\
   \vspace{10mm}
   \textbf{blablabla}
}
\author{Vivian}
\vspace{5mm}
\date{
    \vspace{25mm}
    \begin{tabular}{rl}
        \vspace{2mm}      
        \textbf{Faculty:}            &{blabla}\\
        \vspace{0.5mm}      
        \textbf{Studies:}            &{blabla}\\
        \vspace{0.5mm}
        \textbf{First Examiner:}     & Prof. \\
        \vspace{0.5mm}
        \textbf{Second Examiner}     & Prof. \\
        \vspace{0.5mm}
        \textbf{Supervisor:}         & Prof.\\
        \vspace{0.5mm}
        \textbf{Issued on:}          & June 30, 2016 \\
        \vspace{0.5mm}
        \textbf{Submitted on:}       & January 9, 2017\\
    \end{tabular} 
    }

    \addbibresource{Bib.bib}

\usepackage{lipsum}

\begin{document}
\setcounter{secnumdepth}{-1}
\pagestyle{empty}

\maketitle  
\pagestyle{scrheadings} 
\pagenumbering{roman}       

    \include{Declaration}

    \include{Abstract}

    \lipsum[1-5]

    \setcounter{secnumdepth}{3} 
    \tableofcontents
    \clearpage
    \pagenumbering{arabic}  

    \include{Chapter1}

    \include{Chapter2}

    \listoffigures

\begin{table}
\caption{Human Body Models and Applications}
\label{tab:HBM}
\centering
\begin{tabular}{*{3}{c}}
\toprule
\multicolumn{1}{c}
{Human model} & {Impact simulation} & {Comfort Simulation} \\
\midrule
here is some text without a meaning this text should show what a printed & text will look like at this place & If you read this text you will get no information\\
here is some text without a meaning this text should show what a printed & text will look like at this place & If you read this text you will get no information\\
here is some text without a meaning this text should show what a printed & text will look like at this place & If you read this text you will get no information\\
\bottomrule\\
\end{tabular}
\end{table}


    \printbibliography

\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248
Vivian
  • 379

2 Answers2

2

Here is a solution. Note the report class does not define \frontmatter, \mainmatter nor \backmatter. Simply use \pagenumbering{roman}, then \pagenumbering{arabic} where relevant.

I suppose ‘Declaration’ and ‘Abstract’ have to be unnumbered chapters while still appearing in the table of contents. A simple way to obtain this result is to set secnumdepth to -1 to begin with, then set it to 3 when main matter begins. Finally, as the table of contents should not be a member of itself (like sets…), I added the [nottoc]option to tocbibind. Also, typearea should be loaded after scrpage2.

Last thing: I removed some obsolete packages (mainly ae, aecompl — useless with lmodern, a4wide — one of the deadful sins according to l2tabu — since you load typearea, and times: if you want to use a times-like font, then don't load lmodern, and replace times with newtxtext + newtxmath).

\documentclass[a4paper, 12pt, english,headsepline, DIV=12, twoside]{report}
\usepackage{lmodern}
%\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{array}
\usepackage{float}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[demo]{graphicx}
\graphicspath{{figure/}}
\usepackage{esint}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{microtype}
\usepackage[backend=bibtex,
            style=authoryear,
            natbib=true,
            style=numeric-comp
            ]{biblatex}
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
    \text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}

\providecommand{\tabularnewline}{\\}
\floatstyle{ruled}
\newfloat{algorithm}{tbp}{loa}[chapter]
\providecommand{\algorithmname}{Algorithm}
\floatname{algorithm}{\protect\algorithmname}

\usepackage {marvosym}
\usepackage{rotating}
\usepackage[nottoc]{tocbibind}
\usepackage{parskip}
\usepackage{makeidx}
\usepackage{url}
\usepackage[english]{babel}

\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot
\automark[section]{chapter}
\ohead{\pagemark}
\ihead{\headmark}
\usepackage[BCOR1cm]{typearea}
\usepackage[normalem]{ulem}
\usepackage{blindtext}


\title{
 \centering
 \includegraphics[width=0.5\textwidth]{logo_cropped}\\
 \rule{0pt}{25mm}%\\
  {Master Thesis} \\
   \vspace{10mm}
   \textbf{blablabla}
}
\author{Vivian}
\vspace{5mm}
\date{
    \vspace{25mm}\setlength{\extrarowheight}{2pt}
    \begin{tabular}{rl}
        \textbf{Faculty:} &{blabla}\\[2mm]
        \textbf{Studies:} &{blabla}\\
        \textbf{First Examiner:} & Prof. \\
        \textbf{Second Examiner} & Prof. \\
        \textbf{Supervisor:} & Prof.\\
        \textbf{Issued on:} & June 30, 2016 \\
        \textbf{Submitted on:} & January 9, 2017\\
    \end{tabular}
    }

    \addbibresource{Bib.bib}
\usepackage{lipsum}

 \begin{document}
\setcounter{secnumdepth}{-1}
\pagestyle{empty}
    \maketitle
\pagestyle{scrheadings}
\pagenumbering{roman}
    \chapter{Declaration}
\blindtext
    \chapter{Abstract}
\lipsum[1-5]

\setcounter{secnumdepth}{3}
\tableofcontents
\clearpage
\pagenumbering{arabic}

    \chapter{Chapter the First}
\lipsum[1-10]

    \chapter{Chapter the Second}
\lipsum[11-20]

\appendix

    \chapter{An Appendix}
\lipsum[21-25]

    \listoffigures

    \printbibliography

\end{document}

enter image description here enter image description here enter image description here

Bernard
  • 271,350
  • Thank you very much for your help! what are function of these two demands(\lipsum[0] and \setcounter{secnumdepth}{3})? And what are the numbers inside for? I have applied the one you wrote, but in table of contents, it still doesn´t include declaration and abstract part. besides it include some blindtext by itself, does it have sth to do with the number after these two domand? – Vivian Oct 28 '16 at 17:03
  • \lipsum[1-5] produces §§1 to 5 of an automatic text generator. It is only used for testing. The other command restores the counter of section levels which are numbered to its default value in the reportclass — 3, i.e they will be numbered up to subsubsection. Parts have level–1, chapters level 0, sections level 1, &c. – Bernard Oct 28 '16 at 19:48
  • That is strange declaration and abstract do not appear. You must compile twice to see them in the table of contents. Are you sure you didn't call them with the starred version (\chapter*)? – Bernard Oct 28 '16 at 19:54
  • Hi Bernard,I can´t check it because it appears a new error:" ! Undefined control sequence. ...ibnameprefix {of}\isdot \ifprefchar {} {} {\ifuseprefix {\bibn... " , this appears in line (\printbibliography). I have edited my script in my question page, can you please have a look? Thank you! – Vivian Nov 02 '16 at 14:29
  • This new error is clearly linked to the bibliography – and you didn't post any bibliography, so I can't reproduce this message. However, there were changes in biblatex a few months ago. Did you check your version is up-to-date? – Bernard Nov 02 '16 at 15:22
  • Thank you so much! The problem is the software for my bibliography. I know how to solve it. Btw, how can i reduce the spacing between paragraph and spacing between figure and text? In chapter 1 it looks quite ok, but from 2nd page of chapter 2, the spacing become very large by itself. – Vivian Nov 03 '16 at 11:44
  • I have tried with (\vspace{10pt}), it can reduce the spacing between paragraph, but the 1st sentence from lower paragraph will be wirtten to the end of upper paragraph, which means the 1st sentence of lower paragraph become last sentence from the upper paragraph. And another question is table full of text, i want to make a table, but due to space issue, now all the text can be seen in pdf file. I have put the table into my question page. Thank you for your effort! – Vivian Nov 03 '16 at 12:17
1

I have added the following two lines to your code:

\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}

Solution found here.

Your working code is now the following one:

\documentclass[a4paper, 12pt, english,headsepline, DIV=12,twoside]{report}
\usepackage{lmodern}
\usepackage{times}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\usepackage{array}
\usepackage{float}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{figure/}}
\usepackage{esint}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{microtype}
\usepackage[backend=bibtex,
            style=authoryear,
            natbib=true, 
            style=numeric-comp
            ]{biblatex}
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth

\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
    \text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}

\providecommand{\tabularnewline}{\\}
\floatstyle{ruled}
\newfloat{algorithm}{tbp}{loa}[chapter]
\providecommand{\algorithmname}{Algorithm}
\floatname{algorithm}{\protect\algorithmname}

\usepackage{ae,aecompl}
\usepackage {marvosym}
\pagenumbering{roman}
\usepackage[BCOR1cm]{typearea}
\usepackage{rotating}
\usepackage{tocbibind}
\usepackage{parskip}
\usepackage{a4wide}
\usepackage{makeidx}
\usepackage{url}
\usepackage[english]{babel}

\usepackage{scrpage2}     
\pagestyle{scrheadings}   
\clearscrheadfoot         
\automark[section]{chapter}   
\ohead{\pagemark}              
\ihead{\headmark}              
\usepackage[normalem]{ulem}
\usepackage{blindtext}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title{
\thispagestyle{plain}
 \centering
 \includegraphics[width=0.5\textwidth]{logo_cropped}\\
   \vspace{20mm}
   \text{Master Thesis}\\
   \vspace{10mm}
   \textbf{blablabla}
}
\author{Vivian}
\vspace{5mm}
\date{
    \vspace{25mm}
    \begin{tabular}{rl}
        \vspace{2mm}      
        \textbf{Faculty:}            &{blabla}\\
        \vspace{0.5mm}      
        \textbf{Studies:}            &{blabla}\\
        \vspace{0.5mm}
        \textbf{First Examiner:}     & Prof. \\
        \vspace{0.5mm}
        \textbf{Second Examiner}     & Prof. \\
        \vspace{0.5mm}
        \textbf{Supervisor:}         & Prof.\\
        \vspace{0.5mm}
        \textbf{Issued on:}          & June 30, 2016 \\
        \vspace{0.5mm}
        \textbf{Submitted on:}       & January 9, 2017\\
    \end{tabular} 
    }

    \addbibresource{Bib.bib}


\begin{document}
\thispagestyle{headings} 

    \maketitle
        %\titlepage
    \include{Declaration}

    \include{Abstract}

    \tableofcontents

    \include{Chapter1}

    \include{Chapter2}

    \include{Appendix}

    \listoffigures

    \printbibliography

\end{document}
cProg
  • 591
  • Hi, thank you for your answer! The empty page before title page has been removed! But I still have the other 2 problems – Vivian Oct 20 '16 at 16:38
  • Remove the definition of \lyxmathsym; you're apparently not using it, because it does nothing at all. – egreg Nov 04 '16 at 09:02