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).
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 »

Hmm ... try this before loading color, graphicx or rotating:

Code: Select all

\makeatletter
\def\color@gray#1#2{%
\c@lor@arg{#2}%
\edef#1{gray #2}} 
\makeatother
Stefan
LaTeX.org admin

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: Missing \begin{document}.

Post by localghost »

frabjous wrote:Why do you need both? What can you do with rotating that you can't do with \rotatebox (and similar) from graphicx?
If you like to complicate things more than necessary, use graphicx and tinker. If you tend to pragmatism, use the environments of rotating.
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

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

Post by jordan »

Hi,

I use rotating for sidewaystables... But anyway, I have problems also with graphicx.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: Missing \begin{document}.

Post by localghost »

You have to reduce the problem to a minimal working example (MWE) as requested earlier by Stefan. This MWE shall only contain the necessary packages and no other additional code like new commands or similar things that are irrelevant to the problem. It has to be small, complete and compilable for everyone. Follow exactly the instructions of the link above.

Use the sidewaystable environment and put some minimal code in. Include an external graphics file and attach this file to your next post if necessary. Remember that this example has to reproduce the error exactly. For generating some text you can use the blindtext package.
jordan
Posts: 7
Joined: Thu Sep 17, 2009 5:41 pm

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

Post by jordan »

I think I'm going to use other style...

Thanks for your help.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

! LaTeX Error: Missing \begin{document}.

Post by localghost »

With this example I would like to encourage you not to give up so fast. Compile it and see what happens. In case of occurring errors, post the log file.

Code: Select all

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[centering,includeheadfoot,margin=2cm]{geometry}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage{booktabs,textcomp}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{blindtext}

\begin{document}
  \blinddocument

  \begin{sidewaystable}
    \caption{Trigonometric functions}\label{tab:trigfunc}
    \centering%\footnotesize
    \begin{tabular}{@{}l*{17}{c}@{}}\toprule
      & 0 & $\frac{1}{6}\,\pi$  & $\frac{1}{4}\,\pi$ & $\frac{1}{3}\,\pi$ & $\frac{1}{2}\,\pi$ & $\frac{2}{3}\,\pi$ & $\frac{3}{4}\,\pi$ & $\frac{5}{6}\,\pi$ & $\pi$ & $\frac{7}{6}\,\pi$ & $\frac{5}{4}\,\pi$ & $\frac{4}{3}\,\pi$ & $\frac{3}{2}\,\pi$ & $\frac{5}{3}\,\pi$ & $\frac{7}{4}\,\pi$ & $\frac{11}{6}\,\pi$ & $2\pi$ \\ \cmidrule{2-18}
      & 0\textdegree & 30\textdegree & 45\textdegree & 60\textdegree & 90\textdegree & 120\textdegree & 135\textdegree & 150\textdegree & 180\textdegree & 210\textdegree & 225\textdegree & 240\textdegree & 270\textdegree & 300\textdegree & 315\textdegree & 330\textdegree & 360\textdegree \\ \midrule[1pt]
      $\sin x$ & $\frac{\sqrt{0}}{2}$ & $\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{4}}{2}$ & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{0}}{2}$ & $-\frac{\sqrt{1}}{2}$ & $-\frac{\sqrt{2}}{2}$ & $-\frac{\sqrt{3}}{2}$ & $-\frac{\sqrt{4}}{2}$ & $-\frac{\sqrt{3}}{2}$ & $-\frac{\sqrt{2}}{2}$ & $-\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{0}}{2}$ \\ \addlinespace
      $\cos x$ & $\frac{\sqrt{4}}{2}$ & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{0}}{2}$ & $-\frac{\sqrt{1}}{2}$ & $-\frac{\sqrt{2}}{2}$ & $-\frac{\sqrt{3}}{2}$ & $-\frac{\sqrt{4}}{2}$ & $-\frac{\sqrt{3}}{2}$ & $-\frac{\sqrt{2}}{2}$ & $-\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{0}}{2}$ & $\frac{\sqrt{1}}{2}$ & $\frac{\sqrt{2}}{2}$ & $\frac{\sqrt{3}}{2}$ & $\frac{\sqrt{4}}{2}$ \\ \addlinespace
      $\tan x$ & 0 & $\frac{\sqrt{3}}{3}$ & 1 & $\sqrt{3}$ & $\pm\infty$ & $-\sqrt{3}$ & $-1$ & $-\frac{\sqrt{3}}{3}$ & 0 & $\frac{\sqrt{3}}{3}$ & 1 & $\sqrt{3}$ & $\pm\infty$ & $-\sqrt{3}$ & $-1$ & $-\frac{\sqrt{3}}{3}$ & 0 \\ \addlinespace
      $\cot x$ & $\pm\infty$ & $\sqrt{3}$ & 1 & $\frac{\sqrt{3}}{3}$ & 0 & $-\frac{\sqrt{3}}{3}$ & $-1$ & $-\sqrt{3}$ & $\pm\infty$ & $\sqrt{3}$ & 1 & $\frac{\sqrt{3}}{3}$ & 0 & $-\frac{\sqrt{3}}{3}$ & $-1$ & $-\sqrt{3}$ & $\pm\infty$ \\ \bottomrule
    \end{tabular}
  \end{sidewaystable}

  \blinddocument
\end{document}
Post Reply