text:
<repo_name>henrikmidtiby/IntroduktionTilLatex<file_sep>/latexIntroCourse/examples/01b.tex
\documentclass{article}
\begin{document}
Hello world!

På Ærø ligger Marstal.
\end{document}
<file_sep>/errors/test009.tex
\documentclass{article}
\newcommand{\i}{$\iota$}% My macro: \i -> \iota
\begin{document}
This is \verb!\i!:~\i.
\end{document}<file_sep>/errors/test006.tex
\documentclass{article}
\begin{document}
\[
  f(x)=ax^2+bx+c, \mbox{where x\geq 0}
\]
\end{document}<file_sep>/errors/test004.tex
\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

Ifølge pythagoras er sidelængden af en retvinklet trekants hypotenuse $c$ givet ud fra kateterne ($a$ og $b).
Formlen er gengivet herunder:
\begin{align}
c^2
	& = a^2 + b^2
\end{align}

\end{document}<file_sep>/latexIntroCourse/simple.tex
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\lstset{% language=TeX,
	basicstyle=\ttfamily\footnotesize,
	columns=fullflexible,
	tabsize=4,
	%numbers=left,
	numberstyle=\tiny,
	stepnumber=2,
	numbersep=5pt}
\usepackage{pdfpages}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{external}
\usepackage{multicol}
\usepackage{dirtree}

