# Chemistry Workbooks

How to submit your questions

Workbooks are created using the LaTeX document preparation system and the TeX language. All questions must be typset using LaTeX2e markup.

## Learning LaTeX

- Online Book
- Document Structure
- Mathematics
- Special Characters
- Tables
- Importing Graphics
- Math Symbols

While there is no substitute for learning the typesetting language, Mathpix Snip allows you to highlight equations and have it transformed into TeX code. Try it on the quadratic equation that was created using Microsoft Equation Editor.

Now try it on the following chemical equation created in Microsoft Word.

Note that the prediction may not be perfect (e.g. the last phase label may be wrong), but most of the code is correct with the fix being minor and, in this case, intuitive.

A convenient site to quickly test your math code is Codecogs LaTeX Equation Editor. Simply type/paste your code and the compiled result will be auto-generated.

## Skeleton Document Code

A document must be created and compiled to view created questions. Provided is a skeletal document that can be used to compile. Simply paste your question code at the indicated position.

```
\documentclass[letterpaper]{article}
\usepackage{amsmath,amssymb,amsfonts,color,currfile,enumerate,environ}
\usepackage[margin=1.0in]{geometry}
\newcommand\qauthor[1]
{\ifnum\showquestionauthor=1\begin{small}\texttt{Author:#1}\end{small}\fi}
\newcommand\qid[1]
{\ifnum\showquestionid=1\par\noindent \begin{small}\texttt{#1}\end{small}\\\fi}
\newcommand\qdiff[1]
{\ifnum\showquestiondiff=1\begin{small}\texttt{Difficulty:#1}\end{small}\\\fi}
\newcommand\qtype[1]
{\ifnum\showquestiontype=1\begin{small}\texttt{Type:#1}\end{small}\\\fi}
\newcommand\qkeyword[1]
{\ifnum\showquestionkeyword=1\begin{small}\texttt{Keyword:#1}\end{small}\\\fi}
\newcommand{\numsolution}[1]
{\ifnum\shownumanswers=1\par\hfill\vspace{\baselineskip}\begin{small}
\textbf{A: #1}\end{small}\vspace{\baselineskip}\fi}
\newif\ifshowmath\newsavebox{\mybox}\NewEnviron{mathsolution}{\color{red}%
\sbox{\mybox}{\begin{minipage}{\textwidth}\BODY\end{minipage}}%
}[\ifshowmath\par\usebox{\mybox}%
\else\par\begin{minipage}{\textwidth}\vspace*{\dimexpr\ht\mybox+\dp\mybox\relax}\end{minipage}\fi]
\def\shownumanswers{1}\def\showquestionid{1}\def\showquestiondiff{1}\def\showanswers{1}
\def\showquestiontype{1}\def\showquestionkeyword{1}\def\showquestionauthor{1}\showmathtrue
\begin{document}\begin{enumerate}\begin{minipage}{\linewidth}
\item{
%% === QUESTION CODE GOES BELOW THIS LINE === %%
%% ^^^ ================================== ^^^ %%
}
\end{minipage}\end{enumerate}\end{document}
```

## Question Criteria

All questions must conform to the following requirements:

- Questions must
**state the units**the numerical answer must be in **Terse**information is given for solutions (when appropriate)- All
**metadata**must be provided - The answer and solutions must adhere to
**significant figures**rules

## Questions: General Structure

Below is a general structure of a question file:

```
QUESTION GOES HERE % <= Exactly what it says
\numsolution{1} % <= A numerical solution should be given for math problems
\begin{mathsolution} % <= All solutions get placed in the 'mathsolution' environment
\begin{align*} % <= Math should generally be written in the 'align*' environment
SOLUTION HERE % If solution is not math, omit the 'align*' environment
\end{align*}
\end{mathsolution}
\qkeyword{<key1>;<key2>...} % <= Semicolon delimited set of keywords for index
\qdiff{<int>} % <= Difficulty level (1-3)
\qtype{<char1>;<char2>...} % <= Question type (H = homework; Q = quiz; E = exam)
\qauthor{<NAME HERE>} % <= Author of question
\qid{\currfilename} % <= This line gets pasted in verbatim at the end of the file
```

Every question should be typed in its own separate `.tex`

file.

Each question must contain the following metadata:

`\qkeyword`

