Document Classes ⇒ Mysterious error when using documentclass "book"
Mysterious error when using documentclass "book"
Dear Latex friends,
I am coming back to latex after a longer break, and all works well except of a mysterious error which puzzles me. I have no clue even after searching the web for days..
I installed protext with the miktex distribution and texnic center. I want to write a longer review so I took the documentclass "book". After adding some text and the first .eps figures (in the \begin{figure} ...\end{figure} environment), I suddenly got error messages, bot latex and tex. Which one depends on the length of the text and the number of figures. Sometimes, it says a "$" is missing, sometimes, it says an "\item" is missing... Actually, there is nothing missing, which I can prove by a simple trick: If I change to documentclass "article", all errors are gone! Also, I can avoid the errors by commenting out the figures, then it works also in documentclass "book".
It looks to me that there is some overflow problem, but I do not know to find out or cure it.
Any hint is welcome.
Thanks
Nankodai
Addendum: I ran a demo file on this online interpreter
http://sciencesoft.at/latex/flatex.gsp?lang=en
(which seems to use miktex as well) and the error comes up there as well, so it is not an issue of my computer or the tex installation
I am coming back to latex after a longer break, and all works well except of a mysterious error which puzzles me. I have no clue even after searching the web for days..
I installed protext with the miktex distribution and texnic center. I want to write a longer review so I took the documentclass "book". After adding some text and the first .eps figures (in the \begin{figure} ...\end{figure} environment), I suddenly got error messages, bot latex and tex. Which one depends on the length of the text and the number of figures. Sometimes, it says a "$" is missing, sometimes, it says an "\item" is missing... Actually, there is nothing missing, which I can prove by a simple trick: If I change to documentclass "article", all errors are gone! Also, I can avoid the errors by commenting out the figures, then it works also in documentclass "book".
It looks to me that there is some overflow problem, but I do not know to find out or cure it.
Any hint is welcome.
Thanks
Nankodai
Addendum: I ran a demo file on this online interpreter
http://sciencesoft.at/latex/flatex.gsp?lang=en
(which seems to use miktex as well) and the error comes up there as well, so it is not an issue of my computer or the tex installation
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Mysterious error when using documentclass "book"
Attach the code that is causing the problems including the image files to your next post. The better way would be to reduce the problem to a minimal working example (MWE).
Best regards and welcome to the board
Thorsten¹
Best regards and welcome to the board
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Mysterious error when using documentclass "book"
sorry, I could have done that before. Enclosed you can find the code. If I run it as book, it makes 13 errors, if I run it as article (comment out the \documentstyle{book}, and remove the % before the article), there are 0 errors. Works same way on the online latex interpreter. Actually, the error is now extremely sensitive to length, if I remove some empty(!) lines from the document, it is gone!
Best regards and thanks for the help
Nankodai
Best regards and thanks for the help
Nankodai
Code: Select all
\documentclass{book}
%\documentclass{article}
\usepackage{graphicx}
\makeindex
\begin{document}
\author{dummy}
\title{dummy}
\maketitle
%\frontmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\tableofcontents
%\mainmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\chapter{Introduction: Basics}
%\chaptermark{Basics}
%\label{intro}
\section[What are]
{What are } \sectionmark{definition_organic}
dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy dummy
are a new class of materials which are characterized by the fact that they are composed of molecules. Organic molecules are characterized by the fact that their properties are mostly determined by the special properties of the carbon atom: Carbon forms different hybridizations, allowing it to form different bond configurations, leading to a variety of different molecular structures. The most important bond configuration which is causing the semiconducting properties of molecular organic materials is the $sp_2$ configuration: In this configuration (see Fig.~ \ref{sp2scheme}), the carbon atoms has three singly occupied orbitals extending into the plane with an angle of 120$^0$ between them and a single unpaired $p_z$ orbital extending vertically above and below the plane.
\begin{figure}[htb]
\begin{center}
\rule{2cm}{2cm}
\end{center}
\caption[]{Schematic drawing of orbital configuration of a carbon atom in the $sp_2$ configuration
Status: taken from orgtalk, to be redrawn}
\label{sp2scheme}
\end{figure}
The three bonds extending in the plane generate the usual $\sigma$-bonds forming the backbone of organic molecules. In particular, by using the three orbitals in the plane, the carbon atoms can form chains or networks. In the chain, the third orbital can bind, e.g., a hydrogen atom or a side group, in a network, it can participate in a 2D-configuration. The single electrons in the $p_z$-orbitals can additionally form the so-called $\pi$-bonds, leading together with the $\sigma$-bound backbone to {\it double bonds}. In a simple picture, the single electron can pair with a the electron from one neighbouring carbon atom, so that alternating double and single bonds exist (see Figure \ref{pibondchain}).
\begin{figure}[htb]
%\sidecaption
\begin{center}
%\includegraphics[width=.5\textwidth,clip]{dummy.eps}
\rule{2cm}{2cm}
\end{center}
\caption[]{Chain of carbon molecules, with both $\sigma$- and $\pi$-bonds:
Status: taken from orgtalk, to be redrawn, use three carbon atoms }
\label{pibondchain}
\end{figure}
The key features of the double bond for the properties of organic semiconductors are:
\begin{itemize}
\item
The $\pi$-electrons are not localized in the double bonds, but delocalize over the full region of alternating single and double bonds, causing an ``electron sea'' which allows comparatively strong coupling of the molecules in the solid state and leads to high optical absorption coefficients
\item
The energy splitting between the bonding $\pi$- and antibonding so-called $\pi ^*$-states corresponds to photon energies
$h \nu$ in the visible range, in contrast to the $\sigma$-bond where those energies are in the UV range (see Fig. )Molecules with a $\pi$-electron system are therefore usually characterized by intense colors due the pronouced absorption bands in the visible from the transition between the $\pi$- and $\pi ^*$-states
\item
By changing the size of the electron system, it is possible to tune the energy splitting between $\pi$- and $\pi^ *$-states over a wide range. Thus, the absorption and emission properties molecules containing a $\pi$-electron system can be widely tuned
\item
Finally, the energies of the highest occupied orbitals (HOMO), which are in most cases the $\pi$-orbitals, and the lowest unoccupied (LUMO) orbitals, usually the $\pi ^*$-orbitals, can be energetically adjusted by suitable electron-donating or -accepting side groups attached to the $\pi$-systems. This property is important when in devices, suitable transport energies of electrons (in the LUMOs) and holes (in the HOMOS) need to be established.
\end{itemize}
\begin{figure}[htb]
%\sidecaption
\begin{center}
\rule{2cm}{2cm}
\end{center}
\caption[]{the $\sigma$- and $\pi$-bonds. The gap between binding and antibinding states of the $\pi$-bonds is usually in the visible region:
Status: taken from orgtalk, to be redrawn}
\end{figure}
%\backmatter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Mysterious error when using documentclass "book"
Your problem is:
The book class tries to use this for the marks (running headers), but without the "underscore" package or escaping the _ as \_, you can't use it in normal text. Hence the problem.
Code: Select all
\sectionmark{definition_organic}
Joseph Wright
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Mysterious error when using documentclass "book"
Perhaps you can explain what you want to achieve by using \chaptermark and \sectionmark. For eventual references there are \label and \ref.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Mysterious error when using documentclass "book"
Thanks for the great help. Yeah, the mistake was that I mixed up the \chaptermark command which is for the index and the \label command.
Unfortunately, however, the error in the MWE disappears if the underscore is removed, but stays in the "real" document?? I will try to make another MWE and repost...
Unfortunately, however, the error in the MWE disappears if the underscore is removed, but stays in the "real" document?? I will try to make another MWE and repost...
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Mysterious error when using documentclass "book"
The \chaptermark is not for the index but for setting column titles. Generating an index entry is done by the \index command.nankodai wrote:[...] Yeah, the mistake was that I mixed up the \chaptermark command which is for the index and the \label command. [...]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10