Matter & Interactions 3rd ed. Practice Problems
Aaron Titus | High Point University
home
(N)=# of solutions

Documentation for submitting problems and solutions

To submit a problem and solution to the database, please do the following:

  1. write the problem and solution in a single latex file
  2. email the latex file along with
    1. a question title
    2. author name (if different from your own)
    3. both the chapter and section from the textbook that the problem and solution pertains to
    4. associated images

to Aaron Titus (titus at mailaps.org). In general, results are best when you use a small set of LaTeX commands since only a few commands will be correctly converted to HTML. See the documentation below for specific commands that can be used.

Outline

Packages
Custom Commands
Examples
Tips for including images
Supported LaTeX Commands (for HTML Conversion)


Packages

The following packages are used in the preamble. For HTML files, all inline math commands must be enclosed by $ $ even if commands use \ensuremath. If you find that a certain command is not properly converted to HTML, please alert Aaron Titus so that the php parser for converting the command to html can be added to the site.

  • amsmath
  • amssymb
  • graphicx
  • textcomp
  • listings
  • SIunits
  • array
  • url
  • hyperref
  • moreverb

Custom Commands

These additional custom commands have been defined.

  • \begin{myvpython} and \end{myvpython} which formats python code without line numbers
  • \begin{vpythonblock} and \end{vpythonblock} which formats python code with line numbers
  • \image{filename}{caption} which embeds an image with scale=1.0
  • \scaledimage{filename}{caption}{scale} which embeds an image with the given scale
  • \triple{x}{y}{z} which typesets a 3-D vector in bracket notation
  • \sci{mantissa}{exponent} which formats a number in scientific notation
  • \type{} which displays text in courier font
  • \code{} which displays text in courier font
\lstnewenvironment{myvpython}{\lstset{language=Python,numbers=none,upquote=true,breaklines}}{}
\lstnewenvironment{vpythonblock}{\lstset{language=Python,numbers=left,numberstyle=\tiny,upquote=true,breaklines}}{}

\newcommand{\image}[2]{
\begin{figure}[h!]
\begin{center}
\includegraphics[scale=1]{#1}
\caption{#2}
\label{#1}
\end{center}
\end{figure}
}

\newcommand{\scaledimage}[3]{
\begin{figure}[h!]
\begin{center}
\includegraphics[scale=#3]{#1}
\caption{#2}
\label{#1}
\end{center}
\end{figure}
}

%math formatting

%a vector with no units
\newcommand{\triple}[3]{
	\ensuremath{\langle #1, #2 , #3 \rangle}
}

%scientific notation with no units
\newcommand{\sci}[2]{
	\ensuremath{#1 \times 10^{#2}}
}

%computer code
\newcommand{\type}[1]{
	{\texttt{#1}}
}
\newcommand{\code}[1]{
	{\texttt{#1}}
}

Example LaTeX questions and solutions.

These are examples of problems and solutions written in LaTeX.

Tips for including images

  • Example LaTeX code for inserting an image.

    \begin{figure}[htbp]
    \begin{center}
    \includegraphics[scale=1]{filename}
    \caption{image caption.}
    \end{center}
    \end{figure}	
    	
    	

    As of this time, \label and \ref{label} are not supported for referring to equations or images in the html, though it will be rendered fine in the pdf file of the solution.

  • images should be in the same folder as the LaTeX file.

Supported LaTeX Commands (for HTML Conversion)

  • \begin{equation}
    ...
    
    \end{equation}
    

    to centered <img>

  • \begin{eqnarray*} 
    ... 
    
    \end{eqnarray*}
    

    to centered <img>

  • \begin{mathdisplay} 
    ... 
    
    \end{mathdisplay}
    

    to centered inline math <img>

  • $$
    to inline <img> with no line breaks
  • \\
    to <br>
  • \emph{}
    to <i></i>
  • {\bf }
    to <b></b>
  • \image{filename}{caption}
    to <img>. This command comes from the titus package and makes it easy to insert images.
  • \begin{figure}[htbp]
    \begin{center}
    \includegraphics[scale=1]{filename}
    \caption{image caption.}
    \end{center}
    \end{figure}	
    	
    	

    is converted to <img>

  • 
    \begin{table}[htdp]
    \begin{center}
    \begin{tabular}{|c|c|}
    \hline
    column 1 & column 2\\
    \hline
    \end{tabular}
    \caption{Table Caption}
    \end{center}
    \label{default}
    \end{table}
    	
    	

    is converted to <table></table>

  • \begin{enumerate}
    	\item 
    	... 
    \end{enumerate}
    
    to <ol> <li> ...</ol>
  • \begin{itemize}
    	\item 
    	...
    \end{itemize}
    to <ul> <li> ...</ul>
  • \href{URL}{text}
    to <a> href="URL" > text </a>
  • --
    to html dash
  • \begin{verbatim}
    ...
    
    \end{verbatim}
    to <pre> ... </pre>
  • \begin{verbatimtab}
    ...
    
    \end{verbatimtab}
    to <pre> ... </pre>
  • \begin{vpythonblock}
    ...
    
    \end{vpythonblock}

    to <pre> ... </pre>. This command comes from Joe Heafner's mandi package.

  • \texttt{...}
    to <code> ... </code>
Commands like \noindent and \pagebreak are removed when converting to HTML.