Page Layout! LaTeX Error: Missing \begin{document}.

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

! LaTeX Error: Missing \begin{document}.

Post by jordan »

Hi all,

I've testing different fancy chapters for my phD thesis. Everything is ok except when I try with Bjornstrup style,

Code: Select all

\usepackage[Bjornstrup]{fncychap}
in this case I get the error ! LaTeX Error: Missing \begin{document}.

Can anybody help me?

Thanks in advance ;)

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

! LaTeX Error: Missing \begin{document}.

Post by Stefan Kottwitz »

Hi Jordan,

welcome to the board!
I don't get that error with that line of code. Test this example:

Code: Select all

\documentclass[a4paper,10pt]{book}
\usepackage[Bjornstrup]{fncychap}
\begin{document}
\chapter{Test}
Test
\end{document}
Perhaps show a minimal working example producing that error.

Stefan
LaTeX.org admin
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

! LaTeX Error: Missing \begin{document}.

Post by jordan »

This is all my stuff:

Code: Select all

\documentclass[a4paper,twoside,10pt]{book}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{indentfirst}
\usepackage{rotating}
\usepackage{geometry,pstricks}
\usepackage{pst-node,graphicx}
\newsavebox\PBox
\usepackage{multirow}
\usepackage{longtable}
\usepackage{url}
\usepackage{subfigure}

\usepackage[Bjornstrup]{fncychap}

\usepackage{geometry}
\geometry{paperheight=24cm,paperwidth=17cm}
\geometry{right=1.6cm}
\geometry{left=2.0cm}
\geometry{top=2.3cm}
\geometry{bottom=2.3cm}
\geometry{twoside}

\usepackage[noinfo,center,a4,frame]{crop}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}
\fancyhead[RO,LE]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}

\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\textheight}{#1}%
    \setlength{\textwidth}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}}
I've tried your example and it works, but when I add all those lines... latex error!
If I use the other fancy chapters I don't get this problem.

Can you tell me why?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

! LaTeX Error: Missing \begin{document}.

Post by Stefan Kottwitz »

Of course there will be the error "Missing \begin{document}" because you don't have a line

Code: Select all

\begin{document}
in your code, and no text and no

Code: Select all

\end{document}
Stefan
LaTeX.org admin
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

! LaTeX Error: Missing \begin{document}.

Post by jordan »

Yes, I have these lines but I've omitted this information in the previous post. Now all the lines of the code:

Code: Select all

\documentclass[a4paper,twoside,10pt]{book}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{indentfirst}
\usepackage{rotating}
\usepackage{geometry,pstricks}
\usepackage{pst-node,graphicx}
\newsavebox\PBox
\usepackage{multirow}
\usepackage{longtable}
\usepackage{url}
\usepackage{subfigure}

\usepackage[Bjornstrup]{fncychap}

\usepackage{geometry}
\geometry{paperheight=24cm,paperwidth=17cm}
\geometry{right=1.6cm}
\geometry{left=2.0cm}
\geometry{top=2.3cm}
\geometry{bottom=2.3cm}
\geometry{twoside}

\usepackage[noinfo,center,a4,frame]{crop}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}
\fancyhead[RO,LE]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\addtolength{\headheight}{0.5pt}

\newenvironment{changemargin}[2]{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\textheight}{#1}%
    \setlength{\textwidth}{#2}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}}


\begin{document}
\chapter{Test}
Test
\end{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Re: ! LaTeX Error: Missing \begin{document}.

Post by Stefan Kottwitz »

I can compile this example without any error message using fncychap.sty 2007/07/30 v1.34. Do you use a different version?

By the way please use the Code button to insert LaTeX code to get more readable posts. I will edit your post above regarding this.

Stefan
LaTeX.org admin
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

Re: ! LaTeX Error: Missing \begin{document}.

Post by jordan »

ups I'm sorry, this is my first time in this forum.

I've downloaded it from CTAN homepage this morning. I don't understand why it works with other styles of fancy chapters but I have problems with Bjornstrup.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

Re: ! LaTeX Error: Missing \begin{document}.

Post by Stefan Kottwitz »

Strage ... you could post your .log file as attachment here, we could examine it.

Stefan
LaTeX.org admin
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

! LaTeX Error: Missing \begin{document}.

Post by jordan »

If I comment the lines

Code: Select all

\usepackage{graphicx}
and

Code: Select all

\usepackage{rotating}
it works. The problem is I need both :(.

I've attached the log file. I hope it helps.
Attachments
test.log
(9.24 KiB) Downloaded 314 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: ! LaTeX Error: Missing \begin{document}.

Post by frabjous »

Why do you need both? What can you do with rotating that you can't do with \rotatebox (and similar) from graphicx?
Post Reply