Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LaTeX Template HsH
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Wille
LaTeX Template HsH
Commits
da65eb76
Commit
da65eb76
authored
1 year ago
by
Jan Wille
Browse files
Options
Downloads
Patches
Plain Diff
Whats LaTeX
parent
7a1c7f93
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
chap/whatsLaTeX.tex
+67
-0
67 additions, 0 deletions
chap/whatsLaTeX.tex
example.pdf
+2
-2
2 additions, 2 deletions
example.pdf
example.tex
+40
-102
40 additions, 102 deletions
example.tex
with
109 additions
and
104 deletions
chap/whatsLaTeX.tex
0 → 100644
+
67
−
0
View file @
da65eb76
\chapter
{
What is LaTeX
}
\label
{
chap: latex
}
So you decided to get stated with LaTeX. Great! So let's talk a bit about the basic concept and differences it comes with.
\medskip
Up to this point you probably used a Word Processor like MS Word. The kind of workflow you know from there is often referred to as
\emph
{
What you
see is what you get
}
. You see the exact final layout as you type it, press some colourful buttons to insert stuff and if it doesn't want to do
something you need, you're screwed.
LaTeX on the other hand falls into the category of
\emph
{
What you see is what you mean
}
, which describes all forms of markup languages. This means
you create your LaTeX document as a simple plain text file without any from of formatting and mix in a bunch of commands telling what you mean.
For example: "This is supposed to be a chapter heading", "make this bold" or "insert an image here". This source file will than be passed to a
document processor (the LaTeX program), which will, depending on its settings, create the document for you. The advantage is, that you can use the
same markup with all sorts of formattings and target file types.
This is why working with LaTeX will require some getting used to and you will find yourself wanting to compile every five seconds to see the
document update. Try to restrain yourself and concentrate on writing. You will find yourself working much faster.
\section
{
Following this document
}
To see how the LaTeX source code and the resulting PDF correspond, I recommend you open this documents source code and PDF file next to each
other and scroll through them simultaneously.
If you already have a working LaTeX setup, most editors support
\emph
{
SyncTex
}
, which allows you to jump between source code and PDF file and
vice versa. You have to compile yourself, which will create a file called
\verb
|
example.synctex.gz
|
in your project directory. Now you
can
\verb
|
<CTRL>+Click
|
in the PDF and the corresponding line of source code will be highlighted.
The shortcut to jump from the source code into the PDF will depend on your Editor, but for VS Code its
\verb
|
right Click
|
→
\verb
|
SyncTex from cursor
|
or
\verb
|
CTRL+ALT+J
|
.
\section
{
Requirements to use LaTeX
}
As LaTeX files are just plain text file, you can edit them with any text editor (even windows notepad works, but that's just terrible).
However, I would strongly recommend a more suitable editor. I use
\href
{
https://code.visualstudio.com/
}{
Visual Studio Code
}
(which is a multi
porpoise text editor that support all major programming languages) but you could also use something like
\href
{
https://www.xm1math.net/texmaker/
}{
Texmaker
}
, which is an editor specifically for LaTeX. There is also the online editor
\href
{
https://www.overleaf.com/
}{
Overfleaf
}
, which saves you the trouble of setting up your own LaTeX installation and provides everything you
need in the cloud.
\pagebreak\medskip
As I have already mention above, you also need the LaTeX program. It comes bundled with packages and other additional software inside a
Tex-distribution. There are two major ones, Texlive and MiKTeX. I recommend MiKTeX, but it essentially doesn't matter which one you choose.
Once you have the distribution installed, test it by running
\verb
|
pdflatex --version
|
in any terminal windows and it should return you
some information about the installed version and setup.
\section
{
Running LaTeX
}
To create a PDF file from your LaTeX source code, you can always navigate to the project folder in a terminal window and run
\verb
|
pdflatex filename.tex
|
. However, if you have a decent editor installed, it will provide you with a button and do this for you.
With these project files you also received a makefile, which demonstrates how to compile this example file successfully from the terminal. The
README file also has some tips and information for you.
If you use VS Code, this project also contains settings for LaTeX and recommended extensions. If you open the folder for the first time you
will be asked if you want to install them and should than be able to compile this file.
\section
{
LaTeX commands
}
Now lets look at the LaTeX command. Every one will begin with a
\textbackslash\space
followed by a letters only command name, like this:
\verb
|
\command
|
. Most commands also accept input, which is put after it into curly brackets:
\verb
|
\command{argument
|
|. They can
accept multiple arguments either in multiple sets of curly brackets or as a comma separated list, depending on the command.
Some commands also accept optional arguments. These are passed inside square brackets between the command name and the curly brackets, like
this:
\verb
|
\command[optional]{argument
|
|.
\section
{
Getting more information
}
So what can you do if you get stuck or just want more information. The simple answer is: Google is your friend. Most questions have already
been answered. For example on
\href
{
https://tex.stackexchange.com/
}{
Tex Strackexchange
}
. Also, Overleaf has a great
\href
{
https://www.overleaf.com/learn
}{
section for learning LaTex
}
.
An of course you can always check the documentation, which you can find on
\href
{
https://ctan.org/
}{
CTAN
}
.
This diff is collapsed.
Click to expand it.
example.pdf
LFS
+
2
−
2
View file @
da65eb76
No preview for this file type
This diff is collapsed.
Click to expand it.
example.tex
+
40
−
102
View file @
da65eb76
%---------------------- the documentclass -----------------------------------------------------------------------------------------------------------%
% using this command you confige the "look and feel" of your document.
% you can pass different options to configure common usecases
% the options are shown for clarity, but most of them are allready the default,
% so no need to pass them explicitly
\documentclass
[
faculty=1,
faculty=
f
1,
paper=a4,
fontsize=11pt,
fontfamily=sans-serif,
language=english,
parskip=
half
+,
parskip=
never
+,
linespacing=single,
twoside=true,
todos=off,
...
...
@@ -18,11 +20,17 @@
% everything between `\documentclass' and `\begin{document}' is called the preamble. Here you configure all settings for your document.
% The `\documentclass' command is actually part of that configuration. Lets see what you could do here:
\usepackage
{
soul
}
\usepackage
{
lipsum
}
% ----- package loading -----
% first thing you do is declare all the packages you need for your document
% you can also pass options to this packages to configure their behavior
\usepackage
{
soul
}
% for strickesthough text
\usepackage
{
lipsum
}
% for dummy text
% for some packages you also call some commands to configure them or your document
% ----- document information -----
% In your preamble you also list your documents information and metadata. These will be used on the title
-
page as well
% In your preamble you also list your documents information and metadata. These will be used on the titlepage as well
% as being available throughout the document. Additionally, these documentclasses set up the resulting PDF file with
% the appropriate Metadata.
% You can just delete any of this commands or leave them empty if you don't need it for a project.
...
...
@@ -62,7 +70,6 @@
% You are not restricted to this exact position and can use it where ever you want in your document, if you prefer it at the back, but it there.
\declarationofauthorship
% # abstract
% sometimes you are required to also create an abstract. Use this environment for that.
% It will create a new page and a heading for you as well as indenting the whole text block a little.
% if you have provided keywords, they will also be put at the end of the abstract.
...
...
@@ -70,89 +77,20 @@
\lipsum
[5-6]
\end{abstract}
% This command will create the table of contents (TOC).
% Keep in mind, that LaTeX can only now about things it has already read. For everything that follows, it relies on temporary files which are created
% on the fly. So the complete TOC will only be rendered after at leas two LaTeX runs.
% this command will create the table of contents (TOC).
\tableofcontents
% the following command is the counterpiece of the `\frontmatter' command.
% It resets pagenumbers so that the next chapter is the first with actuall content.
\mainmatter
% now we can begin with the actuall relevant content
% you chould just putt all commands and content herer,
% but for larger documents it makes sens to split each chapter into a seperate file.
% We include this files here:
\include
{
chap/whatsLaTeX
}
% now we can begin with the actuall relevant content. So let's beginn by creating the first chapter:
\chapter
{
What is LaTeX
}
\label
{
chap: latex
}
So you decided to get stated with LaTeX. Great! So let's talk a bit about the basic concept and differences it comes with.
\medskip
Up to this point you probably used a Word Processor like MS Word. The kind of workflow you know from there is often referred to as
\emph
{
What you
see is what you get
}
. You see the exact final layout as you type it, press some colourful buttons to insert stuff and if it doesn't want to do
something you need, you're screwed.
LaTeX on the other hand falls into the category of
\emph
{
What you see is what you mean
}
, which describes all forms of markup languages. This means
you create your LaTeX document as a simple plain text file without any from of formatting and mix in a bunch of commands telling what you mean.
For example: "This is supposed to be a chapter heading", "make this bold" or "insert an image here". This source file will than be passed to a
document processor (the LaTeX program), which will, depending on its settings, create the document for you. The advantage is, that you can use the
same markup with all sorts of formattings and target file types.
This is why working with LaTeX will require some getting used to and you will find yourself wanting to compile every five seconds to see the
document update. Try to restrain yourself and concentrate on writing. You will find yourself working much faster.
\section
{
Following this document
}
To see how the LaTeX source code and the resulting PDF correspond, I recommend you open this documents source code and PDF file next to each
other and scroll through them simultaneously.
If you already have a working LaTeX setup, most editors support
\emph
{
SyncTex
}
, which allows you to jump between source code and PDF file and
vice versa. You have to compile yourself, which will create a file called
\verb
|
example.synctex.gz
|
in your project directory. Now you
can
\verb
|
<CTRL>+Click
|
in the PDF and the corresponding line of source code will be highlighted.
The shortcut to jump from the source code into the PDF will depend on your Editor, but for VS Code its
\verb
|
right Click
|
→
\verb
|
SyncTex from cursor
|
or
\verb
|
CTRL+ALT+J
|
.
\section
{
Requirements to use LaTeX
}
As LaTeX files are just plain text file, you can edit them with any text editor (even windows notepad works, but that's just terrible).
However, I would strongly recommend a more suitable editor. I use
\href
{
https://code.visualstudio.com/
}{
Visual Studio Code
}
(which is a multi
porpoise text editor that support all major programming languages) but you could also use something like
\href
{
https://www.xm1math.net/texmaker/
}{
Texmaker
}
, which is an editor specifically for LaTeX. There is also the online editor
\href
{
https://www.overleaf.com/
}{
Overfleaf
}
, which saves you the trouble of setting up your own LaTeX installation and provides everything you
need in the cloud.
\pagebreak\medskip
As I have already mention above, you also need the LaTeX program. It comes bundled with packages and other additional software inside a
Tex-distribution. There are two major ones, Texlive and MiKTeX. I recommend MiKTeX, but it essentially doesn't matter which one you choose.
Once you have the distribution installed, test it by running
\verb
|
pdflatex --version
|
in any terminal windows and it should return you
some information about the installed version and setup.
\section
{
Running LaTeX
}
To create a PDF file from your LaTeX source code, you can always navigate to the project folder in a terminal window and run
\verb
|
pdflatex filename.tex
|
. However, if you have a decent editor installed, it will provide you with a button and do this for you.
With these project files you also received a makefile, which demonstrates how to compile this example file successfully from the terminal. The
README file also has some tips and information for you.
If you use VS Code, this project also contains settings for LaTeX and recommended extensions. If you open the folder for the first time you
will be asked if you want to install them and should than be able to compile this file.
\section
{
LaTeX commands
}
Now lets look at the LaTeX command. Every one will begin with a
\textbackslash\space
followed by a letters only command name, like this:
\verb
|
\command
|
. Most commands also accept input, which is put after it into curly brackets:
\verb
|
\command{argument
|
|. They can
accept multiple arguments either in multiple sets of curly brackets or as a comma separated list, depending on the command.
Some commands also accept optional arguments. These are passed inside square brackets between the command name and the curly brackets, like
this:
\verb
|
\command[optional]{argument
|
|.
\section
{
Getting more information
}
So what can you do if you get stuck or just want more information. The simple answer is: Google is your friend. Most questions have already
been answered. For example on
\href
{
https://tex.stackexchange.com/
}{
Tex Strackexchange
}
. Also, Overleaf has a great
\href
{
https://www.overleaf.com/learn
}{
section for learning LaTex
}
.
An of course you can always check the documentation, which you can find on
\href
{
https://ctan.org/
}{
CTAN
}
.
\noindent
\begin{minipage}
{
\textwidth
}
% prevent automatic pagebreaks
% print list of figures and tables
\listoffigures
\listoftables
\end{minipage}
\end{document}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment