0

Here's my code -

\documentclass[12pt,x11names]{book}
\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}
\usepackage{xcolor}

\definecolor{Powder blue}{HTML}{A8DADC}


\usepackage{garamondlibre}

\usepackage[most]{tcolorbox}

%geometry package
\usepackage{geometry}
\geometry{papersize={23cm,28cm}, right=9.3cm, left=3cm, top=2.5cm, bottom=3cm, marginparwidth=4.8cm, marginparsep=1.5cm, headheight=0cm}

\usepackage{siunitx}


\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LO,RE]{\chaptername\ \thechapter}
\fancyfoot{}
\fancyfoot[LO,RE]{\thepage}

%Packages for Maxwell-Boltzmann distribution
\usepackage{pgfplots,siunitx}


%Wrapping lines of text package
\usepackage{seqsplit}


%For the unit of rate constant table
\usepackage{tabularray}
\UseTblrLibrary{amsmath, siunitx}

%Package for striking out terms in a calculation
\usepackage{cancel}

\usepackage{xfrac}




\definecolor{Yale blue}{HTML}{084B83}
% definition boxes colour [colback=Powder blue!50!white, colframe=Powder blue!50!white]
\definecolor{Powder blue}{HTML}{BBE6E4}


%Examples header
\definecolor{Indian red}{HTML}{DB5461}
%Examples box [colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
\definecolor{Unbleached silk}{HTML}{FFD9CE}


%Margin notes colour (Linen!60!white)
\definecolor{Linen}{HTML}{F9EAE1}



%Package for inserting figures in margin notes
\usepackage{sidenotes}

%packages required for sidenotes package to work correctly
\usepackage{marginnote}
\usepackage{xparse}
\usepackage{caption}
\usepackage{l3keys2e}
\usepackage{changepage}

%package for landscape tables
\usepackage{rotating}
\usepackage{array}
\newcolumntype{L}{>{\centering\arraybackslash}m{3cm}}

%Defining a new column type for the alkyl groups table
\newcolumntype{A}{>{\centering\arraybackslash}m{2cm}}
\newcolumntype{B}{>{\centering\arraybackslash}m{3.4cm}}
\newcolumntype{C}{>{\centering\arraybackslash}m{1.7cm}}
\newcolumntype{D}{>{\centering\arraybackslash}m{4cm}}

%Defining a new column type for the cis-trans isomers table
\newcolumntype{E}{>{\centering\arraybackslash}m{7cm}}
\newcolumntype{F}{>{\centering\arraybackslash}m{3cm}}


\newcolumntype{G}{>{\centering\arraybackslash}m{8cm}}

%For the free radical substitution reaction
\newenvironment{f}{$\displaystyle\aligned}{\endaligned$}

%to fix overlflowing margin notes
\usepackage{marginfix}



% Diagrams from mathcha
\usepackage{physics}
\usepackage{tikz}
\usepackage{mathdots}
\usepackage{yhmath}
\usepackage{cancel}
\usepackage{color}
\usepackage{siunitx}
\usepackage{array}
\usepackage{multirow}
\usepackage{gensymb}
\usepackage{tabularx}
\usepackage{extarrows}
\usepackage{booktabs}
\usetikzlibrary{fadings}
\usetikzlibrary{patterns}
\usetikzlibrary{shadows.blur}
\usetikzlibrary{shapes}

\usetikzlibrary{arrows.meta}

\begin{document}

\chapter{\textcolor{Rust}{Organic chemistry}}
\section{\textcolor{Rust}{\textbf{Fundamentals of Organic chemistry}}}
\subsection{\textcolor{Yale blue}{Historical background}}
During the late $18^{\text{th}}$ century, chemists began distinguishing between inorganic and organic compounds. \textcolor{Indian red}{\textbf{Compounds that formed in living organisms were labelled as organic while those formed in inanimate matter were labelled as inorganic compounds.}} 

According to the idea of vitalism, organic molecules can \emph{only} be produced in living organisms due to some vital force (They cannot be produced from inorganic compounds). Fredrich W\"{o}ler, a German chemist, proved vitalism wrong when he discovered that an organic compound called urea ($\ce{CO(NH2)2}$) could be produced by heating an inorganic compound called ammonium cyanate ($\ce{NH4OCN}$). 

More such discoveries-such as the synthesis of acetic acid and methane - were made in $19^{\text{th}}$ century and vitalism was completely abandoned. After such discoveries, theories of bonding emerged and modern organic chemistry was born.


\newpage
\subsection{\textcolor{Yale blue}{Representation of organic compounds}}
\textcolor{Indian red}{\textbf{Organic chemistry its the study of carbon and its compounds.}} Carbon shows catenation, which is the property of atoms of the same element to bond with each other. 

\subsubsection{\textcolor{Yale blue}{Molecular formula}}
\textcolor{Indian red}{\textbf{Molecular formula tell us the total number and type of atoms in a molecule.}} Examples - 

\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams gather*]
%\[
\ce{C6H14},\ce{C2H5OH}, \ce{C6H6}, \ce{(NH2)2CO}, \ce{K2Cr2O7}
%\]
\end{tcolorbox}

