12 February 2014

Doing your homework in latex.

It is a common occurrence for other students to comment on my homework whenever I turn it in for one of my classes.

The complete LaTeX file (and the pdf output) can be found in my repository, latex-homework-template .

Below are a few screenshots of problems that I’ve done in the past:

Cover page

If I didn’t know how easy it was and the benefits that I get from typesetting my homework, I’d probably ask as well. However, I’d argue that using LaTeX to type up homework has made me a far better student than when I used to handwrite my homeworks.

And that is something that I care a lot about.

The Benefits

I can summarize the benefits like so:

It can be kept in Source Control. Handwriting can’t be stored in a version control system; once you erase something, it’s gone.

You can see your homework materialize in front of you. Seeing the results and the equations in their complete LaTeX-glory is a very powerful way to conceptualize things. There’s just something different about the way things look so perfect that makes the subject easier to understand.

You’ll do better in your classes. This one goes with the previous point, but having the ability to see your homework helps you understand it. By understanding it well, you’ll do better on tests. You will maximize how much you can learn as well as maximize your grade (if that matters to you).

It’s very neat & tidy. Although my handwriting has improved quite a bit, I still find myself slipping back into a rushed, messy script from the past. LaTeX gives zero doubt that the professor/TA will be able to read my solutions.

About LaTeX

A very short history.

Donald Knuth , a legendary Computer Scientist as well as one of my favorites, is well known for the system that he created called just TeX .

It is a piece of typesetting software that aids in writing documents and formulas. The power comes from the fact that the document that you write is plain source code.

The code that you write is then “typeset” into the final document in whatever form you wish.

Here’s an example of some basic LaTeX code:

With the output looking like below:

Example output

Using the Template

I’ve created a GitHub repository, latex-homework-template , just for my homework template that I’ve been using ever since I started. I found it online and used it as a base to start my template.

To use it, just download the homework.tex file and start editing. Once you need to typeset it, you’ll need LaTeX here .

After that, you just need to compile it and you’ll get your output. There are tons of different resources that I’ve found useful in learning LaTeX:

TeX StackExchange

LaTeX Wikibook

Effect on Performance

I have a solid set of anecdotal evidence in favor of using LaTeX for writing up my homework.

In all the classes that I’ve used LaTeX, I’ve come out of the class with a very strong understanding of the material as well as a good grade. Although I’m not a big fan of grades (like at all), I know it matters to some people.

This might have to do with the fact that doing the homework in LaTeX takes longer. It might have to do with the fact that I perfect the appearance and spend a lot more time looking at the subject.

The most likely reason is a combination of all that I previously mentioned plus other factors. I’m usually one to always want to quantify something, but in this case, I know it helps; that’s all I need.

Learning Curve

There definitely is a learning curve when it comes to trying to use LaTeX for homework. I felt that it was definitely worth the effort unlike how it might seem to some students.

I reasoned that when I go to graduate school, I will want to use it there. I also know how pervasive it is in textbooks. Since I love to read textbooks so much, I wanted to see what it took to write them so elegantly. I may even want to write one in the future; we’ll have to see =]

To me it seemed like a small tradeoff for the great benefits that it provided.

I cannot recommend using LaTeX for your homework enough.

The benefits go a long way. It helps you learn the material and in a way that isn’t as easily achieved when just using pencil and paper.

LaTeX is also widely used in academia and learning about the tool is almost essential if you wish to go to graduate school.

Once I graduate from university, I plan on releasing all my code for the last three semesters as open source. It includes all my LaTeX code which has really accumulated over the last year. It should provide a nice resource for others.

In the meantime, hopefully if you start using LaTeX for your homework, you won’t be able to resist doing it early because of how fun it is. Well, at least it was fun for me =]

02 Using LaTeX for Homework

I hope that you will use the LaTeX typesetting system to write your homework solutions for this course. (See the guide to submitting homework.) It might look daunting at first, if you haven't used LaTeX before, but you won't have to learn LaTeX in depth. You just have to fill in answers to exercises, so you won't need to deal with the complexities of writing complete documents. You will mainly need to know how to express mathematics in LaTeX. Unfortunately, matrices and systems of linear equations are among the more difficult things to write. Fortunately, you will have examples that you can imitate. What follows here is some basic information to get you oriented.

Using LaTeX is something like programming: You write "source code" in plain text, which is "compiled" to produce the actual document. Perhaps the first thing to know is that to start a new paragraph, you need to leave a blank line. Other than that, carriage returns are ignored. Also, multiple consecutive spaces are treated as a single space.

To Include mathematics in a document, you type the LaTeX source code for the math between dollar signs. For example, $ax^2+bx+c=0$ will be typeset as \(ax^2+bx+c=0\). If you enclose the code between double dollar signs, the math will be displayed on on line by itself. (This is called "displayed math.") For example, $ $ax^2+bx+c=0$ $ will be typeset as \[ax^2+bx+c=0\] Some things look different as displayed math. For example, compare \(\lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1\) to \[\lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1\] If case you are wondering, the LaTeX code for that is \lim_{n\to\infty}\sum_{k=1}^n\frac{1}{2^n}=1 . Remember that it has to be enclosed between either single or double dollar signs. Stuff that is between dollar signs is said to be in math mode , as opposed to the regular "text mode."

In the source code, certain characters have special meaning: $ \ { } ^ _ & ~ # % . We have seen that $ is used to surround math code.

The backslash character, \ , is used for LaTeX commands, and braces, { and } , are used to enclose the parameters to which a command applies. For example, in \sqrt{b^2-4ac} , the command is \sqrt , the parameter is b^2-4ac , and the typeset result is \(\sqrt{b^2-4ac}\). The \frac command is used to make a fraction, and it has two parameters, so \frac{n!}{k!(n-k)!} is typeset as \(\frac{n!}{k!(n-k)!}\). Some commands don't have parameters. For example, \infty represents the infinity symbol, \(\infty\), and \to produces a right arrow, \(\to\). Note that you might need to leave a space after a command like \to to mark the end of the command word. For example, use f\colon X\to Y to get \(f\colon X\to Y\). Typing \colonX instead of \colon X will just get you an error.

The special characters caret, ^ , and underscore,  _ , are used for exponents and subscripts in math mode. Note that if an exponent or subscript is more than one character or command, it must be enclosed in braces, so you need f^{-1}(x_i) to get \(f^{-1}(x_i)\). Some similar things, such as the upper and lower limits on a sum ( \sum_{n=1}^\infty for \(\sum_{n-1}^\infty\)) and the thing that goes below "lim" ( \lim_{x\to a} for \(\lim_{x\to a}\)). By the way, in display math, that would look like \(\displaystyle\lim_{x\to a}\). If you want to force some math into display style, use the command \displaystyle in regular math mode: $\displaystyle\lim_{x\to a}$ .

We will see that the amphersand, & , is used similarly to a tab character in tables and matrices. The other three special characters probably won't come up in your writing for this course. (A  ~ represents a non-breaking space, #  is used when defining new commands, and %  marks the start of a comment that ends at the end of the same line. Comments are ignored by LaTeX.) Most of the special characters can be output to the typeset document by preceding the character by a backslash in the source code. For example, type  \{ for \(\{\). However, this does not work for the backslash character; \\ is used to force a line break in the output. It also does not work for \^  or  \~ (which are used for making accented characters). I also note that | , < , and  > work in math mode but give funny results if used outside of math mode.

Some LeTeX code uses environments . Environments are coded using \begin and \end , which take the name of the environment as parameter. For example, you will write your solution to exercises in this course using my " answer " environment. That means that you will write your solution between \begin{answer} and \end{answer} . Similarly, I will write the problem text between \begin{problem} and \end{\problem} . (These two environments are not built into LaTeX. It is possible to define new environments and new commands in a document. The LaTeX source files that I give you will already define any extra commands and environments that you need.)

