1. Spilled the Beans
Join Date
Jan 2007
Beans
15
Distro
Ubuntu 6.10 Edgy

## Efficiently Using LaTeX

Recently, I read an article about a class at Harvard called Math 55 where they teach four years of undergraduate math in a year-long course. One of the interesting things I noticed in the article is that the students prefer to type up their homework using LaTeX. That idea perked my interest, so I installed TeTeX and Kile from Synaptic Package Manager (in Ubuntu Dapper). Once I learned LaTeX, I typed up the detailed solution to two partial differential equations and was quite impressed by LaTeX's capabilities. However, there was one caveat: it took forever to do.

I understand that with time and experience, I can become much more efficient using LaTeX, but even then it would seem much more slower than just writing it out by hand. I can justify some loss of efficiency because of the very professional look of the homework and the experience I would gain with LaTeX, but there's still a gap to be bridged.

First, does someone know how to do a line break in 'displaymath'? I couldn't figure it out, so I just put the equations in an 'equation*' and start a new 'equation*' when I want a new line. I did try an 'eqnarray*', but the formatting it gave me was very odd (I often put several steps of the same solution on one line).

Also, I would like to create some keyboard shortcuts for things I frequently type: Greek characters such as \lambda, the integral symbol \int, the curly d in a partial derivative \partial, etc. If I had a library of these shortcuts, over time I could memorize them and type everything up much faster.

Also, this is kind of unrelated, but does someone know how to widen the margins? Page layout is very complicated, and every try to get 1" margins all around has failed. I try to keep the margins small so I can use paper efficiently.

2. A Carafe of Ubuntu
Join Date
Apr 2006
Beans
Hidden!

## Re: Efficiently Using LaTeX

I don't think I can help with the equation problem I'm afraid. Have you read the not short guide to latex?

To get kile to complete those greek letters, go to Settings > Configure Kile > Kile > Complete > Tex/Latex (tab) > Add (button)

select the file latex-mathsymbols.cwl

I use this kind of thing to sort out my page margins:
Code:
% Page geometry
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{23cm}
\setlength{\topmargin}{-0.5cm}
\setlength{\oddsidemargin}{1.25cm}
\textfloatsep=0.5cm

3. Spilled the Beans
Join Date
Jan 2007
Beans
15
Distro
Ubuntu 6.10 Edgy

## Re: Efficiently Using LaTeX

Thanks for the help. I did read the first 3 chapters as well as the section in Chapter 6 on page layout. The problem with 'displaymath' is that it seems to resist line breaks. Your idea works for the layout, but I actually found a really good solution on the web before I saw your post.
Code:
\usepackage{fullpage}
More detailed information (as well as the trick I just showed) can be found here

Adding in completion for the math symbols is another step forward. I still would like if there's a way to do keyboard shortcuts to paste custom phrases such as "\begin{equation*}\end{equation*}" or "\frac{\partial y}{\partial x}".

4. A Carafe of Ubuntu
Join Date
Apr 2006
Beans
Hidden!

## Re: Efficiently Using LaTeX

Well it's not entirely convenient, but you can use abbreviations for those things if you want.

Make a file at /usr/share/apps/kile/complete/abbreviation/myAbbrevs.cwl with
Code:
# My abbreviations file
# 8.1.2007
estar=\begin{equation*}\end{equation*}
pderiv=\frac{\partial y}{\partial x}
Then go to the abbreviations tab in the same settings page as before, and add that file. Then in your latex document, you begin typing estar and type ctrl+alt+spacebar, and it offers the expanded abbreviation. Alternatively, you could add
Code:
\begin{equation*}
\frac{\partial y}{\partial x}
to /usr/share/apps/kile/complete/tex/latex-document.cwl and tick the box at

Settings > Latex > Environments > Automatically complete environments

Restart Kile, and begin{equation*} will be a completion option, and the end{equation*} will be automatically inserted.

5. ## Re: Efficiently Using LaTeX

Originally Posted by commike37
First, does someone know how to do a line break in 'displaymath'?
use
Code:
\\
to break line inside... or use like below...
otherway

I'm pretty sure I have all the margin issues taken care of. I thought that none of this was working at first, but then I realized I had to run 'texconfig' from the terminal and set the default paper to letter. Apparently, TeTeX would create an A4 page even if I had letterpaper specified in the document class. That was what was making the commands not work as I had hoped.

7. ## Re: Efficiently Using LaTeX

Have a look at \begin{eqnarray}. This allows line breaks (with \\) and also allows centering with respect to e.g. an equal sign. There is a way to have only the last line numbered. I don't know if there is an equivalent displaymath command (matharray???). Example:

Code:
\begin{eqnarray}\label{eq:superH}
H & = & \sum_{i}\frac{\mn{p}_i^{\phantom{i}2}}{2m_e} + \sum_{I}\frac{\mn{P}_I^{\phantom{i}2}}{2M_I} -  \frac{1}{4\pi\epsilon _0} \sum_{i,J}\frac{z_Je^2}{|r_i-R_J|} + \nonumber\\
& + & \frac{1}{2} \frac{1}{4\pi\epsilon _0}  \sum_{i\neq j}\frac{e^2}{|r_i-r_j|} + \frac{1}{2}\frac{1}{4\pi\epsilon _0}  \sum_{I\neq J}\frac{z_Iz_Je^2}{|R_I-R_J|}\quad .
\end{eqnarray}
Try it to see if you like it. Please note that I might have used an abbreviation here (taken from my halfway PhD work, with quite some abbreviations).

8. First Cup of Ubuntu
Join Date
Apr 2005
Beans
7

## Re: Efficiently Using LaTeX

Originally Posted by Miguel
Have a look at \begin{eqnarray}. This allows line breaks (with \\) and also allows centering with respect to e.g. an equal sign. There is a way to have only the

<snip>

hth

9. ## Re: Efficiently Using LaTeX

If you want to be a lazy slob like me use lyx instead of raw latex. I wrote my doctoral thesis with latex (mathematical physics) and it was hard going. Since then I forgot all the latex because I was using Scientific Word. When I started on linux again I found lyx a great way to spin up again on latex and a great memory saver. You can export to latex once you are done with lyx and then fine tune this using latex style files etc.

10. Dipped in Ubuntu
Join Date
Aug 2005
Location
The Local Group
Beans
631

## Re: Efficiently Using LaTeX

Originally Posted by commike37
First, does someone know how to do a line break in 'displaymath'? I couldn't figure it out, so I just put the equations in an 'equation*' and start a new 'equation*' when I want a new line. I did try an 'eqnarray*', but the formatting it gave me was very odd (I often put several steps of the same solution on one line).
Have a look at this document: http://www.ctan.org/tex-archive/macr...th/amsldoc.pdf. I'm a fan of environments align and align*, which make it easy to typeset a sequence of equations or inequalities with each step on a different line. If you don't care about alignment, there are gather and gather*.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•