2015-06-23 23:27:03 +00:00
\usepackage [T1] { fontenc}
2015-06-24 16:33:43 +00:00
\usepackage [utf8] { inputenc}
2015-06-25 10:03:26 +00:00
\usepackage { baskervald} % Default font
2015-07-13 17:25:39 +00:00
\usepackage [onehalfspacing] { setspace}
2015-06-23 23:27:03 +00:00
\usepackage { graphicx}
2015-06-25 23:36:34 +00:00
\usepackage { color}
2015-06-23 23:27:03 +00:00
\usepackage { textcomp}
2015-07-20 13:08:24 +00:00
\usepackage [hidelinks, pdfusetitle] { hyperref}
2015-06-29 10:15:11 +00:00
\usepackage { float}
2015-07-10 10:21:35 +00:00
\usepackage { ltxcmds}
2015-07-13 17:25:39 +00:00
\usepackage { fp}
2015-07-18 19:05:50 +00:00
\usepackage { tikz}
2015-07-20 13:08:24 +00:00
\usepackage { etoolbox}
2015-07-20 14:33:24 +00:00
% We frequently prevent page breaks before pictures, and it has a tendency to create a lot of widowed lines. Let's prevent it from happening.
\usepackage [all] { nowidow}
2015-07-18 19:05:50 +00:00
\usetikzlibrary { calc}
2015-07-19 18:48:00 +00:00
\usetikzlibrary { fit}
2015-06-23 23:27:03 +00:00
2015-06-24 16:33:43 +00:00
% This macro produces a "Snap!" logo.
%
% Note that in Polish (and other languages), nouns are inflected. The form "Snap!" with suffix looks plain stupid, so the macro takes a suffix as argument. If the suffix is non-empty, no exclamation mark is generated, and the suffix is used instead.
\newcommand { \Snap } [1]{ %
2015-06-24 16:55:24 +00:00
\textsf { %
2015-06-24 16:33:43 +00:00
Snap%
2015-06-25 07:50:52 +00:00
\ifx \\ #1\\ \textit { !\@ } %
2015-06-24 16:33:43 +00:00
\else #1%
\fi %
} %
}
2015-07-02 13:55:42 +00:00
\newcommand { \code } [1]{ \textsf { \textbf { #1} } }
2015-07-13 17:25:39 +00:00
\makeatletter
2015-06-23 23:27:03 +00:00
\newcommand { \defaultGraphicsScale } { 0.6}
2015-07-13 17:25:39 +00:00
\makeatother
2015-06-23 23:27:03 +00:00
2015-06-24 16:33:43 +00:00
\renewcommand { \thechapter } { \Roman { chapter} }
\renewcommand { \thesection } { \Alph { section} }
\renewcommand { \thesubsection } { }
2015-07-10 10:21:35 +00:00
\makeatletter
2015-07-13 17:25:39 +00:00
\edef \defaultFontSize { \f @size}
% A dirty hack: Apparently, this is the only way to multiply a length by a constant factor in the code below. What a mess.
\newdimen \raiseLength
\newcommand { \inlinepicraised } [3]{ %
{ %
\FPeval \fontSizeRatio { \f @size / \defaultFontSize } %
\FPeval \scale { #3 * \fontSizeRatio } %
\raiseLength =#2%
\raisebox { \fontSizeRatio \raiseLength } { %
\includegraphics [scale=\scale] { #1} %
} %
2015-06-23 23:27:03 +00:00
} %
2015-07-10 10:21:35 +00:00
% Add kerns if the next character is punctuation.
\ltx @ifnextchar@nospace.{ \, } { %
\ltx @ifnextchar@nospace,{ \, } { %
} %
} %
}
\makeatother
2015-07-13 17:25:39 +00:00
\newcommand { \inlinepic } [2][\defaultGraphicsScale ]{ %
\inlinepicraised { #2} { -4pt} { #1} %
2015-06-23 23:27:03 +00:00
}
2015-07-13 17:25:39 +00:00
\newcommand { \inlinereporterpic } [2][\defaultGraphicsScale ]{ %
\inlinepicraised { #2} { -1.5pt} { #1} %
2015-07-07 14:49:26 +00:00
}
2015-06-23 23:27:03 +00:00
\newcommand { \bigpic } [1]{
2015-06-29 10:15:11 +00:00
\begin { figure} [H]
\centering
2015-06-23 23:27:03 +00:00
\includegraphics [scale=\defaultGraphicsScale] { #1}
2015-06-29 10:15:11 +00:00
\end { figure}
2015-07-20 13:08:24 +00:00
}
\newcommand { \manualtitlepage } [2][]{ {
\def \title { #2}
\def \translator { #1}
\begin { titlepage}
\pgfdeclarelayer { background}
\pgfsetlayers { background,main}
\begin { tikzpicture} [remember picture, overlay, text depth=0]
\definecolor { title blue} { HTML} { 206C8F}
\definecolor { title orange} { HTML} { F59201}
\pgfdeclareimage [width=0.2\textwidth] { logo} { ../common/logo}
\pgfdeclareimage { cover picture} { ../common/cover-picture}
\coordinate (NW) at ($ ( current page.north west ) + ( 0 . 5 , - 0 . 5 ) $ );
\coordinate (NE) at ($ ( current page.north east ) + ( - 0 . 5 , - 0 . 5 ) $ );
\coordinate (SW) at ($ ( current page.south west ) + ( 0 . 5 , 0 . 5 ) $ );
\coordinate (SE) at ($ ( current page.south east ) + ( - 0 . 5 , 0 . 5 ) $ );
% Logo at the top left corner.
\node [
below right,
align=left,
font=\Large ,
execute at begin node=\setlength \baselineskip { 3ex} ]
at ($ ( NW ) + ( 1 . 5 , - 1 . 5 ) $ ) {
\pgfuseimage { logo} \\
Build Your Own Blocks
} ;
% Version number.
\node [
below right,
color=white,
font=\fontsize { 40pt} { 48pt} \selectfont ]
at ($ ( NE ) - ( 7 , 5 ) $ ) {
4.0
} ;
% Title. Note: the % at the end is necessary for correct spacing between the text and orange background.
\node [
left,
text=white,
align=right,
inner sep=15pt,
font=\fontsize { 40pt} { 42pt} \selectfont ]
(title text)
at ($ ( NE ) - ( 1 . 5 , 9 ) $ ) {
\title %
} ;
% The cover picture.
\node [below left, inner sep=0] (cover picture)
at ($ ( NE ) - ( 0 , 12 ) $ ) {
\pgfuseimage { cover picture}
} ;
\draw [white, ultra thick]
(cover picture.north west) -- (cover picture.north east);
\draw [white, ultra thick]
(cover picture.south west) -- (cover picture.south east);
% Authors.
\node [above right, color=white, align=left, font=\Large]
at ($ ( SE ) + ( - 7 , 3 ) $ ) {
Brian Harvey\\
Jens M\" onig
} ;
% Translator.
\ifdefempty { \translator } { } {
\node [below right, color=white, align=left, font=\large ]
at ($ ( SE ) + ( - 7 , 2 ) $ ) {
\translator
} ;
}
\begin { pgfonlayer} { background}
% Blue bar on the right.
\fill [title blue] ($ ( NE ) - ( 7 . 5 , 0 ) $ ) rectangle (SE);
% Title background stretches to the left until it reaches the left edge, which means (NW.x, title text.west.y).
\coordinate (title background left point)
at (NW |- title text.west);
% Orange title background.
\node [
fit=(title text) (title background left point),
shape=rectangle,
fill=title orange,
text=white,
draw=white,
ultra thick,
align=right,
inner sep=0,
font=\fontsize { 40pt} { 42pt} \selectfont ] { } ;
\end { pgfonlayer}
\end { tikzpicture}
\end { titlepage}
2015-07-21 11:09:15 +00:00
} }
\newcommand { \TODO } [1]{ %
\colorbox { yellow} { \textcolor { red} { \textbf { %
TODO%
\ifstrempty { #1} { } { %
: #1
} %
} } } %
}