\subsubsection{\textcolor{Yale blue}{Lewis structures}}
\textcolor{Indian red}{\textbf{Lewis structures tell us the types and number of atoms in a molecule and which atoms are bonded to each other.}} The Lewis dot structures can be simplified by representing a two electron covalent bond by a dash. For example, consider the Lewis structure of methane (figure \ref{Lewis dot structure of methane})
\begin{figure}[H]
    \centering
    \includegraphics[scale=0.15]{MainMatter/Organic chemistry/10.1: Fundamentals of Organic chemistry/Diagrams/CH4 dotted.png}
    \caption{Lewis dot structure of methane}
    \label{Lewis dot structure of methane}
\end{figure}
The two-electron covalent bond can be replaced by line (figure \ref{CH4 lines}) - 
\begin{figure}[H]
    \centering
    \includegraphics[scale=0.15]{MainMatter/Organic chemistry/10.1: Fundamentals of Organic chemistry/Diagrams/CH4 lines.png}
    \caption{}
    \label{CH4 lines}
\end{figure}
A single line represents a single bond, two lines represent a double bond, and three lines represent a triple bond. 

\subsubsection{\textcolor{Yale blue}{Condensed formula}}
A condensed formula is quick way to represent the structure of a molecule. Examples - 
\[
\ce{CH3CH2CH3}, \ce{CH3CH2CHO}, \ce{CH3(CH2)3CH3}, \ce{(NH2)2CO}
\]
\subsubsection{\textcolor{Yale blue}{Partially condensed formula}}
\textcolor{Indian red}{\textbf{A condensed formula where only some bonds are shown (figure}} \ref{Partially condensed})- 
\begin{figure}[H]
    \centering
    \includegraphics[scale=0.27]{MainMatter/Organic chemistry/10.1: Fundamentals of Organic chemistry/Diagrams/Partially condensed.png}
    \caption{Partially condensed vs condensed formula}
    \label{Partially condensed}
\end{figure}

\subsubsection{\textcolor{Yale blue}{Bond line structure/skeletal formula}}
\textcolor{Indian red}{\textbf{Endpoints and junctions represent carbon atoms. Heteroatoms (any atom that is not carbon or hydrogen) are always represented.}} Common heteroatoms in organic molecules are - $\ce{O}$, $\ce{N}$, $\ce{F}$, $\ce{Cl}$. 
\marginnote{
\begin{tcolorbox}[colback=Linen!60!white, colframe=Linen!60!white]
Do not use bond-line notation in exams unless the question demands it.
\end{tcolorbox}}
\begin{figure}[H]
    \centering
    \includegraphics[scale=0.30]{MainMatter/Organic chemistry/10.1: Fundamentals of Organic chemistry/Diagrams/Bond line.png}
    \caption{Skeletal formula examples}
    \label{Skeletal formula examples}
\end{figure}


\newpage
\subsection{\textcolor{Yale blue}{Classification of organic compounds}}
The large number of organic compounds and their 
ever-increasing number has made their 
classification necessary. Organic compounds can be 
broadly classified in terms of their structure. 
For example, organic compounds with rings are 
classified as Cyclic (figure \ref{Cyclic 
compounds}) while organic without rings are 
classified as Acyclic (figure \ref{Acyclic compounds}).


\textcolor{Indian red}{\textbf{Organic compounds can also be classified on the basis of functional groups and homologous series.}} 