If you are going to use LaTeX in this course, you need to learn about matrix environments. To produce a matrix enclosed in parentheses, use the pmatrix environment. The rows of the matrix are separated by \\ . In each row, the elements of that row are separated by  & . All of that goes between \begin{pmatrix} and \end{pmatrix} , and it must all be in math mode or displayed math mode. LaTeX ignores end-of-lines in math mode, but it's a good idea to lay out the matrix in the source code similarly to how it looks when typeset (except I don't always do that for simple column vectors, which have just one element per row). For example,

will produce this in the typeset document: \[\begin{pmatrix} 3 & -10 & 2 \\ -1 & 7 & 4 \\ 5 & 0 & 1 \end{pmatrix} \begin{pmatrix} x\\ y\\ z \end{pmatrix} = \begin{pmatrix} 3x-10y+2z \\ -x+7y+4z \\ 5x+z \end{pmatrix}\]

Later, we will use the vmatrix environment to make matrices that are enclosed between vertical bars instead of between parentheses. There is a plain matrix environment for typesetting the elements of the matrix with nothing enclosing them. I use the matrix environment to typeset systems of linear equations, where each equation is one row in the matrix. Each term in an equation is one element of the row. The equal sign and the right-hand side of the equation are also elements. A column can be left empty—two & 's in a row—if a term is missing from the equation. For example:

gives \[ \begin{matrix} 3x_1 & -2x_2 & +x_3 & -x_4 & = & 7\\ -x_1 & & -5x_3 & +2x_4 & = & 2\\ & x_2 & +2x_3 & & = & 0\\ 2x_1 & +3x_2 & & -5x_4 & = & -1 \end{matrix} \]

Unfortunately, there is no simple environment for making augmented matrices. I use a pattern based on the array environment, which makes it possible to put lines between columns of the array and to say whether you want the columns to be centered, left justified, or right justified. This is specified in an extra parameter that comes after \begin{array} . For example, \begin{array}{cccc|c} is used for an array with five centered columns and a line between the fourth and fifth columns; you can use r and l instead of c to get right-justified or left-justified columns. Since the array environment does not include parentheses, I have to add them myself: \left( and \right) add appropriately sized parentheses around whatever is put between them. Here's the augmented matrix that represents the above linear system:

giving \[\left( \begin{array}{cccc|c} 3 & -2 & 1 & -1 & 7\\ -1 & 0 & -5 & 2 & 2\\ 0 & 1 & 2 & 0 & 0\\ -2 & 3 & 0 & -5 & -1 \end{array} \right) \]

The only other environment that is really essential is align* . This environment is unusual in that it is used for mathematics, but it has to be used in regular text mode, not inside math mode. Its purpose is to vertically align a sequence of rows. Rows are separated by \\ , and the position in each row that is to be aligned is marked with a  & . Often, a row is an equation or inequality (or just the operator and the right half of an equation/inequality), with the operators vertically aligned. Here is an example:

which is typeset as

\(\begin{align*} \frac{d}{dx}(x\sin(x^2)) &= x\frac{d}{dx}(\sin(x^2)) + \sin(x^2)\frac{d}{dx}(x) \\ &= x\cos(x^2)\frac{d}{dx}(x^2) + \sin(x^2)\\ &= x\cos(x^2)2x + \sin(x^2)\\ &= 2x^2\cos(x^2) + \sin(x^2) \end{align*}\)

For showing a series of row reductions applied to a matrix or linear system, you might use array or matrix environments inside an align* environment. This can get complicated, but an example is given in the first homework assignment. I have defined the command \rowop for making the arrows that go between the steps of a row reduction. The parameter to \rowop is either a single row operation or several operations separated by  \\ . For example, \rowop{\rho_2\leftrightarrow\rho_3} and \rowop{2\rho_1+\rho_2\\-3\rho_1+\rho_3} for \(\rowop{\rho_2\leftrightarrow\rho_3}\) and \(\rowop{2\rho_1+\rho_2\\-3\rho_1+\rho_3}\)

You can find lists of other LaTeX command elsewhere, and you will find examples in the documents that I give you. Here are a few more that you might use in this course. Most of these are used only in math mode, and a few of them require some preliminary configuration in the LaTeX file.

(back to contents)

Robert J. Won

Department of Mathematics, The George Washington University

How to TeX your homework

The TeX template used in the video is included at the bottom of this post. You can paste this into a .tex file locally, or into Overleaf.

  • If you’re just starting out, I recommend using  Overleaf  as your TeX editor.
  • You can use  Detexify  to hand-draw a symbol to find the LaTeX command for it.
  • There is also a nice  WikiBook  on LaTeXing mathematics.
  • When in doubt, Google is your friend!

You will frequently have problems with TeX which will make the document unable to compile. You should remember to compile often so that you can pinpoint your errors. Here are some things to check.

  • Remember to place math within dollar signs, so $x^2$ typesets as  x 2 .
  • Make sure you have started and ended all environments in the appropriate spots.
  • Make sure you have closed all of your curly braces { }.
  • Check to see if you used a new command that requires a new package.

Leave a Reply Cancel reply

Save my name, email, and website in this browser for the next time I comment.

This site uses cookies to offer you a better browsing experience. Visit GW’s Website Privacy Notice to learn more about how GW uses cookies.

Logo

10 min read

Share this post, published september 9, 2023 in general, mastering latex: a comprehensive guide to using latex for math, by scholarly, introduction.

LaTeX is a typesetting system widely used in the scientific and academic community for the production of high-quality documents, especially in mathematics. In this comprehensive guide, we will explore the various aspects of using LaTeX for math, from its history and benefits to best practices and common techniques.

In the past, mathematical expressions and equations were created using typewriters or handwritten. However, these methods were extremely time-consuming and often lacked the professional appearance required in academic papers.

LaTeX was developed by Leslie Lamport in the early 1980s as a way to address these limitations. It provided a standardized markup language for mathematical typesetting, allowing researchers and scholars to produce elegant and precise mathematical documents.

Current State

Today, LaTeX has become the standard tool for mathematical typesetting and is widely used in various fields, including mathematics, physics, computer science, and engineering. It offers a powerful and flexible system for creating complex mathematical equations, symbols, and structures.

Researchers and academics use LaTeX to write research papers, theses, and dissertations, as well as to create presentations, posters, and technical documents. The LaTeX ecosystem also includes various packages and templates that further enhance its capabilities.

Future State

Looking ahead, LaTeX will continue to play a crucial role in mathematical typesetting and document preparation. With the advancements in technology and the growing demand for professional-looking documents, LaTeX's popularity is only expected to increase.

Moreover, the integration of LaTeX with AI technologies holds incredible potential. AI-powered algorithms can assist in auto-generating LaTeX code and offer suggestions for improving mathematical expressions. This collaboration between LaTeX and AI will streamline the document creation process and further enhance the capabilities of mathematical typesetting.

Using LaTeX for math offers several key benefits:

Professional Appearance: LaTeX produces documents of exceptional quality, with precise mathematical symbols and structures that are consistent throughout the document.

Flexibility and Customization: LaTeX allows for extensive control over the layout, formatting, and appearance of mathematical equations, making it suitable for various mathematical disciplines.

Efficiency and Productivity: LaTeX automates many tasks involved in mathematical typesetting, such as numbering equations and generating tables of contents. This automation saves time and increases productivity.

Compatibility and Portability: LaTeX documents can be easily shared and viewed on different devices and operating systems without any loss of formatting or quality.

Mathematical Typesetting: LaTeX provides extensive support for mathematical notation, making it the ideal choice for writing complex mathematical equations, symbols, and formulas.

Significance

LaTeX's significance in the scientific and academic community cannot be overstated. It has revolutionized the way mathematical documents are created and has become the gold standard for mathematical typesetting.

The precision, professional appearance, and consistency of LaTeX-produced documents have made it the preferred choice for researchers, mathematicians, and educators worldwide. Moreover, LaTeX's open-source nature encourages collaboration and the sharing of knowledge within the scientific community.

Best Practices

To make the most out of LaTeX for math, consider the following best practices:

Organize Your Document: Break your document into logical sections and use appropriate LaTeX commands to structure your content. This helps in maintaining clarity and easy navigation.

Use Packages and Templates: Take advantage of the vast collection of LaTeX packages and templates available. These resources provide enhanced functionality and save time by giving you pre-defined styles and layouts.

Consistent Formatting: Ensure consistent formatting throughout your document, including font styles, spacing, and alignment. This contributes to the professional appearance of your math equations and overall document.

Cite References: Use LaTeX's built-in bibliographic features to cite relevant sources in your math document. This not only adds credibility but also facilitates easy referencing and cross-referencing.

Proofread and Test: Always proofread your LaTeX document and test it thoroughly before finalizing. Check for typographical errors, equation alignments, and any rendering issues that may affect the readability of your math content.

Pros and Cons

  • LaTeX produces professional-looking mathematical documents with precise symbols and structures.
  • It offers extensive control over equation formatting and customization.
  • LaTeX documents are easily portable and compatible across different devices and operating systems.
  • The LaTeX ecosystem provides a wide range of packages and templates to enhance functionality and save time.
  • LaTeX is highly efficient in handling complex mathematical notation and formulas.
  • The learning curve for LaTeX can be steep for beginners.
  • Creating complex layouts and templates may require advanced knowledge of LaTeX.
  • Troubleshooting rendering issues can be time-consuming.
  • Collaboration on LaTeX documents without version control systems can be challenging.
  • Limited WYSIWYG (What You See Is What You Get) editing capabilities compared to word processors.

Online LaTeX Editors

Overleaf : Overleaf is a popular online LaTeX editor that offers real-time collaboration and pre-built templates. It provides a user-friendly interface and seamless integration with other LaTeX tools.

ShareLaTeX : ShareLaTeX is another online LaTeX editor that allows collaborative editing and features an intuitive editor with LaTeX syntax highlighting. It offers a free version with limited features and paid plans for additional functionality.

Scholarly : Scholarly is an AI-powered platform for document preparation, including LaTeX. It offers a range of features to automate LaTeX code generation and improve the productivity of mathematical typesetting.

Desktop LaTeX Editors

TeXstudio: TeXstudio is a popular LaTeX editor that provides an integrated development environment (IDE) for efficient document authoring. It offers advanced features like syntax highlighting, auto-completion, and built-in PDF viewer.

LaTeXila: LaTeXila is a lightweight LaTeX editor for Linux users. It provides a simple and intuitive interface, with features like project management, syntax highlighting, and error checking.

When using LaTeX for math, consider the following methods:

Creating Equations: Use LaTeX commands to define and create mathematical equations. For example, use the equation environment to display numbered equations.

Using Mathematical Symbols: LaTeX provides a comprehensive set of commands for mathematical symbols. Use these commands to insert symbols like Greek letters, mathematical operators, and special characters.

Aligning Equations: Use the align environment to align multiple equations, ensuring proper spacing and alignment of mathematical expressions.

Including Graphics: LaTeX allows for the inclusion of graphics, such as plots or diagrams, within your math document. Use the graphicx package and the includegraphics command for this purpose.

Typesetting Mathematical Formulas: LaTeX provides powerful tools for typesetting mathematical formulas. Use commands like frac , sqrt , and int to create fractions, square roots, and integrals, respectively.

AI Applications

AI can have a significant impact on LaTeX for math by automating various tasks, such as equation generation, template design, and error detection. AI can analyze large datasets of mathematical expressions and provide suggestions for improving the quality and efficiency of LaTeX documents.

AI Techniques

AI techniques like natural language processing (NLP) and machine learning (ML) can be used to automate the conversion of plain text into LaTeX code. This simplifies the process of creating mathematical equations and makes it more accessible to non-technical users.

AI Benefits

The integration of AI into LaTeX for math offers several benefits, including:

  • Improved productivity and efficiency in mathematical typesetting.
  • Enhanced accuracy and consistency in creating complex equations.
  • Streamlined collaboration and version control.

AI Challenges

There are challenges associated with incorporating AI into LaTeX, such as:

  • Ensuring the accuracy and reliability of AI-generated LaTeX code.
  • Overcoming the limitations of AI in understanding the context and semantics of mathematical expressions.
  • Balancing automation with user control and customization.

AI Online Apps

Several online apps leverage AI to enhance the LaTeX experience:

Scholarly : Scholarly is an AI-powered platform specifically designed for scientific document preparation, including LaTeX. It offers various AI features to accelerate equation creation, generate flashcards, and transcribe mathematical content.

Mathpix : Mathpix utilizes AI to extract LaTeX code from images of mathematical equations. This can be useful when you have handwritten or printed equations that you want to convert into LaTeX.

Cocalc : Cocalc is a collaborative online platform that supports LaTeX for math and allows for real-time collaboration on LaTeX documents. It provides a range of mathematical computation capabilities in addition to LaTeX editing.

Detexify : Detexify is an AI-powered online tool that helps you find the LaTeX command for a particular symbol. You can draw the symbol, and Detexify will suggest relevant LaTeX commands.

LaTeX Base : LaTeX Base is a web-based LaTeX editor with built-in features like real-time collaboration, syntax highlighting, and a template library.

LaTeX is a powerful tool for mathematical typesetting and document preparation, offering precise control over equations, symbols, and structures. Its professional appearance, flexibility, and compatibility have made it the go-to choice for researchers, mathematicians, and educators worldwide.

As technology advances, the integration of AI with LaTeX opens up exciting possibilities for further improving mathematical typesetting. AI-powered tools and apps simplify the equation creation process, enhance collaboration, and increase productivity.

Whether you are a student, researcher, or professional in the field of mathematics, LaTeX is an invaluable tool that will elevate the presentation of your mathematical work. Embrace its capabilities, explore the vast LaTeX ecosystem, and unlock the full potential of mathematical typesetting.

Keep Reading

Revolutionize Your Learning: The Impact of AI-Powered Technology

Posted November 15, 2023 in General

Revolutionize your learning: the impact of ai-powered technology.

Next-Gen Learning: Embrace AI-Powered Education Now

Next-Gen Learning: Embrace AI-Powered Education Now

Harnessing AI: Tools and Tips to Accelerate Your AI Learning

Harnessing AI: Tools and Tips to Accelerate Your AI Learning

AI Education: How to Learn AI With Confidence and Ease

AI Education: How to Learn AI With Confidence and Ease

Try scholarly.

Get started for free. No credit card required.

Level up your studies today.

Are you a school or organization? Contact us

© 2024 Scholarly. All rights reserved.

LaTeX-Tutorial.com

Latex math and equations, learn to typeset and align equations, matrices and fractions in latex. overview of basic math features, with live-rendering..

  • Inline math
  • Scaling of Parentheses, Brackets etc.

There are two major modes of typesetting math in LaTeX one is embedding the math directly into your text by encapsulating your formula in dollar signs and the other is using a predefined math environment. You can follow along and try the code in your computer or online using overleaf. I also prepared a quick reference of math symbols .

Using inline math – embed formulas in your text

To make use of the inline math feature, simply write your text and if you need to typeset a single math symbol or formula, surround it with dollar signs:

Output equation: \(\text{This formula }f(x) = x^2\text{ is an example.}\)

The equation and align environment

The most useful math envorinments are the equation environment for typesetting single equations and the align environment for multiple equations and automatic alignment:

Output Equation: \(\begin{equation}1 + 2 = 3\end{equation}\) \(\begin{equation}1 = 3 – 2\end{equation}\) Output Align: \(\begin{align} 1 + 2 & = 3\\ 1 & = 3 – 2 \end{align}\)

The align environment will align the equations at the ampersand & . Single equations have to be seperated by a linebreak \\ . There is no alignment when using the simple equation environment. Furthermore it is not even possible to enter two equations in that environment, it will result in a compilation error . The asterisk (e.g. equation*) only indicates, that I don’t want the equations to be numbered.

