longequations.tex
beamerColourAndLogo.tex
algmulticol.tex
algmulticol_lncs.tex
biblatex.tex
beamer-kent-red.tex
tables.tex
beamertikzpicture.tex
algorithm2e.tex
algorithms.tex
if.tex
definitions.tex
figureSpacing.tex
matrices.tex
algorithmic.tex
tikz_examples.tex
misc.tex

longequations.tex

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{multline}
  Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P(O \mid \lambda ) \sum_s \sum_m \sum_t \gamma_m^{(s)} (t) \biggl( n \log(2 \pi ) \\
  + \log \left| C_m^{(s)} \right| + \left( \mathbf{o}_t - \hat{\mu}_m^{(s)} \right) ^T C_m^{(s)-1} \left(\mathbf{o}_t - \hat{\mu}_m^{(s)}\right) \biggr)
\end{multline}

\begin{equation} \label{eq1}
\begin{split}
A & = \frac{\pi r^2}{2} \\
 & = \frac{1}{2} \pi r^2
\end{split}
\end{equation}

\begin{align} 
2x - 5y &=  8 \\ 
3x + 9y &=  -12
\end{align}

\end{document}


beamerColourAndLogo.tex

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{graphicx}

% shows how to change default (blue) colours in the default beamer theme
% found here: http://joerglenhard.wordpress.com/tag/latex/
\definecolor{WaterlooRed}{RGB}{145,11,46}
\setbeamercolor{title}{fg=WaterlooRed}
\setbeamercolor{frametitle}{fg=WaterlooRed}
\setbeamercolor{structure}{fg=WaterlooRed}

% adds logo in the footer
\logo{\includegraphics[scale=.25]{csuow}}

