Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Efficiently Using LaTeX

Hybrid View

  1. #1
    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. #2
    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
    KDE/Akonadi developer

  3. #3
    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
    http://web.mit.edu/answers/latex/formatting/latex_margins.html

    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. #4
    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.
    KDE/Akonadi developer

  5. #5
    Join Date
    Nov 2012
    Beans
    1

    Re: Efficiently Using LaTeX

    Dear Stievire,

    this is an inquiry about defining abbreviations in kile. According to the documentation it should be possible to insert newline by %n and the curser by %C. However, expanding my abbreviation just inserts the text as it is, i.e. %n introduces a comment rather than creating a newline.
    Could you give me a hint? (encoding, kile version, ...)

    Best regards
    Jan Mohring

  6. #6
    Join Date
    Oct 2006
    Location
    Ayrshire.
    Beans
    54,861
    Distro
    Ubuntu Development Release

    Re: Efficiently Using LaTeX

    Old thread back to sleep.

    Please start a new thread if required.

  7. #7
    Join Date
    Nov 2005
    Location
    127.0.0.1
    Beans
    354
    Distro
    Ubuntu Development Release

    Re: Efficiently Using LaTeX

    Quote Originally Posted by commike37 View Post
    First, does someone know how to do a line break in 'displaymath'?
    use
    Code:
    \\
    to break line inside... or use like below...
    otherway
    enclose the expression within $ signs after including amsmath package
    Code:
    \include{amsmath}
    $ a^2 + 2*a*b + b^2 $. \\
    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.
    not exaclty and answer. keyboard shortcuts ==> editor stuff. but in the source code if you want to use a command instead of some long-words used repeatedly..for example.."i like ubuntu"
    use \newcommand command
    eg:
    Code:
    \newcommand{\ilu}{I like ubuntu}


    then use the shortcut command inside the source code...

    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.
    include a new package called geometry.
    Code:
    \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
    hope this helps...

    search for lshort.pdf in google and download that very helpful latex guide...its oxygen!
    Last edited by neoflight; January 8th, 2007 at 07:18 PM.

  8. #8
    Join Date
    Dec 2005
    Beans
    Hidden!

    Re: Efficiently Using LaTeX

    Quote Originally Posted by neoflight View Post
    include a new package called geometry.
    Code:
    \usepackage[left=1in,right=1in,top=1in,bottom=1in]{geometry}
    hope this helps...
    I'll definitely try that! Hope it works!

  9. #9
    Join Date
    Jan 2007
    Beans
    15
    Distro
    Ubuntu 6.10 Edgy

    Re: Efficiently Using LaTeX

    New commands and abbreviations both sound like good ideas. I'll try them both.

    However, \\ doesn't work in math mode. Math mode will ignore most spaces and line breaks (I've also tried \newline and \linebreak). The problem with $...$ is that math formulae in text mode are typeset differently. The sample page I made in LaTeX has one formula in both math mode and text mode, and the one in math mode is considerably better.

    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.

  10. #10
    Join Date
    Mar 2005
    Location
    UK
    Beans
    397
    Distro
    Ubuntu 12.04 Precise Pangolin

    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).
    Now on... Thinkpad T400

    Latest news for radeon and/or radeonhd:
    ATI R600g Gains Mip-Map, Face Culling Support, 30th July 2010

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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