Latex

Start code for tikz picture

   \usepackage{tikz}
   \usetikzlibrary{positioning} 
   \usetikzlibrary{arrows,shapes} 
   ...
    \begin{tikzpicture}[node distance=1.5cm,scale=0.70,transform shape,font=\sffamily] 
	\begin{pgfscope} 
	    \tikzstyle{every node}=[draw,rectangle, rounded corners, minimum height=2.5em] 
	    \node (1) at (0,0) {Master}; 
	    \node (2) [left=of 1] {Slave}; 
	    \node (3) [right=of 1] {Slave}; 
	    \node (4) [above=1.5cm of 1] {Slave}; 
	\end{pgfscope} 
	\begin{scope}[-latex] 
	    \draw (2) -- (1) node[midway,below] {x}; 
	    \draw (3) -- (1) node[midway,below] {x}; 
	    \draw (4) -- (1) node[midway,left] {x}; 
	\end{scope} 
    \end{tikzpicture} 

hints for listings

Use

 ,moredelim=**[is][\bfseries]{|}{|}

inside of options setting and you can define where you get bold code parts. For Example

 printf(...)
 |this is new|
 prinft(asdf)

would print the middle line in bold font.

page margins do not fit

 \begin{center}
 \vspace*{-2cm}
 CD LABEL
 \vspace*{6cm}
 CD TITLE
 \end{center}

this code sketch was used to print A4 pages for a cd label.

Serifen oder Serifenlos (Groteske/Sans Serif)?

Compare code samples with basicstyle=\small and basicstyle=\small\sffamily.

new commands

Witout parameter

 \newcommand{\xvec}{\mbox{$x_1,\ldots,x_n$}}

With on parameter

 \newcommand{\avec}[1]{\mbox{$#1_1,\ldots,#1_n$}}

With two parameters

 \newcommand{\anvec}[2]{\mbox{$#1_1,\ldots,#1_#2$}

With optional parameter

 \newcommand{\ovec}[2][n]{\mbox{$#2_1,\ldots,#2_#1$}}
if called as \ovec[m]{x} it will take m as parameter #2 otherwise it takes n.

If there is a problem that after the insertion of the new command the text is added with no space character between the following text you can enforce a space character after the command with

 \xvec{}

or

 \xvec\ 
where a space is following behind the second backslash.

ensure math mode

 \renewcommand{\ovec}[2][n]{\ensuremath{#2_1,\ldots,#2_#1}}

new enviroments

 \newenviroment{sitqoute}{\begin{quote}\small\itshape}{\end{quote}}

install custom .cls or .sty files

The easiest way is to copy new files under your home directory. For example if you download a new package named asdf.zip with contained .sty etc files.

 mkdir ~/texmf/tex/latex/asdf
 cp asdf.sty ... ~/texmf/tex/latex/asdf

Thats all.

or I found another way if the above does not work:

special characters

short reference for latex

 \documentclass[a5paper] {article}
 \usepackage{ngerman}
 \usepackage[latin1]{inputenc}

 \begin{document}
 your text
 \end{document}

default classes

\documentclass{class} \documentclass[opt1,opt2,...]{class}

document structure

 \part
 \chapter
 \section
 \subsection
 \subsubsection
 \paragraph
 \subparagraph
 \appendix

Title of document

 \documentclass[titlepage,a4paper]{article}
 \begin{document}
 \title{this is the first line
and this the second line
of the title } \author{ Foo Bar \and{} Another Foobar } \date{March 2008} \maketitle

Table of contents

 \tableofcontents
 \newpage

Preface

 \chapter*{Preface}
 \addcontentsline{Preface}
Preface will be not numbered but add into table of contents

Appendix

 \appendix
 \chapter{blabla}
 \chapter{further blabla}

Summary after title

With 'abstract' and after \maketitle

changeable section names

 \abstractname
 \appendixname
 \bibname
 \chaptername
 \contentsname
 \indexname
 \listfigurename
 \listtablename
 \partname
 \refname

change of the numbering of pages

 \pagenumbering

top- and bottomline

 \pagestyle

multiple columns

 \begin{multicols}{2}
    text in 2 columns
 \end {multicols}

Text structuring

Lists

 \begin{itemize}
 \item asdf
 \item qwer
 \end{itemize}
 \begin{enumerate}
 \item asdf
 \item qwer
 \end{itemize}
 \begin{description}
 \item asdf
 \item qwer
 \end{itemize}

unformated text

 \verb/\LatTeX{}/
 Bei der URL \url|http://www.asdf.org| gibt es was feines.

To print a whole file as unformated text use

 \verbatiminput{filename}

Quotation

 \begin{quote}
    Der Mensch kann tun was er will, aber er kann nicht wollen was er will.
 \end{quote}

font sizes

 \tiny
 \scriptsize
 \footnotesize
 \small
 \normalsize
 \large
 \Large
 \LARGE
 \huge
 \Huge

word separation

 Sei\-ten\-um\-bruch

Tables

 \begin{tabular}{lcr}
     left'\\'
     center'\\'
     right'\\'
 \end{tabular}

 \begin{tabular}{|l|p{7cm}|}
 \hline
    alsdjflkasjdlfkjasldkjf

 \hline
   alsdjflkajsdlfkj
 \end{tabular}

figures and tabulars (Abbildungen und Tafeln)

 \begin{figure}[position]
  % content
  \caption{subtext for figure}
 \end{figure}


 \caption[shorttitle]{text under figure}

To change the automatic text which appears e.g. Fig. 23.11

 \renewcommand{\figurename}{Bild}

The figure* and tabular* commands use the whole space if the text is a two column one.

To position the object use:

 \begin{table}[pos] 

where pos is

 h here
 t top
 b bottom
 p page

feet notes

 \footnote{see paper xy on http://www.org}

end notes

appear at the end of the chapter and will be created with

 \usepackage{endnotes}

 \endnotes
 ajsdlfkjdsfalskdjflkasdjf
 end of chapter
 \theendnotes

links and references

 \label{imagewhereyoucanseesomething}
 \label{equationforcomputation}

but no numeration at all to have the ability of movements of the objects.

 look at the fine picture \ref{imagewhereyoucanseesomething}. There you can see ...

 \pageref{asdf}

 \usepackage{titleref}
 \titleref{asdf}

Better references with package 'varioref':

 \usepackage[german]{varioref}
 Das Bild zeigt \vref{fig:lökj} zeigt ...
creates different text in dependence of the distance of the reference to its destination.

References to external documents with package 'xr'.

 \externaldocument[mypapername:]{mypaper.tex}
 asdf
 Wie wir in Abschnitt \ref{mypapername:asdf} zeigen ...

Graphic