Commit f46f6b98 authored by Martin Ukrop's avatar Martin Ukrop
Browse files

Merge branch 'english' into 'master'

Add support for english reports

See merge request xukrop/fi-thesis-report!10
parents c355fdb7 6a6f8c23
......@@ -5,6 +5,14 @@
% in the project's repository at https://gitlab.fi.muni.cz/xukrop/fi-thesis-report/
\ProvidesClass{fi-thesis-report}[2017/06/09 v1.2 FI thesis report template]
\newcommand{\ftr@colorProfile}{color}
\DeclareOption{bw}{\renewcommand{\ftr@colorProfile}{bw}}
\DeclareOption{color}{} % the default
\newcommand{\ftr@lang}{czech}
\DeclareOption{english}{\renewcommand{\ftr@lang}{english}}
\DeclareOption{czech}{} % the default
% Based on 'article'
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions \relax
......@@ -19,7 +27,7 @@
\RequirePackage[a4paper, top=30mm, bottom=35mm, left=30mm, right=30mm]{geometry}
\RequirePackage[final,kerning=true,spacing=true]{microtype}
\microtypecontext{spacing=nonfrench}
\RequirePackage[czech]{babel}
\RequirePackage[\ftr@lang]{babel}
\RequirePackage{color}
\RequirePackage{graphicx}
\RequirePackage{tabularx}
......@@ -29,9 +37,15 @@
% Define colours
\definecolor{blue-mu}{RGB}{0,39,118}
\ifthenelse{\equal{\ftr@colorProfile}{bw}}{
\definecolor{ref-dark-red}{rgb}{0.3,0.3,0.3}
\definecolor{ref-dark-green}{rgb}{0.3,0.3,0.3}
\definecolor{ref-medium-blue}{rgb}{0.3,0.3,0.3}
}{
\definecolor{ref-dark-red}{rgb}{0.6,0.15,0.15}
\definecolor{ref-dark-green}{rgb}{0.15,0.4,0.15}
\definecolor{ref-medium-blue}{rgb}{0,0,0.5}
}
% setup hyperref
\RequirePackage[ colorlinks=true
......@@ -41,8 +55,8 @@
]{hyperref}
% Define name strings and setting commands
\def\@colorProfile{}
\newcommand{\setColorProfile}[1]{\def\@colorProfile{#1}}
\newcommand{\setColorProfile}[1]{\def\ftr@colorProfile{#1}%
\PackageWarning{fi-thesis-report}{setColorProfile is deprecated, please use bw documentclass option (colorprofile: bw for markdown)}}
\def\@reportType{}
\newcommand{\setReportType}[1]{\def\@reportType{#1}}
\def\@thesisType{}
......@@ -61,7 +75,11 @@
}
\newcommand{\setSignature}[1]{\def\@signature{#1}}
% Helper for translation
\newcommand{\ftr@ite@czech}[2]{\ifthenelse{\equal{\ftr@lang}{czech}}{#1}{#2}}
% Determine correct title texts
\ftr@ite@czech{
\def\@titleFirst{Posudek
\ifthenelse{\equal{\@reportType}{inter-reader}}{interního oponenta}{
\ifthenelse{\equal{\@reportType}{reader}}{oponenta}{vedoucího}}
......@@ -70,15 +88,26 @@
\ifthenelse{\equal{\@thesisType}{phd}}{disertační}{%
\ifthenelse{\equal{\@thesisType}{bc}}{bakalářské}{diplomové}%
} práce}
}{
\def\@titleFirst{
\ifthenelse{\equal{\@thesisType}{phd}}{Disertation}{%
\ifthenelse{\equal{\@thesisType}{bc}}{Bachelor}{Master}%
} Thesis}
\def\@titleSecond{
\ifthenelse{\equal{\@reportType}{inter-reader}}{Internal}{
\ifthenelse{\equal{\@reportType}{reader}}{Reader's}{Supervisor's}
} Review}
}
% Document header (logo + table with names)
\AtBeginDocument{
\begin{tikzpicture}[remember picture,overlay]
\node[] (TopLeft) at (current page.north west) {};
\node[anchor=north west](FI-logo) [below right=-3mm and 11.5mm of TopLeft] {%
\ifthenelse{\equal{\@colorProfile}{bw}}%
{\includegraphics{fi-logo-bw}}%
{\includegraphics{fi-logo-color}}%
\ifthenelse{\equal{\ftr@colorProfile}{bw}}%
{\ftr@ite@czech{\includegraphics{logos/fi-cz-bw}}{\includegraphics{logos/fi-en-bw}}}%
{\ftr@ite@czech{\includegraphics{logos/fi-cz-color}}{\includegraphics{logos/fi-en-color}}}%
};
\node[] (TopRight) at (current page.north east) {};
......@@ -90,18 +119,18 @@
\noindent
{\def\arraystretch{1.3}\tabcolsep=10pt
\begin{tabularx}{\textwidth}{@{} l >{\it} X @{}}
Název práce: & \@thesisName \\
Autor práce: & \@student
\ifthenelse{\isundefined{\@supervisor}}{}{\\Vedoucí práce: & \@supervisor}%
\ftr@ite@czech{Název práce}{Title}: & \@thesisName \\
\ftr@ite@czech{Autor práce}{Author}: & \@student
\ifthenelse{\isundefined{\@supervisor}}{}{\\\ftr@ite@czech{Vedoucí práce}{Supervisor}: & \@supervisor}%
\ifthenelse{\isundefined{\@consultant}}{}{\\Konzultant: & \@consultant}%
\ifthenelse{\isundefined{\@reader}}{}{\\Oponent: & \@reader}%
\ifthenelse{\isundefined{\@interReader}}{}{\\Interní oponent: & \@interReader}%
\ifthenelse{\isundefined{\@reader}}{}{\\\ftr@ite@czech{Oponent}{Reader}: & \@reader}%
\ifthenelse{\isundefined{\@interReader}}{}{\\\ftr@ite@czech{Interní oponent}{Internal Reader}: & \@interReader}%
\end{tabularx}
}
\vspace{-0.5em}
\par\noindent
{%
\ifthenelse{\equal{\@colorProfile}{bw}}{}{\color{blue-mu}}%
\ifthenelse{\equal{\ftr@colorProfile}{bw}}{}{\color{blue-mu}}%
\rule{\textwidth}{0.3mm}
}
\vspace{-0.5em}
......
This diff is collapsed.
This diff is collapsed.
\documentclass[$if(fontsize)$$fontsize$,$else$12pt,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{fi-thesis-report}
\documentclass[$if(fontsize)$$fontsize$,$else$12pt,$endif$$if(colorprofile)$$colorprofile$,$endif$$if(language)$$language$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{fi-thesis-report}
\usepackage{amsmath,amssymb}
% Set types and names
$if(colorprofile)$\setColorProfile{$colorprofile$}$endif$ % 'color' or 'bw'
$if(reporttype)$\setReportType{$reporttype$}$endif$ % 'reader' or 'supervisor'
$if(thesistype)$\setThesisType{$thesistype$}$endif$ % 'bc' or 'mgr'
$if(thesisname)$\setThesisName{$thesisname$}$endif$
......
---
colorprofile: color # 'color' or 'bw'
language: czech # 'czech' or 'english'
reporttype: reader # 'reader' or 'supervisor' or 'inter-reader'
thesistype: bc # 'bc' or 'mgr' or 'phd'
thesisname: The Great Thesis
......
\documentclass[12pt]{fi-thesis-report}
% OPTIONAL: class options
% - bw: use black & white logo and link colors
% - english: use english for the report
% e.g. \documentclass[12pt, english, bw]
\usepackage{lipsum}
% MANDATORY: Choose color or black-and-white version
\setColorProfile{color} % 'color' or 'bw'
% DEPRECATED: Choose color or black-and-white version
% (use bw documentclass option for black & white design)
% \setColorProfile{color} % 'color' or 'bw'
% MANDATORY: Set report & thesis types, student and thesis names.
\setReportType{reader} % 'reader' or 'supervisor' or 'inter-reader'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment