kopia lustrzana https://github.com/backface/turtlestitch
Internationalize the title page
rodzic
4f5835a957
commit
facda70435
|
@ -5,11 +5,12 @@
|
|||
\usepackage{graphicx}
|
||||
\usepackage{color}
|
||||
\usepackage{textcomp}
|
||||
\usepackage[hidelinks]{hyperref}
|
||||
\usepackage[hidelinks, pdfusetitle]{hyperref}
|
||||
\usepackage{float}
|
||||
\usepackage{ltxcmds}
|
||||
\usepackage{fp}
|
||||
\usepackage{tikz}
|
||||
\usepackage{etoolbox}
|
||||
|
||||
\usetikzlibrary{calc}
|
||||
\usetikzlibrary{fit}
|
||||
|
@ -71,4 +72,104 @@
|
|||
\centering
|
||||
\includegraphics[scale=\defaultGraphicsScale]{#1}
|
||||
\end{figure}
|
||||
}
|
||||
}
|
||||
|
||||
\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}
|
||||
} }
|
|
@ -4,95 +4,11 @@
|
|||
|
||||
\begin{document}
|
||||
|
||||
\title{\Snap{} Reference Manual}
|
||||
\author{Brian Harvey \and Jens M\"{o}nig}
|
||||
\title{Snap! Reference Manual}
|
||||
\author{Brian Harvey\texorpdfstring{ \and}{,} Jens M\"onig}
|
||||
\date{}
|
||||
|
||||
\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)$) {
|
||||
Snap! Reference Manual%
|
||||
};
|
||||
|
||||
% 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, 2)$) {
|
||||
Brian Harvey\\
|
||||
Jens M\"onig
|
||||
};
|
||||
|
||||
\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}
|
||||
\manualtitlepage{Snap! Reference Manual}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
|
||||
\begin{document}
|
||||
|
||||
\title{\Snap{} \\ Podręcznik użytkownika}
|
||||
\author{Brian Harvey \and Jens M\"{o}nig}
|
||||
\title{Snap! --- Podręcznik użytkownika}
|
||||
\author{Brian Harvey\texorpdfstring{ \and}{,} Jens M\"onig}
|
||||
\date{}
|
||||
|
||||
\maketitle
|
||||
\manualtitlepage[Tłumaczenie na język polski:\\Bartosz Leper]{Snap!\\Podręcznik użytkownika}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue