3

Here's my code -

\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{syntonly}
\usepackage{amsthm}
\usepackage{parskip}
\usepackage{tabularray}
%xparse package needed for physics package to work properly
\usepackage{xparse}

% Font encoding
\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}
%For colours
\usepackage[x11names]{xcolor}

%Defining colours
\definecolor{Rust}{HTML}{BF3100}
\definecolor{Orange yellow}{HTML}{EEB902}


\definecolor{Vermillion}{HTML}{D52D0B}
\definecolor{Imperial Red}{HTML}{E63946}
\definecolor{Honeydew}{HTML}{F1FAEE}
\definecolor{Powder Blue}{HTML}{A8DADC}
\definecolor{Atomic Tangerine}{HTML}{F39C6B}
\definecolor{Selective yellow}{HTML}{FFB703}
\definecolor{Prussian blue}{HTML}{033063}
\definecolor{Raisin black}{HTML}{272838}


%%%%%%%%%%%%%%%%%%%%COLOURSCHEME%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%COLOURSCHEME%%%%%%%%%%%%%%%%%%%
%Definitions header
\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}
%%%%%%%%%%%%%%%%%%%%COLOURSCHEME%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%COLOURSCHEME%%%%%%%%%%%%%%%%%%%


%Package for fixing bugs when using marginnotes
\usepackage{mparhack}

%For Garmond font
\usepackage{garamondlibre}

%Float package
\usepackage{float}

%Continue to enumerate
\usepackage{enumitem}

\usepackage{tcolorbox}

%layout package
\usepackage{layout}

%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}

%marginparpush=2cm

%fancyheaders
\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}


%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}
For example - 
\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white]
\begin{align*}
    \ce{\textstyle\frac{1}{2}Br2(l) & ->[\Delta H_{at}^{\ominus}]Br(g)}\\
    \ce{\textstyle\frac{1}{2}Cl2(g) & ->[\Delta H_{\text{at}}^{\ominus}] Cl(g)}\ \ \ \ \Delta H_{at}^{\ominus}=+121\ \unit{kJ\ mol^{-1}}\\
    \ce{Na(s) & ->[\Delta H_{at}^{\ominus}] Na(g)}\ \ \ \ \Delta H_{\text{at}}^{\ominus}=+109\ \unit{kJ\ mol^{-1}}\\
     \ce{\textstyle\frac{1}{2}H2(g) & ->[\Delta H_{\text{at}}^{\ominus}] H(g)}\ \ \ \ \Delta H_{at}^{\ominus}=+218\ \unit{kJ\ mol^{-1}}
\end{align*}
\end{tcolorbox}
\end{document}

This generates the following - enter image description here

Any ideas on how I can remove the extra blue vertical space?

3
  • why \usepackage{syntonly} ??? Sep 27 at 13:00
  • Please, next time simplify your preamble to just required packages.
    – Ignasi
    Sep 27 at 14:47
  • I see nothing in blue. Sep 28 at 17:58

2 Answers 2

3

Use option ams align* in tcolorbox options and avoid using ams align* environment inside.

\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}

\begin{document}
For example - 
\begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white, ams align*]
%\begin{align*}
    \ce{\textstyle\frac{1}{2}Br2(l) & ->[\Delta H_{at}^{\ominus}]Br(g)}\\
    \ce{\textstyle\frac{1}{2}Cl2(g) & ->[\Delta H_{\text{at}}^{\ominus}] Cl(g)}\ \ \ \ \Delta H_{at}^{\ominus}=+121\ \unit{kJ\ mol^{-1}}\\
    \ce{Na(s) & ->[\Delta H_{at}^{\ominus}] Na(g)}\ \ \ \ \Delta H_{\text{at}}^{\ominus}=+109\ \unit{kJ\ mol^{-1}}\\
     \ce{\textstyle\frac{1}{2}H2(g) & ->[\Delta H_{\text{at}}^{\ominus}] H(g)}\ \ \ \ \Delta H_{at}^{\ominus}=+218\ \unit{kJ\ mol^{-1}}
%\end{align*}
\end{tcolorbox}
\end{document}

enter image description here

1

Use the array environment

\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}
\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}

\begin{document}
\noindent   
For example - 
    \begin{tcolorbox}[colback=Powder blue!50!white, colframe=Powder blue!50!white]
        \arraycolsep=1.6pt
        $\begin{array}{rl>{\qquad}l}
        \ce{\textstyle\frac{1}{2}Br2(l) & ->[\Delta H_{at}^{\ominus}]Br(g)}\\
        \ce{\textstyle\frac{1}{2}Cl2(g) & ->[\Delta H_{\text{at}}^{\ominus}] Cl(g)} & \Delta H_{at}^{\ominus}=+121\ \unit{kJ\ mol^{-1}}\\
        \ce{Na(s) & ->[\Delta H_{at}^{\ominus}] Na(g)} & \Delta H_{\text{at}}^{\ominus}=+109\ \unit{kJ\ mol^{-1}}\\
        \ce{\textstyle\frac{1}{2}H2(g) & ->[\Delta H_{\text{at}}^{\ominus}] H(g)} & \Delta H_{at}^{\ominus}=+218\ \unit{kJ\ mol^{-1}}
        \end{array}$
    \end{tcolorbox}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.