\newcommand{\insertPDF}[2][0.8]{
	\includegraphics[trim=4.5cm 0cm 0cm 3.5cm, clip, scale=#1]{#2}}

\newcommand{\addnote}[1]{
\pause
\begin{tikzpicture}[remember picture, overlay]
\draw (current page.center) ++ (0, -4) node[above, fill=orange, text width=7cm] {#1};
\end{tikzpicture}
}

\newcommand{\source}[1]{
\tikzexternaldisable
\begin{tikzpicture}[remember picture, overlay]
\draw (current page.south west) ++ (0.25, 0.40) node[above right]{\footnotesize #1};
\end{tikzpicture}
\tikzexternalenable
}

%\usepackage{beamerthemesplit}
\usetheme{Goettingen}
%\usetheme{Bergen}
%\usetheme{Madrid}

\title{\LaTeX{} kursus}
\author{<NAME>}
\date{}

\begin{document}

\frame{\titlepage}

\frame{
\frametitle{Inden vi starter kan du \ldots}
\begin{itemize}
\item Afprøve om der er internet adgang
\item Hente præsentationen, \\
	{\small \url{http://henrikmidtiby.github.io/presentations/}}
\item Logge ind på OverLeaf, \\
	{\small \url{https://www.overleaf.com}}
\end{itemize}
}

\frame{
\dirtree{%
.1 IntroduktionTilLatex.
.2 latexIntroCourse.
.3 Examples.
.4 skabelon.
.4 01.tex.
.4 02.tex.
.4 ....
.3 pic.
.3 simple.pdf.
.3 simple.tex.
.2 errors.
.3 test001.tex.
.3 test002.tex.
.3 ....
.2 TeXworks-scripts.
.3 ....
}
}

% ================================================================
% ================================================================
\section{Hvorfor \LaTeX{}?}
\frame{
\begin{multicols}{2}
	\tableofcontents[currentsection]
\end{multicols}
}

% ================================================================
\subsection{Hvad er \LaTeX{}?}
\frame {
	\includegraphics[width=0.75\linewidth]{pic/fileextensions.png}
	\source{\tiny{\url{https://xkcd.com/1301/}}}
}

\frame {
\frametitle{Hvad er \LaTeX{}?}

\begin{itemize}
\item	Et dokument formaterings system
\item	Baseret på \TeX{} (deraf navnet Lazy \TeX)
\item 	Udviklet af Leslie Lamport i 1983
\end{itemize}
}

\newcommand{\hsmcomment}[1]{}
%\hsmcomment{

% ================================================================
\subsection{Fordele og ulemper}
\frame
{
  \frametitle{Fordele og ulemper}
  Fordele ved \LaTeX{}
  \begin{itemize}
	\item Separation af indhold og udseende
	\item Godt grafisk udseende
	\item Håndtering af store dokumenter
	\item Dokument samarbejde
  \end{itemize}

  Ulemper ved \LaTeX{}
  \begin{itemize}
	\item Svært at komme igang (stejl indlæringskurve)
  \end{itemize}
}

\frame{
	\centering
\begin{tikzpicture}
%\draw[step=0.2cm] (0, 0) grid (4, 4);
%\draw node[anchor=south west, xshift=-0.87cm, yshift=-0.88cm, opacity=0.5] {\includegraphics[width=8cm]{learningcurve.jpg}};
\draw[->] (0, 0) -- (0, 5) node[right] {Effort};
\draw[->] (0, 0) -- (6, 0) node[above left] {Document complexity};
\draw[thick, red] (0, 0.65) .. controls +(10: 1.6cm) and +(270: 3cm) .. (2.6, 5.3);
\draw[thick, blue] (0, 1.2) .. controls +(80: 0.6cm) and +(185: 3cm) .. (5.5, 2.30);
\draw (0, 0.8) node[left, scale=0.6] {Easy};
\draw (0, 2.5) node[left, scale=0.6] {Moderate};
\draw (0, 4.0) node[left, scale=0.6] {Nearly impossible};
\draw (0.7, 0) node[below=0.2cm, scale=0.6] {Very simple};
\draw (2.6, 0) node[below=0.2cm, scale=0.6] {Somewhat complex};
\draw (4.7, 0) node[below=0.2cm, scale=0.6] {Extremely complex};
\draw[thick, blue] (5, 4) -- (5.5, 4) node[right] {\LaTeX};
\draw[thick, red] (5, 3.5) -- (5.5, 3.5) node[right] {MS Word};
\draw (0, -1) node[right] {\tiny Efter \url{http://www2.ihis.aau.dk/~trautner/car-phds.html}};
\end{tikzpicture}

}

\frame
{
	\includegraphics[width=9cm]{pic/MovingAPictureInWord.jpg}
	\source{\tiny{\url{https://twitter.com/emilbronikowski/status/497695730602360832/photo/1}}}
}

% ================================================================
\subsection{Programmer}
\frame
{
	\frametitle{Online latex editor}

	Online platform til LaTeX, der understøtter at flere retter i samme dokument på en gang.

	\url{https://www.overleaf.com/}
}

% ================================================================
%\frame
%{
%\frametitle{TeXworks}
%	\includegraphics[height=6cm]{pic/texworksLatexErrors.png}
%}

\frame
{
\frametitle{Warnings og Errors}
	Det er en god ide at slippe af med \emph{alle} errors og warnings.
}

% ================================================================
% ================================================================
\section{Eksempler 1}
\frame{
\begin{multicols}{2}
	\tableofcontents[currentsection]
\end{multicols}
}

% ================================================================
\subsection{Hello world}
\begin{frame}[fragile]
	\frametitle{Minimalt eksempel}

\begin{verbatim}
\documentclass{article}
\begin{document}
Hello world!

På Ærø ligger Marstal.
\end{document}
\end{verbatim}

\end{frame}
\frame
{
	\insertPDF{examples/01b.pdf}
}

% ================================================================
\subsection{Afsnit}
\frame
{
	\frametitle{Afsnit}
	\lstinputlisting{examples/02paragraphs.tex}
}

\frame
{
	\insertPDF{examples/02paragraphs.pdf}
}

% ================================================================
\subsection{Indholdsfortegnelse}
\frame
{
	\frametitle{Indholdsfortegnelse}
	\lstinputlisting{examples/02.tex}
}

\frame
{
	\insertPDF{examples/02firstRun.pdf}
	\addnote{For at opdatere indholdet i indholdsfortegnelsen er det nødvendigt at oversætte filen to gange.}
}

\frame
{
	\insertPDF{examples/02.pdf}
}

% ================================================================
%\subsection{Informationsflow}
\frame
{
	\frametitle{Kompilering og informationsflow}

	\includegraphics[width=8cm]{pic/latexInformationFlow.pdf}

	\source{Efter figur 1.1 i Latex Companion.}

}

% Der er problemer med at indsætte æøå vha. listingspakken
%\frame
%{
%	\frametitle{ÆØÅ problemer}
%	\lstinputlisting[extendedchars]{examples/03.tex}
%}
%
%\frame
%{
%	\insertPDF{examples/03.pdf}
%}

% ================================================================
\subsection{Simpel forside}
\frame {
	\frametitle{Simpe forside}
	\lstinputlisting{examples/03.tex}
}

\frame {
	\insertPDF{examples/03.pdf}
	% \addnote{Henvisninger til referencer kræver også to oversættelser.}
}

% ================================================================
\subsection{Referencer}
\frame {
	\frametitle{Referencer}
	\lstinputlisting[firstline=4, lastline=18]{examples/05.tex}
}

\frame {
	\insertPDF{examples/05firstRun.pdf}
	\addnote{Henvisninger til referencer kræver også to oversættelser.}
}

\frame {
	\insertPDF{examples/05.pdf}
}

% ================================================================
\subsection{Kommando anatomi}
\frame {
	\frametitle{Kommando anatomi}
	Generel opbygning
	\lstinputlisting[firstline=1, lastline=5]{commandanatomy.tex}
	Eksempler
	\lstinputlisting[firstline=6, lastline=9]{commandanatomy.tex}
}

% ================================================================
% ================================================================
\section{Eksempler 2}
\frame{
\begin{multicols}{2}
	\tableofcontents[currentsection]
\end{multicols}
}

% ================================================================
\subsection{Lister}
\frame {
	\frametitle{Lister}
	\lstinputlisting[firstline=5, lastline=18]{examples/04.tex}
}

\frame {
	\insertPDF{examples/04.pdf}
}

\frame {
	\frametitle{Lister i lister}
	\lstinputlisting[firstline=5, lastline=13]{examples/04b.tex}
}

\frame {
	\insertPDF{examples/04b.pdf}
}

% ================================================================
\subsection{Tabeller og figurer}
\frame {
	\frametitle{Tabeller}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}]{examples/10.tex}

	\lstinputlisting[firstline=6, lastline=19]{examples/10.tex}
}

\frame {
	\insertPDF{examples/10.pdf}
}

\frame {
	\frametitle{Online hjælp}

	\includegraphics[width=8cm]{pic/latexTableGenerator.png}

	\source{\url{http://www.tablesgenerator.com/latex_tables}}
}

\frame {
	\frametitle{Figurer}
	\lstinputlisting[firstline=2, lastline=3, basicstyle=\color{red}]{examples/06.tex}

	\lstinputlisting[firstline=7, lastline=14]{examples/06.tex}
}

\frame {
	\insertPDF{examples/06.pdf}
}

\frame{
	\frametitle{Ide til en mappestruktur}

	Mappe struktur for et latex dokument (undermapper til billeder m.m.)
	\begin{itemize}
		\item	project.tex
		\item	pic
		\begin{itemize}
			\item	vandstraaler.jpg
		\end{itemize}
	\end{itemize}

}

\begin{frame}[fragile]
\frametitle{Pakker i \LaTeX}

Pakker kan hentes fra CTAN: Comprehensive TeX Archive Network (\url{https://www.ctan.org/}).

Et eksempel på en pakke er \verb!graphicx!, der gør det muligt at indsætte billeder
i \LaTeX dokumenter.

I kan finde pakken på ctan på nedenstående adresse og finde
dokumentation til pakken samme sted.

\source{\url{https://www.ctan.org/pkg/graphicx}}
\end{frame}

\begin{frame}[fragile]
\frametitle{Placering af figurer og tabeller}

\lstinputlisting[firstline=5, lastline=21]{examples/06figureplacementsdefault.tex}
\end{frame}

\begin{frame}
\insertPDF{examples/06figureplacementsdefault.pdf}
\end{frame}

\begin{frame}[fragile]
\frametitle{Placering af figurer og tabeller}

\lstinputlisting[firstline=5, lastline=21]{examples/06figureplacements.tex}
\end{frame}

\begin{frame}
\insertPDF{examples/06figureplacements.pdf}
\end{frame}

\begin{frame}
\frametitle{Placerings modifiers}
\begin{description}
\item[h]	Here, indsæt figuren her
\item[t]	Top, indsæt figuren øverst på en side
\item[b]	Bottom, indsæt figuren nederst på en side
\item[p] Page, indsæt figuren på en side uden tekst
\end{description}
\end{frame}

% ================================================================
\subsection{Matematik}
\begin{frame}[fragile]
	\frametitle{Formler 0}
	{\Huge
	\begin{align*}
		\frac{a}{b}	\qquad a^b	\qquad \theta
	\end{align*}
	}
	\pause
	\begin{verbatim}
\frac{a}{b}
a^b
\theta
	\end{verbatim}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Matematik tilstand}

	Latex kan kun skrive formler når den er i en matematik
	tilstand. Der findes to forskellige matematik tilstande

	\begin{description}
	\item[inline] til matematik inde i en tekst, \\ afgrænses af \$ \ldots \$
	\item[display] til matematik på en linje for sig selv, \\ afgrænses af \verb!\begin{align}! og \verb!\end{align}!
	\end{description}
\end{frame}

\begin{frame}[fragile]
	\frametitle{Matematik tilstand (2)}
	\begin{verbatim}
	Noget tekst $\frac{a}{b}$ og noget mere matematik
	\begin{align}
		a^b
	\end{align}
	\begin{align*}
		\theta
	\end{align*}
	\end{verbatim}

	Noget tekst $\frac{a}{b}$ og noget mere matematik
	\begin{align}
		a^b
	\end{align}
	\begin{align*}
		\theta
	\end{align*}
\end{frame}

\frame {
	\frametitle{Formler I}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}]{examples/07a.tex}
	\lstinputlisting[firstline=4, lastline=14]{examples/07a.tex}
}

\frame {
	\insertPDF{examples/07a.pdf}
}

\frame {
	\frametitle{Hvor finder man symbolerne?}

	\begin{itemize}
	\item Detexify, \\
			{\tiny \url{http://detexify.kirelabs.org/classify.html}}
	\item The Comprehensive LaTeX Symbol List, \\
			{\tiny \url{http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf}}
	\end{itemize}

	\centering
	\includegraphics[width=7cm]{pic/detexify.png}
}

\frame {
	\frametitle{Tag et billede af formlerne!}

	\begin{itemize}
	\item Mathpix, \\
			{\tiny \url{https://mathpix.com/}}
	\end{itemize}

	\centering
	\includegraphics[width=7cm]{pic/mathpix_snip_mac.png}
}

\frame {
	\frametitle{Lidt mere matematik}

	Er der behov for at skrive mere matematik kan
	\emph{The short math guide for \LaTeX } af <NAME>,
	American Mathematical Society anbefales.

	\source{\url{ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf}}
}

\begin{frame}[fragile]
	\frametitle{Align miljøet}

	Align miljøet fra pakken \verb!amsmath! kan bruges til at
	sætte flere ligninger op under hinanden, så de f.eks. alle har lighedstegnet
	det samme sted.
\end{frame}

\frame {
	\frametitle{Formler II}
	\lstinputlisting{examples/07.tex}
}

\frame {
	\insertPDF{examples/07.pdf}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}]{examples/07.tex}
	\lstinputlisting[firstline=4, lastline=13]{examples/07.tex}
}

% ================================================================
\subsection{Miljø anatomi}
\frame {
	\frametitle{Miljø (environment) anatomi}
	Generel opbygning
	\lstinputlisting[firstline=1, lastline=5]{environmentanatomy.tex}
	Eksempler
	\lstinputlisting[firstline=6]{environmentanatomy.tex}
}

% ================================================================
\subsection{Fejlsøgning}
\frame {
	\frametitle{Fejlsøgning}

	Der er eksempler på forskellige fejl i errors mappen.

	Kan I finde og rette disse fejl?

	Strategi:
	\begin{itemize}
	\item Binær søgning ved at placere \textbackslash{}end\{document\} forskellige steder i dokumentet
	\item Udkommentere enkelte linjer
    \item Lave et \emph{minimal reproducible example}
	\end{itemize}

    \hspace{1cm}

    Video hvor jeg viser hvordan opgaverne kan løses.
    \begin{itemize}
      \item \href{https://youtu.be/bLNAddfICDE}{link}
    \end{itemize}

\source{http://www.gust.org.pl/bachotex/2017-pl/presentations/bbeeton-1-2017.pdf}
}

% ================================================================
% ================================================================
\section{Eksempler 3}
\frame{
\begin{multicols}{2}
	\tableofcontents[currentsection]
\end{multicols}
}

% ================================================================
\subsection{Citationer}
\frame {
	\frametitle{Cite and bibitem}
	\lstinputlisting[firstline=4, lastline=20]{examples/08.tex}
}

\frame {
	\insertPDF{examples/08firstRun.pdf}
}

\frame {
	\insertPDF{examples/08.pdf}
}

%}

\frame {
	\frametitle{biblatex I}
	\lstinputlisting{examples/09biblatex.tex}
}

\frame {
	\frametitle{biblatex II (bibtexfile.bib)}
	\lstinputlisting{examples/bibtexfile.bib}
}

\frame {
	\insertPDF{examples/09biblatexfirstRun.pdf}
}

\frame {
	\insertPDF{examples/09biblatex.pdf}
}

\frame
{
	\frametitle{Bibtex og informationsflow}

	\includegraphics[width=5.8cm]{pic/bibtexInformationFlow.pdf}
	\source{Efter figur 12.1 i Latex Companion.}
}

\frame
{
	\frametitle{latexmk}

	latexmk er et lille program / perl script der sørger for at
	køre pdflatex, bibtex med mere det antal gange der er
	nødvendigt for at dokumentet ser rigtigt ud.

	Installationsvejledning til latexmk på windows \\
	{\tiny\url{http://tex.stackexchange.com/a/149861/1366}}
}

\frame
{
	\frametitle{Jabref}

	\centering
	\includegraphics[width=9cm]{pic/jabref.png}

	{\tiny \url{http://jabref.sourceforge.net/}}
}

\frame
{
	\frametitle{Mendeley}

	\centering
	\includegraphics[width=9cm]{pic/mendeley.png}

	{\tiny \url{http://www.mendeley.com/}}
}

% ================================================================
\subsection{Todonotes}

\frame {
	\frametitle{Todonotes}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}]{examples/11.tex}
	\lstinputlisting[firstline=5, lastline=15]{examples/11.tex}
}

\frame {
	\insertPDF[0.6]{examples/11.pdf}
}

% ================================================================
\subsection{Forskelligt}

\frame {
	\frametitle{Tikz}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}\footnotesize]{examples/12.tex}
	\lstinputlisting[firstline=4, lastline=18, basicstyle=\footnotesize]{examples/12.tex}
}

\frame {
	\insertPDF[0.6]{examples/12.pdf}
}

\frame {
	\frametitle{mhchem (1/2)}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}\footnotesize]{examples/13mhchem.tex}
	\lstinputlisting[firstline=4, lastline=18, basicstyle=\footnotesize]{examples/13mhchem.tex}
}

\frame {
	\insertPDF[0.6]{examples/13mhchem.pdf}
}

\frame {
	\frametitle{mhchem (2/2)}
	\lstinputlisting[firstline=5, lastline=10, basicstyle=\footnotesize]{examples/13mhchemReactions.tex}
}

\frame {
	\insertPDF[0.6]{examples/13mhchemReactions.pdf}
}

\frame {
	\frametitle{siunitx}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}\footnotesize]{examples/14siunitx.tex}
	\lstinputlisting[firstline=4, lastline=14, basicstyle=\footnotesize]{examples/14siunitx.tex}
}

\frame {
	\insertPDF[0.6]{examples/14siunitx.pdf}
}

% ================================================================
\subsection{hyperref}

\frame {
	\frametitle{hyperref}
	\lstinputlisting[firstline=2, lastline=4, basicstyle=\color{red}\footnotesize]{examples/15hyperref.tex}
	\lstinputlisting[firstline=10, lastline=21, basicstyle=\footnotesize]{examples/15hyperref.tex}
}

\frame {
	\insertPDF[0.6]{examples/15hyperref.pdf}
}

% ================================================================
\subsection{caption}

\frame {
	\frametitle{caption -- Tilpasse udseende af figurtekster}
	\lstinputlisting[firstline=2, lastline=2, basicstyle=\color{red}\footnotesize]{examples/18adjustcaptions.tex}
	\lstinputlisting[firstline=5, lastline=13, basicstyle=\footnotesize]{examples/18adjustcaptions.tex}
}

\frame {
	\insertPDF[0.6]{examples/18adjustcaptions.pdf}
}

% ================================================================
\subsection{include / input}

\frame {
	\frametitle{include / input}
	16include.tex
	\lstinputlisting[firstline=1, lastline=4, basicstyle=\footnotesize]{examples/16include.tex}

	\vspace{1cm}
	16includePartA.tex
	\lstinputlisting[firstline=1, lastline=2, basicstyle=\footnotesize]{examples/16includePartA.tex}
}

\frame {
	\insertPDF[0.6]{examples/16include.pdf}
}

% ================================================================
% ================================================================
\section{Skabelon}
\frame{
\begin{multicols}{2}
	\tableofcontents[currentsection]
\end{multicols}
}

%\frame {
%	\frametitle{Rapport skabelon}
%	\lstinputlisting[firstline=1, lastline=14]{examples/skabelon/doc/project.tex}
%}

{
% The following line is needed to avoid beamer
% placing a white background on top of the other contents
\setbeamercolor{background canvas}{bg=}
\includepdf[pages={1, 2, 3, 4, 5, 6}, nup=2x1, frame, delta=0.5cm 0.5cm, scale=0.9]
	{examples/skabelon/doc/project.pdf}
}

% ================================================================
% ================================================================
\section{Ressourcer}
\frame {
	\begin{itemize}
    \item   Learn LaTeX in 30 minutes \\
            {\tiny \url{https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes}}
	\item 	\LaTeX fortsætter kursus \\
			{\tiny \url{http://henrikmidtiby.github.io/downloads/LatexContinued.zip}}
	\item	The not so short introduction to latex 	\\
			{\tiny \url{http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf}}
	\item	Introduktion til \LaTeX 				\\
			{\tiny \url{http://imf.au.dk/system/latex/bog/}}
	\item	Den nye LaTeX for forfattere \\
			{\tiny \url{http://dirac.ruc.dk/imfufalatex/ltxnoterh.pdf}}
	\item	Bog om latex på wikibooks 				\\
			{\tiny \url{http://en.wikibooks.org/wiki/LaTeX}}
	\end{itemize}
}

\frame {
	\begin{itemize}
	\item	The \LaTeX{} companion					\\
			{\tiny \url{http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf}}
    \item  writelatex online latex kursus			\\
    		{\tiny \href{https://www.writelatex.com/blog/7-free-online-introduction-to-latex-course-part-1\#.U3ybNx\_64wx}{part1}} \\
    		{\tiny \href{https://www.writelatex.com/blog/9-free-online-introduction-to-latex-course-part-2\#.U3yckB\_64ww}{part2}} \\
    		{\tiny \href{https://www.writelatex.com/blog/18\#.U3yckh\_64ww}{part3}}
    \item The Bates LaTeX Manual \\
    { \tiny \url{https://www.bates.edu/mathematics/resources/latex-manual/}}
	\end{itemize}
}

\frame{
	\frametitle{Andre tips}
	Hvis latex kompileringen fejler kan problemet nogle gange løses ved at slette
	alle \emph{.aux} filer.
}

\frame{
	\frametitle{Tak for nu}
}

% ================================================================
\frame
{
	\frametitle{Hvilke programmer skal jeg bruge?}
	Oversættere (oversætter et latex dokument til en pdf fil)
	\begin{itemize}
		\item Hente og installere tinytex, \\
			{\tiny \url{https://yihui.name/tinytex/}}
	\end{itemize}

	Editorer (det program du bruger til at rette i latex dokumenter)
	\begin{itemize}
		\item	TeXworks, \\
			{\tiny \url{http://www.tug.org/texworks/}}
		\item	TexnicCenter, \\
			{\tiny \url{http://www.texniccenter.org/}}
		\item 	Texmaker, \\
			{\tiny \url{http://www.xm1math.net/texmaker/}}
	\end{itemize}
}

% ================================================================
%\subsection{Ekstra scripts til TeXworks}
\frame
{
	\frametitle{Ekstra scripts til TeXworks}

	\begin{itemize}
	\item Ligger i TeXworks-scripts mappen
	\item Indholdet flyttes over i den mappe som åbnes via
		\begin{itemize}
		\item Scripts
		\item Scripting TeXworks
		\item Show Scripts Folder
		\end{itemize}
	\item Alternativ download lokation \\
		{\tiny \url{https://github.com/henrikmidtiby/TeXworks-scripts}}
	\end{itemize}
}

\begin{frame}
\frametitle{Script -- LogParser}

\includegraphics[width=6cm]{pic/texworksConsoleOutput.png}

Standard visning af fejl i console output.

\end{frame}

\begin{frame}
\frametitle{Script -- LogParser}

\includegraphics[width=6cm]{pic/texworksLogParser.png}

Visning af fejl med log parser scriptet.

Opsummeringen vises først når oversætteren er \emph{færdig}.

\end{frame}

\begin{frame}[fragile]
\frametitle{Script -- Autocomplete}

Scriptet aktiveres ved genvejen \verb!crtl + m!.

Scriptet kan hjælpe med at autocomplete ting som
\begin{itemize}
\item	kommandoer
\item	miljøer (figure, itemize, enumerate, \ldots)
\item	referencer (ref, label)
\item	citationer (cite)
\item 	\ldots
\end{itemize}

\end{frame}

\end{document}
<file_sep>/latexIntroCourse/Makefile
PROJEKTNAVN := simple
RERUNCONDITION := "(There were undefined references|Rerun to get (cross-references|the bars) right)"

CLEAN := \
	${PROJEKTNAVN}.aux \
	${PROJEKTNAVN}.log \
	${PROJEKTNAVN}.nav \
	${PROJEKTNAVN}.out \
	${PROJEKTNAVN}.toc \
	${PROJEKTNAVN}.snm \
	${PROJEKTNAVN}.bbl \
	${PROJEKTNAVN}.blg \
	examples/*.bbl \
	examples/*.blg \
	examples/*.toc \
	examples/*.log \
	examples/*.aux \
	examples/*.tdo \
	examples/*.pdf \
	examples/skabelon/doc/project.aux \
	examples/skabelon/doc/project.log \
	examples/skabelon/doc/project.idx \
	examples/skabelon/doc/project.toc \
	examples/skabelon/doc/project.out \
	examples/skabelon/doc/project.pdf \
	examples/skabelon/doc/project.tdo \

DISTCLEAN := \
	${PROJEKTNAVN}.pdf \

DEPENDENCIES := \
	examples/01.pdf \
	examples/01b.pdf \
	examples/01c.pdf \
	examples/02.pdf \
	examples/02paragraphs.pdf \
	examples/03.pdf \
	examples/04.pdf \
	examples/04b.pdf \
	examples/05.pdf \
	examples/06.pdf \
	examples/06figureplacementsdefault.pdf \
	examples/06figureplacements.pdf \
	examples/07a.pdf \
	examples/07.pdf \
	examples/08.pdf \
	examples/09.pdf \
	examples/09biblatex.pdf \
	examples/10.pdf \
	examples/11.pdf \
	examples/12.pdf \
	examples/13mhchem.pdf \
	examples/13mhchemReactions.pdf \
	examples/14siunitx.pdf \
	examples/15hyperref.pdf \
	examples/16include.pdf \
	examples/18adjustcaptions.pdf \
	examples/skabelon/doc/project.pdf \

${PROJEKTNAVN}.pdf: \
	${PROJEKTNAVN}.tex \
	${DEPENDENCIES}
	pdflatex ${PROJEKTNAVN}.tex
	egrep -c ${RERUNCONDITION} ${PROJEKTNAVN}.log && pdflatex ${PROJEKTNAVN}.tex; true

default: \
	${PROJEKTNAVN}.pdf

view: \
	${PROJEKTNAVN}.pdf
	okular ${PROJEKTNAVN}.pdf

# Fjerner midlertidige filer
clean:
	@rm -f $(CLEAN)

# Fjerner alle filer der kan gendannes vha. simpel regnekraft.
distclean: clean
	@rm -f $(DISTCLEAN)

examples/skabelon/doc/project.pdf:
	cd examples/skabelon && make default

examples/01.pdf: \
	examples/01.tex
	cd examples && pdflatex 01.tex
	cd examples && pdflatex 01.tex

examples/01b.pdf: \
	examples/01b.tex
	cd examples && pdflatex 01b.tex
	cd examples && pdflatex 01b.tex

examples/01c.pdf: \
	examples/01c.tex
	cd examples && pdflatex 01c.tex
	cd examples && pdflatex 01c.tex

examples/02.pdf: \
	examples/02.tex
	touch examples/02.toc
	rm examples/02.toc
	cd examples && pdflatex 02.tex
	cp examples/02.pdf examples/02firstRun.pdf
	cd examples && pdflatex 02.tex

examples/02paragraphs.pdf: \
	examples/02paragraphs.tex
	cd examples && pdflatex 02paragraphs.tex

examples/03.pdf: \
	examples/03.tex
	cd examples && pdflatex 03.tex
	cd examples && pdflatex 03.tex

examples/04.pdf: \
	examples/04.tex
	cd examples && pdflatex 04.tex
	cd examples && pdflatex 04.tex

examples/04b.pdf: \
	examples/04b.tex
	cd examples && pdflatex 04b.tex
	cd examples && pdflatex 04b.tex

examples/05.pdf: \
	examples/05.tex
	touch examples/05.aux
	rm examples/05.aux
	cd examples && pdflatex 05.tex
	cp examples/05.pdf examples/05firstRun.pdf
	cd examples && pdflatex 05.tex

examples/06.pdf: \
	examples/06.tex
	cd examples && pdflatex 06.tex
	cd examples && pdflatex 06.tex

examples/06figureplacementsdefault.pdf: \
	examples/06figureplacementsdefault.tex
	cd examples && pdflatex 06figureplacementsdefault.tex

examples/06figureplacements.pdf: \
	examples/06figureplacements.tex
	cd examples && pdflatex 06figureplacements.tex

examples/07a.pdf: \
	examples/07a.tex
	cd examples && pdflatex 07a.tex
	cd examples && pdflatex 07a.tex

examples/07.pdf: \
	examples/07.tex
	cd examples && pdflatex 07.tex
	cd examples && pdflatex 07.tex

examples/08.pdf: \
	examples/08.tex
	touch examples/08.aux
	rm examples/08.aux
	cd examples && pdflatex 08.tex
	cp examples/08.pdf examples/08firstRun.pdf
	cd examples && pdflatex 08.tex

examples/09.pdf: \
	examples/09.tex
	touch examples/09.aux
	rm examples/09.aux
	cd examples && pdflatex 09.tex
	cp examples/09.pdf examples/09firstRun.pdf
	cd examples && bibtex 09
	cd examples && pdflatex 09.tex
	cd examples && pdflatex 09.tex

examples/09biblatex.pdf: \
	examples/09biblatex.tex
	rm -f examples/09biblatex.aux
	rm -f examples/09biblatex.bbl
	rm -f examples/09biblatex.bcf
	rm -f examples/09biblatex.blg
	cd examples && pdflatex 09biblatex.tex
	cp examples/09biblatex.pdf examples/09biblatexfirstRun.pdf
	cd examples && biber 09biblatex
	cd examples && pdflatex 09biblatex.tex
	cd examples && pdflatex 09biblatex.tex

examples/10.pdf: \
	examples/10.tex
	cd examples && pdflatex 10.tex
	cd examples && pdflatex 10.tex

examples/11.pdf: \
	examples/11.tex
	cd examples && pdflatex 11.tex
	cd examples && pdflatex 11.tex

examples/12.pdf: \
	examples/12.tex
	cd examples && pdflatex 12.tex
	cd examples && pdflatex 12.tex

examples/13mhchem.pdf: \
	examples/13mhchem.tex
	cd examples && pdflatex 13mhchem.tex

examples/13mhchemReactions.pdf: \
	examples/13mhchemReactions.tex
	cd examples && pdflatex 13mhchemReactions.tex

examples/14siunitx.pdf: \
	examples/14siunitx.tex
	cd examples && pdflatex 14siunitx.tex

examples/15hyperref.pdf: \
	examples/15hyperref.tex
	touch examples/15hyperref.aux
	rm examples/15hyperref.aux
	cd examples && pdflatex 15hyperref.tex
	cp examples/15hyperref.pdf examples/15hyperreffirstRun.pdf
	cd examples && biber 15hyperref
	cd examples && pdflatex 15hyperref.tex

examples/16include.pdf: \
	examples/16include.tex
	cd examples && pdflatex 16include.tex

examples/18adjustcaptions.pdf: \
	examples/18adjustcaptions.tex
	cd examples && pdflatex 18adjustcaptions.tex

<file_sep>/latexIntroCourse/examples/08.tex
\documentclass{article}
\begin{document}

\section{Overskrift}
Noget andet tekst der gentages en del gange
\cite{Reference}.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange
\cite{AnotherRef}.
Noget andet tekst der gentages en del gange.

\begin{thebibliography}{99}
\bibitem{Reference} First author
 {\it Book title},
 Publishing date.
\bibitem{AnotherRef} Second author
 {\it Some different book title},
 Publishing date.
\end{thebibliography}

\end{document}
<file_sep>/errors/Makefile
clean:
	rm -f *.pdf
	rm -f *.aux
<file_sep>/latexIntroCourse/examples/12.tex
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  %color one half of a unit circle
  \begin{scope}
    \clip (0,0) circle (1cm);
    \fill[black] (0cm,1cm) rectangle (-1cm, -1cm);
  \end{scope}
  %fill heads
  \fill[black] (0,0.5) circle (0.5cm);
  \fill[white] (0,-0.5) circle (0.5cm);
  %fill eyes
  \fill[white] (0,0.5) circle (0.1cm);
  \fill[black] (0,-0.5) circle (0.1cm);
  %outer line
  \draw (0,0) circle (1cm);
\end{tikzpicture}
\end{document}
<file_sep>/examples/040biblatexbasics.tex
\documentclass[a4paper]{article}
\usepackage[style=authoryear]{biblatex}
\bibliography{040biblatexlibrary.bib}

\begin{document}
\section{Introduction}
See this book about \LaTeX{} \parencite{companion}.

\printbibliography
\end{document}
<file_sep>/latexIntroCourse/examples/04b.tex
\documentclass{article}

\begin{document}

\begin{enumerate}
\item	Banan
	\begin{itemize}
	\item	Banan
	\item	Volvo
	\end{itemize}
\item	Volvo
\end{enumerate}

\end{document}
<file_sep>/latexIntroCourse/examples/skabelon/doc/project.tex
\documentclass[11pt,a4paper,fleqn]{article}
% Sørger for at prædefinerede tekster står på dansk.
\usepackage[danish]{babel}

% Håndter æøå.
\usepackage[utf8]{inputenc}

% Opstil ligninger med align miljøet
\usepackage{amsmath}

% Øg teksthøjden med 2 cm på alle sider
\usepackage[margin=4cm, marginparwidth=3cm]{geometry}

% Definerer indholdet af sidehoved og sidefod.
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{Latex rodebunke}
\chead{}
\rhead{\rightmark}
\lfoot{<NAME>}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}

% Gør det muligt at vise kildekode med syntaks
% fremhævning i dokumentet.
\usepackage{listings}
\lstset{language=TeX,
	basicstyle=\footnotesize,
	tabsize=4,
	numbers=left,
	numberstyle=\tiny,
	stepnumber=1,
	numbersep=5pt}

% Gør det muligt at inkludere grafik (bl.a. png og jpg)
% i dokumentet.
\usepackage{graphicx}

% Definerer hvordan figur tekster ser ud.
\usepackage[
	textfont={rm, it},
	labelfont={bf}]
	{caption}

% Aktiverer todonotes pakken
\usepackage{todonotes}

% Gør det muligt at følge henvisninger (links) i dokumentet.
% Beskriver hvordan henvisningerne bliver vist.
\usepackage[
	colorlinks=true,
	linkcolor=black,
	citecolor=black,
	urlcolor=black]
	{hyperref}

% Korrigerer hvor hyperref hopper hen ved links til figurer.
\usepackage[all]{hypcap}

% Sørg for at formler nummereres inden for hvert afsnit.
\numberwithin{equation}{section}

% Aktiverer tegne funktionaliteten i tikz / pgf.
\usepackage{tikz}

\author{<NAME>}
\title{Latex rodebunke med forklaringer}
\date{2014-03-20}

\begin{document}
\maketitle
\newpage
\tableofcontents
\listoftodos
\newpage

% ==================================================================
% ====== Introduktion ==============================================
% ==================================================================
\section{Introduktion}

I dette dokument vises det hvordan en række forskellige ting kan
gøres i latex.
\todo{Man kan også indsætte kommentarer i margen om ting der skal
ændres / forbedres / tjekkes senere.}
Der er eksempler på hvordan man indsætter en figur, noget kildekode
og meget mere \ldots

\section{Lister}

Latex kan formatere tekst på mange forskellige måder.
Ofte struktureres ting ved at opstille lister, det kan gøres på denne måde:
%
\begin{lstlisting}
\begin{itemize}
	\item Hund
	\item Elefant
	\item Pindsvin
\end{itemize}
\end{lstlisting}
%
Hvilket givet nedenstående resultat
%
\begin{itemize}
	\item Hund
	\item Elefant
	\item Pindsvin
\end{itemize}
%
Ønsker man en nummereret liste benyttes \emph{enumerate}
i stedet for \emph{itemize}.
\todo{Eksempel med lister i lister.}
Desuden er det muligt at beskrive en række ting
%
\begin{description}
	\item[Æble:] 	En frugt
	\item[Abe:]	Et dyr
\end{description}
%
Koden til det ovenstående er
%
\begin{lstlisting}
\begin{description}
	\item[Banan:] 	En frugt
	\item[Abe:]	Et dyr
\end{description}
\end{lstlisting}

\section{En figur i TikZ}

PGF/TikZ er et meget kraftfuldt tegnemiljø til \LaTeX .
På \url{http://www.fauskes.net/pgftikzexamples/} er der en stor
samling af eksempler på hvad PGF / TikZ kan præstere.

\subsection{Enhedscirklen med kommentarer}

\begin{tikzpicture}[scale=2.5,cap=round]
  % Local definitions
  \def\costhirty{0.8660256}

  % Colors
  \colorlet{anglecolor}{green!50!black}
  \colorlet{sincolor}{red}
  \colorlet{tancolor}{orange!80!black}
  \colorlet{coscolor}{blue}

  % Styles
  \tikzstyle{axes}=[]
  \tikzstyle{important line}=[very thick]
  \tikzstyle{information text}=[rounded corners,fill=red!10,inner sep=1ex]

  % The graphic
  \draw[style=help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);

  \draw (0,0) circle (1cm);

  \begin{scope}[style=axes]
    \draw[->] (-1.5,0) -- (1.5,0) node[right] {$x$};
    \draw[->] (0,-1.5) -- (0,1.5) node[above] {$y$};

    \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1}
      \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white]
            {$\xtext$};

    \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}
      \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white]
            {$\ytext$};
  \end{scope}

  \filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm);
  \draw (15:2mm) node[anglecolor] {$\alpha$};

  \draw[style=important line,sincolor]
    (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} +(0,-.5);

  \draw[style=important line,coscolor]
    (0,0) -- node[below=2pt,fill=white] {$\cos \alpha$} (\costhirty,0);

  \draw[style=important line,tancolor] (1,0) --
    node [right=1pt,fill=white]
    {
      $\displaystyle \tan \alpha \color{black}=
      \frac{{\color{sincolor}\sin \alpha}}{\color{coscolor}\cos \alpha}$
    } (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);

  \draw (0,0) -- (t);

  \draw[xshift=2.00cm] node [right,text width=6cm,style=information text]
    {
      The {\color{anglecolor} angle $\alpha$} is $30^\circ$ in the
      example ($\pi/6$ in radians). The {\color{sincolor}sine of
        $\alpha$}, which is the height of the red line, is
      \[
      {\color{sincolor} \sin \alpha} = 1/2.
      \]
      By the Theorem of Pythagoras we have ${\color{coscolor}\cos^2 \alpha} +
      {\color{sincolor}\sin^2\alpha} =1$. Thus the length of the blue
      line, which is the {\color{coscolor}cosine of $\alpha$}, must be
      \[
      {\color{coscolor}\cos\alpha} = \sqrt{1 - 1/4} = \textstyle
      \frac{1}{2} \sqrt 3.
      \]%
      This shows that {\color{tancolor}$\tan \alpha$}, which is the
      height of the orange line, is
      \[
      {\color{tancolor}\tan\alpha} = \frac{{\color{sincolor}\sin
          \alpha}}{\color{coscolor}\cos \alpha} = 1/\sqrt 3.
      \]%
    };
\end{tikzpicture}

\newpage
% ==================================================================
% ====== Forskellige ting ==========================================
% ==================================================================
\section{Forskellige ting}

% ==================================================================
% ==================================================================
\subsection{Styre udseende af figur tekster}

I preamble kan man indstille hvordan figur tekster skal se ud i
dokumentet.
Det gøres ved at inkludere pakken \verb!caption! og give den en
række argumenter.
F.eks. giver følgende figur tekster hvor figur nummeret står med en
ikke kursiv fed tekst og resten af figur teksten står i
kursiv.
%
\begin{lstlisting}
\usepackage[textfont={rm, it}, labelfont={bf}]{caption}
\end{lstlisting}

% ==================================================================
% ==================================================================
\subsection{Interne links i dokumenter}

Når pakken \verb!hyperref! inkluderes i preamblet vil latex lave
henvisninger i dokumentet om til links, som læseren kan følge når
\todo{Noget der skal ændres i dokumentet.}
dokumentet læses.
%
\begin{lstlisting}
\usepackage{hyperref}
\end{lstlisting}
%
Hvis man ikke ønsker kasser omkring de dannede links (som det gøres
pr. default) kan ovenstående linie erstattes med følgende
%
\begin{lstlisting}
\usepackage[colorlinks=true, linkcolor=black,
            citecolor=black, urlcolor=black]{hyperref}
\end{lstlisting}
%
ønsker man at linkene skiller sig ud fra den omgivende tekst, kan
\verb!black! udskiftes med f.eks. \verb!red! og linkene bliver i så
fald røde.

% ==================================================================
% ==================================================================
\subsection{Sidehoved og sidefod}

Pakken \verb!fancyhdr!, gør det muligt at indsætte sidehoved og
sidefod på sine dokumenter.
%
\begin{lstlisting}
\usepackage{fancyhdr}
\end{lstlisting}
%
Udseendet af sidehovedet og sidefoden defineres ved følgende række
kommandoer, som regel er placeret i preamblet.
%
\begin{lstlisting}
\pagestyle{fancy}
\lhead{\korttitel}
\chead{}
\rhead{\rightmark}
\lfoot{\forfattere}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\end{lstlisting}
%
Ovenstående kode, er den der er benyttet til at generere sidehovedet
og foden på dette dokument.

\subsection{Skrive matematik}

Jeg benytter pakken \verb!amsmath! til at sætte formler op i.
Den giver mulighed for at skrive mellem regninger pænt under
hinanden (sådan at alle lighedstegn står over / under hinanden).
%
\begin{lstlisting}
\usepackage{amsmath}
\end{lstlisting}
%
Herunder er der nogle eksempler på hvordan matematikken kan se ud og
hvordan det skrives.
Først idiot formlen.
%
\begin{align}
1
	& = \sin(x)^2 + \cos(x)^2
\end{align}
%
\begin{lstlisting}
\begin{align}
1
	& = \sin(x)^2 + \cos(x)^2
\end{align}
\end{lstlisting}
%
Så Schrödinger ligningen i et endimensionelt system
%
\begin{align}
\left(\frac{-\hbar^2}{2m} \frac{\partial^2}{\partial x^2}
		+ V(x)\right) \Psi(t, x)
	& = E \Psi(t, x)
\end{align}
%
Koden er så
%
\begin{lstlisting}
\begin{align}
\left(\frac{-\hbar^2}{2m} \frac{\partial^2}{\partial x^2}
		+ V(x)\right) \Psi(t, x)
	& = E \Psi(t, x)
\end{align}
\end{lstlisting}
%
Har man behov for at forklare hvad de enkelte dele af en formel
betyder, kan det gøres med
\verb!\underbrace{formel del}_{forklaring}! kommandoen.
%
\begin{align}
\underbrace{\left(\underbrace{\frac{-\hbar^2}{2m}
		\frac{\partial^2}{\partial x^2}}_{\textrm{Kinetisk energi}}
		+ \underbrace{V(x)}_{\textrm{Potentiel energi}}
		\right)}_{\textrm{Hamilton operator}}
		\underbrace{\Psi(t, x)}_{\textrm{Bølgefunktion}}
	& = \underbrace{E}_{\textrm{Systemets energi}} \Psi(t, x)
\end{align}
%
\begin{lstlisting}
\begin{align}
\underbrace{\left(\underbrace{\frac{-\hbar^2}{2m}
		\frac{\partial^2}{\partial x^2}}_{\textrm{Kinetisk energi}}
		+ \underbrace{V(x)}_{\textrm{Potentiel energi}}
		\right)}_{\textrm{Hamilton operator}}
		\underbrace{\Psi(t, x)}_{\textrm{Blgefunktion}}
	& = \underbrace{E}_{\textrm{Systemets energi}} \Psi(t, x)
\end{align}
\end{lstlisting}

% ==================================================================
% ==================================================================
% ==================================================================
\end{document}

<file_sep>/latexIntroCourse/examples/11.tex
\documentclass{article}
\usepackage{todonotes}
\begin{document}

Noget tekst der gentages.
Noget tekst der gentages.
Noget tekst der gentages.
\todo{Noget jeg skal huske \ldots}
Meget mere tekst der gentages.
Meget mere tekst der gentages.
Meget mere tekst der gentages.
\todo[inline]{Noget andet der skal huskes}

\listoftodos

\end{document}
<file_sep>/examples/007References.tex
\documentclass{article}

\begin{document}
\section{Main heading}
\label{secMainHeading}

Check out \ref{ssecSubHeading} on page \pageref{ssecSubHeading}
Simple repeated text.
Simple repeated text.

\subsection{Sub heading}
\label{ssecSubHeading}

Simple repeated text.
Simple repeated text.
See section \ref{secMainHeading}

\end{document}<file_sep>/latexIntroCourse/examples/04.tex
\documentclass{article}

\begin{document}

\begin{itemize}
\item	Banan
\item	Volvo
\end{itemize}

\begin{enumerate}
\item	Banan
\item	Volvo
\end{enumerate}

\begin{description}
\item[Banan:] En frugt
\item[Volvo:] En bil
\end{description}
\end{document}
<file_sep>/latexIntroCourse/examples/02paragraphs.tex
\documentclass{article}
\usepackage[danish]{babel}

\begin{document}
\section{Overskrift}

Tekst i afsnit.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.

Tekst i andet afsnit.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.

\end{document}
<file_sep>/latexIntroCourse/examples/10.tex
\documentclass{article}
\usepackage[danish]{babel}
\begin{document}

\begin{table}
\centering
\begin{tabular}{l | c | r r}
Venstre just& centreret & hoejre just & h just	\\
\hline
bla			& blas		& asga 		  & asdfa	\\
bla			& blas		& asga 		  & asdfa
\end{tabular}
\caption{Tekst der staar under tabellen.}
\label{tabTabelOverHmm}
\end{table}

Se noget i tabel \ref{tabTabelOverHmm}.

\end{document}
<file_sep>/errors/test007.tex
\documentclass{article}
\begin{document}
\[

  f(x)=ax^2+bx+c

\]
\end{document}<file_sep>/latexIntroCourse/examples/06figureplacements.tex
\documentclass{article}
\usepackage{graphicx}

\begin{document}
First section of text.

\begin{figure}
\centering
\rule{7cm}{1cm}
\caption{Fig 1}
\end{figure}

Second section of text.

\begin{figure}[h]
\centering
\rule{7cm}{1cm}
\caption{Fig 2}
\end{figure}

Third section of text.

\end{document}
<file_sep>/installationGuide/installingLatex.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{todonotes}
\usepackage{graphicx}
\usepackage[colorlinks, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}

\title{Installation af \LaTeX}
\author{<NAME>}

\begin{document}
\maketitle

Dette dokument beskriver hvordan man installerer \LaTeX{} og
efterfølgende tjekker at det virker.
\LaTeX{} virker på alle operativsystemer, men installationsprocessen
er noget forskellig mellem de enkelte operativsystemer.
Processen er beskrevet i afsnit \ref{secInstallation} og
det efterfølgende tjek af installationen er beskrevet i
afsnit \ref{secTjekAfAtInstallationenVirker}.

\section{Installation}
\label{secInstallation}

\subsection{Windows}

Følg nedenstående skridt:
\begin{enumerate}
\item	Gå ind på \url{http://miktex.org/download}
\item	Download \emph{Basic MiKTeX installer (Windows 32-bit)}, downloaden fylder ca. 180MB.
\item	Kør installationsprogrammet
\end{enumerate}

\subsection{Mac}

Følg nedenstående skridt:
\begin{enumerate}
\item	Gå ind på \url{https://tug.org/mactex/mactex-download.html}
\item	Download \emph{MacTeX.pkg}, filen fylder ca. 2.5GB.
\item	Dobbeltklik på den hentede fil og installationen starter.
\end{enumerate}

\subsection{Linux}

Skriv følgende i en terminal
\begin{verbatim}
sudo apt-get install texlive
\end{verbatim}

\section{Tjek af at installationen virker}
\label{secTjekAfAtInstallationenVirker}

Følg følgende skridt:
\begin{enumerate}
\item	Start programmet TeXworks
\item	I et nyt dokument indskriv følgende linjer
\begin{verbatim}
\documentclass{article}
\begin{document}
\section{Hello world!}
\end{document}
\end{verbatim}
\item	Gem filen som ``test.tex'' i en ny mappe.
\item	Oversæt dokumentet med pdflatex ved at trykke på den grønne knap
		øverst til venstre.
\item	TeXworks vil nu åbne et nyt vindue, i hvilket teksten
		``1 Hello world!'' vises.
\end{enumerate}

\end{document}<file_sep>/latexIntroCourse/examples/16include.tex
\documentclass{article}
\begin{document}
\include{16includePartA}
\end{document}
<file_sep>/latexIntroCourse/examples/07a.tex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
1 = \sin(x)^2 + \cos(x)^2
\end{align}

\begin{align}
\cos(C) = \frac{c^2 - a^2 - b^2}{2 \cdot a \cdot b}
\end{align}

\begin{align}
\exp(i\theta) = \cos(\theta) + i \sin(\theta)
\end{align}
\end{document}
<file_sep>/latexIntroCourse/examples/skabelon/Makefile
# project/Makefile

PROJEKTNAVN := project

MODULES := \
	doc/pic \
	doc \

# Each module will add to this
DEPENDENCIES :=

SRC :=

CLEAN :=

DISTCLEAN :=

CC := g++

default: doc/${PROJEKTNAVN}.pdf

# include the description for
# each module
include $(patsubst %, \
	%/modules.mk,$(MODULES))

.phony: view

view: kpdf

kpdf: doc/${PROJEKTNAVN}.pdf
	kpdf doc/${PROJEKTNAVN}.pdf

kdvi: doc/${PROJEKTNAVN}.dvi
	kdvi doc/${PROJEKTNAVN}.dvi

xdvi: doc/${PROJEKTNAVN}.dvi
	xdvi doc/${PROJEKTNAVN}.dvi

# Fjerner midlertidige filer
clean:
	@rm -f $(CLEAN)

# Fjerner alle filer der kan gendannes vha. simpel regnekraft.
distclean: clean
	@rm -f $(DISTCLEAN)

<file_sep>/latexIntroCourse/examples/09.tex
\documentclass{article}
\begin{document}

\bibliographystyle{unsrt}

\section{Introduction}
The discovery of the Quantised Hall Effect was made
by Klitzing~\cite{klitzing:qhe} for which he was
awarded the 1985 Nobel prize for
physics~\cite[page 12]{klitzing:nobel}.

\bibliography{bibtexfile}
\end{document}
<file_sep>/latexIntroCourse/examples/skabelon/doc/pic/modules.mk
# projekt/doc/pic/modules.mk

DEPENDENCIES += \
	doc/pic/figur.png

SRC += \

CLEAN += \

DISTCLEAN += \

# Example
# doc/pic/cs/original.eps:\
# 	doc/pic/cs/original.jpg
# 	cd doc/pic/cs && convert original.jpg original.eps

<file_sep>/latexIntroCourse/examples/01c.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\begin{document}
Hello world!

På Ærø ligger Marstal.
\end{document}
<file_sep>/examples/005BasicMarkup.tex
\documentclass{article}

\begin{document}
\section{Main heading}

Simple repeated text.
Simple repeated text.

\subsection{Sub heading}

Simple repeated text.
Simple repeated text.

\section{Hello}

Simple repeated text.
Simple repeated text.

\subsection{World}

Simple repeated text.
Simple repeated text.

\end{document}<file_sep>/examples/050minireport.tex
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[style=authoryear]{biblatex}
\bibliography{040biblatexlibrary.bib}

\title{Øvelsesrapport}
\author{<NAME>}
\begin{document}
\maketitle

\section{Introduktion}

I denne øvelse skal vi læse om \LaTeX{} i bogen
\parencite{companion}.
Desuden skal vi i afsnit \ref{secFigurer} se på hvordan
man indsætter figurer i latex.

\section{Figurer}
\label{secFigurer}

Se figur \ref{figEtBilledeAfNogleSukkerroer}.

\begin{figure}[h]
\centering
\includegraphics[width=6cm]{img/image.jpg}
\caption{Et billede af nogle sukkerroer.}
\label{figEtBilledeAfNogleSukkerroer}
\end{figure}

Vi kan også skrive noget matematik, eksempelvis
Pythagoras' læresætning
\begin{align}
a^2 + b^2 = c^2
\end{align}

\section{Konklusion}

Latex virker \ldots

\printbibliography
\end{document}
<file_sep>/latexIntroCourse/examples/03.tex
\documentclass{article}

\title{Test dokument}
\author{<NAME>}
\date{\today}

\begin{document}
\maketitle

\section{Her starter vi med indholdet}

Noget tekst.
\end{document}
<file_sep>/latexIntroCourse/environmentanatomy.tex
\begin{environment}[opt]{req}
...
...
...
\end{environment}
\begin{enumerate}
	\item Punkt 1
	\begin{itemize}
		\item Punkt 1.1
	\end{itemize}
\end{enumerate}
<file_sep>/latexIntroCourse/examples/13mhchemReactions.tex
\documentclass{article}
\usepackage[version=3]{mhchem}

\begin{document}
\ce{CO2 + C ->[\text{above}] 2CO}

\vspace{0.5cm}

\ce{SO4^2- + Ba^2+ -> BaSO4 v}

\end{document}
<file_sep>/latexIntroCourse/examples/09biblatex.tex
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{bibtexfile.bib}

\begin{document}

\section{Introduction}
The discovery of the Quantised Hall Effect was made
by Klitzing~\parencite{klitzing:qhe} for which he was
awarded the 1985 Nobel prize for
physics~\parencite[page 12]{klitzing:nobel}.

\printbibliography
\end{document}
<file_sep>/examples/013BabelDanish.tex
\documentclass{article}
\usepackage[danish]{babel}

\begin{document}
\tableofcontents

\section{Main heading}

Simple repeated text.
Simple repeated text.

\subsection{Sub heading}

Simple repeated text.
Simple repeated text.

\end{document}<file_sep>/latexIntroCourse/examples/05.tex
\documentclass{article}
\begin{document}

\section{Overskrift}
\label{secOverskrift}

\subsection{En underoverskrift}
\label{subsecUnderoverskrift}
Noget tekst. Se afsnit \ref{secOverskrift}
og \ref{subsecAndenunderoverskrift}.

\subsection{En anden underoverskrift}
\label{subsecAndenunderoverskrift}
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.
Se afsnit \ref{subsecUnderoverskrift}.

\end{document}
<file_sep>/errors/test008.tex
\documentclass{article}
\begin{document}
\[
  f(x)=\left\{\begin{array}{@{}ll}
    ax^2+bx+c, & x<0 \\
    dx^2+ex+f, & x\geq 0
  \end{array}
\]
\end{document}<file_sep>/latexIntroCourse/commandanatomy.tex
\commandname
\commandname{required}
\commandname{required}{required}
\commandname[optional]{required}
\commandname[optional]{required}{required}
\tableofcontents
\section{Overskrift}
\section[Kort overskrift]{Lang overskrift}
\usepackage[danish]{babel}
<file_sep>/latexIntroCourse/examples/02.tex
\documentclass{article}
\usepackage[danish]{babel}

\begin{document}
\tableofcontents
\section{Overskrift}

\subsection{En underoverskrift}
Noget tekst.

\subsection{En anden underoverskrift}
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.
Noget andet tekst der gentages en del gange.

\end{document}
<file_sep>/latexIntroCourse/examples/07.tex
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
1
	& = \sin(x)^2 + \cos(x)^2					\\
\left[A, B\right]
	& = AB - BA									\\
\label{eqnDiffusionEqn}
\frac{\partial }{\partial t} C(x, t)
	& = D \frac{\partial^2}{\partial x^2} C(x, t)
\end{align}
Formel \eqref{eqnDiffusionEqn} er diffusions ligningen.
\end{document}
<file_sep>/exercises/exercise01.tex
\documentclass{article}

\begin{document}
In March 2006, Congress raised that ceiling an additional \$0.79
trillion to \$8.97 trillion, which is approximately 68\% of GDP. As of
October 4, 2008, the “Emergency Economic Stabilization Act of
2008” raised the current debt ceiling to \$11.3 trillion.
\end{document}
<file_sep>/errors/test003.tex
\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{figure}
\centering
Figur bestående af tekst.
\caption{En figur.}
\label{figWithText}
\end{figure}

Se figur \ref{figWidthText}.

\end{document}<file_sep>/skabelon/project.tex
\documentclass[11pt,a4paper,fleqn]{article}
\usepackage[english, danish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
% Gør det muligt at inkludere grafik (bl.a. png og jpg) i dokumentet.
\usepackage[pdftex]{graphicx}
\usepackage{tikz}
% Definer hvordan figur tekster ser ud.
\usepackage[textfont={rm, it}, labelfont={bf}]{caption}
% Gør det muligt at medtage flere delfigurer i en enkelt samlet figur.
\usepackage{subfig}
% Aktiverer todonotes pakken
\usepackage{todonotes}
% Gør det muligt at følge henvisninger (links) i dokumentet.
% Beskriver hvordan henvisningerne bliver vist.
\usepackage[colorlinks=true, linkcolor=black, citecolor=black, urlcolor=black]{hyperref}
\usepackage[all]{hypcap}
% Gør det muligt at vise kildekode med syntaks fremhævning i dokumentet.
\usepackage{listings}
\lstset{language=TeX,
	basicstyle=\footnotesize,
	tabsize=4,
	numbers=left,
	numberstyle=\tiny,
	stepnumber=1,
	numbersep=5pt}

% ==================================================================
% ============== Setting up fancy headers ... ======================
% ==================================================================
% Holder styr på sidehoved og side fod
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\lhead{\korttitel}
\chead{}
\rhead{\rightmark}
\lfoot{\forfattere}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}

% Øg teksthøjden med 2 cm på alle sider
\addtolength\textheight{2cm}
\addtolength\topmargin{-1cm}
\addtolength\marginparwidth{1.5cm}
\addtolength\headheight{1.6pt}

\makeindex

% ==================================================================
% ============== Various options ===================================
% ==================================================================
\numberwithin{equation}{section}

% ==================================================================
% ============== Indledende oevelser ===============================
% ==================================================================
\title{\titel}
\author{}
\date{}

\newcommand{\forfattere}{<NAME>}
\newcommand{\titel}{Latex rodebunke med forklaringer}
\newcommand{\korttitel}{Latex rodebunke}
\newcommand{\dato}{2007-12-24}
\newcommand{\fag}{DM63}

\begin{document}

% ==================================================================
% ====== Forside ===================================================
% ==================================================================
\phantom{g}
\vspace{2.5cm}
\noindent
\begin{Huge}
{\titel}
\end{Huge}
\vspace{11cm}

\begin{tabular}{@{} l l @{}}
\hline
Titel           & \titel                \\
Udarbejdet af   & \forfattere           \\
Afleveringsdato & \dato					\\
Fag      		& \fag					\\
\hline
\end{tabular}
\thispagestyle{empty}
\newpage

\tableofcontents
\listoftodos
\newpage

% ==================================================================
% ====== Introduktion ==============================================
% ==================================================================
\section{Introduktion}

I dette dokument vises det hvordan en række forskellige ting kan
gøres i latex.
\todo{Man kan også indsætte kommentarer i margen om ting der skal
ændres / forbedres / tjekkes senere.}%
Der er eksempler på hvordan man indsætter en figur, noget kildekode
og meget mere \ldots

\section{Lister}

Latex kan formatere tekst på mange forskellige måder.
Ofte struktureres ting ved at opstille lister, det kan gøres på denne måde:
%
\begin{lstlisting}
\begin{itemize}
	\item Hund
	\item Elefant
	\item Pindsvin
\end{itemize}
\end{lstlisting}
%
Hvilket givet nedenstående resultat
%
\begin{itemize}
	\item Hund
	\item Elefant
	\item Pindsvin
\end{itemize}
%
Ønsker man en nummereret liste benyttes \emph{enumerate} i stedet for \emph{itemize}.
\todo{Eksempel med lister i lister.}%
Desuden er det muligt at beskrive en række ting
%
\begin{description}
	\item[Æble:] 	En frugt
	\item[Abe:]	Et dyr
\end{description}
%
Koden til det ovenstående er
%
\begin{lstlisting}
\begin{description}
	\item[Banan:] 	En frugt
	\item[Abe:]	Et dyr
\end{description}
\end{lstlisting}

\section{Billeder og figurer}

Billeder indsættes i latex med \verb!\includegraphics! kommandoen.
Ofte ønsker man at angive hvor stort billedet skal være, det gøres
med \verb!width! og \verb!height! options.

\includegraphics[width=5cm]{pic/figur.png}
\begin{verbatim}
\includegraphics[width=5cm]{pic/figur.png}
\end{verbatim}

Typisk indsættes billeder i et \verb!figure! miljø med tilhørende
figurnummber og tekst.
Figur \ref{figLabel} er lavet med nedenstående kode:

\begin{verbatim}
\begin{figure}
\centering
\includegraphics[width=7cm]{pic/figur.png}
\caption{En figurtekst.}
\label{figLabel}
\end{figure}
\end{verbatim}

\begin{figure}
\centering
\includegraphics[width=7cm]{pic/figur.png}
\caption{En figurtekst.}
\label{figLabel}
\end{figure}

\section{En figur i TikZ}

PGF/TikZ er et meget kraftfuldt tegnemiljø til \LaTeX .
På \url{http://www.fauskes.net/pgftikzexamples/} er der en stor
samling af eksempler på hvad PGF / TikZ kan præstere.

\subsection{Enhedscirklen med kommentarer}

\begin{tikzpicture}[scale=2.5,cap=round]
  % Local definitions
  \def\costhirty{0.8660256}

  % Colors
  \colorlet{anglecolor}{green!50!black}
  \colorlet{sincolor}{red}
  \colorlet{tancolor}{orange!80!black}
  \colorlet{coscolor}{blue}

  % Styles
  \tikzstyle{axes}=[]
  \tikzstyle{important line}=[very thick]
  \tikzstyle{information text}=[rounded corners,fill=red!10,inner sep=1ex]

  % The graphic
  \draw[style=help lines,step=0.5cm] (-1.4,-1.4) grid (1.4,1.4);

  \draw (0,0) circle (1cm);

  \begin{scope}[style=axes]
    \draw[->] (-1.5,0) -- (1.5,0) node[right] {$x$};
    \draw[->] (0,-1.5) -- (0,1.5) node[above] {$y$};

    \foreach \x/\xtext in {-1, -.5/-\frac{1}{2}, 1}
      \draw[xshift=\x cm] (0pt,1pt) -- (0pt,-1pt) node[below,fill=white]
            {$\xtext$};

    \foreach \y/\ytext in {-1, -.5/-\frac{1}{2}, .5/\frac{1}{2}, 1}
      \draw[yshift=\y cm] (1pt,0pt) -- (-1pt,0pt) node[left,fill=white]
            {$\ytext$};
  \end{scope}

  \filldraw[fill=green!20,draw=anglecolor] (0,0) -- (3mm,0pt) arc(0:30:3mm);
  \draw (15:2mm) node[anglecolor] {$\alpha$};

  \draw[style=important line,sincolor]
    (30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} +(0,-.5);

  \draw[style=important line,coscolor]
    (0,0) -- node[below=2pt,fill=white] {$\cos \alpha$} (\costhirty,0);

  \draw[style=important line,tancolor] (1,0) --
    node [right=1pt,fill=white]
    {
      $\displaystyle \tan \alpha \color{black}=
      \frac{{\color{sincolor}\sin \alpha}}{\color{coscolor}\cos \alpha}$
    } (intersection of 0,0--30:1cm and 1,0--1,1) coordinate (t);

  \draw (0,0) -- (t);

  \draw[xshift=2.00cm] node [right,text width=6cm,style=information text]
    {
      The {\color{anglecolor} angle $\alpha$} is $30^\circ$ in the
      example ($\pi/6$ in radians). The {\color{sincolor}sine of
        $\alpha$}, which is the height of the red line, is
      \[
      {\color{sincolor} \sin \alpha} = 1/2.
      \]
      By the Theorem of Pythagoras we have ${\color{coscolor}\cos^2 \alpha} +
      {\color{sincolor}\sin^2\alpha} =1$. Thus the length of the blue
      line, which is the {\color{coscolor}cosine of $\alpha$}, must be
      \[
      {\color{coscolor}\cos\alpha} = \sqrt{1 - 1/4} = \textstyle
      \frac{1}{2} \sqrt 3.
      \]%
      This shows that {\color{tancolor}$\tan \alpha$}, which is the
      height of the orange line, is
      \[
      {\color{tancolor}\tan\alpha} = \frac{{\color{sincolor}\sin
          \alpha}}{\color{coscolor}\cos \alpha} = 1/\sqrt 3.
      \]%
    };
\end{tikzpicture}

\newpage
% ==================================================================
% ====== Forskellige ting ==========================================
% ==================================================================
\section{Forskellige ting}

% ==================================================================
% ==================================================================
\subsection{Styre udseende af figur tekster}

I preamble kan man indstille hvordan figur tekster skal se ud i
dokumentet.
\todo{En ting jeg gerne vil have ændret i dokumentet.}%
Det gøres ved at inkludere pakken \verb!caption! og give den en
række argumenter.
F.eks. giver følgende figur tekster hvor figur nummeret står med en
ikke kursiv fed tekst og resten af figur teksten står i
kursiv.
%
\begin{lstlisting}
\usepackage[textfont={rm, it}, labelfont={bf}]{caption}
\end{lstlisting}

% ==================================================================
% ==================================================================
\subsection{Interne links i dokumenter}

Når pakken \verb!hyperref! inkluderes i preamblet vil latex lave
henvisninger i dokumentet om til links, som læseren kan følge når
\todo{Noget der skal ændres i dokumentet.}%
dokumentet læses.
%
\begin{lstlisting}
\usepackage{hyperref}
\end{lstlisting}
%
Hvis man ikke ønsker kasser omkring de dannede links (som det gøres
pr. default) kan ovenstående linie erstattes med følgende
%
\begin{lstlisting}
\usepackage[colorlinks=true, linkcolor=black,
            citecolor=black, urlcolor=black]{hyperref}
\end{lstlisting}
%
ønsker man at linkene skiller sig ud fra den omgivende tekst, kan
\verb!black! udskiftes med f.eks. \verb!red! og linkene bliver i så
fald røde.

% ==================================================================
% ==================================================================
\subsection{Sidehoved og sidefod}

Pakken \verb!fancyhdr!, gør det muligt at indsætte sidehoved og
sidefod på sine dokumenter.
%
\begin{lstlisting}
\usepackage{fancyhdr}
\end{lstlisting}
%
Udseendet af sidehovedet og sidefoden defineres ved følgende række
kommandoer, som regel er placeret i preamblet.
%
\begin{lstlisting}
\pagestyle{fancy}
\lhead{\korttitel}
\chead{}
\rhead{\rightmark}
\lfoot{\forfattere}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\end{lstlisting}
%
Ovenstående kode, er den der er benyttet til at generere sidehovedet
og foden på dette dokument.

\subsection{Skrive matematik}

Jeg benytter pakken \verb!amsmath! til at sætte formler op i.
Den giver mulighed for at skrive mellem regninger pænt under
hinanden (sådan at alle lighedstegn står over / under hinanden).
%
\begin{lstlisting}
\usepackage{amsmath}
\end{lstlisting}
%
Herunder er der nogle eksempler på hvordan matematikken kan se ud og
hvordan det skrives.
Først idiot formlen.
%
\begin{align*}
1
	& = \sin(x)^2 + \cos(x)^2
\end{align*}
%
\begin{lstlisting}
\begin{align*}
1
	& = \sin(x)^2 + \cos(x)^2
\end{align*}
\end{lstlisting}
%
Så Schrödinger ligningen i et endimensionelt system
%
\begin{align}
\left(\frac{-\hbar^2}{2m} \frac{\partial^2}{\partial x^2}
		+ V(x)\right) \Psi(t, x)
	& = E \Psi(t, x)
\end{align}
%
Koden er så
%
\begin{lstlisting}
\begin{align}
\left(\frac{-\hbar^2}{2m} \frac{\partial^2}{\partial x^2}
		+ V(x)\right) \Psi(t, x)
	& = E \Psi(t, x)
\end{align}
\end{lstlisting}
%
Har man behov for at forklare hvad de enkelte dele af en formel
betyder, kan det gøres med
\verb!\underbrace{formel del}_{forklaring}! kommandoen.
%
\begin{align}
\nonumber
\underbrace{\left(\underbrace{\frac{-\hbar^2}{2m}
		\frac{\partial^2}{\partial x^2}}_{\textrm{Kinetisk energi}}
		+ \underbrace{V(x)}_{\textrm{Potentiel energi}}
		\right)}_{\textrm{Hamilton operator}}
		\underbrace{\Psi(t, x)}_{\textrm{Bølgefunktion}}
	& = \underbrace{E}_{\textrm{Systemets energi}} \Psi(t, x)
\end{align}
%
\begin{lstlisting}
\begin{align}
\nonumber
\underbrace{\left(\underbrace{\frac{-\hbar^2}{2m}
		\frac{\partial^2}{\partial x^2}}_{\textrm{Kinetisk energi}}
		+ \underbrace{V(x)}_{\textrm{Potentiel energi}}
		\right)}_{\textrm{Hamilton operator}}
		\underbrace{\Psi(t, x)}_{\textrm{Blgefunktion}}
	& = \underbrace{E}_{\textrm{Systemets energi}} \Psi(t, x)
\end{align}
\end{lstlisting}

% ==================================================================
% ==================================================================
% ==================================================================
\end{document}

<file_sep>/latexIntroCourse/examples/18adjustcaptions.tex
\documentclass{article}
\usepackage[textfont={rm, it}, labelfont={bf}]{caption}

\begin{document}
First section of text.
Second section of text.
Third section of text.

\begin{figure}
\centering
\rule{7cm}{1cm}
\caption{Caption of the figure.}
\end{figure}

\end{document}
<file_sep>/errors/test005.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

Ifølge pythagoras er sidelængden af en retvinklet trekants hypotenuse $c$ givet ud fra
kateterne ($a$ og $b$). Nogle heltallige eksempler er givet i tabel \ref{tabPythagoras}.
De er genereret ud fra de to hele tal $n$ og $m$ ud fra nedenstående formel.

\begin{align}
(a, b, c) = (m^2 – n^2, 2 \cdot m \cdot n, m^2 + n^2)
\end{align}

\begin{table}
\centering
\begin{tabular}{lr|rr}
$n$ & $m$ & $a$ & $b$ & $c$ \\
\hline
1 & 2 	& 3 		& 4 		& 5	\\
1 & 3 	& 8 		& 6 		& 10	\\
2 & 3 	& 5 		& 12 	& 13	\\
1 & 4 	& 15 	& 8 		& 17	\\
2 & 4 	& 12 	& 16 	& 20	\\
3 & 4 	& 7 		& 24 	& 25	\\
\end{tabular}
\caption{Pythagorære tripler}
\label{tabPythagoras}
\end{table}

\end{document}<file_sep>/latexIntroCourse/examples/06.tex
\documentclass{article}
\usepackage{graphicx}
\usepackage[danish]{babel}

\begin{document}

\begin{figure}
\centering
\includegraphics[width=6cm]{vandstraaler.jpg}
\caption{En tekst der forklarer figuren.}
\label{figImage}
\end{figure}

Se illustrationen i figur \ref{figImage}.

\end{document}
<file_sep>/latexIntroCourse/examples/skabelon/doc/modules.mk
# projekt/doc/modules.mk

RERUNCONDITION := "(There were undefined references|Rerun to get (cross-references|the bars) right)"

DEPENDENCIES += \
	doc/var/citations.bib \

SRC += \
	doc/${PROJEKTNAVN}.tex

CLEAN += \
	doc/${PROJEKTNAVN}.aux \
	doc/${PROJEKTNAVN}.lof \
	doc/${PROJEKTNAVN}.log \
	doc/${PROJEKTNAVN}.lot \
	doc/${PROJEKTNAVN}.toc \
	doc/${PROJEKTNAVN}.bbl \
	doc/${PROJEKTNAVN}.blg \
	doc/${PROJEKTNAVN}.idx \
	doc/${PROJEKTNAVN}.out \
	doc/${PROJEKTNAVN}.ind \
	doc/${PROJEKTNAVN}.ilg \
	doc/${PROJEKTNAVN}.tdo \

DISTCLEAN += \
	doc/${PROJEKTNAVN}.dvi \
	doc/${PROJEKTNAVN}.pdf \
	doc/${PROJEKTNAVN}.ps

doc/${PROJEKTNAVN}.pdf : \
	${DEPENDENCIES} \
	doc/${PROJEKTNAVN}.tex
	cd doc && pdflatex ${PROJEKTNAVN}.tex
	cd doc && pdflatex ${PROJEKTNAVN}.tex
	#cd doc && bibtex ${PROJEKTNAVN}
	#cd doc && makeindex ${PROJEKTNAVN}
	cd doc && egrep -c ${RERUNCONDITION} ${PROJEKTNAVN}.log && pdflatex ${PROJEKTNAVN}.tex; true
	cd doc && egrep -c ${RERUNCONDITION} ${PROJEKTNAVN}.log && pdflatex ${PROJEKTNAVN}.tex; true

doc/${PROJEKTNAVN}.dvi : \
	${DEPENDENCIES} \
	doc/${PROJEKTNAVN}.tex
	cd doc && latex ${PROJEKTNAVN}.tex
	#cd doc && bibtex ${PROJEKTNAVN}
	#cd doc && makeindex ${PROJEKTNAVN}
	cd doc && egrep -c ${RERUNCONDITION} ${PROJEKTNAVN}.log && latex ${PROJEKTNAVN}.tex; true
	cd doc && egrep -c ${RERUNCONDITION} ${PROJEKTNAVN}.log && latex ${PROJEKTNAVN}.tex; true

doc/${PROJEKTNAVN}.ps : doc/${PROJEKTNAVN}.dvi
	cd doc && dvips ${PROJEKTNAVN}.dvi -o ${PROJEKTNAVN}.ps

<file_sep>/latexIntroCourse/examples/13mhchem.tex
\documentclass{article}
\usepackage[version=3]{mhchem}

\begin{document}
\ce{H2O}

\vspace{0.5cm}

\ce{(NH4)2S}

\vspace{0.5cm}

\ce{^{227}_{90}Th+}

\vspace{0.5cm}

\ce{CrO4^2-}

\end{document}
<file_sep>/latexIntroCourse/examples/16includePartA.tex
\section{Hej}
Tekst
<file_sep>/latexIntroCourse/examples/15hyperref.tex
\documentclass{article}
\usepackage[colorlinks]{hyperref}
% \usepackage[colorlinks, linkcolor=blue,
%	urlcolor=blue, citecolor=blue]{hyperref}
\usepackage[style=authoryear]{biblatex}
\bibliography{bibtexfile}

\begin{document}

\section{Introduction}
\label{secIntroduction}

The discovery of the Quantised Hall Effect was made
by Klitzing~\parencite{klitzing:qhe} for which he was
awarded the 1985 Nobel prize for
physics~\parencite[page 12]{klitzing:nobel}.

Reference to the introduction \ref{secIntroduction}.
A useful webpage \url{www.google.com}.

\printbibliography
\end{document}<file_sep>/examples/027Figures.tex
\documentclass{article}
\usepackage{graphicx}

\begin{document}

\begin{figure}
\centering
\includegraphics[width=5cm]{img/image.jpg}
\caption{Figur tekst.}
\label{figPlanter}
\end{figure}

See figure \ref{figPlanter}.

\end{document}<file_sep>/errors/test002.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

Brøkregneregler
\begin{align}
\frac{a}b}
	& = \frac{a \cdot c{b \cdot c}		\qquad c \neq 0
\end{align}

\end{document}<file_sep>/examples/025Images.tex
\documentclass{article}
\usepackage{graphicx}

\begin{document}

\includegraphics[width=5cm]{img/image.jpg}

\end{document}<file_sep>/examples/020MathOne.tex
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
c^2
	= a^2 + b^2		\\
c^2
	= a^2 + b^2 - 2 a \cdot b \cdot \cos(C)		\\
\cos(C)
	= \frac{a^2 + b^2 - c^2}{2 \cdot a \cdot b}
\end{align}
\begin{align}
c^2
	& = a^2 + b^2		\\
c^2
	& = a^2 + b^2 - 2 a \cdot b \cdot \cos(C)		\\
\cos(C)
	& = \frac{a^2 + b^2 - c^2}{2 \cdot a \cdot b}
\end{align}
\end{document}<file_sep>/exercises/exercise03.tex
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage[colorlinks, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage[danish]{babel}
\usepackage{graphicx}

\title{Test dokument}
\author{Henrik}

\begin{document}
\maketitle

\tableofcontents

\section{Først overskrift}
\label{secFoersteOverskrift}
Dette er et lille test dokument, hvor der er henvisninger, overskrifter
og lidt matematik.

\subsection{Underoverskrift}
\label{ssecUnderoverskrift}
Noget mere tekst efterfulgt af en formel.
\begin{align}
\label{eqnPythagoras}
a^2 + b^2 = c^2
\end{align}

\subsection{Endnu et afsnit}
I afsnit \ref{ssecUnderoverskrift} blev Pythagoras' læresætning
\eqref{eqnPythagoras} præsenteret.

\section{Mere matematik}

\begin{align}
c
	& = \sqrt{a^2 + b^2}			\\
\frac{d}{dx} x^2
	& = 2x
\end{align}

\section{Nogle lister}

En punkt opstillet liste
\begin{itemize}
\item	bananer
\item	citroner
\item	æbler
\end{itemize}

En nummereret liste
\begin{enumerate}
\item	Cykle til bilka
\item	Handle ind
\item	Cykle hjem
\end{enumerate}

\section{Figurer}

Se på figur \ref{figTestFigure}.

\begin{figure}
\centering
\includegraphics[width=6cm]{pic/figur.png}
\caption{Et png billede der er indsat.}
\label{figTestFigure}
\end{figure}

\end{document}<file_sep>/latexIntroCourse/examples/14siunitx.tex
\documentclass{article}
\usepackage{siunitx}

\begin{document}
\SI{5}{\meter\per\second}

\si{\newton}

\SI{10}{\newton\per\meter\squared}

\end{document}
\SI{42}{\micro\meter}

\end{document}
<file_sep>/errors/test001.tex
\documentclass{article}
\begin{document}
Hej

\sectin{Overskrift}
\end{document}

languages: Makefile TeX

repo_language: Makefile

repo_name: henrikmidtiby/IntroduktionTilLatex


text:
<file_sep>/**
 * Route Mappings
 * (sails.config.routes)
 *
 * Your routes tell Sails what to do each time it receives a request.
 *
 * For more information on configuring custom routes, check out:
 * https://sailsjs.com/anatomy/config/routes-js
 */

module.exports.routes = {

  /***************************************************************************
  *                                                                          *
  * Make the view located at `views/homepage.ejs` your home page.            *
  *                                                                          *
  * (Alternatively, remove this and add an `index.html` file in your         *
  * `assets` directory)                                                      *
  *                                                                          *
  ***************************************************************************/

  '/': {
    view: 'homepage'
  },

  /***************************************************************************
  *                                                                          *
  * Custom routes here...                                                    *
  *                                                                          *
  * If a request to a URL doesn't match any of the custom routes above, it   *
  * is matched against Sails route blueprints. See `config/blueprints.js`    *
  * for configuration options and examples.                                  *
  *                                                                          *
  ***************************************************************************/
  'PUT /login': 'UserController.login',
  'POST /logout': 'UserController.logout',
  'GET /users': 'UserController.getUsers',
  'GET /users/:id': 'UserController.getUser',

  'GET /cars': 'CarController.find',

  'POST /stores': 'StoreController.createStore',
  'POST /stores/:storeId/cars': 'StoreController.addCar',
  'GET /stores': 'StoreController.find',
  'GET /stores/:storeId/cars': 'StoreController.getCars',
};
<file_sep>/**
 * UserController
 *
 * @description :: Server-side actions for handling incoming requests.
 * @help        :: See https://sailsjs.com/docs/concepts/actions
 */

var Emailaddresses = require('machinepack-emailaddresses');
var Passwords = require('machinepack-passwords');
var Strings = require('machinepack-strings');

module.exports = {

  login: (req, res) => {
    User.findOne({
      email: req.param('email'),
    })
    .exec((err, user) => {
      if (err) {
        sails.log.error(err);
        return res.badRequest(err);
      }
      if (!user) {
        return res.notFound();
      }

      Passwords.checkPassword({
        passwordAttempt: req.param('password'),
        encryptedPassword: <PASSWORD>,
      }).exec({
        error: (err) => {
          sails.log.error(err);
          return res.badRequest(err);
        },

        incorrect: () => {
          return res.notFound();
        },

        success: () => {
          if (user.deleted) {
            return res.forbidden('Your account has been deleted.');
          }

          req.session.userId = user.id;

          return res.ok({
            userId: user.id,
            username: user.email,
            admin: user.admin,
          });
        }
      });
    });
  },

  logout: (req, res) => {
    User.findOne(req.session.userId, (err, user) => {
      if (err) {
        return res.negotiate(err);
      }

      if (!user) {
        sails.log.verbose('Session refers to a user who no longer exists.');
        return res.redirect('/');
      }

      req.session.userId = null;

      return res.ok();
    });
  },

  getUsers: (req, res) => {
    User.count().exec((err, numberOfUsers) => {
      if (err) { return res.negotiate(err); }
      if (!numberOfUsers) { return res.notFound(); }

      User.find({
        limit: 10,
        skip: req.param('skip'),
      })
      .exec((err, foundUsers) => {
        if (err) { return res.serverError(err); }

        return res.json({
          total: numberOfUsers,
          data: foundUsers,
        });
      });
    });
  },

  getUser: (req, res) => {
    User.findOne({
      id: req.param('id'),
    }).exec((err, user) => {
      if (err) {
        return res.serverError(err);
      }

      if (!user) {
        return res.notFound();
      }

      return res.json({
        id: user.id,
        email: user.email,
        admin: user.admin,
      });
    });
  },
};
<file_sep>/**
 * Bootstrap
 * (sails.config.bootstrap)
 *
 * An asynchronous bootstrap function that runs before your Sails app gets lifted.
 * This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
 *
 * For more information on bootstrapping your app, check out:
 * https://sailsjs.com/config/bootstrap
 */

module.exports.bootstrap = function(done) {
  const Passwords = require('machinepack-passwords');

  User.findOne({
    email: '<EMAIL>',
  }).exec((err, user) => {
    if (err) {
      return done(err);
    }

    if (user) {
      return done();
    }

    Passwords.encryptPassword({
      password: '<PASSWORD>',
    }).exec({
      error: (err) => {
        return done(err);
      },

      success: (result) => {
        let options = {};
        options.email = '<EMAIL>';
        options.encryptedPassword = <PASSWORD>;
        options.deleted = false;
        options.admin = false;
        User.create(options).exec((err, user) => {
          if (err) {
            return done(err);
          }
          return done();
        });
      },
    });
  });
};

branch_name: refs/heads/master

repo_language: JavaScript

repo_name: mmayla/AutoTraderBackendDemo


text:
<file_sep>
syntax on " ハイライト表示
set nocompatible " vi互換にしない
set noinsertmode " デフォルトをインサートモードにしない
set wrap " 行の端まで到達すると折り返す
set backspace=1 " 全てバックスペースで削除可能にする
set noerrorbells " エラー時にベルを鳴らさない
set cmdheight=1 " コマンドラインの高さ
set shortmess=t " 'Press RETURN or enter command to continue' を表示しない
set ignorecase " 検索文字列が小文字のみの場合、大文字･小文字を区別しない
set smartcase " 検索文字列に大文字が含まれていると、大文字･小文字を区別する
set history=100 " 保存するコマンド数
set wildmode=list:longest " コマンドライン補完をシェルと同じに
set magic " 正規表現使用時に magic モードにする
set incsearch " 検索してすぐにその単語の所まで飛ぶ
set hlsearch " 検索ワードをハイライトする
set iminsert=1 " 日本語入力状態でもEscでコマンドモードへ
set number
set listchars=tab:-\ " タブの代替文字
set expandtab "タブ入力がスペースに変換される。
set list " タブを表示
set tabstop=2 " タブ幅
set shiftwidth=2 " インデント幅
set wrapscan " ファイルの最後に来たら最初から検索
set laststatus=2 " 常にステータス行を表示
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%04B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set showmatch " 対応する括弧に一時的に移動
set showcmd " 実行したコマンドを表示
set history=100 " 記憶するコマンド数
map + <C-W><S-+> " + でカレントウィンドウを大きく
set smartindent
"set backup
"set backupdir=$HOME/backup/vim
"set backupskip=/tmp/*,/private/tmp/*

" Delete Key を使えるようにする
set t_kD=^?

" bundleで管理するディレクトリを指定
filetype off
if has('vim_starting')
  set runtimepath+=~/.vim/bundle/neobundle.vim
  call neobundle#rc(expand('~/.vim/bundle/'))
endif
NeoBundle 'Shougo/neobundle.vim' " neobundle 自身を管理
NeoBundle 'Shougo/vimproc'  " 別プロセスでテストが実行でき
NeoBundle 'Shougo/vimshell'  " 非同期でシェルを起動する
NeoBundle 'scrooloose/syntastic'  " syntax check
NeoBundle 'tpope/vim-endwise.git' " if...endなど対応するキーワードの自動補完
NeoBundle 'ruby-matchit'  " %を拡張して、def...end等のキーワードを移動出来るようにする。
"NeoBundle 'Shougo/neocomplcache'  " 補完
"NeoBundle 'Shougo/neocomplcache-snippets-complete'
"NeoBundle 'jpalardy/vim-slime'
"NeoBundle 'Shougo/unite.vim'
"NeoBundle 'VimClojure'
filetype plugin indent on     " required!
filetype indent on
syntax on

"autocmd FileType ruby map <F9> :w<CR>:!ruby -c %<CR>
<file_sep>== 環境設定

自分がよく使うzshrcの設定など
<file_sep># 環境設定
export PATH=$PATH:~/.gem/ruby/1.8/bin/:/Users/n_itou/pear/bin
export PATH="/Users/n_itou/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems:$PATH"
export PATH="/usr/bin/rails:$PATH"
export PATH=/usr/local/bin:$PATH

alias ruby='/usr/local/Cellar/ruby/2.1.2_2/bin/ruby'

# 色
export CLICOLOR=1
export LSCOLORS=DxGxcxdxCxegedabagacad

# 補完設定
autoload -U compinit; compinit

# sudo でも補完の対象
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin

# 補完時に大文字小文字を区別しない
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# 補完候補が複数ある時に、一覧表示
setopt auto_list

# auto_list の補完候補一覧で、ls -F のようにファイルの種別をマーク表示
setopt list_types

# ディレクトリ名の補完時に / を付加
setopt auto_param_slash

# Ctrl+wで､直前の/までを削除する
WORDCHARS='*?_-.[]~=&;!#$%^(){}<>'

compdef _man w3mman
compdef _tex platex

# プロンプトの設定
autoload -U colors; colors
PROMPT=$'\n%{\e[1;32m%}%n@%m %{\e[1;33m%}%~\n%{\e[1;m%}%(!.#.$) '
SPROMPT="correct: %R -> %r ? "

# history 関係の設定
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=100000
setopt extended_history # history ファイルに時刻を追加
setopt share_history  # シェルのプロセスごとに履歴を共有
setopt append_history # 複数の zsh を同時に使う時など history ファイルに上書きせず追加

# コマンドが入力されるとすぐに追加
setopt inc_append_history

# 補完の利用設定
autoload -U compinit; compinit

# rvm 環境設定
if [[ -s ~/.rvm/scripts/rvm ]] ; then source ~/.rvm/scripts/rvm ; fi

# 言語設定
export LANG=ja_JP.UTF-8

# aliases
alias vim='env LANG=ja_JP.UTF-8 vim'
alias ls='ls -FG'

alias rm='rm -i'
alias mv='mv -i'
alias l='ls -al'
alias ps='ps aux'
alias tree='find . -type f -print'
alias hist='vim ~/.zsh_history'
alias gd='git diff HEAD --color'

# git 関係の設定
autoload -Uz VCS_INFO_get_data_git; VCS_INFO_get_data_git 2> /dev/null

function rprompt-git-current-branch {
  local name st color gitdir action
  if [[ "$PWD" =~ '/\.git(/.*)?$' ]]; then
    return
  fi
  name=`git branch 2> /dev/null | grep '^\*' | cut -b 3-`
    if [[ -z $name ]]; then
      return
    fi
    gitdir=`git rev-parse --git-dir 2> /dev/null`
    action=`VCS_INFO_git_getaction "$gitdir"` && action="($action)"
    st=`git status 2> /dev/null`
    if [[ -n `echo "$st" | grep "^nothing to"` ]]; then
      color=%F{green}
    elif [[ -n `echo "$st" | grep "^nothing added"` ]]; then
      color=%F{yellow}
    elif [[ -n `echo "$st" | grep "^# Untracked"` ]]; then
      color=%B%F{red}
    else
      color=%F{red}
    fi
    echo "$color$name$action%f%b "
}

# git 関係  プロンプトが表示されるたびにプロンプト文字列を評価、置換する
setopt prompt_subst
RPROMPT='[`rprompt-git-current-branch`%~]'

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

## 顔文字
setopt prompt_subst
autoload colors; colors;
autoload -Uz add-zsh-hook
local RANDOM_COLOR=$'%F{$[1+RANDOM%7]}'
p_anim_counter=0
p_anim=(
    "(´ ・ω ・\` )"
    "(  ´ ・ω ・)"
    "(    ´ ・ω )"
    "(      ´ ・)"
    "(          )"
    "(・\`       )"
    "(ω ・\`     )"
    "(・ω ・\`   )"
)
function _precmd_anim () {
    psvar[1]=$p_anim[`expr $p_anim_counter % ${#p_anim[*]} + 1`]
    p_anim_counter=`expr $p_anim_counter + 1`
}
add-zsh-hook precmd _precmd_anim
## 顔文字end

# cat
alias cat='~/local/bin/cat.sh'

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

languages:
RDoc
Vim Script
Shell

repo_language: RDoc


text:
<repo_name>gregdamp/blog<file_sep>/startbootstrap-clean-blog-gh-pages/Model/Article.php
<?php

namespace gregdamp\Model;

class Article
{
	private $id;
  private $title;
  private $description;
  private $publishedDate;
  private $idUser;
  private $pseudoUser;

      public function __construct($id, $title, $description, $publishedDate, $idUser, $pseudoUser) {
        $this->setId($id);
        $this->setTitle($title);
        $this->setDescription($description);
        $this->setPublishedDate($publishedDate);
        $this->setIdUser($idUser);
        $this->setPseudoUser($pseudoUser);
    }

    /*
    // Un tableau de données doit être passé à la fonction (d'où le préfixe « array »).
    public function hydrate(array $donnees)
    {
      foreach ($donnees as $key => $value)
      {
        // On récupère le nom du setter correspondant à l'attribut.
        $method = 'set'.ucfirst($key);

        // Si le setter correspondant existe.
        if (method_exists($this, $method))
        {
          // On appelle le setter.
          $this->$method($value);
        }
      }
    }
    */

  public function getId() {
    return $this->id;
  }

  public function setId($id) {
    $this->id = $id;
  }

	public function getTitle() {
		return $this->title;
	}

	public function setTitle($title) {
		$this->title = $title;
	}

    public function getDescription() {
		return $this->description;
	}

	public function setDescription($description) {
		$this->description = $description;
	}

  public function getPublishedDate() {
    return $this->publishedDate;
  }

  public function setPublishedDate($publishedDate) {
    $this->publishedDate = $publishedDate;
  }

  public function getIdUser() {
    return $this->idUser;
  }

  public function setIdUser($idUser) {
    $this->idUser = $idUser;
  }

  public function getPseudoUser() {
    return $this->pseudoUser;
  }

  public function setPseudoUser($pseudoUser) {
    $this->pseudoUser = $pseudoUser;
  }
}
<file_sep>/startbootstrap-clean-blog-gh-pages/Controller/ArticleController.php
<?php

use \gregdamp\Model\ArticleRepository;
use \gregdamp\Model\UserRepository;
use \gregdamp\Model\CommentRepository;

require('./Model/ArticleRepository.php');

function listArticle()
{
    $articleRepository = new ArticleRepository();
    $articleList = $articleRepository->findAll();

    $commentRepository = new CommentRepository();
    $commentList = $commentRepository->getAllComment();

    require('./View/test.php');

}

function addArticle() {

    $articleRepository = new ArticleRepository();
    $articleRepository->addArticle();

}

function deleteArticle() {
    $articleRepository = new ArticleRepository();
    $articleRepository->deleteArticle();
}

function editArticle() {

    $articleRepository = new ArticleRepository();
    $articleList = $articleRepository->getArticleById($_GET['id']);

    $userRepository = new UserRepository();
    $userList = $userRepository->findAll();

    require('./View/editArticle.php');
}

function updateArticle() {

    $articleRepository = new ArticleRepository();
    $articleRepository->updateArticle();

}
<file_sep>/startbootstrap-clean-blog-gh-pages/Model/User.php
<?php

namespace gregdamp\Model;

class User
{
  private $idUser;
  private $pseudo;
  private $password;
  private $email;
  private $isAdmin;

      public function __construct($idUser, $pseudo, $password, $email, $isAdmin) {
        $this->setIdUser($idUser);
        $this->setPseudo($pseudo);
        $this->setPassword($password);
        $this->setEmail($email);
        $this->setIsAdmin($isAdmin);

    }

  public function getIdUser() {
    return $this->idUser;
  }

  public function setIdUser($idUser) {
    $this->idUser = $idUser;
  }

	public function getPseudo() {
		return $this->pseudo;
	}

	public function setPseudo($pseudo) {
		$this->pseudo = $pseudo;
	}

    public function getPassword() {
		return $this->password;
	}

	public function setPassword($password) {
		$this->password = $password;
	}

  public function getEmail() {
    return $this->email;
  }

  public function setEmail($email) {
    $this->email = $email;
  }

  public function getIsAdmin() {
    return $this->isAdmin;
  }

  public function setIsAdmin($isAdmin) {
    $this->isAdmin = $isAdmin;
  }
}<file_sep>/startbootstrap-clean-blog-gh-pages/Controller/CommentController.php
<?php

use \gregdamp\Model\CommentRepository;

require('./Model/CommentRepository.php');

function addComment() {

    $commentRepository = new CommentRepository();
    $commentRepository->addComment();

}

function deleteComment() {

	$_SESSION['idComment'] = $_GET['id'];
    $commentRepository = new CommentRepository();
    $commentRepository->deleteComment();
}

function updateComment() {

    $commentRepository = new CommentRepository();
    $commentRepository->updateComment();

}

function warningComment() {

    $commentRepository = new CommentRepository();
    $commentRepository->warningComment();

}

function validComment() {

    $commentRepository = new CommentRepository();
    $commentRepository->validComment();

}<file_sep>/startbootstrap-clean-blog-gh-pages/Model/ArticleRepository.php
<?php

namespace gregdamp\Model;

use PDO;

require('./Model/Repository.php');
require('./Model/Article.php');

class ArticleRepository extends Repository {

    function findAll()
	{
        $db = $this->dbConnect();

        $req = $db->query('SELECT * FROM article INNER JOIN user ON article.idUser = user.idUser ORDER BY publishedDate DESC');
        $req->execute();

        $articleList = [];

        while ($data = $req->fetch(PDO::FETCH_ASSOC))
        {

            $article = new Article($data['idArticle'], $data['title'], $data['description'], $data['publishedDate'], $data['idUser'], $data['pseudo']);

            $articleList[] = $article;

        }

        $req->closeCursor();

		return $articleList;

	}

    public function addArticle()
    {
        $db = $this->dbConnect();

        $reqInsert = 'INSERT INTO article';
        $reqCol = '(title, description, publishedDate, idUser)';
        $reqValues = ' VALUES(:title, :description, now(), 1)';

        $req = $db->prepare($reqInsert . $reqCol . $reqValues);

        $req->bindParam(':title', $_SESSION['title'], \PDO::PARAM_STR);
        $req->bindParam(':description', $_SESSION['description'], \PDO::PARAM_STR);
        //$req->bindParam(':idAuthor', $_SESSION['idAuthor'], \PDO::PARAM_STR);

        $req->execute();

        header('Location: /gregdamp/index.php');

    }

    public function deleteArticle() {

        $db = $this->dbConnect();

        $reqDelete = 'DELETE FROM article';
        $reqWhere = ' WHERE idArticle = :id';

        $req = $db->prepare($reqDelete . $reqWhere);

        $req->bindParam(':id', $_SESSION['id'], \PDO::PARAM_STR);

        $req->execute();

        header('Location: /gregdamp/index.php');

    }

    public function updateArticle() {

        $db = $this->dbConnect();

        $sql = "UPDATE article SET title=?, description=?, publishedDate=now(), idUser=? WHERE idArticle=?";

        $stmt = $db->prepare($sql);

        $stmt->execute(array($_SESSION['title'], $_SESSION['description'], $_SESSION['idUser'], $_SESSION['id']));

        header('Location: /gregdamp/index.php');

    }

    public function getArticleById($id) {

        $db = $this->dbConnect();

        $reqSelect = 'SELECT * FROM article INNER JOIN user ON article.idUser = user.idUser';
        $reqWhere = ' WHERE idArticle = :id';

        $req = $db->prepare($reqSelect . $reqWhere);

        $req->bindParam(':id', $id, \PDO::PARAM_STR);

        $req->execute();

        $articleList = [];

        while ($data = $req->fetch(PDO::FETCH_ASSOC))
        {

            $article = new Article($data['idArticle'], $data['title'], $data['description'], $data['publishedDate'], $data['idUser'], $data['pseudo']);

            $articleList[] = $article;

        }

        $req->closeCursor();

        return $articleList;
    }

}
?><file_sep>/startbootstrap-clean-blog-gh-pages/Model/Comment.php
<?php

namespace gregdamp\Model;

class Comment
{
	private $idComment;
	private $publishedDate;
	private $isModerate;
	private $parentId;
	private $idUser;
	private $idArticle;
	private $description;
	private $warning;
	private $pseudoUser;

	public function __construct($idComment, $publishedDate, $isModerate, $parentId, $idUser, $idArticle, $description, $warning, $pseudoUser) {
        $this->setIdComment($idComment);
        $this->setPublishedDate($publishedDate);
        $this->setIsModerate($isModerate);
        $this->setParentId($parentId);
        $this->setIdUser($idUser);
        $this->setIdArticle($idArticle);
        $this->setDescription($description);
        $this->setWarning($warning);
        $this->setPseudoUser($pseudoUser);

    }

  public function getIdComment() {
    return $this->idComment;
    }

  public function setIdComment($idComment) {
    $this->idComment = $idComment;
    }

  public function getPublishedDate() {
		return $this->publishedDate;
	}

  public function setPublishedDate($publishedDate) {
		$this->publishedDate = $publishedDate;
	}

  public function getIsModerate() {
		return $this->isModerate;
	}

  public function setIsModerate($isModerate) {
		$this->isModerate = $isModerate;
	}

  public function getParentId() {
    return $this->parentId;
    }

  public function setParentId($parentId) {
    	  $this->parentId = $parentId;
    }

  public function getIdUser() {
    return $this->idUser;
    }

  public function setIdUser($idUser) {
    $this->idUser = $idUser;
    }

  public function getIdArticle() {
    return $this->idArticle;
    }

  public function setIdArticle($idArticle) {
    $this->idArticle = $idArticle;
    }

  public function getDescription() {
    return $this->description;
    }

  public function setDescription($description) {
    $this->description = $description;
    }

  public function getWarning() {
    return $this->warning;
    }

  public function setWarning($warning) {
    $this->warning = $warning;
    }

  public function getPseudoUser() {
    return $this->pseudoUser;
  }

  public function setPseudoUser($pseudoUser) {
    $this->pseudoUser = $pseudoUser;
  }
}<file_sep>/startbootstrap-clean-blog-gh-pages/Controller/UserController.php
<?php

use \gregdamp\Model\UserRepository;

require('./Model/UserRepository.php');

function addUser() {

    $userRepository = new UserRepository();
    $userRepository->addUser();

}

function connectUser() {

	$userRepository = new UserRepository();
	$userRepository->connectUser();
}
<file_sep>/startbootstrap-clean-blog-gh-pages/Model/CommentRepository.php
<?php

namespace gregdamp\Model;

use PDO;

require('./Model/Comment.php');

class CommentRepository extends Repository {

	function addComment()
	{
        $db = $this->dbConnect();

        $reqInsert = 'INSERT INTO comment';
        $reqCol = '(publishedDate, isModerate, parentId, idUser, idArticle, description, warning)';
        $reqValues = ' VALUES(now(), 0, 0, :idUser, :idArticle, :description, 0)';

        $req = $db->prepare($reqInsert . $reqCol . $reqValues);

        $req->bindParam(':idArticle', $_SESSION['idArticle'], \PDO::PARAM_STR);
        $req->bindParam(':description', $_SESSION['description'], \PDO::PARAM_STR);
        $req->bindParam(':idUser', $_SESSION['idUser'], \PDO::PARAM_STR);

        $req->execute();

        header('Location: /gregdamp/index.php');

    }

    public function getAllComment() {

    	$db = $this->dbConnect();

        $reqSelect = 'SELECT * FROM comment INNER JOIN user ON comment.idUser = user.idUser ORDER BY publishedDate DESC';
        $req = $db->prepare($reqSelect);

        $req->execute();

       $commentList = [];

        while ($data = $req->fetch(PDO::FETCH_ASSOC))
        {

            $comment = new Comment($data['idComment'], $data['publishedDate'], $data['isModerate'], $data['parentId'], $data['idUser'],  $data['idArticle'], $data['description'], $data['warning'], $data['pseudo']);

            $commentList[] = $comment;

        }

        $req->closeCursor();

		return $commentList;
    }

    public function deleteComment() {

        $db = $this->dbConnect();

        $reqDelete = 'DELETE FROM comment';
        $reqWhere = ' WHERE idComment = :id';

        $req = $db->prepare($reqDelete . $reqWhere);

        $req->bindParam(':id', $_SESSION['idComment'], \PDO::PARAM_STR);

        $req->execute();

        header('Location: /gregdamp/index.php');
    }

    public function updateComment() {

        $db = $this->dbConnect();

        $sql = "UPDATE comment SET isModerate=1 WHERE idComment=?";

        $stmt = $db->prepare($sql);

        $stmt->execute(array($_SESSION['idComment']));

        header('Location: /gregdamp/index.php');

    }

    public function warningComment() {

        $db = $this->dbConnect();

        $sql = "UPDATE comment SET warning=1 WHERE idComment=?";

        $stmt = $db->prepare($sql);

        $stmt->execute(array($_SESSION['idComment']));

        header('Location: /gregdamp/index.php');

    }

    public function validComment() {

        $db = $this->dbConnect();

        $sql = "UPDATE comment SET warning=2 WHERE idComment=?";

        $stmt = $db->prepare($sql);

        $stmt->execute(array($_SESSION['idComment']));

        header('Location: /gregdamp/index.php');

    }

}<file_sep>/startbootstrap-clean-blog-gh-pages/Model/UserRepository.php
<?php

namespace gregdamp\Model;

use PDO;

require('./Model/User.php');

class UserRepository extends Repository {

	public function addUser()
    {
        $db = $this->dbConnect();

        $reqInsert = 'INSERT INTO user';
        $reqCol = '(pseudo, password, email)';
        $reqValues = ' VALUES(:pseudo, :password, :email)';

        $req = $db->prepare($reqInsert . $reqCol . $reqValues);

        $req->bindParam(':pseudo', $_SESSION['pseudo'], \PDO::PARAM_STR);
        $req->bindParam(':password', $_SESSION['password'], \PDO::PARAM_STR);
        $req->bindParam(':email', $_SESSION['email'], \PDO::PARAM_STR);

        $req->execute();

        header('Location: /gregdamp/index.php');

    }

	public function connectUser()
	{
		$db = $this->dbConnect();

        $reqSelect = "SELECT idUser, isAdmin FROM user WHERE pseudo=:pseudo AND password=:password";

        $req = $db->prepare($reqSelect);

        $req->bindParam(':pseudo', $_SESSION['pseudo'], \PDO::PARAM_STR);
        $req->bindParam(':password', $_SESSION['<PASSWORD>'], \PDO::PARAM_STR);

        $req->execute();

        $data = $req->fetch();
        if($data['idUser'] == "")
        {
        	unset($_SESSION['pseudo']);
        	header('Location: /gregdamp/index.php');
        }
        $_SESSION['isAdmin']=$data['isAdmin'];
        $_SESSION['idUser']=$data['idUser'];

        header('Location: /gregdamp/index.php');
	}

	function findAll()
	{
        $db = $this->dbConnect();

        $req = $db->query('SELECT * FROM user');
        $req->execute();

        $userList = [];

        while ($data = $req->fetch(PDO::FETCH_ASSOC))
        {

            $user = new User($data['idUser'], $data['pseudo'], $data['password'], $data['email'], $data['isAdmin']);

            $userList[] = $user;

        }

        $req->closeCursor();

		return $userList;

	}

  }<file_sep>/startbootstrap-clean-blog-gh-pages/index.php
<?php
session_start();

require('./Controller/ArticleController.php');
require('./Controller/UserController.php');
require('./Controller/CommentController.php');

try {
    if (isset($_GET['action'])) {
        if ($_GET['action'] == 'listArticle') {
            listArticle();
        }

        else if ($_GET['action'] == 'addArticle') {

            $_SESSION['title'] = $_POST['title'];
            $_SESSION['description'] = $_POST['description'];

            addArticle();
        }

        else if ($_GET['action'] == 'deleteArticle') {

            $_SESSION['id'] = $_GET['id'];

            deleteArticle();
        }

        else if ($_GET['action'] == 'editArticle') {

            $_SESSION['id'] = $_GET['id'];

            editArticle();
        }

        else if ($_GET['action'] == 'updateArticle') {

            $_SESSION['title'] = $_POST['title'];
            $_SESSION['description'] = $_POST['description'];
            $_SESSION['id'] = $_GET['id'];
            $_SESSION['publishedDate'] = $_POST['publisheDate'];
            $_SESSION['idUser'] = $_POST['author'];

            updateArticle();
        }

        else if ($_GET['action'] == 'addUser') {

            $_SESSION['pseudo'] = $_POST['pseudo'];
            $_SESSION['email'] = $_POST['email'];
            $_SESSION['password'] = $_POST['<PASSWORD>'];

            addUser();

        }

        else if ($_GET['action'] == 'connectUser') {

                $_SESSION['pseudo'] = $_POST['pseudo'];
                $_SESSION['password'] = $_POST['password'];

                connectUser();

        }

        else if ($_GET['action'] == 'addComment') {

            $_SESSION['idArticle'] = $_GET['id'];
            $_SESSION['description'] = $_POST['description'];

            addComment();
        }

        else if ($_GET['action'] == 'deleteComment') {

            $_SESSION['id'] = $_GET['id'];

            deleteComment();
        }

        else if ($_GET['action'] == 'updateComment') {

            $_SESSION['idComment'] = $_GET['id'];

            updateComment();
        }

        else if ($_GET['action'] == 'warningComment') {

            $_SESSION['idComment'] = $_GET['id'];

            WarningComment();
        }

        else if ($_GET['action'] == 'validComment') {

            $_SESSION['idComment'] = $_GET['id'];

            ValidComment();
        }

    }
    else {
        listArticle();

    }
}

catch(Exception $e) { // S'il y a eu une erreur, alors...
    echo 'Erreur : ' . $e->getMessage();
}

repo_language: PHP

repo_name: gregdamp/blog


text:
<repo_name>Sudhakar17/recipes<file_sep>/README.md
# Recipes

This repository contains recipes for some foods I like.

This repository is used in [Udacity's Git & GitHub course](https://www.udacity.com/course/how-to-use-git-and-github--ud775)
Check out this and other courses here: https://www.udacity.com/courses/all

This repository is forked from LarryMad/recipes for practicing the git commands and to resolve the conflicts between the master branch and different oil branch.

repo_language: Markdown