- a semi-colon delimited set of keywords that categorize the question; this gets listed in the index`\qdiff`

- an integer measure of the difficult level of the question (1-3)`\qtype`

- semi-colon delimited list of question application (**H**omework,**Q**uiz,**E**xam)`\qauthor`

- the name of the author of the question`\qid{\currfilname}`

- this should be the last line in the question text file

All code should work with the following set of LaTeX packages:

- geometry
- amsmath,amssymb
- amsfonts
- epsfig
- environ
- booktabs
- multicol
- array
- chemfig, caption
- graphicx
- enumerate
- enumitem
- fancyhdr
- currfile
- adjustbox
- varwidth
- mhchem
- xcolor

If a package is needed that is not listed, please be sure to include that in your question submission.

## Question Examples

### Basic Question

- For scalable parenthesis, use
`\left (`

and`\right )`

are used. This is especially important when parenthesizing fractions and exponents.

**Code**

```
Convert $1.00\times 10^{-3}$ km to m.
\numsolution{1.00}
\begin{mathsolution}
\begin{align*}
1.00\times 10^{-3}~\mathrm{km} \left ( \dfrac{10^3~\mathrm{m}}{1~\mathrm{km}} \right ) = 1.00~\mathrm{m}
\end{align*}
\end{mathsolution}
\qkeyword{dimensional analysis; metric table}
\qdiff{1}
\qtype{H;Q}
\qauthor{John Jacob Jingleheimer Schmidt}
\qid{\currfilename}
```

### Chemical Equations

- Chemical equations given as part of a question are generally indented with
`\hspace*{3ex}`

followed by encapsulation in single`$`

expressions.

- A
`\longrightarrow`

is preferred for chemical equation arrows. - A
`1ex`

vertical space is inserted between the question and the chemical equation. - The solution gets centered in a set of double
`$$`

expressions. - No spaces are placed between the stoichiometric coefficient and the chemical formula.

`\mathrm{}`

is used to keep letters upright.- Phases get italicized.

**Code**

```
What is the sum of the coefficients once the following chemical equation is balanced? \\[1ex]
\hspace*{3ex}
$\mathrm{H_2}(g) + \mathrm{O_2}(g) \longrightarrow \mathrm{H_2O}(g)$
\numsolution{5}
\begin{mathsolution}
$$\mathrm{2H_2}(g) + \mathrm{O_2}(g) \longrightarrow 2\mathrm{H_2O}(g)$$
\end{mathsolution}
\qkeyword{balancing equations; stoichiometry}
\qdiff{1}
\qtype{H;Q}
\qauthor{Mr. Brownstone}
\qid{\currfilename}
```

### Multi-Line Math Solutions

- Multi-line math solutions should be written in the
`align*`

environment. Ampersands (`&`

) are used to indicate where the alignment takes place on each line. Alignment generally occurs at the equal signs but not always. - A
`1ex`

of vertical space is used to separate the first conversion in the solution (K to C) from the second conversion (C to F). - ACS style states a space is included between the numeral of the temperature and its corresponding unit. Whitespace is ignored in mathmode so a
`~`

is used to insert an explicit space (line 10). - The
`\circ`

command is the appropriate way to print a degree symbol. - For scalable parenthesis, use
`\left (`

and`\right )`

are used. This is especially important when parenthesizing fractions and exponents. `\times`

is used for multiplication.- Multiple numerical solutions are given in the order that they are asked in the question.

**Code**

```
What is 273.15 K in $^{\circ}$C and $^{\circ}$F?
\numsolution{0.00; 32.00}
\begin{mathsolution}
\begin{align*}
\mathrm{K} = \mathrm{^{\circ}C} + 273.15 \longrightarrow \mathrm{^{\circ}C}
&= \mathrm{K} - 273.15 \\
&= 273.15 - 273.15 = 0.00 \\[1ex]
\mathrm{^{\circ}F} &= \left( \dfrac{9}{5}\times \mathrm{^{\circ}C} \right ) + 32 \\
&= \left( \dfrac{9}{5}\times 0.00~ \mathrm{^{\circ}C} \right ) + 32 = 32.00
\end{align*}
\end{mathsolution}
\qkeyword{temperature conversions}
\qdiff{1}
\qauthor{Rocky and Bullwinkle}
\qid{\currfilename}
```