0% found this document useful (0 votes)
9 views2 pages

Mechanics

Uploaded by

saifamu2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Mechanics

Uploaded by

saifamu2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

 Fixed length spaces

A box in TeX is characterized by three lengths:


To insert a fixed-length space, use:
 depth
 height  \hspace{length}
 width  \vspace{length}
\hspace stands for horizontal space, \vspace for vertical space.
 Length manipulation
 Fill
You can change the values of the variables defining the page layout with two commands. With this one you can set a new value for an
existing length variable: \hfill will produce empty space.
\dotfill will produce dots.
\setlength{\mylength}{length} \hrulefill will produce a rule.

Common length macros are:


---------------------------------------------------------------------COUNTERS----------------------------------------------------------------------
\baselineskip Counters are an essential part of LaTeX: they allow you to control the numbering mechanism of everything (sections, lists, captions, etc.).
The normal vertical distance between lines in a paragraph.
\baselinestretch In LaTeX it is fairly easy to create new counters and even counters that reset automatically when another counter is increased (think
A factor multiplying \baselineskip. Has to be set with \renewcommand{\baselinestretch}{factor} subsection in a section for example). With the command
\columnsep
The distance between columns. \newcounter{NameOfTheNewCounter}
\columnwidth
The width of the column. you create a new counter that is automatically set to zero. If you want the counter to be reset to zero every time another counter is
\evensidemargin increased, use:
The margin for 'even' pages (think of a printed booklet).
\linewidth \newcounter{NameOfTheNewCounter}[NameOfTheOtherCounter]
The width of a line in the local environment.
\oddsidemargin For example, if you want to enumerate the equations in each chapter independently, you can create something like an "equationschapter"
The margin for 'odd' pages (think of a printed booklet).
counter that will be automatically reset at the begin of each section.
\paperwidth
The width of the page.
\newcounter{equationschapter}[section]
\paperheight
The height of the page.
\section{First Section}
\parindent
I present one equation:
The normal paragraph indentation.
\parskip \stepcounter{equationschapter} $a=b+c$ (Eq. \arabic{section}.\arabic{equationschapter})
The extra vertical space between paragraphs.
\tabcolsep \section{Second Section}
The default separation between columns in a tabular environment. I present more equations:
\textheight
The height of text on the page. \stepcounter{equationschapter} $a=c+d$ (Eq. \arabic{section}.\arabic{equationschapter})
\textwidth
The width of the text on the page. \stepcounter{equationschapter} $d=e$ (Eq. \arabic{section}.\arabic{equationschapter})
\topmargin
The size of the top margin.
\unitlength  Custom Sectioning
Units of length in picture environment.
Here is an example for recreating something similar to a section and subsection counter that already exist in LaTeX:

\newcounter{mysection}
\newcounter{mysubsection}[mysection]
\addtocounter{mysection}{2} % set them to some other numbers than 0
\addtocounter{mysubsection}{10} % same
%
\arabic{mysection}.\arabic{mysubsection}
Blah blah

\stepcounter{mysection}
\arabic{mysection}.\arabic{mysubsection}
Blah blah

\stepcounter{mysubsection}
\arabic{mysection}.\arabic{mysubsection}
Blah blah

\addtocounter{mysubsection}{25}
\arabic{mysection}.\arabic{mysubsection}
Blah blah and more blah blah

----------------------------------------------------------------BOXES---------------------------------------------------------------------------------------------------------
\begin{minipage}[pos][height][contentpos]{width}
text
\end{minipage}

 Frame Box

\fbox{Answer all the questions}


or
\framebox[0.5\textwidth]{Answer all the questions}

Adjustments
\setlength{\fboxsep}{9pt}
\setlength{\fboxrule}{2pt}
\framebox{Answer all the questions}

You might also like