\begin{tcolorbox}[colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
\textcolor{Indian red}{\textbf{Functional group}}: Is the reactive part of a molecule that determines the characteristic chemical properties of an organic compound. 
\end{tcolorbox}

\begin{tcolorbox}[colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
    \textcolor{Indian red}{\textbf{Homologous series}}: A homologous series is a series of compounds that have the same functional group.
\end{tcolorbox}

The members of a homologous series are called homologues. The \textcolor{Indian red}{\textbf{members of a homologous series can usually be represented by a common molecular formula and successive members usually differ by a common structural unit.}} 

\textcolor{Indian red}{\textbf{Members of the same homologous series show a pattern (either increase or decrease) when it comes to physical properties}} (properties such as melting point, boiling point, etc). 

There are a number of homologous series of organic compounds. Some of these are alkanes, alkenes, alkynes, haloalkanes, alkanols, alkanals, alkanones, alkanoic acids, amines etc. 
\newpage
\subsection{\textcolor{Yale blue}{Alkanes}}
\marginnote{
\begin{tcolorbox}[colback=Linen!60!white, colframe=Linen!60!white]
A hydrocarbon is a compound containing hydrogen and carbon atoms only. 
\end{tcolorbox}}

\begin{tcolorbox}[colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
   \textcolor{Indian red}{\textbf{Alkanes}}: Are a family of hydrocarbons whose general molecular formula is $\ce{C_{n}H_{2n+2}}$.
\end{tcolorbox}

\begin{tcolorbox}[colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
    \textcolor{Indian red}{\textbf{Empirical formula}}: The simplest whole number ratio of atoms in a molecule.
\end{tcolorbox}

\begin{tcolorbox}[colback=Unbleached silk!65!white, colframe=Unbleached silk!65!white]
    \textcolor{Indian red}{\textbf{Molecular formula}}: Tells us the total number of atoms of each element present in a molecule.
\end{tcolorbox}
\textcolor{Indian red}{\textbf{Molecular formula is an integral multiple of the empirical formula.}} Examples of alkanes have been given in table \ref{Alkanes table}.

\begin{margintable}
    \centering
    \begin{tabular}{|c|c|}
\hline
Chain length & Word root \\
\hline
    $\ce{C1}$ & Meth \\
\hline
    $\ce{C2}$ & Eth \\
\hline
    $\ce{C3}$ & Prop \\
\hline
    $\ce{C4}$ & But \\
\hline
    $\ce{C5}$ & Pent \\
\hline
    $\ce{C6}$ & Hex \\
\hline
    $\ce{C7}$ & Hept \\
\hline
    $\ce{C8}$ & Oct \\
\hline
    $\ce{C9}$ & Non \\
\hline
    $\ce{C10}$ & Dec \\
\hline
    \end{tabular}
    \caption{Word roots in IUPAC naming}
    \label{Meth eth prop}
\end{margintable}
\begin{table}[H]
    \centering
    \begin{tabular}{|c|c|c|}
\hline
    Name & Molecular formula & Empirical formula \\
\hline
Methane & $\ce{CH4}$ & \ce{CH4} \\
\hline
Ethane & $\ce{C2H6}$ & \ce{CH3} \\
\hline
Propane & $\ce{C3H8}$ & \ce{C3H8} \\
\hline
Butane & $\ce{C4H10}$ & \ce{C2H5} \\
\hline
Pentane & $\ce{C5H12}$ & \ce{C5H12} \\
\hline
Hexane & $\ce{C6H14}$ & \ce{C3H7} \\
\hline
    \end{tabular}
    \caption{Examples of alkanes}
    \label{Alkanes table}
\end{table}
Straight chain alkanes can be easily named by using the word roots given in table \ref{Meth eth prop}. For example, the alkane $\ce{C7H16}$ has $7$ carbon atoms therefore its name would be heptane. We shall return to naming alkanes later.

\subsubsection{\textcolor{Yale blue}{More functional groups}}
A few functional groups you are likely to come across in IBDP chemistry are given in table \ref{More functional groups} - 

\subsection{\textcolor{Yale blue}{Boiling point and homologous series}}

\textcolor{Indian red}{\textbf{As the number of carbon atoms in a homologous series increases, the boiling point increases as well.}} The boiling point of straight-chain alkanes increases when the number of carbon atoms increases because the strength of the London dispersion forces increases with the increasing molecular mass. A similar trend is seen in the boiling point of molecules belonging to other homologous series. 

\marginnote{
\begin{tcolorbox}[colback=Linen!60!white,colframe=Linen!60!white]
A compound is termed saturated if it contains only carbon-carbon single bonds. Unsaturated hydrocarbons contain at least one carbon-carbon double or triple bond.
\end{tcolorbox}}

Figure \ref{The boiling points of some alcohols and alkanes} compares the boiling point of alcohols with that of alkanes. It can be seen that the boiling point of alcohols increases as the number of carbon atoms increases. Also notice that the \textcolor{Indian red}{\textbf{boiling point of alcohols is much higher than that of alkanes.}} This is because alcohol molecules hydrogen bond with each other since they contain a hydrogen bonded to an oxygen (-OH). These hydrogen bonding forces are much stronger than the London dispersion forces that hold the alkanes together, not to mention that London dispersion forces act between alcohol molecules as well. 


\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white,ams equation]
\ce{N2(g) + 3H2 (g) -> 2NH3(g)} \tag{\Delta H = +96\ \unit{kJ}}
\end{tcolorbox}

\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams gather*]
%\begin{equation*}
    \ce{Na^{+}(aq) + e^{-} <=> Na(s)} \qquad(\mathrm{E}^{\ominus} = -2.71\ \unit{V})
%\end{equation*}
\end{tcolorbox}




\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams align*]
%\begin{align*}
    \ce{Cl2(g) + 2e^{-} <=> 2Cl^{-}(aq)} \qquad(\mathrm{E}^{\ominus} = 1.36\ \unit{V}) \\
    \ce{4H^{+}(aq) + 4e^{-} + O2(g) <=> 2H2O(l)} \qquad(\mathrm{E}^{\ominus} = 1.23\ \unit{V})
%\end{align*}
\end{tcolorbox}


\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams gather*]
%\begin{equation*}
\ce{H2O(l) + e^{-} <=> \frac{1}{2}H2(g) + OH^{-}(aq)} 
\qquad{\mathrm{E}^{\ominus} = -0.83\ \unit{V}}
%\end{equation*}
\end{tcolorbox}

