Math & ScienceEquations & text in the same enviornment (auto vert. space)?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Clark3934
Posts: 1
Joined: Thu Jul 23, 2009 12:40 am

Equations & text in the same enviornment (auto vert. space)?

Post by Clark3934 »

First of all, I'm not sure if this is the right forum to post this in or not, but since I'm working with mostly equations and not text, I decided to post here.

Objective:
To make an algebra problem set that contains both equations and word problems in the same section.

The problem:
I cannot find a good solution that both labels/numbers the problems the way I wish (like the default in the enumerate environment), while simultaneously spacing symbolic questions (namely those with multiple \frac commands) the way the equation environment does.

Possible Solution 1:
I tried putting everything in the enumerate environment. This gave me what I wanted as far as left-side numbering with periods instead of parentheses [e.g. 1. instead of (1)] and full left problem justification; however, it really squished some of my more complicated equations, as it tries to keep the vertical height of each \item the same.

Possible Solution 2:
Since I have mostly math problems, and I want automatic math spacing, I tried putting everything in the equation environment. This proved more difficult than I thought, but I got it to be almost perfect.

The first problem I had was the numbering. I fixed this with by moving the numbering left with leqno, then justifying everything left with fleqn. I changed the default (1),(2),... numbering scheme to 1.,2.,... with this bit of code:

Code: Select all

\makeatletter
  \def\tagform@#1{\maketag@@@{#1.\@@italiccorr}}
\makeatother
I was able to rest the numbering counter whenever I wanted with this:

Code: Select all

\setcounter{equation}{0}
I played around with various ways of making multiple equations and finally settled on adding the amsmath package and using gather. When I wanted to add some word problems, I entered everything as normal, except I used \text or /mbox (what's the difference, anyways?) to indicate that I was typing English words and not variables.

This is where my problem came. Everything was fine, except for the fact that the text didn't automatically line break. I tried to do it manually, but since it didn't justify, it still looked kind of weird.

If there is anyway to make \text or \mbox automatically linebreak when necessary, that would solve my problems, but I've searched, and I can't seem to find anything.

Possible Solution 3:
Ok, well this is the closest I've gotten so far, but it's still not perfect. I used the environments the way they were intended(?) and kept all my word problems in enumerate and all the equations in equation. While this looks pretty good, this are still some tabbing issues. Enumerate remains slightly indented when compared to equation.

I want everything to look uniform--like problems are numbered in mathematics textbooks.

-----

Is there a way to put all of these problems in a single environment, numbered and aligned in the way I specified? Even if they're all indented, while not ideal, it would still suffice for me. Or am I doing this completely wrong?

Thanks!

Edit::
Here is some of my sample code:

Code: Select all

\documentclass[openany,12pt,letterpaper, leqno, fleqn]{article}

\usepackage{calc}
\usepackage{amsmath}

%changing the tag appereance when amsmath has been loaded
\makeatletter
  \def\tagform@#1{\maketag@@@{#1.\@@italiccorr}}
\makeatother

%making some page breaks in gather
\allowdisplaybreaks

%and it beings
\begin{document}
\maketitle

\section{Basic Algebraic Equations and Word Problems}
\subsection{Practice Set 3}
Solving quadratic equations using factoring, completing the square, and the quadratic formula.  Analyzing an equation's discriminant.

\subsubsection{Solve the following by completing the square.}
Remember the logic for finding the new $C$ term:  If $A = 1$, then the new $C$ should equal $(\frac{B}{2})^{2}$.
\setcounter{equation}{0}
\begin{gather}
x^2 - 10x + 24 = 0 \\
x^2 + 6n - 1 = 0 \\
2t^2 + 12t - 5 = 0 \\
x^2 + 4x - 221 = 0 \\
2n^2 + n - 4 = 0 \\
\end{gather}

\subsubsection{Solve the following quadratic word problems.}
Some of these can be pretty tricky---just remember that they're all going to be quadratics (containing a second-order variable).  Some questions may look like geometry, but realize they're only expecting that you know how to find the area and perimeter of simple shapes like rectangles and triangles.

%This is trying to typeset the word problems using the equation environment.  It doesn't linebreak automatically. :\
\setcounter{equation}{0}
\begin{gather}
\mbox{Find two consecutive even integers whose product is 528.} \\
\mbox{A MIT Tech Dingy has a triangular sail with an area of 30 square feet.  The height of the sail is 7 feet more than the legnth of the base of the sail.  Find the height of the sail.} \\
\mbox{The perimeter of a rectangle is 44 inches and its area is 112 square inches.  Find the length and width of the rectangle.} \\
\mbox{The area of a rectangular region is 52 square feet.  If the length of the rectangle is increased by 4 feet and the width by 2 feet, the area is increased by 50 square feet.  Find the length and width of the original rectangular region.}
\end{gather}

%This is doing the same thing as above, but another way.  It indented strangely and through off all the rest of the justification, but at least it linebreaks correctly...
%\begin{enumerate}
%\item Find two consecutive even integers whose product is 528. 
%\item A MIT Tech Dinghy (sailboat) has a triangular sail with an area of 30 square feet.  The height of the sail is 7 feet more than the legnth of the base of the sail.  Find the height of the sail. 
%\item The perimeter of a rectangle is 44 inches and its area is 112 square inches.  Find the length and width of the rectangle.
%\item The area of a rectangular region is 52 square feet.  If the length of the rectangle is increased by 4 feet and the width by 2 feet, the area is increased by 50 square feet.  Find the length and width of the original rectangular region.
%\item $\frac{\frac{\frac{\frac{1+x}{1+x^{2}+x}}{1+x}}{x^{2}+x+1}}{1+x}$ %this is just to show how the equations mess up the enumerate environment
%\end{enumerate}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply