LaTeX template for Kaunas University of Technology.
- Ensure that you have the entire TeX Live software installed (for Windows download this installer, for Linux - search and install
texlive-full
package). - Copy ktua4.sty and ktulogo.eps files to your project directory.
- Write your
.tex
document with\usepackage{ktua4}
and the commands described below - see minimal example below. - Compile it using
xelatex
with-shell-escape
flag (if using TeXworks - you need to openEdit -> Preferences -> Typesetting -> Processing Tools -> XeLaTeX -> Edit...
, press+
and enter-shell-escape
and move it with an up arrow so that it is on top - before$synctexoption
) orluatex
with--shell-escape
flag.
\newcommand{\ktusubject}{subject}
\newcommand{\ktutitle}{title}
\newcommand{\ktuyear}{year}
\newcommand{\ktudate}{\ktuyear-month-day}
\newcommand{\ktucity}{city}
\newcommand{\ktuinstitution}{institution}
\newcommand{\ktufaculty}{subinstitution}
\newcommand{\ktucathedral}{subsubinstitution}
\newcommand{\ktuauthor}{author}
\newcommand{\ktumaster}{receiver}
\documentclass[12pt, a4paper, onecolumn, titlepage, oneside, intlimits, fleqn]{report}
\usepackage{ktua4}
\begin{document}
\ktuinit{}
Hello, world!
\end{document}
Insert a list of references.
Use \begin{thebibliography}
inside:
\begin{ktuliterature}
\begin{thebibliography}{99}
\bibitem{NSSI} Tobias Oetiker et. al. \emph{The Not So
Short Introduction to \LaTeXe{}}.
\end{thebibliography}
\end{ktuliterature}
Or use \printbibliography{}
if you use Biblatex (see Biblatex):
\begin{ktuliterature}
\printbibliography{}
\end{ktuliterature}
Wrap the "sample text" with nice lithuanian quotes.
Insert the "sample text" in monospace font and with a box around.
Do not render "sample text" at all.
Insert a list of appendices.
Use \ktusection{example}
for each appendix.
\begin{ktuappendices}
\ktusection{Example material}
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, R, S, T, U, V, Z.
\end{ktuappendices}
Useful to mark the solution of some problem. Wraps the text with beginning and ending triangles.
Automatically generates and inserts a nice full front title page, table of contents, list of figures, list of tables and list of algorithms.
Lists are inserted only when at least one element of the list type is in the document.
Do not forget to put a ktu_logo.eps file near ktua4.sty
.
The full name of the person who is the author of this document, for example "John Doe".
You must use only regular letters - math formulas and other fancy symbols will not work.
If you want to use non-regular letters - you have to delete line \usepackage[pdftitle={\ktutitle}...
line from ktua4.sty
.
The full name with titles of the person who accepts the document or advises to the main author, for example "prof. Jane Roe".
The main title of the document, for example "Knapsack problem".
You must use only regular letters - math formulas and other fancy symbols will not work.
If you want to use non-regular letters - you have to delete line \usepackage[pdftitle={\ktutitle}...
line from ktua4.sty
.
Type of this document, a series that this document belongs, for example "Mathematical analysis report #1" or "Master's thesis".
You must use only regular letters - math formulas and other fancy symbols will not work.
If you want to use non-regular letters - you have to delete line \usepackage[pdftitle={\ktutitle}...
line from ktua4.sty
.
Full year of the document publish date, for example "2014".
Document publish date in ISO 8601 format, for example "2014-04-24".
The institution this document belongs to, for example "Kauno technologijos universitetas".
The faculty of the institution this document belongs to, for example "Matematikos ir gamtos mokslų fakultetas".
The cathedral of the faculty of the institution this document belongs to, for example "Taikomosios matematikos katedra".
The city where the institution, faculty and cathedral is located, for example "Kaunas".
Create a chapter named "example".
Create a chapter named "example" that does not have a number in the table of contents.
Create a section named "example".
Create a subsection named "example".
Create a subsubsection named "example".
Insert a reference to a section named "example".
Wraps an algorithm, inserts a caption and creates a reference id.
\begin{ktualgo}{referenceid}{Example ABC algorithm}
\Procedure{ABC}{$a,b,c,n$}
\For{$d$ nuo $0$ iki $b$}
\State{$z_0(d) \gets 0$}\Comment{inicializacija}
\EndFor{}
\EndProcedure{}
\end{ktualgo}
For the help about the commands to describe the algorithm (e.g. \Procedure
, \For
, \State
, etc.) please refer to the documentation of package "algorithms".
Inserts a reference to algorithm "referenceid".
For the algorithm above, use \ktualgoref{referenceid}
.
Inserts a picture from test.jpg
file, makes it 18cm wide (proportions preserved), adds a "A test image" caption and creates a reference.
Insert a reference to a figure with file "test.jpg".
Inserts a picture from test.jpg
file, makes it maximally horizontally wide (proportions preserved), adds a "A test image" caption and creates a reference.
Wraps the contents of test.tex
file as a figure, adds a "A test figure" caption and creates a reference.
Wraps the contents of test.tex
file as a table, adds a "A test table" caption and creates a reference.
Example contents of test.tex
:
\begin{tabular}{lcl}
Vardas & Metai & Formulė \\
Niutonas & 1687 & $F = m a$ \\
Einšteinas & 1905 & $E = m c^2$ \\
\end{tabular}
To insert a reference for this table use \vref{tab:test.tex}
.
Wraps a table, inserts a caption and creates a reference id.
\begin{ktutable}{referenceid}{Random table}
\begin{tabular}{lcl}
Vardas & Metai & Formulė \\
Niutonas & 1687 & $F = m a$ \\
Einšteinas & 1905 & $E = m c^2$ \\
\end{tabular}
\end{ktutable}
To insert a reference for this table use \vref{tab:referenceid}
.
This template does not set the KTU style "Times New Roman" and "Courier New" fonts, because some computers may not have them.
To use the KTU style fonts add the following lines after \usepackage{ktua4}
:
\setmainfont{Times New Roman}
\setmonofont{Courier New}
If your computer does not have them, you can download them (move the fonts
folder near ktua4.sty
) and then use lines instead of previous two lines:
\setmainfont[
Path = ./fonts/,
Extension = .TTF,
Ligatures = TeX,
BoldFont = *bd,
ItalicFont = *i,
BoldItalicFont = *bi
]{Times}
\setmonofont[
Path = ./fonts/,
Extension = .ttf,
Ligatures = TeX,
BoldFont = *bd,
ItalicFont = *i,
BoldItalicFont = *bi
]{cour}
Biblatex enables you to automatically generate list of bibliography from a BibTeX file and \cite
commands in your tex file (for more similar commands read section 3.7 Citation Commands).
-
Use the polyglossia package by adding these lines before
\usepackage{ktua4}
:\usepackage{polyglossia} \setdefaultlanguage{lithuanian}
-
Please download ISO 690 style for biblatex and extract it into
texmf/tex/latex
directory (texmf isC:/Users/username/texmf
on Windows,/home/username/texmf
on Linux) so that filetexmf/tex/latex/biblatex-iso690-master/iso.bbx
exists. -
Create a BibTeX file
yourmaintexfile.bib
with your bibliography, for example:@Book{gisslen2011professional, author="Gisslen, Wayne", title="Professional cooking", year="2011", edition="7", publisher="John Wiley \& Sons", address="Hoboken, N.J", keywords="Quantity cooking", keywords="Food service", note="Wayne Gisslen ; photography by J. Gerard Smith.", note="Includes bibliographical references (p. 1059-1060) and indexes.", isbn="9780470197523" }
-
Add the following lines between
\usepackage{ktua4}
and\begin{document}
:\usepackage[spacecolon=false,bibencoding=UTF8,sortlocale=en_US,backend=biber,sorting=none,labelnumber=true,natbib=true,bibstyle=iso-numeric,firstinits=true,citestyle=iso-authoryear,language=lithuanian]{biblatex} \bibliography{yourmaintexfile}
-
Make sure you have lithuanian.lbx file near
ktua4.sty
file or changelanguage=lithuanian
tolanguage=english
near\usepackage[...]{biblatex}
(from the above code snippet). Also, please note that thislithuanian.lbx
is not completely translated, so if you notice bugs, create an issue. -
Add the following lines somewhere near before
\end{document}
:\begin{ktuliterature} \printbibliography{} \end{ktuliterature}
-
Compile
yourmaintexfile.tex
that contains\cite{gisslen2011professional}
- runXeLaTeX
, thenbiber
(read the following instructions) and thenXeLaTex
again.
If it does not work for you, it is probably because older versions of biblatex are broken.
Please download a newer version and extract it into texmf
directory (C:/Users/username/texmf
on Windows, /home/username/texmf
on Linux) so that file texmf/tex/latex/biblatex/biblatex.sty
exists.
- Open
Edit -> Preferences -> Typesetting -> Processing Tools
, press+
and enterbiber
byName
,biber.exe
byProgram
, press+
and enter$basename
, untickView PDF after running
. - Select
biber
from the combo box near the big green button with tooltipTypeset
and press that button each time you updateyourmaintexfile.bib
or the citations inyourmaintexfile.tex
.
- Open command line terminal and run
biber yourmaintexfile
(installapt-get install biber
if needed) each time you updateyourmaintexfile.bib
or the citations inyourmaintexfile.tex
.
- Install
- on Windows:
- Download latest version of Python, for example
3.4.0
, and install it - in the "Customize" screen enable the "Add python.exe to Path" option which is under "Python". - Open
Start -> Run
(or press Windows+R keys), enterpip install Pygments
and pressOK
.
- Download latest version of Python, for example
- on Linux:
- search and install package
python-pygments
with your package manager
- search and install package
- Use the commands below.
Insert a reference to a file example.txt
.
Inserts the contents of a text file example.txt
with line numbers (use false
instead of true
to hide line numbers) and with a caption "An example text file".
Creates a reference.
Inserts the contents of a text file example.txt
with line numbers and with a caption "An example text file".
Creates a reference.
Inserts the contents of a text file example.txt
with line numbers.
Creates a reference.
Inserts the contents of a text file example.txt
with line numbers and with a caption "example.txt".
Creates a reference.
Inserts the contents of a file example.py
with Python source code highlighting, with line numbers and with a \ktusubsection
header "example.py".
Creates a reference.
Inserts the contents of a file files/example.py
with Python source code highlighting, with line numbers and with a \ktusubsection
header "example.py".
Creates a reference.
Inserts the contents of a file files/example.py
with Python source code highlighting, with line numbers and with a \ktusection
header "example.py".
Creates a reference.
- Replace
\usepackage{ktua4}
with\usepackage{ktua5}
(make sure you have ktua5.sty near your main.tex
file). - Replace
\documentclass[12pt, a4paper, onecolumn, titlepage, oneside, intlimits, fleqn]{report}
with\documentclass[10pt, a5paper, onecolumn, titlepage, twoside, intlimits, fleqn]{report}
.
This only works on Linux or other Unix-like environments (Apple OS X, Cygwin, FreeBSD, etc.).
This feature let's you write in Markdown syntax and have it included and rendered in your LaTeX document. It also dynamically evaluates embedded R code. See sample.md file.
In the instructions below, we assume your main .tex
file is paper.tex
.
- Install R with knitr package.
- Install kramdown with the
kramdown-mylatex.rb
file copied to<kramdown_directory>/converter/latex.rb
:
- if kramdown is installed with
gem install kramdown
, then<kramdown_directory>
is something like/home/username/.rvm/gems/ruby-2.0.0-p195/gems/kramdown-1.0.2/lib/kramdown
- if kramdown is installed on Ubuntu with
apt-get install ruby-kramdown
, then<kramdown_directory>
is something like/usr/lib/ruby/vendor_ruby/kramdown
- Open
Makefile
in your text editor and editMARKDOWN_TO_LATEX
variable to contain a space-separated list of allmd-<name>.tex
file names for each<name>.md
file you want to have. For example if you have\input{md-sample}
inpaper.tex
file and you editsample.md
file, you must haveMARKDOWN_TO_LATEX := md-sample.tex
line inMakefile
. - Adjust
paper.pdf
andpaper.tex
filenames inMakefile
to suit your real names and then runmake paper.pdf
in command line.
To cite in Markdown you just use the bold mode **citationID**
.
The citationID
is the same cite id that is in your concrete BibTeX .bib file.
To add R code, use:
```{r}
1+1
.4-.7+.3 # what? it is not zero!
```
For more syntax documentation look at knitr minimal example and kramdown quick reference.
This feature let's you embed Sage Math code and have the results automatically evaluated and included your document.
-
Install Sage Math.
-
Copy
SAGE_ROOT/local/share/texmf/tex/generic/sagetex
directory (SAGE_ROOT
is your Sage installation directory) totexmf/tex/latex
directory (texmf isC:/Users/username/texmf
on Windows,/home/username/texmf
on Linux) so that filetexmf/tex/latex/sagetex/sagetex.sty
exists. -
Add
\usepackage{sagetex}
before\begin{document}
. -
Include something like this between
\begin{document}
and\end{document}
:\begin{sageblock} f(x) = exp(x) * sin(2*x) \end{sageblock} Here's a plot of $f$ from $-1$ to $1$: \sageplot[width=15cm]{plot(f, -1, 1)}
-
Run
xelatex paper.tex
thensage paper.tex
and then againxelatex paper.tex
. -
For more syntax documentation look at SageTex tutorial.
-
Save sas.tex near
ktua4.sty
and add\input{sas}
before\begin{document}
. -
Execute SAS program, for example:
data knots; infile '../data1of3/knots.dat'; input knot $ 4 rope 7 direction 10 weight 13-15; run; ods tagsets.tablesonlylatex file='body.tex' (notop nobot); proc means data = knots; var weight; run; data knots; set knots; weight_e = weight - 188.9166667; run; filename diag 'a1.wmf'; goptions gsfname=diag device=wmf; title 'standartizuotu svoriu nuokrypiu grafikas'; proc univariate data = knots normal; var weight_e; probplot / normal(mu=est sigma=est); ods exclude TestsForLocation Quantiles Moments BasicMeasures ExtremeObs; run; ods tagsets.tablesonlylatex close;
-
Copy relevant source code from the generated
body.tex
file to your main.tex
file between\begin{document}
and\end{document}
. -
Convert generated images (
a1.wmf
) to pdf with wmf2svg and svg2pdf (or just usedevice=jpg
in SAS and just copy jpegs) and include them in your main.tex
file as figures.