Fractions and more

LaTeX is capable of displaying any mathematical notation. It’s possible to typeset integrals, fractions and more. Every command has a specific syntax to use. I will demonstrate some of the most common LaTeX math features:

Output: \(\begin{align*} f(x) &= x^2\\ g(x) &= \frac{1}{x}\\ F(x) &= \int^a_b \frac{1}{3}x^3 \end{align*}\)

It is also possible to combine various commands to create more sophisticated expressions such as:

Output: \(\frac{1}{\sqrt{x}}\)

The more complex the expression, the more error prone this is, it’s important to take care of opening and closing the braces {} . It can take a long time to debug such errors. The Lyx  program offers a great formula editor, which can ease this work a bit. Personally, I write all code by hand though, since it’s faster than messing around with the formula editor.

Furthermore it’s possible to display matrices in LaTeX. There is a special matrix environment for this purpose, please keep in mind that the matrices only work within math environments as described above :

Output: \(\begin{matrix} 1 & 0\\ 0 & 1 \end{matrix}\)

Brackets in math mode – Scaling

To surround the matrix by brackets, it’s necessary to use special statements, because the plain [ ] symbols do not scale as the matrix grows. The following code will result in wrong brackets:

Output: \([ \begin{matrix} 1 & 0\\ 0 & 1 \end{matrix} ]\)

To scale them up, we must use the following code:

Output: \( \left[ \begin{matrix} 1 & 0\\ 0 & 1 \end{matrix} \right] \)

This does also work for parentheses and braces and is not limited to matrices. It can be used to scale for fractions and other expressions as well:

Output: \(\left(\frac{1}{\sqrt{x}}\right)\)

  • LaTeX is a powerful tool to typeset math
  • Embed formulas in your text by surrounding them with dollar signs $
  • The equation environment is used to typeset one formula
  • The align environment will align formulas at the ampersand & symbol
  • Single formulas must be seperated with two backslashes \\
  • Use the matrix environment to typeset matrices
  • Scale parentheses with \left( \right) automatically
  • All mathematical expressions have a unique command with unique syntax
  • \int^a_b for integral symbol
  • \frac{u}{v} for fractions
  • \sqrt{x} for square roots
  • Characters for the greek alphabet and other mathematical symbols  such as \lambda

Next Lesson: 05 Figures

BYU Logo

Math 341 — Theory of Analysis 1

Latex resources.

Under Construction!!

Getting started with \(\LaTeX\)

  • Online LaTeX Editor Overleaf
  • https://www.overleaf.com/latex/learn/free-online-introduction-to-latex-part-1
  • Use 12 point font and 1" or 1.25" margins
  • Here is a link for a homework template Math 341 Homework Template as a starting point for your homework assignments typed in LaTeX.
  • Hint: Look at this example and its LaTeX source code .

Various reference sources

  • LaTeX reference sheet by Dave Richeson (2 pages)
  • Math 290 LaTeX reference sheet (2 pages)
  • LaTeX reference sheet by Winston Change (2 pages )
  • Darrin Doud's Short Introduction to LaTeX
  • Lots of LaTeX symbols (4 pages)
  • Learn LaTeX in 30 Minutes A tutorial at Overleaf.com
  • AMS Math Users Guide How to typeset most formulas!
  • The (Not So Short) Introduction to LaTeX   This is a book. It explains the overall philosophy of LaTeX, text mode, math mode, insertion of table of contents, images, figures, chapters, sections, appendices, index, and lots of other stuff.
  • More Math into LaTeX by George Gratzer. A free PDF download for BYU students. This is an extensive textbook. You will need to log on through the BYU authentication page.

A few software options

  • Pros of Overleaf:  Free. Several nice editor features. User friendly. Video tutorials.
  • MiKTeX comes with TeXworks, which is a built-in text editor and previewer a lot like the online options.
  • Pros:  Fast Compiling.  No dependency on internet connection.  Easier to use on a small screen than the online editors. You should turn on syntax highlighting and line numbers.
  • When you install MiKTeX, you should set the paper size to "letter" (the default is the European A4 size).  Also, let MiKTeX download any missing packages automatically.
  • Note: You can download other free text editors that are better than TeXworks that will still use the MiKTeX compiling engine.
  • The MacTeX installer includes both a LaTeX compiler and a text editor called MacTeX. Go to the website and follow the instructions to download and install the latest version. MacTeX is very similar to TeXworks except that is runs only on Mac.
  • TeXstudio (Windows, MacOsX, Linux) — My favorite freeware LaTeX editor. It has graphical pallets to help you if you don't remember all of the LaTeX command and environments. It has a built-in PDF previewer. You need to install a TeX/LaTeX system like MiKTeX first before installing this. If you have a 4K high resolution computer monitor, you will need to go to "Options|Configure TeXstudio|Show Advanced Options|GUI Scaling" and drag the sliders to make the symbol pallets larger.
  • WinEdt + MiKTeX + Sumatra PDF (Windows only)  WinEdt is not freeware, but it is very versatile and infinitely customizable. For the programmer type, this might be the best Windows editor for LaTeX files.
  • LyX (Windows, Mac, Linux) — A freeware graphical front end for LaTeX. As you edit documents, formulas actually look like formulas!!! LyX is difficult to use if you don't already understand basic LaTeX. Learn LaTeX using a simple editor first, then try LyX. I can type most documents more quickly with the old-school method of directly editing the *.tex file with a text editor and compiling to create a PDF file. However, I sometimes use LyX to type long, complicated, multiline formulas where the source code becomes very complicated.

Microsoft Word, PowerPoint, Excel, and OneNote all support a genuine equation environment, called a Math Zone, similar to LaTeX math mode. Learning how to use Math Zones well is at least as difficult as learning LaTeX. However, since the amount you need to learn to type only calculus formulas is relatively small, it's pretty easy to get started. You will save a lot of time by learning the keyboard shortcuts rather than using the click-on pallets and icons. In an MS Math Zone, you can type many LaTeX commands and the autocorrect feature will convert the LaTeX command into a unicode math character. If you learn how to use math zones well, your equations will look quite good. If you prefer to use Microsoft software (for example if you become a public school teacher it might be more natural to use MS Word than LaTeX), I recommend Murray Sargent's excellent Math in Office Blog for tips. In one of his blog articles about unicode , he refers to Unicode Technical Note #28, UnicodeMath, a Nearly Plain-Text Encoding of Mathematics which explains many of the keyboard commands that make typing mathematics in MS Office documents much easier and better looking. I found the book Creating Research and Scientific Documents Using Microsoft Word to be quite helpful. (I purchased the book a few years ago for about $20.) Microsoft Word is actually pretty good at making all of the standard calculus formulas and symbols.

Although you won't use MS PowerPoint to type homework, you might use it to make a presentation at a conference or for another class. You can insert genuine LaTeX formulas into PowerPoint by using a plugin called IguanaTeX . It's very easy to use. Also formulas created in Microsoft Math Zones look good in PowerPoint.

LaTeX/Mathematics

One of the greatest motivating forces for Donald Knuth when he began developing the original TeX system was to create something that allowed simple construction of mathematical formulae, while looking professional when printed. The fact that he succeeded was most probably why TeX (and later on, LaTeX) became so popular within the scientific community. Typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation.

If your document requires only a few simple mathematical formulas, plain LaTeX has most of the tools that you will ever need. If you are writing a scientific document that contains numerous complex formulas, the amsmath package [1] introduces several new commands that are more powerful and flexible than the ones provided by basic LaTeX. The mathtools package fixes some amsmath quirks and adds some useful settings, symbols, and environments to amsmath. [2] To use either package, include:

in the preamble of the document. The mathtools package loads the amsmath package and hence there is no need to \usepackage{amsmath} in the preamble if mathtools is used.

  • 1.1 Inserting "Displayed" maths inside blocks of text
  • 3 Greek letters
  • 4 Operators
  • 5 Powers and indices
  • 6.1 Continued fractions
  • 6.2 Multiplication of two numbers
  • 8 Sums and integrals
  • 9.1 Automatic sizing
  • 9.2 Manual sizing
  • 10.1 Matrices in running text
  • 11.1 Formatted text
  • 12.1 Accents
  • 14 Plus and minus signs
  • 15 Controlling horizontal spacing
  • 16 Manually Specifying Formula Style
  • 17.1 Introducing dots in formulas
  • 17.3 Write an equation with the align environment
  • 18 List of mathematical symbols
  • 20 References
  • 22 Further reading
  • 23 External links

Mathematics environments [ edit | edit source ]

LaTeX needs to know when the text is mathematical. This is because LaTeX typesets math notation differently from normal text. Therefore, special environments have been declared for this purpose. They can be distinguished into two categories depending on how they are presented:

{\displaystyle a+a=2a}

  • displayed — displayed formulas are on a line by themselves.

As math requires special environments, there are naturally the appropriate environment names you can use in the standard way. Unlike most other environments, however, there are some handy shorthands for declaring your formulas. The following table summarizes them:

Suggestion : Using the $$ ... $$ should be avoided, as it may cause problems, particularly with the AMS-LaTeX macros. Furthermore, should a problem occur, the error messages may not be helpful.

The equation* and displaymath environments are functionally equivalent.

If you are typing text normally, you are said to be in text mode , but while you are typing within one of those mathematical environments, you are said to be in math mode , that has some differences compared to the text mode :

  • Most spaces and line breaks do not have any significance, as all spaces are either derived logically from the mathematical expressions or have to be specified with special commands such as \quad
  • Empty lines are not allowed. Only one paragraph per formula.
  • Each letter is considered to be the name of a variable and will be typeset as such. If you want to typeset normal text within a formula (normal upright font with normal spacing), then you have to enter the text using dedicated commands.

Inserting "Displayed" maths inside blocks of text [ edit | edit source ]

{\displaystyle \displaystyle \sum }

Symbols [ edit | edit source ]

Mathematics has many symbols! The following is a set of symbols that can be accessed directly from the keyboard:

Beyond those listed above, distinct commands must be issued in order to display the desired symbols. There are many examples such as Greek letters, set and relations symbols, arrows, binary operators, etc.

For example:

Fortunately, there's a tool that can greatly simplify the search for the command for a specific symbol. Look for "Detexify" in the external links section below. Another option would be to look in "The Comprehensive LaTeX Symbol List" in the external links section below.

Greek letters [ edit | edit source ]

Greek letters are commonly used in mathematics, and they are very easy to type in math mode . You just have to type the name of the letter after a backslash: if the first letter is lowercase, you will get a lowercase Greek letter, if the first letter is uppercase (and only the first letter), then you will get an uppercase letter. Note that some uppercase Greek letters look like Latin ones, so they are not provided by LaTeX (e.g. uppercase Alpha and Beta are just "A" and "B", respectively). Lowercase epsilon, theta, kappa, phi, pi, rho, and sigma are provided in two different versions. The alternate, or var iant, version is created by adding "var" before the name of the letter:

Scroll down to #List of mathematical symbols for a complete list of Greek symbols.

Operators [ edit | edit source ]

An operator is a function that is written as a word: e.g. trigonometric functions (sin, cos, tan), logarithms and exponentials (log, exp), limits (lim), as well as trace and determinant (tr, det). LaTeX has many of these defined as commands:

For certain operators such as limits , the subscript is placed underneath the operator:

For the modular operator there are two commands: \bmod and \pmod :

To use operators that are not pre-defined, such as argmax , see custom operators

Powers and indices [ edit | edit source ]

Powers and indices are equivalent to superscripts and subscripts in normal text mode. The caret ( ^ ; also known as the circumflex accent ) character is used to raise something, and the underscore ( _ ) is for lowering. If an expression containing more than one character is raised or lowered, it should be grouped using curly braces ( { and } ).

For powers with more than one digit, surround the power with {}.

{\displaystyle |}

Fractions and Binomials [ edit | edit source ]

A fraction is created using the \frac { numerator }{ denominator } command (for those who need their memories refreshed, that's the top and bottom respectively!). Likewise, the binomial coefficient (a.k.a, the Choose function) may be written using the \binom command: [note 1]

You can embed fractions within fractions:

{\displaystyle {\tfrac {a}{b}}}

For relatively simple fractions, especially within the text, it may be more aesthetically pleasing to use powers and indices instead:

If this looks a little "loose" (i.e., overspaced), a tightened version can be defined by inserting some negative space

If you use them throughout the document, usage of xfrac package is recommended. This package provides \sfrac command to create slanted fractions. Usage:

If fractions are used as an exponent, curly braces have to be used around the \sfrac command:

In some cases, using the package alone will result in errors about certain font shapes not being available. In that case, the lmodern and fix-cm packages need to be added as well.

Alternatively, the nicefrac package provides the \nicefrac command, whose usage is similar to \sfrac .

Continued fractions [ edit | edit source ]

Continued fractions should be written using \cfrac command: [note 1]

Multiplication of two numbers [ edit | edit source ]

To make multiplication visually similar to a fraction, a nested array can be used. For example, multiplication of numbers written one below the other can be typeset as follows:

Roots [ edit | edit source ]

The \sqrt command creates a square root surrounding an expression. It accepts an optional argument specified in square brackets ( [ and ] ) to change magnitude:

Some people prefer writing the square root "closing" it over its content. This method arguably makes it more clear what is in the scope of the root sign. This habit is not normally used while writing with the computer, but if you still want to change the output of the square root, LaTeX gives you this possibility. Just add the following code in the preamble of your document:

{\displaystyle {\sqrt[{b}]{a}}}

An alternative piece of TeX code that does allow multiple roots is

However, this requires the \usepackage { letltxmacro } package.

Sums and integrals [ edit | edit source ]

The \sum and \int commands insert the sum and integral symbols respectively, with limits specified using the caret ( ^ ) and underscore ( _ ). The typical notation for sums is:

The limits for the integrals follow the same notation. It's also important to represent the integration variables with an upright d, which in math mode is obtained through the \mathrm{} command, and with a small space separating it from the integrand, which is attained with the \, command.

There are many other "big" commands which operate in a similar manner:

For more integral symbols, including those not included by default in the Computer Modern font, try the esint package.

The \substack command [note 1] allows the use of \\ to write the limits over multiple lines:

If you want the limits of an integral to be specified above and below the symbol (like the sum), use the \limits command:

However, if you want this to apply to all integrals, it is preferable to specify the intlimits option when loading the amsmath package:

Subscripts and superscripts in other contexts, as well as other parameters to amsmath package related to them, are described in Advanced Mathematics chapter.

For bigger integrals, you may use personal declarations, or the bigints package [3] .

Brackets, braces and delimiters [ edit | edit source ]

How to use braces in multi line equations is described in the Advanced Mathematics chapter.

The use of delimiters such as brackets soon becomes important when dealing with anything but the most trivial equations. Without them, formulas can become ambiguous. Also, special types of mathematical structures, such as matrices, typically rely on delimiters to enclose them.

There are a variety of delimiters available for use in LaTeX:

where \lbrack and \rbrack may be used in place of [ and ].

Automatic sizing [ edit | edit source ]

Very often, mathematical features will differ in size, in which case the delimiters surrounding the expression should vary accordingly. This can be done automatically using the \left , \right , and \middle commands. Any of the previous delimiters may be used in combination with these:

Curly braces are defined differently by using \left\{ and \right\} ,

If a delimiter on only one side of an expression is required, then an invisible delimiter on the other side may be denoted using a period ( . ).

Manual sizing [ edit | edit source ]

In certain cases, the sizing produced by the \left and \right commands may not be desirable, or you may simply want finer control over the delimiter sizes. In this case, the \big , \Big , \bigg and \Bigg modifier commands may be used:

These commands are primarily useful when dealing with nested delimiters. For example, when typesetting

we notice that the \left and \right commands produce the same size delimiters as those nested within it. This can be difficult to read. To fix this, we write

Manual sizing can also be useful when an equation is too large, trails off the end of the page, and must be separated into two lines using an align command. Although the commands \left . and \right . can be used to balance the delimiters on each line, this may lead to wrong delimiter sizes. Furthermore, manual sizing can be used to avoid overly large delimiters — if an \underbrace or a similar command appears between the delimiters.

Matrices and arrays [ edit | edit source ]

A basic matrix may be created using the matrix environment [note 1] : in common with other table-like structures, entries are specified by row, with columns separated using an ampersand ( & ) and new rows separated with a double backslash ( \\ )

To specify alignment of columns in the table, use starred version [note 2] :

The alignment by default is c , but it can be any column type valid in array environment.

However matrices are usually enclosed in delimiters of some kind, and while it is possible to use the \left and \right commands , there are various other predefined environments which automatically include delimiters:

When writing down arbitrary sized matrices, it is common to use horizontal, vertical and diagonal triplets of dots (known as ellipses ) to fill in certain columns and rows. These can be specified using the \cdots , \vdots and \ddots respectively:

In some cases, you may want to have finer control of the alignment within each column, or to insert lines between columns or rows. This can be achieved using the array environment, which is essentially a math-mode version of the tabular environment , which requires that the columns be pre-specified:

You may see that the AMS matrix class of environments doesn't leave enough space when used together with fractions resulting in output similar to this:

{\displaystyle M={\begin{bmatrix}{\frac {5}{6}}&{\frac {1}{6}}&0\\{\frac {5}{6}}&0&{\frac {1}{6}}\\0&{\frac {5}{6}}&{\frac {1}{6}}\end{bmatrix}}}

To counteract this problem, add additional leading space with the optional parameter to the \\ command:

If you need "border" or "indexes" on your matrix, plain TeX provides the macro \bordermatrix

Matrices in running text [ edit | edit source ]

To insert a small matrix without increasing leading in the line containing it, use smallmatrix environment:

Adding text to equations [ edit | edit source ]

The math environment differs from the text environment in the representation of text. Here is an example of trying to represent text within the math environment:

There are two noticeable problems: there are no spaces between words or numbers, and the letters are italicized and more spaced out than normal. Both issues are simply artifacts of the maths mode, in that it treats it as a mathematical expression: spaces are ignored (LaTeX spaces mathematics according to its own rules), and each character is a separate element (so are not positioned as closely as normal text).

There are a number of ways that text can be added properly. The typical way is to wrap the text with the \text { ... } command [note 1] (a similar command is \mbox { ... } , though this causes problems with subscripts, and has a less descriptive name). Let's see what happens when the above equation code is adapted:

The text looks better. However, there are no gaps between the numbers and the words. Unfortunately, you are required to explicitly add these. There are many ways to add spaces between math elements, but for the sake of simplicity we may simply insert space characters into the \text commands.

Formatted text [ edit | edit source ]

Using the \text is fine and gets the basic result. Yet, there is an alternative that offers a little more flexibility. You may recall the introduction of font formatting commands , such as \textrm , \textit , \textbf , etc. These commands format the argument accordingly, e.g., \textbf { bold text } gives bold text . These commands are equally valid within a maths environment to include text. The added benefit here is that you can have better control over the font formatting, rather than the standard text achieved with \text .

Formatting mathematics symbols [ edit | edit source ]

We can now format text; what about formatting mathematical expressions? There are a set of formatting commands very similar to the font formatting ones just used, except that they are specifically aimed at text in math mode (requires amsfonts )

These formatting commands can be wrapped around the entire equation, and not just on the textual elements: they only format letters, numbers, and uppercase Greek, and other math commands are unaffected.

To bold lowercase Greek or other symbols use the \boldsymbol command [note 1] ; this will only work if there exists a bold version of the symbol in the current font. As a last resort there is the \pmb command [note 1] (poor man's bold): this prints multiple versions of the character slightly offset against each other.

To change the size of the fonts in math mode, see Changing font size .

Accents [ edit | edit source ]

So what to do when you run out of symbols and fonts? Well, the next step is to use accents:

Color [ edit | edit source ]

The package xcolor , described in Colors , allows us to add color to our equations. For example,

The only problem is that this disrupts the default L a T e X formatting around the - operator. To fix this, we enclose it in a \mathbin environment, since - is a binary operator. This process is described here .

Plus and minus signs [ edit | edit source ]

LaTeX deals with the + and − signs in two possible ways. The most common is as a binary operator. When two maths elements appear on either side of the sign, it is assumed to be a binary operator, and as such, allocates some space to either side of the sign. The alternative way is a sign designation. This is when you state whether a mathematical quantity is either positive or negative. This is common for the latter, as in math, such elements are assumed to be positive unless a − is prefixed to it. In this instance, you want the sign to appear close to the appropriate element to show their association. If you put a + or a − with nothing before it but you want it to be handled like a binary operator you can add an invisible character before the operator using {} . This can be useful if you are writing multiple-line formulas, and a new line could start with a − or +, for example, then you can fix some strange alignments adding the invisible character where necessary.

A plus-minus sign is written as:

Similarly, there exists also a minus-plus sign:

Controlling horizontal spacing [ edit | edit source ]

LaTeX is obviously pretty good at typesetting maths—it was one of the chief aims of the core TeX system that LaTeX extends. However, it can't always be relied upon to accurately interpret formulas in the way you did. It has to make certain assumptions when there are ambiguous expressions. The result tends to be slightly incorrect horizontal spacing. In these events, the output is still satisfactory, yet any perfectionists will no doubt wish to fine-tune their formulas to ensure spacing is correct. These are generally very subtle adjustments.

There are other occasions where LaTeX has done its job correctly, but you just want to add some space, maybe to add a comment of some kind. For example, in the following equation, it is preferable to ensure there is a decent amount of space between the maths and the text.

This code produces errors with Miktex 2.9 and does not yield the results seen on the right. Use \mathrm instead of just \text.

(Note that this particular example can be expressed in more elegant code by the cases construct provided by the amsmath package described in Advanced Mathematics chapter.)

LaTeX has defined two commands that can be used anywhere in documents (not just maths) to insert some horizontal space. They are \quad and \qquad

A \quad is a space equal to the current font size. So, if you are using an 11pt font, then the space provided by \quad will also be 11pt (horizontally, of course.) The \qquad gives twice that amount. As you can see from the code from the above example, \quad s were used to add some separation between the maths and the text.

OK, so back to the fine tuning as mentioned at the beginning of the document. A good example would be displaying the simple equation for the indefinite integral of y with respect to x :

{\displaystyle \int y\,\mathrm {d} x}

If you were to try this, you may write:

However, this doesn't give the correct result. LaTeX doesn't respect the white-space left in the code to signify that the y and the d x are independent entities. Instead, it lumps them altogether. A \quad would clearly be overkill in this situation—what is needed are some small spaces to be utilized in this type of instance, and that's what LaTeX provides:

NB you can use more than one command in a sequence to achieve a greater space if necessary.

So, to rectify the current problem:

The negative space may seem like an odd thing to use, however, it wouldn't be there if it didn't have some use! Take the following example:

The matrix-like expression for representing binomial coefficients is too padded. There is too much space between the brackets and the actual contents within. This can easily be corrected by adding a few negative spaces after the left bracket and before the right bracket.

In any case, adding some spaces manually should be avoided whenever possible: it makes the source code more complex and it's against the basic principles of a What You See is What You Mean approach. The best thing to do is to define some commands using all the spaces you want and then, when you use your command, you don't have to add any other space. Later, if you change your mind about the length of the horizontal space, you can easily change it modifying only the command you defined before. Let us use an example: you want the d of a dx in an integral to be in roman font and a small space away from the rest. If you want to type an integral like \int x \, \mathrm { d } x , you can define a command like this:

in the preamble of your document. We have chosen \dd just because it reminds the "d" it replaces and it is fast to type. Doing so, the code for your integral becomes \int x \dd x . Now, whenever you write an integral, you just have to use the \dd instead of the "d", and all your integrals will have the same style. If you change your mind, you just have to change the definition in the preamble, and all your integrals will be changed accordingly.

Manually Specifying Formula Style [ edit | edit source ]

To manually display a fragment of a formula using text style, surround the fragment with curly braces and prefix the fragment with \textstyle . The braces are required because the \textstyle macro changes the state of the renderer, rendering all subsequent mathematics in text style. The braces limit this change of state to just the fragment enclosed within. For example, to use text style for just the summation symbol in a sum, one would enter

The same thing as a command would look like this:

Note the extra braces. Just one set around the expression won't be enough. That would cause all math after \tsum k to be displayed using text style.

To display part of a formula using display style, do the same thing, but use \displaystyle instead.

Advanced Mathematics: AMS Math package [ edit | edit source ]

The AMS ( American Mathematical Society ) mathematics package is a powerful package that creates a higher layer of abstraction over mathematical LaTeX language; if you use it it will make your life easier. Some commands amsmath introduces will make other plain LaTeX commands obsolete: in order to keep consistency in the final output you'd better use amsmath commands whenever possible. If you do so, you will get an elegant output without worrying about alignment and other details, keeping your source code readable. If you want to use it, you have to add this in the preamble:

Introducing dots in formulas [ edit | edit source ]

amsmath defines also the \dots command, that is a generalization of the existing \ldots . You can use \dots in both text and math mode and LaTeX will replace it with three dots "…" but it will decide according to the context whether to put it on the bottom (like \ldots ) or centered (like \cdots ).

Dots [ edit | edit source ]

LaTeX gives you several commands to insert dots (ellipses) in your formulae. This can be particularly useful if you have to type big matrices omitting elements. First of all, here are the main dots-related commands LaTeX provides:

Instead of using \ldots and \cdots , you should use the semantically oriented commands. It makes it possible to adapt your document to different conventions on the fly, in case (for example) you have to submit it to a publisher who insists on following house tradition in this respect. The default treatment for the various kinds follows American Mathematical Society conventions.

Write an equation with the align environment [ edit | edit source ]

How to write an equation with the align environment with the amsmath package is described in Advanced Mathematics .

List of mathematical symbols [ edit | edit source ]

All the pre-defined mathematical symbols from the \TeX\ package are listed below. More symbols are available from extra packages.

Note: To use the Greek Letters in LaTeX that have the same appearance in the Latin alphabet, just use Latin: e.g., A instead of Alpha, B instead of Beta, etc.

^ Not predefined in LATEX 2. Use one of the packages latexsym, amsfonts, amssymb, txfonts, pxfonts, or wasysym

If LaTeX does not include a command for the mathematical operator you want to use, for example \cis ( c osine plus i times s ine), add to your preamble:

You can then use \cis in the document just like \cos or any other mathematical operator.

Summary [ edit | edit source ]

As you begin to see, typesetting math can be tricky at times. However, because LaTeX provides so much control, you can get professional quality mathematics typesetting with relatively little effort (once you've had a bit of practice, of course!). It is possible to elaborate further on the nitty-gritty of mathematics because the possibilities seem endless. However, with this tutorial, you should be able to get along with it sufficiently.

References [ edit | edit source ]

  • ↑ http://www.ams.org/publications/authors/tex/amslatex
  • ↑ http://www.ctan.org/tex-archive/macros/latex/contrib/mathtools/mathtools.pdf
  • ↑ http://hdl.handle.net/2268/6219

Notes [ edit | edit source ]

  • ↑ a b c d e f g h i j k l m n o p q r s t requires the amsmath package
  • ↑ a b c d e f requires the mathtools package
  • ↑ a b c d e f The mathalpha package allows for specifying a broader variety of fonts to be used in the \mathfrak{} , \mathbb{} , \mathcal{} and \mathscr{} commands. For example, the command \usepackage[bb=pazo]{mathalpha} makes it so \mathbb{} uses the "pazo" font. mathalpha 's documentation gives a comparison of the different font options; some have lowercase letters, Greek letters or numerals where the default does not.

Further reading [ edit | edit source ]

  • meta:Help:Displaying a formula : Wikimedia uses a subset of LaTeX commands.

External links [ edit | edit source ]

  • detexify : applet for looking up LaTeX symbols by drawing them
  • amsmath documentation
  • LaTeX - The Student Room
  • The Comprehensive LaTeX Symbol List
  • Comprehensive List of Mathematical Symbols

doing math homework in latex

  • Wikibooks pages with to-do lists
  • Pages that use a deprecated format of the math tags

Navigation menu

doing math homework in latex

Improve your Students’ Math Experience with LaTeX Lesson Notes

March 31, 2021 Company Features , Getting Started , Management , News & Updates , Software , Tutoring & Test Preparation

doing math homework in latex

Teaching students mathematical concepts effectively can be tricky when equations aren’t formatted neatly. These difficult-to-read equations can cause unnecessary confusion and frustration for both tutors and their students.

Teachworks offers tutor management software that includes plenty of useful features for math tutors, like the LaTeX Lesson Notes Add-on in all of our plans. When you complete lessons in Teachworks, you’re able to add detailed notes about the lesson. This feature allows LaTeX scripts to be displayed as correctly formatted equations within lesson notes and ensures that students can learn without any hiccups or misunderstandings.

What is LaTeX?

If you aren’t familiar with LaTeX, it’s a script used to typeset mathematical equations into documents. Essentially this means that it conveniently translates plain character text instructions into correctly formatted mathematical equations that are easy to read. 

Benefits of using Teachworks’ LaTeX Lesson Notes Add-on 

When tutoring mathematics, LaTeX can be a very useful tool to help students grasp the concepts correctly. Below are two of the main benefits of the LaTeX Lesson Notes Add-on .

Ensures the correct formatting of math equations 

When compiling Lesson Notes, you can add in the LaTeX script to ensure equations are formatted properly. Before completing the lesson, you can even preview your script to make sure that equations are shown correctly by pressing “LaTeX to Math” located underneath the field box. 

Having equations displayed correctly helps students refine their math skills quicker, with less confusion related to the concepts.  

Allows students to access their homework within Teachworks 

If you’ve enabled user accounts for your students, they’ll be able to log in, access, and readily view their mathematics homework with ease. They can access their notes in the following ways: 

  • Profile : students can select “Profile” and choose the lesson under “Recent Lessons”.
  • Lesson History: students can select “Calendar” then “Lesson History” and select a lesson.

Enabling the LaTeX Lesson Notes Add-on 

Getting started with the LaTeX Add-on in Teachworks is easy! To enable the feature, select Account & Settings > Integrations & Add-ons. On the Integration & Add-ons page, scroll down to the “LaTeX Lesson Notes” feature and select “Enable”. Once that step is done, there’s no other configuration needed to start formatting equations! 

Using the LaTeX Lesson Notes Add-on 

When the feature is enabled, you can start using it within a lesson’s internal or shared notes fields. To access these note fields, you can select “Complete” on the lesson pop-up within the calendar. 

Using the characters found on your keyboard, you’re able to construct an equation in plain text that once converted, displays it perfectly formatted and easy to read. For symbol options, check out this math equation cheat sheet ! 

There are a couple of options for displaying your equation within the lesson notes. The first method is to display it within its own block, using the dollar sign characters to wrap the equation like this: “$$your equation$$”. This means it will show on a completely different line than the other text you have within the note. 

The other option is formatting it to display on the same line as the other text by surrounding the equation with backslashes & brackets shown like this: “\(your equation\)”. For example, the Pythagorean theorem would be displayed in the following ways within Teachworks:  

showing the Pythagorean theorem displayed both inline and within its own block

Viewing Lesson Notes

Once notes have been added, there are multiple ways to review them including through the Lesson Summaries Report, Lesson History by Student, through the Main Calendar, and in student’s profiles. Take a look here to learn more about viewing lesson notes!  

The LaTeX Lesson Note Add-on included in Teachworks can help tutors ensure they’re displaying correctly formatted math equations, and allow students to access them with their own user account.

Students learn and grasp mathematical concepts more effectively with fewer misunderstandings or formatting errors to hold them back. To try this feature for yourself, sign up for a free trial or read about it in our Knowledge Base .  

Comments are closed.

Overleaf Homework Template

This is a LaTeX class aimed towards formatting homework.

For more and documentation see: https://github.com/simurgh9/hw

Overleaf Homework Template

Have you checked our knowledge base ?

Message sent! Our team will review it and reply by email.

IMAGES

  1. Doing Your Homework in LaTeX

    doing math homework in latex

  2. Exercises

    doing math homework in latex

  3. Math Homework Latex Template

    doing math homework in latex

  4. Latex Math Homework Template

    doing math homework in latex

  5. Writing Math Equations in Latex [Latex Tutorial]

    doing math homework in latex

  6. Latex Homework Template

    doing math homework in latex

VIDEO

  1. How to Set Up and Use LaTeX For Writing Homework/Math/Science

  2. [LATEX] UEC Add Math II Past Year Questions

  3. Amssymb and Amsmath en LaTex: Escribiendo en modo matemático

  4. Beginner's Summary of LaTeX

  5. Math 696

  6. Learn LaTeX 021

COMMENTS

  1. Doing Your Homework in LaTeX

    Doing Your Homework in LaTeX. It is a common occurrence for other students to comment on my homework whenever I turn it in for one of my classes. The complete LaTeX file (and the pdf output) can be found in my repository, latex-homework-template. View on GitHub. Below are a few screenshots of problems that I've done in the past: Cover page ...

  2. Using LaTeX for Math

    We have seen that $ is used to surround math code. The backslash character, \, is used for LaTeX commands, and braces, { and } , are used to enclose the parameters to which a command applies. For example, in \sqrt{b^2-4ac}, the command is \sqrt , the parameter is b^2-4ac, and the typeset result is b 2 − 4 a c.

  3. Should I keep using LaTeX to do my math homework?

    4. My probability professor suggested us to try to use LaTeX for the homework. I have successfully wrote my first LaTeX project (5 pages). However, no one except me used LaTeX in that course. I spent 1 hour to do the homework on paper but 5 hours to convert it into LaTeX document (to debug, check math symbols).

  4. How to TeX your homework

    The TeX template used in the video is included at the bottom of this post. You can paste this into a .tex file locally, or into Overleaf. If you're just starting out, I recommend using Overleaf as your TeX editor. You can use Detexify to hand-draw a symbol to find the LaTeX command for it. There is also a nice WikiBook on LaTeXing mathematics.

  5. Simple Math Homework Template

    LaTeX Project Public License 1.3c. Abstract. I had to relearn LaTeX to turn in my real analysis homework last night, so I made it into a template in case others are in the same situation. Tags. Homework Assignment Math.

  6. Writing Math Homework in LaTeX

    Need easily formatted and good looking math homework? In this video I demonstrate how I write my homework in LaTeX.LaTeX is a text setting language which all...

  7. Class file for Homework/Assignments

    This file is used by inserting \documentclass{jhwhw} at the beginning of a document. The standard formatting for a problem looks like this: <<statements of problem>>. <<solution>>. It creates a new page for every problem. Also, if a problem has multiple "parts" the formatting might look like this. \begin{enumerate}

  8. teaching

    Only once I've tried to typeset math homework using LaTeX and it was a pain. It was much quicker to write up the answers on paper than to do context switching between typing up LaTeX, thinking & waiting/viewing the results. One way would be to have an interactive web2.0 website to submit LaTeX typeset answer with automatic rendering.

  9. Example math homework (with solutions)

    An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

  10. Mathematical expressions

    This article shows the most basic commands needed to get started with writing maths using LaTeX. Writing basic equations in LaTeX is straightforward, for example: proved to be invalid for other exponents. \[ x^n + y^n = z^n \] \end{ document } Open this example in Overleaf. As you see, the way the equations are displayed depends on the ...

  11. How to LaTeX (with math homework template)

    You can find the template at https://blogs.gwu.edu/robertwon/2021/07/18/how-to-tex-your-homework/

  12. Mastering LaTeX: A Comprehensive Guide to Using LaTeX for Math

    Introduction. LaTeX is a typesetting system widely used in the scientific and academic community for the production of high-quality documents, especially in mathematics. In this comprehensive guide, we will explore the various aspects of using LaTeX for math, from its history and benefits to best practices and common techniques. History.

  13. How to write your homework using LaTeX

    Get the (free) Homework Template https://www.overleaf.com/read/pycnqvvptsvf#94a8a3. This template is on Overleaf, my thanks to Overleaf for sponsoring toda...

  14. LaTeX math and equations

    LaTeX is capable of displaying any mathematical notation. It's possible to typeset integrals, fractions and more. Every command has a specific syntax to use. I will demonstrate some of the most common LaTeX math features: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} f(x) &= x^2\\.

  15. LaTeX Resources

    as a starting point for your homework assignments typed in LaTeX. Hint: Look at this example and its LaTeX source code. Various reference sources . LaTeX reference sheet by Dave Richeson (2 pages) Math 290 LaTeX reference sheet (2 pages) LaTeX reference sheet by Winston Change (2 pages) Darrin Doud's Short Introduction to LaTeX

  16. LaTeX/Mathematics

    Fortunately, there's a tool that can greatly simplify the search for the command for a specific symbol. Look for "Detexify" in the external links section below. Another option would be to look in "The Comprehensive LaTeX Symbol List" in the external links section below.. Greek letters [edit | edit source]. Greek letters are commonly used in mathematics, and they are very easy to type in math mode.

  17. How do I create a simple page of homework in LaTeX?

    5. Here's one possibility: The first page of the resulting document: I defined some commands \idnumber and \classname for the ID number and the class name; the \makeheader command typesets the information for these two commands and \author, \title with the desired formatting.

  18. Improve your Students' Math Experience with LaTeX Lesson Notes

    When tutoring mathematics, LaTeX can be a very useful tool to help students grasp the concepts correctly. Below are two of the main benefits of the LaTeX Lesson Notes Add-on. Ensures the correct formatting of math equations When compiling Lesson Notes, you can add in the LaTeX script to ensure equations are formatted properly.

  19. Example of math homework exercises

    License. Other (as stated in the work) Abstract. Sample LaTeX document of math homework, created by Robert Hanson. Source: Robert Hanson webpage. This template was originally published on ShareLaTeX and subsequently moved to Overleaf in October 2019. Tags. Homework Assignment. Find More Examples.

  20. formatting

    3. I've been using this homework template I found online that is pretty light. I am very new to using LaTeX, and although I find writing basic mathematical expressions easy, some of the cooler more complex LaTeX stuff seems way above me. The homework template I found has this in it: \newcounter{prob} \newenvironment{problem}[1]

  21. Math Homework Can End Up Doing More Harm Than Good, Study Shows

    Giving pupils math homework can sometimes do more harm than good, according to a new study - particularly when the tasks involved in the work are too complex for kids to complete even with the help of their parents. The researchers, from the University of South Australia and St Francis Xavier University in Canada, interviewed eight Canadian ...

  22. Mathematics homework template

    An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.

  23. Templates

    How to use this template: 1) Change the header and the footer (Layout -> headerfooter.tex) 2) Change the title page (Layout -> titlepage.tex) 3) Write sections by going to the Sections folder and duplicating 1_Section_whatever.tex and rename. 4) Add sections to the assignment by going to main.tex and linking the files Easy peasy.

  24. Overleaf Homework Template

    An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.