\title[]{Title Text}
\author[Marek Grze\'{s}]{Marek Grze\'{s}}
\institute{\includegraphics[scale=0.25]{uow}}
\date{{\tiny\today}}

\begin{document}

  \begin{frame}
    \titlepage
  \end{frame}

  \begin{frame}
    \frametitle{This is the first slide}
    Content goes here
    \begin{itemize}
      \item Item 1
    \end{itemize}

  \end{frame}

\end{document}

algmulticol.tex

\documentclass{article}
\usepackage[margin=1in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{algorithm}% http://ctan.org/pkg/algorithm
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\usepackage[bf]{caption}% http://ctan.org/pkg/caption; with bf all captions are bold
%\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\lipsum[1]

\medskip

\begin{figure}
 \caption{xxx}
\end{figure}


\noindent\begin{minipage}{.5\textwidth}
\noindent\rule{\textwidth}{0.35mm}\vskip -3mm
\captionof{algorithm}{Euclid’s algorithm algorithm algorithm algorithm }\vskip -3mm
\hrulefill\vskip -2mm
\begin{algorithmic}[1]
  \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
    \State $r\gets a\bmod b$
    \While{$r\not=0$}\Comment{We have the answer if r is 0}
      \State $a\gets b$
      \State $b\gets r$
      \State $r\gets a\bmod b$
    \EndWhile\label{euclidendwhile}
    \State \textbf{return} $b$\Comment{The gcd is b}
  \EndProcedure
\end{algorithmic}
\vskip -3mm
\hrulefill
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
  \centering
  \rule{0.3\textwidth}{50pt}
  \captionof{figure}{This is a figure caption.} \label{myfig1}
  \bigskip
  \rule{0.25\textwidth}{70pt}
  \captionof{figure}{This is another figure.} \label{myfig2}
\end{minipage}

\medskip

On the left is Algorithm~\ref{myalg}. On the right is Figures~\ref{myfig1} and~\ref{myfig2}.

\lipsum[2]

\end{document}

algmulticol_lncs.tex

%\documentclass{article}
\documentclass{llncs}
\usepackage[margin=0.5in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{algorithm}% http://ctan.org/pkg/algorithm
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\usepackage[bf,compatibility=false]{caption}% http://ctan.org/pkg/caption; with bf all captions are bold
%\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
\lipsum[1]

\medskip

\begin{figure}
 \caption{xxx}
\end{figure}

\begin{figure*} % put minipage inside figure to make it float
\centering

\noindent\begin{minipage}{.47\textwidth}
\noindent\rule{\textwidth}{0.35mm}\vskip -3mm
\captionof{algorithm}{Euclid’s algorithm algorithm algorithm algorithm $\alpha$ and $\langle \gamma \rangle$}\label{myalg}\vskip -3mm
\hrulefill\vskip -2mm
\begin{algorithmic}[1]
  \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
    \State $r\gets a\bmod b$
    \While{$r\not=0$}\Comment{We have the answer if r is 0}
      \State $a\gets b$
      \State $b\gets r$
      \State $r\gets a\bmod b$
    \EndWhile\label{euclidendwhile}
    \State \textbf{return} $b$\Comment{The gcd is b}
  \EndProcedure
\end{algorithmic}
\vskip -3mm
\hrulefill
\end{minipage}%
\hspace{0.01\textwidth}
\begin{minipage}[t]{.47\textwidth}
  \centering
  \rule{0.3\textwidth}{50pt}
  \captionof{figure}{This is a figure caption.} \label{myfig1}
  \bigskip
  \rule{0.25\textwidth}{70pt}
  \captionof{figure}{This is another figure.} \label{myfig2}
\end{minipage}

\end{figure*}

\medskip

On the left is Algorithm~\ref{myalg}. On the right is Figures~\ref{myfig1} and~\ref{myfig2}.

\lipsum[2]

\end{document}

biblatex.tex

\documentclass{article}

% abbrv using biblatex

\usepackage[backend=bibtex,style=trad-abbrv,maxcitenames=2]{biblatex}
\bibliography{../../../../latexdocs/mybib.bib}

\begin{document}

\citeauthor{sutton1998}~\cite{sutton1998} some text and \citeauthor{mnih15deepRLAtari}~\cite{mnih15deepRLAtari}

\printbibliography

\end{document}

beamer-kent-red.tex

% unknownkeysallowed
\documentclass[10pt]{beamer}

\usepackage[english,ruled,vlined,linesnumbered]{algorithm2e}

\usepackage{pdfpages}

\usepackage{empheq} % equations in a box and colours

% uncomment this line to have serif fonts in the entire document
% \usefonttheme{serif}
\setbeamertemplate{footline}[frame number]

% shows how to change default (blue) colours in the default beamer theme
% ----- Kent Red colours
\definecolor{KentRed}{RGB}{103, 17, 21}
\definecolor{KentBlue}{rgb}{0.0,0.2196,0.5098}
\setbeamercolor{title}{fg=KentRed}
\setbeamercolor{frametitle}{fg=KentRed}
\setbeamercolor{structure}{fg=KentRed}
\setbeamercolor{alerted text}{fg=KentRed}
\setbeamerfont{alerted text}{series=\bfseries}
\newcommand{\alerttwo}[1]{\textcolor{KentBlue}{#1}}

% --------------- notes -----------------

\usepackage{pgfpages}

%\setbeameroption{hide notes} % Only slides
%\setbeameroption{show only notes} % Only notes
\setbeameroption{show notes} % Both

\setbeamertemplate{note page}{\pagecolor{white}\insertnote}

% --------------- notes -----------------

\title[]{my title}
%\subtitle{CO832---Data Mining and Knowledge Discovery}
\author{Marek Grze\'{s}}
%institute{Where You're From}
%\date{Date of Presentation}

\begin{document}

\begin{frame}
  \titlepage
\end{frame}

% Uncomment these lines for an automatically generated outline.
%\begin{frame}{Outline}
%  \tableofcontents
%\end{frame}

\section{Instance-based Learning and k-NN}

\begin{frame}{Machine Learning Models}\label{SEC:MODELS}

\begin{itemize}\setlength\itemsep{10mm}
 \item Data 
\end{itemize}

\note[item]{}

\end{frame}


\nocite{witten16DMbook4thEd}

% ================================

\section*{References}
\begin{frame}[fragile] % allowframebreaks
\frametitle{References}
{\tiny
\bibliographystyle{apalike}
% \bibliography{../../mybib}
\bibliography{/home/mgrzes/Documents/svndocs/latexdocs/mybib}
}
\end{frame}

\end{document}



tables.tex

\documentclass{article}
\usepackage[landscape]{geometry}% http://ctan.org/pkg/geometry
\usepackage{array}% http://ctan.org/pkg/array
\usepackage{rotating}
\usepackage{makecell}

\begin{document}

% =========== multi-line cells ===========

	\begin{center}
		\begin{tabular}{ | c | c | c |}
			\hline
			\thead{A Head} & \thead{A Second \\ Head} & \thead{A Third \\ Head} \\
			\hline
			Some text &  \makecell[l]{Some really \\ longer text}  & Text text text  \\
			\hline
		\end{tabular}
	\end{center}

% =========== FACTOR approach ===========
{\renewcommand{\arraystretch}{2}%
\begin{tabular}{|l|l|}
  \hline
  column 1 & column 2 \\
  \hline
  I really would like this less & crammed \\
  \hline
\end{tabular}} \quad
% =========== LENGTH approaches ===========
\begin{tabular}{|l|l|}
  \hline
  column 1 & column 2 \\[4ex]
  \hline
  I really would like this less & crammed \\[5pt]
  \hline
\end{tabular} \quad
{\setlength{\extrarowheight}{20pt}%
\begin{tabular}{|l|l|}
  \hline
  column 1 & column 2 \\
  \hline
  I really would like this less & crammed \\
  \hline
\end{tabular}}

% vertical text in table cells

\begin{tabular}{|c|c|}
 \begin{sideways} column 1 \end{sideways} & col 2 \\ \hline
  text, requires rotating package & text2 \\
\end{tabular}

\begin{table}

% text wrapping in table cells

\begin{tabular}{|l|c|}
 
 \hline
 col a & col b \\ \hline

 tensor &  \parbox{12cm}{\vskip 1mm
  \begin{itemize}
   \item Tensors are geometric objects that describe linear relations between vectors, scalars, and other tensors. Elementary examples of such relations include the dot product, the cross product, and linear maps. Vectors and scalars themselves are also tensors. A tensor can be represented as a multi-dimensional array of numerical values. The order (also degree) of a tensor is the dimensionality of the array needed to represent it, or equivalently, the number of indices needed to label a component of that array. For example, a linear map can be represented by a matrix (a 2-dimensional array) and therefore is a 2nd-order tensor. A vector can be represented as a 1-dimensional array and is a 1st-order tensor. Scalars are single numbers and are thus 0th-order tensors. It is very important not to confuse dimensions of the array with dimensions of the underlying vector space.
  \end{itemize}
 } \\ \hline

 inductive reasoning &  \parbox{12cm}{\vskip 1mm
  \begin{itemize}
   \item Inductive reasoning (as opposed to deductive reasoning) is reasoning in which the premises seek to supply strong evidence for (not absolute proof of) the truth of the conclusion. While the conclusion of a deductive argument is supposed to be certain, the truth of the conclusion of an inductive argument is supposed to be probable, based upon the evidence given.
  \end{itemize}
 } \\ \hline

\end{tabular}  

\caption{Text wrapping in table cells.}
\end{table}

% histogram kind of bars in table cells; copied from our IJAR paper

\begin{table}[tbh]
  \setlength{\tabcolsep}{1pt}
  \centering
  {\small
  \begin{tabular}{|r|ccc|ccccc|cccccc|cccc|c|}\hline
 & \multicolumn{3}{c|}{Observations}
 & \multicolumn{5}{c|}{Task}
 & \multicolumn{6}{c|}{Behaviour}
 & \multicolumn{4}{c|}{Ability}
 & \\ \cline{2-19}
 \begin{sideways}Time step, t\end{sideways}
  & \begin{sideways}brush\_wet\end{sideways}
  & \begin{sideways}tap\end{sideways}
  & \begin{sideways}brush\_position\end{sideways}
  & \begin{sideways}brush\_wet\end{sideways}
  & \begin{sideways}brush\_in\_hand\end{sideways}
  & \begin{sideways}brush\_in\_cup\end{sideways}
  & \begin{sideways}brush\_on\_surface\end{sideways}
  & \begin{sideways}tap\_on\end{sideways}
  & \begin{sideways}other\end{sideways}
  & \begin{sideways}nothing\end{sideways}
  & \begin{sideways}alter\_tap\_to\_on\end{sideways}
  & \begin{sideways}take\_brush\_from\_cup\end{sideways}
  & \begin{sideways}wet\_brush\end{sideways}
  & \begin{sideways}take\_brush\_from\_surface\end{sideways}
  & \begin{sideways}Rn\_brush\_in\_cup\end{sideways}
  & \begin{sideways}Rn\_brush\_on\_surface\end{sideways}
  & \begin{sideways}Af\_tap\end{sideways}
  & \begin{sideways}Af\_water\end{sideways}
  & \begin{sideways}\makecell{System Action\\(prompt for ability specified)}\end{sideways}
\\ \hline
 0
 & dry 
 & off 
 & in\_cup 
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.20mm}
 & \rule{3mm}{1.20mm}
 & \rule{3mm}{0.60mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.90mm}
 & \rule{3mm}{1.90mm}
 & \rule{3mm}{1.60mm}
 & \rule{3mm}{1.60mm}
 & Af\_tap 
\\ \hline
 1
 & dry 
 & off 
 & in\_cup 
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.14mm}
 & \rule{3mm}{1.82mm}
 & \rule{3mm}{0.06mm}
 & \rule{3mm}{0.08mm}
 & \rule{3mm}{0.40mm}
 & \rule{3mm}{0.64mm}
 & \rule{3mm}{0.08mm}
 & \rule{3mm}{0.08mm}
 & \rule{3mm}{0.40mm}
 & \rule{3mm}{0.40mm}
 & \rule{3mm}{1.62mm}
 & \rule{3mm}{1.76mm}
 & \rule{3mm}{1.96mm}
 & \rule{3mm}{1.44mm}
 & Af\_tap 
\\ \hline
 2
 & dry 
 & off 
 & in\_cup 
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{1.96mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.36mm}
 & \rule{3mm}{0.82mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.36mm}
 & \rule{3mm}{0.36mm}
 & \rule{3mm}{1.50mm}
 & \rule{3mm}{1.70mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{1.38mm}
 & Rn\_brush\_cup 
\\ \hline
 3
 & dry 
 & off 
 & in\_hand 
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.78mm}
 & \rule{3mm}{0.22mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.02mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.14mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.74mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{1.68mm}
 & \rule{3mm}{1.62mm}
 & \rule{3mm}{1.36mm}
 & Af\_tap 
\\ \hline
 4
 & dry 
 & on 
 & in\_hand 
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.88mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.88mm}
 & \rule{3mm}{0.12mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.80mm}
 & \rule{3mm}{1.68mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{1.34mm}
 & Af\_water 
\\ \hline
 5
 & dry 
 & on 
 & in\_hand 
 & \rule{3mm}{0.08mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.06mm}
 & \rule{3mm}{1.80mm}
 & \rule{3mm}{0.04mm}
 & \rule{3mm}{0.10mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.72mm}
 & \rule{3mm}{1.68mm}
 & \rule{3mm}{1.62mm}
 & \rule{3mm}{1.94mm}
 & Af\_water 
\\ \hline
 6
 & wet 
 & on 
 & in\_hand 
 & \rule{3mm}{1.90mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{2.00mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{0.06mm}
 & \rule{3mm}{0.08mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.84mm}
 & \rule{3mm}{0.01mm}
 & \rule{3mm}{1.68mm}
 & \rule{3mm}{1.66mm}
 & \rule{3mm}{1.44mm}
 & \rule{3mm}{2.00mm}
 & donothing 
\\ \hline
  \end{tabular}
  }
  \caption{Requires package makecell}
  \label{TAB:TOOTHRESULTS}
\end{table}


\end{document}

beamertikzpicture.tex

\documentclass{beamer}
\usepackage{tikz}   
\begin{document}

\begin{frame}
\begin{center}
\begin{tikzpicture}
  \node (img1) {\includegraphics[height=3cm]{bb-crop}};
  \pause
  \node (img2) at (img1.south east) {\includegraphics[height=3cm]{bb-crop}};
  \pause
  \node (img3) at (img2.south west) [yshift=1cm] {\includegraphics[height=3cm]{bb-crop}};
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}

algorithm2e.tex

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[english,ruled,vlined]{algorithm2e}

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

\begin{document}
\maketitle

\begin{algorithm}[H]
 \linesnumbered%
 \dontprintsemicolon%
 \KwData{this text}
 \KwResult{how to write algorithm with \LaTeX2e }
 initialization\;
 \While{not at end of this document}{
  read current\;
  \eIf{understand}{
   go to next section\;
   current section becomes this one\;
   }{
   go back to the beginning of current section\;
  }
 }
 \caption{How to write algorithms}
\end{algorithm}

\end{document}

algorithms.tex

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{algorithm}

\usepackage[noend]{algorithmic} % noend is for for no endfor and no endif
\algsetup{indent=3mm} % controls the indentation
%\renewcommand\algorithmicthen{} % remove 'then' in algorithmic
%\renewcommand\algorithmicdo{} % remove 'do' in algorithmic

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

\begin{document}
\maketitle

\begin{algorithm}
\caption{Algorithm x that does y.}
\textsc{quickSort(A,B)}
\begin{algorithmic}[1]
 \STATE text
 \IF{condition} \STATE{text} \ENDIF
 \FOR{condition} \STATE{text} \ENDFOR
 \FOR{condition \TO condition } \STATE{text} \ENDFOR
 \FORALL{condition} \STATE{text} \ENDFOR
 \WHILE{condition} \STATE{text} \ENDWHILE
 \REPEAT \STATE{text} \UNTIL{condition}
 \LOOP \STATE{text} \ENDLOOP
 \REQUIRE text
 \ENSURE text
 \RETURN text
 \PRINT text
 \COMMENT{text}
 \AND, \OR, \XOR, \NOT, \TO, \TRUE, \FALSE
\end{algorithmic}

\end{algorithm}


\algsetup{indent=1em}
\newcommand{\factorial}{\ensuremath{\mbox{\sc Factorial}}}
\begin{algorithm}[h!]
\caption{$\factorial(n)$}\label{alg:factorial}
\begin{algorithmic}[1]
\REQUIRE An integer $n \geq 0$.
\ENSURE The value of $n!$.
\medskip
\IF {$n = 0$}
\RETURN $1$
\ELSE
\RETURN $n \cdot \factorial(n-1)$
\ENDIF
\end{algorithmic}
\end{algorithm}


\end{document}

if.tex

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

% prints everything when \trimdef is not defined
\newcommand{\trimout}[1]{\ifx\trimdef\undefined#1\fi}

\begin{document}
\maketitle

% simple if else

\def\mydef{0}

\ifx\mydef\undefined
mydef is undefined
\else
mydef is defined
\fi

\ifdefined\mydef
mydef is defined2
\fi

% conditioned print command

% \def\trimdef{0}

[\trimout{print using trimout and trimdef}]

\trimout{
      \begin{figure}
        \caption{null caption}      
      \end{figure}
}

\end{document}

definitions.tex

\newcommand{\rotz}[1]{\begin{sideways}#1\end{sideways}}
% \rotz{vertical text}
% \rotz{\parbox{3cm}{Long header name ...}} to break a long header into several lines

\newcommand{\tuple}[1]{\langle #1\rangle}

%\DeclareMathSizes{}{}{}[}

% compressing text in papers; NB: titlesec may change capitalisation of section names
\usepackage{times}
\usepackage[small,compact]{titlesec}

figureSpacing.tex

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

% spacing below and above the caption
%\setlength{\belowcaptionskip}{1cm}
%\setlength{\abovecaptionskip}{0.1cm}
\advance\belowcaptionskip by -0.5cm
\advance\abovecaptionskip by -0.3cm

\begin{document}
%\maketitle

There are many different types or variations of LaTeX available, mostly using the same packages, but often in different ways. This leads to a confusion of commands and differing outcomes when rendering documents. For example, some packages use certain fonts, while other packages use different ones. One problem that can occur is that a solution found on the Web fails to work with your version of LaTeX, due to some difference in the implementation or choice of packages. Check that you have all the required packages you think you will need. If not, then there are a number of sites dedicated to LaTeX that have basic and some more esoteric packages available.

\begin{figure}
 \centering
 \includegraphics[scale=.5]{exampleFig}
 \caption{This is caption.}
\end{figure} 

There are many different types or variations of LaTeX available, mostly using the same packages, but often in different ways. This leads to a confusion of commands and differing outcomes when rendering documents. For example, some packages use certain fonts, while other packages use different ones. One problem that can occur is that a solution found on the Web fails to work with your version of LaTeX, due to some difference in the implementation or choice of packages. Check that you have all the required packages you think you will need. If not, then there are a number of sites dedicated to LaTeX that have basic and some more esoteric packages available.

\end{document}

matrices.tex

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage{graphicx}

 \usepackage{amsmath} 

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

% spacing below and above the caption
%\setlength{\belowcaptionskip}{1cm}
%\setlength{\abovecaptionskip}{0.1cm}
\advance\belowcaptionskip by -0.5cm
\advance\abovecaptionskip by -0.3cm

\begin{document}
%\maketitle

\section{A matrix with row and column descriptions}

           $T_a = \bordermatrix{~ & s'_1 & \dots & s'_n \cr
                  s_1 & t_{1,1} & \dots & t_{1,n} \cr
                  \dots & \dots & \dots & \dots \cr
                  s_n & t_{n,1} & \dots & t_{n,n} \cr}$


\section{A standard matrix}

pmatrix requires amsmath 

$A_{m,n} =
 \begin{pmatrix}
  a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
  a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  a_{m,1} & a_{m,2} & \cdots & a_{m,n}
 \end{pmatrix}$

$A_{m,n} =
 \begin{bmatrix}
  a_{1,1} & a_{1,2} & \cdots & a_{1,n} \\
  a_{2,1} & a_{2,2} & \cdots & a_{2,n} \\
  \vdots  & \vdots  & \ddots & \vdots  \\
  a_{m,1} & a_{m,2} & \cdots & a_{m,n}
 \end{bmatrix}$


\end{document}

algorithmic.tex

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage{algorithmic}

\title{}
\author{}
\date{}

\pdfinfo{%
  /Title    ()
  /Author   ()
  /Creator  ()
  /Producer ()
  /Subject  ()
  /Keywords ()
}

\begin{document}
\maketitle

\begin{algorithm}
\caption{Algorithm x that does y.}
\textsc{quickSort(A,B)}
\begin{algorithmic}[1]
 \STATE text
 \IF{condition} \STATE{text} \ENDIF
 \FOR{condition} \STATE{text} \ENDFOR
 \FOR{condition \TO condition } \STATE{text} \ENDFOR
 \FORALL{condition} \STATE{text} \ENDFOR
 \WHILE{condition} \STATE{text} \ENDWHILE
 \REPEAT \STATE{text} \UNTIL{condition}
 \LOOP \STATE{text} \ENDLOOP
 \REQUIRE text
 \ENSURE text
 \RETURN text
 \PRINT text
 \COMMENT{text}
 \AND, \OR, \XOR, \NOT, \TO, \TRUE, \FALSE
\end{algorithmic}

\end{algorithm}


\algsetup{indent=1em}
\newcommand{\factorial}{\ensuremath{\mbox{\sc Factorial}}}
\begin{algorithm}[h!]
\caption{$\factorial(n)$}\label{alg:factorial}
\begin{algorithmic}[1]
\REQUIRE An integer $n \geq 0$.
\ENSURE The value of $n!$.
\medskip
\IF {$n = 0$}
\RETURN $1$
\ELSE
\RETURN $n \cdot \factorial(n-1)$
\ENDIF
\end{algorithmic}
\end{algorithm}


\end{document}

tikz_examples.tex

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}

\usepackage[utf8]{inputenc}

\usepackage{tikz}
\usetikzlibrary{shapes.geometric, positioning, shapes, arrows}

\begin{document}

\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (2,0);
\coordinate (C) at (4,0);
\coordinate (D) at (6,0);
\draw [-latex] (A) -- (B);
\draw [-latex] (A) to [bend left] (C);
\draw [-latex] (A) to [bend left=60] (D);
\end{tikzpicture}

\vskip 2cm

\begin{tikzpicture}
  \node (l1) [ellipse, draw=black, fill=white!20, text=black, scale=0.8]{
    $l_1$};
  \node (l2) [ellipse, draw=black, fill=white!20, text=black, scale=0.8, below left=1cm of l1]{
    $l_2$};
\draw[bend left,->]  (l1) to node [auto] {Link} (l2);
\end{tikzpicture}

\vskip 2cm

\tikzstyle{block} = [draw, fill=blue!20, rectangle, 
    minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]

% The block diagram code is probably more verbose than necessary
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
    % We start by placing the blocks
    \node [input, name=input] {};
    \node [sum, right of=input] (sum) {};
    \node [block, right of=sum] (controller) {Controller};
    \node [block, right of=controller, pin={[pinstyle]above:Disturbances},
            node distance=3cm] (system) {System};
    % We draw an edge between the controller and system block to 
    % calculate the coordinate u. We need it to place the measurement block. 
    \draw [->] (controller) -- node[name=u] {$u$} (system);
    \node [output, right of=system] (output) {};
    \node [block, below of=u] (measurements) {Measurements};

    % Once the nodes are placed, connecting them is easy. 
    \draw [draw,->] (input) -- node {$r$} (sum);
    \draw [->] (sum) -- node {$e$} (controller);
    \draw [->] (system) -- node [name=y] {$y$}(output);
    \draw [->] (y) |- (measurements);
    \draw [->] (measurements) -| node[pos=0.99] {$-$} 
        node [near end] {$y_m$} (sum);
\end{tikzpicture}

\end{document}

misc.tex

# removes the box and adds black clickable links
\usepackage[colorlinks=true,citecolor=black,urlcolor=black,linkcolor=black]{hyperref}
\usepackage{xurl}


( \big( \Big( \bigg( \Bigg( or [ \big[ \Big[ \bigg[ \Bigg[ for parentheses and brackets

\big\{ \Big\{ \bigg\{ \Bigg\{ \dots \Bigg\rangle \bigg\rangle \Big\rangle \big\rangle for braces and cheverons

see http://en.wikipedia.org/wiki/Help:Displaying_a_formula#Continuation_and_cases

You can also define stretched values. A stretching value is a length preceded by plus or minus to specify to what extent tex is authorized to change the length. Example:

\setlength{\parskip}{10pt plus 5pt minus 3pt}

It means that tex will try to use a length of 10pt; if it is underfull, it will raise the length up to a maximum of 15pt; if it is overfull, it will lower the length up to a minimum of 7pt.

% From documentation in epslatex (by Keith Reckdahl):
%   \floatsep     - spacing between floats at top/bottom of page
%   \textfloatsep - spacing between text and the float at top/bottom of page
%   \intextsep    - spacing above & below the float in the middle of page

% The removed 20% extra spacing is added back, thus 1 / 0.8 = 1.25
%
\setlength{\floatsep}{1.25\@twolinespacing}
\setlength{\textfloatsep}{1.25\@twolinespacing plus 5pt}
\setlength{\intextsep}{1.25\@twolinespacing}

\setlength{\abovecaptionskip}{2mm}
\setlength{\belowcaptionskip}{2mm}

Common length macros are:

\baselineskip 
    The normal vertical distance between lines in a paragraph.
\baselinestretch 
    Multiplies \baselineskip.
\columnsep 
    The distance between columns.
\columnwidth 
    The width of the column.
\evensidemargin 
    The margin for 'even' pages (think of a printed booklet).
\linewidth 
    The width of a line in the local environment.
\oddsidemargin 
    The margin for 'odd' pages (think of a printed booklet).
\paperwidth 
    The width of the page.
\paperheight 
    The height of the page.
\parindent 
    The normal paragraph indentation.
\parskip 
    The extra vertical space between paragraphs.
\tabcolsep 
    The default separation between columns in a tabular environment.
\textheight 
    The height of text on the page.
\textwidth 
    The width of the text on the page.
\topmargin 
    The size of the top margin.
\unitlength 
    Units of length in picture environment. 

% minipage for beamer posters to split blocks into columns
                \begin{minipage}[b]{0.4\linewidth}
                \end{minipage}
                \hspace{0cm}
                \begin{minipage}[b]{0.5\linewidth}
                \end{minipage}

% align inside tabular cells
\begin{tabular}{l|l|}
      A & B \\
      & {$\!\begin{aligned} % http://tex.stackexchange.com/q/98482/16595 
               A &= B \\    % http://tex.stackexchange.com/q/78788/16595
               C &= D \end{aligned}$}
\end{tabular}

% ----- lists -----

% pack lists
\usepackage{enumitem} % to reduce a left margin in a list
\begin{itemize}[leftmargin=0.5cm]
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
  
  \item Aaaaa.....
  
\end{itemize}

% increase space between list items (useful in beamer presentations)
\begin{itemize}\setlength\itemsep{5mm}
 \item Item 1
 \item Item 2
\end{itemize}




Back to main page