\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams gather*]
%\begin{equation*}
    \ce{Cr2O7^{2-} + 14H^{+} + 6e^{-} -> 2Cr^{3+} + 7H2O} \tag{Reduction reaction}
%\end{equation*}
\end{tcolorbox}

\end{document}

The output pdf's header is the problem - enter image description here How can I fix this problem?

3
  • Your code is too long and contains a lot of things that are not relevant to your issue, you should condense it down into an MWE as it helps people help you. Edit: your code also does not compile without error, first is \UseTblrLibrary is not defined and when commented out leads to further issues, please make your code work and reduce it please.
    – JamesT
    Commented Sep 29, 2022 at 15:27
  • 1
    also what fix do you want? FUNDAMENTALS OF ORGANIC CHEMISTRY Chapter 1 does not fit, you could change the layout or change the text \section[Fudamentals]{Fundamentals of Organic chemistry} or use a bigger page, or use a smaller font or .... Commented Sep 29, 2022 at 15:45
  • 1
    You don't specify the section title in your header. So I think it comes from the fancyhdr defaults. I suggest you put a fancyhf{} right after \pagestyle{fancy}. This will clear the defaults. Commented Sep 29, 2022 at 15:49

1 Answer 1

2

Chapter 1 is appearing as you have not cleared the header like you did with the footer (\fancyfoot{}), so clearing the header, changing the font size to small (as your page margins are unusual) and using \rightmark rather then \chaptername\ \thechapter produces this:

enter image description here

\documentclass[12pt]{book}

\usepackage{lipsum} % For MWE purpose only, delete in main document

\usepackage{geometry}
\geometry{papersize={23cm,28cm}, right=9.3cm, left=3cm, top=2.5cm, bottom=3cm, marginparwidth=4.8cm, marginparsep=1.5cm, headheight=0cm}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LO,RE]{\small\rightmark}
\fancyfoot{}
\fancyfoot[LO,RE]{\thepage}

\begin{document}

\chapter{Organic chemistry}
\section{\textbf{Fundamentals of Organic chemistry}}
\subsection{Historical background}
During the late 18\textsuperscript{th} century.

\lipsum[1-20]

\end{document}

If this doesn't answer your question then please edit your question to be more specific as to what you desire or follows @David Carlisle's advice to reduce the length of header text.

Additionally, I always use \textsuperscript{th} for when I need to add notation to numbers (typically days) in-text, I am not sure if using math mode $...$ is better but I have used my alternate way in the answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .