Search This Blog

Monday, October 22, 2012

Drawing Horizontal Lines in LaTeX

Drawing Horizontal Lines in LaTeX



Lines can be drawin in LaTeX using the \line function. This takes an x-slope, y-slope and length like so:
\line(x-slope,y-slope){length}
To draw a horizontal line (or horizontal rule), set the x-slope to 1 and the y-slope to zero.
Depending on the margins which have been set, a length of 450 will draw a line which is the width of the page (minus the margins).
If you’re looking for a clean line to divide the page, try the following:
\begin{center}
\line(1,0){250}
\end{center}

LaTeX: Changing the Font Size

LaTeX: Changing the Font Size

Latex provides 10 different font sizes. To change the size of a font use a new font size parameter. The different font sizes are listed below.
  • Font Sizes

    1. \tiny
    2. \scriptsize
    3. \footnotesize
    4. \small
    5. \normalsize
    6. \large
    7. \Large
    8. \LARGE
    9. \huge
    10. \Huge
All of these fonts are listed from smallest to largest. To change the size of the font use a '\' followed by one of the above font sizes before the TEXT you want to change. For example: \LARGE {This is an example of the LARGE font size} will produce:

This is an example of the LARGE font size

LaTeX Line and Page Breaking

LaTeX Line and Page Breaking

The first thing LaTeX does when processing ordinary text is to translate your input file into a string of glyphs and spaces. To produce a printed document, this string must be broken into lines, and these lines must be broken into pages. In some environments, you do the line breaking yourself with the \\ command, but LaTeX usually does it for you. The available commands are
  • \\ start a new paragraph.
  • \\* start a new line but not a new paragraph.
  • \- OK to hyphenate a word here.
  • \cleardoublepage flush all material and start a new page, start new odd numbered page.
  • \clearpage plush all material and start a new page.
  • \hyphenation enter a sequence pf exceptional hyphenations.
  • \linebreak allow to break the line here.
  • \newline request a new line.
  • \newpage request a new page.
  • \nolinebreak no line break should happen here.
  • \nopagebreak no page break should happen here.
  • \pagebreak encourage page break.

\\

 \\[*][extra-space]
The \\ command tells LaTeX to start a new line. It has an optional argument, extra-space, that specifies how much extra vertical space is to be inserted before the next line. This can be a negative amount. The \\* command is the same as the ordinary \\ command except that it tells LaTeX not to start a new page after the line.

\-

The \- command tells LaTeX that it may hyphenate the word at that point. LaTeX is very good at hyphenating, and it will usually find all correct hyphenation points. The \- command is used for the exceptional cases, as e.g.
 man\-u\-script

\cleardoublepage

The \cleardoublepage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed. In a two-sided printing style, it also makes the next page a right-hand (odd-numbered) page, producing a blank page if necessary.

\clearpage

The \clearpage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed.

\hyphenation

 \hyphenation{words}
The \hyphenation command declares allowed hyphenation points, where words is a list of words, separated by spaces, in which each hyphenation point is indicated by a - character, e.g.
  \hyphenation{man-u-script man-u-stripts ap-pen-dix}

\linebreak

 \linebreak[number]
The \linebreak command tells LaTeX to break the current line at the point of the command. With the optional argument, number, you can convert the \linebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is. The \linebreak command causes LaTeX to stretch the line so it extends to the right margin.

\newline

The \newline command breaks the line right where it is. The \newline command can be used only in paragraph mode.

\newpage

The \newpage command ends the current page.

\nolinebreak

 \nolinebreak[number]
The \nolinebreak command prevents LaTeX from breaking the current line at the point of the command. With the optional argument, number, you can convert the \nolinebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.

\nopagebreak

 \nopagebreak[number]
The \nopagebreak command prevents LaTeX form breaking the current page at the point of the command. With the optional argument, number, you can convert the \nopagebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.

\pagebreak

 \pagebreak[number]
The \pagebreak command tells LaTeX to break the current page at the point of the command. With the optional argument, number, you can convert the \pagebreak command from a demand to a request. The number must be a number from 0 to 4. The higher the number, the more insistent the request is.

Latex Pagebreaks

Latex Pagebreaks

Besides the tricks talked about in the latex manual about pagebreaks and linebreaks, the following can be useful. A useful TeX command that can be used in LaTeX but is not mentioned in the LaTeX manual is \looseness.
\looseness+1 This is the start of a paragraph ....
tells latex/tex that is the paragraph can be made to take up one more line let it do so. This is useful for filling up an underfull page or forcing a line on to the next page (in cases where a singleton line already exists on the next page and looks bad).
\looseness-1 This is the start of a paragraph ....
Does the opposite. Latex/Tex will try to make the paragraph take up one less line. You can sometimes go back several pages and increase or decrease several paragraphs by one line to ensure a page looks nice.

General rules

The TeXbook is the major source for information on the pagebreaking algorithm unfortunately the algorithm is fairly complicated. In general page breaking is done by balancing the need to avoid widows and orphans, avoiding overfull pages, and avoiding underfull pages. It can do this by manipulating the glue (elastic space that can be found around figures, section heads, etc) and choosing where to break paragraphs. The tools the user can use for affecting pagebreaking are
\pagebreak[]
use to start a new page at the end of the current line. Without arguments if forces a page break. With arguments of 0,1,2,3, or 4 it suggests that this is a good place to break. 4 being equivalent to no argument and forcing the break. No extra space is put at the end of the page.
\nopagebreak
similar to \pagebreak except it prevents a pagebreak at the end of the current line. I rarely use it.
\samepage
pretty much as the latex manual says. I rarely use it.
\newpage
forces a break at the point and puts in space as needed at the end of the page.
\clearpage
similar to \newpage but figures are also printed
\cleardoublepage
similar to \clearpage but will force another page if needed so the next page with print is odd numbered.
Underfull \hboxes are the most common error for pages that don't fit exactly. Unless they look bad many people ignore them. You can try putting in some more elastic space. I confess I tend to use the tex commands for stretchable space (\vskip and \hskip) instead of the latex commands. The format is
\vskip 10pt plus 2pt minus 3pt
which says 10pts is best but tex/latex can go as high as 12pts or as low as 7pts without complaint. The default \parskip in 10pt article style is 0pt plus 1pt. The little stretch stops many underfull hbox errors. Don't forget the option of floating large diagrams by using the figure or table environment. If you don't use \caption argument within the figure, it won't be labelled which can be useful.

IIT Lingo

IIT Lingo
Agrawals A correspondence based coaching program for JEE. Now defunct
Apping  Applying to American Universities
Arbit Senseless
A Star  'A' Grade of the topper of the course , informally called 
Batka, Matka, Phudda Student of B.Tech, M.Tech and Ph.D. respectively
Bong Person from Bengal, Bengali. Often derogatory
BTP Acronym for B.Tech Project. A degree requirement
Bumps Curious ritual in which person is caught by arms and legs and dashed to the ground repeatedly to the accompaniment of kicks. It is spposed to show affection
Com C Computer Centre 
Convo The Convocation Hall 
Darshan Allowing someone to see you. Normally used in the context of holy men or shrines
Daru Liquor
Dassi Grade Point Average of 10 on 10. Usually also the person managing it. Has recently become extinct after the new grading policy
Dep Department
Dhabha Roadside eating joint
Dhakkan Literally meaning cap or lid, it is often used in a derogatory sense. Also used to designate last Hawa (see below) holder of a dep person
Enthu Enthusiasm
Fakka 'F' Grade
Fight Marna To try very hard 
Fundas/Funde Fundamentals. Often meaning motivation
Futcha First yearite. Freshman
Futchi Freshwoman
Hawa Stands for AIR, All India Rank in JEE
Hazaar Thousand, usually used for any large quantity
Insti Short for Institute meaning Academic area of IIT Delhi
IIM Indian Institute of Management. Four are extant A (Ahmedabad), B (Bangalore), C (Calcutta) and L (Lucknow)
IIT  Hammer A broken iron leg of the bed used as hammer, extinct now with advent of new design of bed
IMS Institute of Management Studies. A correspondence based coaching program for CAT
ISC  Indoor Sports Club
JEE The Joint Entrance Exam for entry to the 6 Indian Institutes of Technology nationwide
Kailash Name of the only girls hostel at IIT Delhi
Kailashite Resident of Kailash hostel
Kalu Dark person
Kara Karakoram hostel. One of the 5 male undergrad hostels of IIT Delhi
Karaite Resident of Karakoram Hostel
Khuphiya Cryptic, usually associated with secretive actions
Khiladi  Player, not exactly Sports
KLS The hostel area canteen
LIC Lady Irwin College. A girls college in Delhi
LT  Lecture Theatre
Majors Semester-end exams at IIT Delhi
Minors Mid-semester exams at IIT Delhi. Held twice a semester
ManPro Course in Manufacturing Processes. 4 credits for menial work
Magai Study
Maggu One who studies tooooo much
Nachun? Interrogative word, meaning should I dance? rumored to be a witty reply to some boring information
Nehli  Grade Point Average greater than 9 but less than 10. (On a scale of 10)
P K Palta Fell over drunk
Phatta A joke, or a lie
Photo Soc The Photgraphy Society of IITD 
Punjabi Person belonging to Punjab in North India
Poltu Contraction of politics, signifying campus politics. Never ideological in nature. Also a person who indulges in the same
Puppipana Action associated with a puppy (See below)
Puppy Quality of being out of line with a generally perceived set of norms. Not always negative. Also a person permanently possessing or temporarily acquiring such a quality
Undi Common abbreviation for underwear
Sasi Hostel gate day time eating joint
Schol Financial aid from American Universities
Sexy Anything good will be called as sexy 
Shady Used in various senses depicting dubiousness
Sick Bay IITD Hospital
Surd Shop The groccery shop of Bitto Sardar (unfortunately closed now)
Surdi Affectionate(?) term for a Punjabi(See above)
Sutta Cigarette
Taklu Baldy
Ulti The abbreviation of  Ultimate
Vela Lazy, person with no work. 
Zook A zero score in exam