322 lines
No EOL
13 KiB
TeX
322 lines
No EOL
13 KiB
TeX
\documentclass[11pt, a4paper]{article}
|
|
\usepackage{pict2e}
|
|
\usepackage[left=2cm,text={17cm, 24cm},top=3cm]{geometry}
|
|
\usepackage[utf8]{inputenc}
|
|
\usepackage[czech]{babel}
|
|
\usepackage{times}
|
|
\usepackage{multirow}
|
|
\usepackage[hidelinks]{hyperref}
|
|
\usepackage[linesnumbered,ruled,czech]{algorithm2e}
|
|
\usepackage{graphicx}
|
|
\usepackage{pdflscape}
|
|
|
|
|
|
\begin{document}
|
|
\catcode`\-=12
|
|
|
|
\begin{titlepage}
|
|
\begin{center}
|
|
\Huge\textsc{Vysoké učení technické v Brně}
|
|
|
|
\huge\textsc{Fakulta informačních technologií}
|
|
|
|
\vspace{\stretch{0.382}}
|
|
|
|
\LARGE Typografie a~publikování -- 3. projekt
|
|
|
|
\Huge Tabulky a obrázky
|
|
|
|
\vspace{\stretch{0.618}}
|
|
\end{center}
|
|
{\Large \today \hfill Roman Nečas}
|
|
\end{titlepage}
|
|
|
|
\section{Úvodní strana}
|
|
Název práce umístěte do zlatého řezu a nezapomeňte uvést \emph{dnešní} (today) datum a vaše jméno a příjmení.
|
|
|
|
\section{Tabulky}
|
|
Pro sázení tabulek můžeme použít buď prostředí \verb| tabbing | nebo prostředí \verb| tabular|.
|
|
|
|
\subsection{Prostředí \texttt{tabbing}}
|
|
Při použití \verb| tabbing | vypadá tabulka následovně:
|
|
|
|
\begin{tabbing}
|
|
Vodní melouny \quad \= Množství \quad \= Jednotka \quad \= Cena za jedn. \quad \= Cena celková \kill
|
|
\textbf{Ovoce} \> \textbf{Množství} \> \textbf{Jednotka} \> \textbf{Cena za jedn.} \> \textbf{Cena celková} \\
|
|
Jablka \> 3 \> kg \> 25,90 Kč \> 77,70 Kč \\
|
|
Hrušky \> 2,5 \> kg \> 27,40 Kč \> 68,50 Kč \\
|
|
Vodní melouny \> 1 \> kus \> 35,-- Kč \> 35,-- Kč
|
|
\end{tabbing}
|
|
\bigskip
|
|
\noindent Toto prostředí se dá také použít pro sázení algoritmů, ovšem vhodnější je použít prostředí \verb| algorithm | nebo \verb|algorithm2e | (viz sekce \ref{section3}).
|
|
|
|
\subsection{Prostředí \texttt{tabular}}
|
|
Další možností, jak vytvořit tabulku, je použít prostředí \verb| tabular|. Tabulky pak budou vypadat takto \footnote{Kdyby byl problém s \texttt{cline}, zkuste se podívat třeba sem: \href{http://www.abclinuxu.cz/tex/poradna/show/325037}{http://www.abclinuxu.cz/tex/poradna/show/325037}.}:
|
|
\bigskip
|
|
\begin{table}[h]
|
|
\centering
|
|
\begin{tabular}{|l|c|c|} \hline
|
|
& \multicolumn{2}{c|}{\textbf{Cena}} \\ \cline{2-3}
|
|
\textbf{Měna} & \textbf{nákup} & \textbf{prodej} \\ \hline
|
|
EUR & 23,26 & 24,93 \\
|
|
GBP & 29,56 & 29,83 \\
|
|
USD & 22,27 & 23,12 \\ \hline
|
|
\end{tabular}
|
|
\caption{Tabulka kurzů k dnešnímu dni}
|
|
\label{tab1}
|
|
\end{table}
|
|
\bigskip
|
|
\begin{table}[h]
|
|
\centering
|
|
\begin{tabular}{|c|c|} \hline
|
|
$A$ & $\neg A$ \\ \hline
|
|
\textbf{P} & N \\ \hline
|
|
\textbf{O} & O \\ \hline
|
|
\textbf{X} & X \\ \hline
|
|
\textbf{N} & P \\ \hline
|
|
\end{tabular}
|
|
\begin{tabular}{|c|c|c|c|c|c|} \hline
|
|
\multicolumn{2}{|c|}{\multirow{2}{*}{$A \wedge B$}} & \multicolumn{4}{c|}{$B$} \\ \cline{3-6}
|
|
\multicolumn{2}{|c|}{} & \textbf{P} & \textbf{O} & \textbf{X} & \textbf{N} \\ \hline
|
|
\multirow{4}{*}{$A$} & \textbf{P} & P & O & X & N \\ \cline{2-6}
|
|
& \textbf{O} & O & O & N & N \\ \cline{2-6}
|
|
& \textbf{X} & X & N & X & N \\ \cline{2-6}
|
|
& \textbf{N} & N & N & N & N \\ \hline
|
|
\end{tabular}
|
|
\begin{tabular}{|c|c|c|c|c|c|} \hline
|
|
\multicolumn{2}{|c|}{\multirow{2}{*}{$A \vee B$}} & \multicolumn{4}{c|}{$B$} \\ \cline{3-6}
|
|
\multicolumn{2}{|c|}{} & \textbf{P} & \textbf{O} & \textbf{X} & \textbf{N} \\ \hline
|
|
\multirow{4}{*}{$A$} & \textbf{P} & P & P & P & P \\ \cline{2-6}
|
|
& \textbf{O} & P & O & P & O \\ \cline{2-6}
|
|
& \textbf{X} & P & P & X & X \\ \cline{2-6}
|
|
& \textbf{N} & P & O & X & N \\ \hline
|
|
\end{tabular}
|
|
\begin{tabular}{|c|c|c|c|c|c|} \hline
|
|
\multicolumn{2}{|c|}{\multirow{2}{*}{$A \to B$}} & \multicolumn{4}{c|}{$B$} \\ \cline{3-6}
|
|
\multicolumn{2}{|c|}{} & \textbf{P} & \textbf{O} & \textbf{X} & \textbf{N} \\ \hline
|
|
\multirow{4}{*}{$A$} & \textbf{P} & P & O & X & N \\ \cline{2-6}
|
|
& \textbf{O} & P & O & P & O \\ \cline{2-6}
|
|
& \textbf{X} & P & P & X & X \\ \cline{2-6}
|
|
& \textbf{N} & P & P & P & P \\ \hline
|
|
\end{tabular}
|
|
\caption{Protože Kleeneho trojhodnotová logika už je „zastaralá", uvádíme si zde příklad čtyřhodnotové logiky}
|
|
\label{tab2}
|
|
\end{table}
|
|
\bigskip
|
|
\pagebreak
|
|
|
|
\section{Algoritmy} \label{section3}
|
|
Pokud budeme chtít vysázet algoritmus, můžeme použít prostředí \verb| algorithm|\footnote{\href{http://ftp.cstug.cz/pub/tex/CTAN/macros/latex/contrib/algorithms/algorithms.pdf}{http://ftp.cstug.cz/pub/tex/CTAN/macros/latex/contrib/algorithms/algorithms.pdf}} nebo \verb| algorithm2e|\footnote{\href{http://ftp.cstug.cz/pub/tex/CTAN/macros/latex/contrib/algorithm2e/doc/algorithm2e.pdf}{http://ftp.cstug.cz/pub/tex/CTAN/macros/latex/contrib/algorithm2e/doc/algorithm2e.pdf}}.
|
|
Příklad použití prostředí \verb| algorithm2e | viz Algoritmus \ref{algorithm1}.
|
|
\bigskip
|
|
\begin{algorithm}
|
|
\label{algorithm1}
|
|
\caption{\textsc{FastSLAM}}
|
|
\SetNlSty{}{}{: }
|
|
\SetNlSkip{-15pt}
|
|
\SetKwFor{For}{for}{do}{end\:for}
|
|
\SetAlgoNoLine
|
|
\SetAlgoNlRelativeSize{-1}
|
|
\KwIn{ $(X_{t-1}, u_t, z_t)$}
|
|
\KwOut{ $X_t$}
|
|
\BlankLine
|
|
\Indpp\Indp $\overline{X_t} = X_t = 0$ \\
|
|
\For{$k = 1 \textrm{ to } M$}{
|
|
$x^{[k]}_t = \textit{sample\_motion\_model}(u_t, x^{[k]}_{t-1})$ \\
|
|
$\omega^{[k]}_t = \textit{measurement\_model}(z_t, x^{[k]}_t, m_{t-1})$ \\
|
|
$m_t^{[k]} = \textit{updated\_occupancy\_grid}(z_t, x^{[k]}_t, m^{[k]}_{t-1})$ \\
|
|
$\overline{X_t} = \overline{X_t} + \langle x^{[m]}_x, \omega_t^{[m]} \rangle$ \\
|
|
}
|
|
\For{$k = 1 \textrm{ to } M$}{
|
|
draw $i$ with probability $\approx \omega_t^{[i]}$ \\
|
|
add $\langle x^{[k]}_x, m^{[k]}_t \rangle \textrm{ to } X_t$ \\
|
|
}
|
|
\Return{$X_t$}
|
|
\end{algorithm}
|
|
|
|
\section{Obrázky}
|
|
Do našich článků můžeme samozřejmě vkládat obrázky. Pokud je obrázkem fotografie, můžeme klidně použít bitmapový soubor. Pokud by to ale mělo být nějaké schéma nebo něco podobného, je dobrým zvykem takovýto obrázek vytvořit vektorově.
|
|
|
|
\begin{figure}[h]
|
|
\centering
|
|
\scalebox{0.4}{\includegraphics{etiopan.eps}
|
|
{\reflectbox{\includegraphics{etiopan.eps}}}}
|
|
\caption{Malý Etiopánek a jeho bratříček}
|
|
\label{etiop}
|
|
\end{figure}
|
|
\bigskip
|
|
\pagebreak
|
|
|
|
Rozdíl mezi vektorovým \ldots
|
|
|
|
\begin{figure}[h]
|
|
\centering
|
|
\scalebox{0.4}{\includegraphics{oniisan.eps}}
|
|
\caption{Vektorový obrázek}
|
|
\label{vektor}
|
|
\end{figure}
|
|
|
|
\ldots a bitmapovým obrázkem
|
|
|
|
\begin{figure}[h]
|
|
\centering
|
|
\scalebox{0.6}{\includegraphics{oniisan2.eps}}
|
|
\caption{Bitmapový obrázek}
|
|
\label{bitmap}
|
|
\end{figure}
|
|
|
|
\noindent se projeví například při zvětšení.
|
|
|
|
Odkazy (nejen ty) na obrázky \ref{etiop}, \ref{vektor} a \ref{bitmap}, na tabulky \ref{tab1} a \ref{tab2} a také na algoritmus \ref{algorithm1} jsou udělány pomocí křížových odkazů. Pak je ovšem potřeba zdrojový soubor přeložit dvakrát.
|
|
|
|
Vektorové obrázky lze vytvořit i přímo v \LaTeX u, například pomocí prostředí \verb| picture| .
|
|
\pagebreak
|
|
|
|
\begin{landscape}
|
|
\begin{figure}[h]
|
|
\setlength{\unitlength}{1mm}
|
|
\centering
|
|
\begin{picture}(200, 100)(0,0)
|
|
|
|
\linethickness{0.5pt}
|
|
\put(0, 0){\framebox(200, 105){}}
|
|
|
|
\linethickness{2.75pt}
|
|
\put(0, 15){\line(1, 0){200}} % Top of sidewalk / Start of grass/driveway
|
|
|
|
\linethickness{0.75pt}
|
|
% --- Garage (Left) ---
|
|
\put(10, 15){\line(0, 1){15}} % Left edge of driveway
|
|
\put(65, 15){\line(0, 1){15}} % Right edge of driveway
|
|
\put(10, 30){\line(1, 0){55}} % Bottom edge of garage door / Top of driveway
|
|
\put(10, 30){\line(0, 1){25}} % Left wall of garage
|
|
\put(65, 30){\line(0, 1){25}} % Right wall of garage (shared with main house)
|
|
|
|
% Garage Door
|
|
\put(12, 30){\framebox(51, 20){}} % Garage door frame
|
|
\put(37.5, 30){\line(0, 1){20}} % Vertical divider
|
|
\put(12, 40){\line(1, 0){51}} % Horizontal divider
|
|
|
|
% Garage Roof
|
|
\put(10, 55){\line(2, 1){27.5}} % Left roof slope
|
|
\put(65, 55){\line(-2, 1){27.5}} % Right roof slope
|
|
\put(8, 54.5){\line(2, 1){29.5}} % Roof edge overhang left
|
|
\put(67, 54.5){\line(-2, 1){29.5}}% Roof edge overhang right
|
|
\put(8, 54.5){\line(1,0){59}} % Bottom roof edge line
|
|
|
|
% Garage Gable Shingles Pattern
|
|
\put(17, 57){\line(1,0){41}}
|
|
\put(21, 59){\line(1,0){33}}
|
|
\put(24, 61){\line(1,0){27}}
|
|
\put(28, 63){\line(1,0){19}}
|
|
\put(32, 65){\line(1,0){11}}
|
|
|
|
% --- Main House Section (Middle) ---
|
|
\put(65, 30){\line(1, 0){50}} % Bottom wall edge above foundation
|
|
\put(115, 30){\line(0, 1){25}}% Right wall edge of this section
|
|
|
|
% Brick Foundation
|
|
\put(65, 25){\line(1, 0){50}} % Bottom of bricks
|
|
\put(65, 25){\line(0, 1){5}} % Left edge of bricks
|
|
\put(115, 25){\line(0, 1){5}} % Right edge of bricks
|
|
\multiput(67, 26)(5,0){10}{\line(1,0){3}} % Brick pattern row 1
|
|
\multiput(66, 28)(5,0){10}{\line(1,0){3}} % Brick pattern row 2
|
|
|
|
% Window (Middle Section)
|
|
\put(80, 38){\framebox(20, 8){}} % Window frame
|
|
\multiput(80, 42)(4,0){6}{\line(0,1){0}} % Simulate horizontal panes top (dots)
|
|
\multiput(80, 38)(0,4){3}{\line(1,0){20}} % Simulate vertical panes (full lines)
|
|
\put(90, 38){\line(0, 1){8}} % Center vertical bar
|
|
|
|
% Front Door Area
|
|
\put(105, 30){\line(0, 1){10}} % Left side of door frame area
|
|
\put(113, 30){\line(0, 1){10}}% Right side of door frame area
|
|
\put(107, 30){\framebox(4, 8){}} % Door
|
|
% Porch Roof
|
|
\put(104, 40){\line(1, 1){3}} % Left porch roof slope
|
|
\put(114, 40){\line(-1, 1){3}} % Right porch roof slope
|
|
\put(107, 43){\line(1, 0){4}} % Porch roof peak
|
|
\put(104, 40){\line(1, 0){10}} % Porch roof eave
|
|
|
|
% Main Roof (Middle Section)
|
|
\put(65, 55){\line(1, 0){50}} % Roof line connecting to right section wall
|
|
\put(37.5, 69){\line(1,0){77.5}} % Eave line lower edge
|
|
|
|
\multiput(45, 66)(5,0){14}{\line(1,0){3}}
|
|
\multiput(51, 63)(5,0){13}{\line(1,0){3}}
|
|
\multiput(57, 60)(5,0){11}{\line(1,0){3}}
|
|
\multiput(63, 57)(5,0){10}{\line(1,0){3}}
|
|
|
|
% --- Two-Story Section (Right) ---
|
|
\put(115, 25){\line(0, 1){54}} % Left wall of right section (up to roof start)
|
|
\put(155, 25){\line(0, 1){54}} % Right wall of right section
|
|
\put(115, 25){\line(1, 0){40}} % Bottom edge of wall
|
|
|
|
% Planter Box (Right)
|
|
\put(117, 25){\framebox(36, 5){}} % Planter box
|
|
% Bush in planter (Simplified curves/scribble)
|
|
\qbezier(118, 30)(125, 35)(130, 30)
|
|
\qbezier(130, 30)(138, 36)(145, 30)
|
|
\qbezier(145, 30)(150, 34)(152, 30)
|
|
\put(117, 30){\line(1,0){36}} % Top line of soil/bush base
|
|
|
|
|
|
% Lower Window (Right Section)
|
|
\put(125, 35){\framebox(20, 8){}} % Frame
|
|
\put(135, 35){\line(0, 1){8}} % Vertical divider
|
|
\put(125, 39){\line(1, 0){20}} % Horizontal divider
|
|
|
|
% Balcony
|
|
\put(115, 50){\line(1, 0){40}} % Balcony floor line
|
|
\put(115, 49){\line(1, 0){40}} % Balcony floor thickness
|
|
\put(115, 49){\line(0, 1){1}}
|
|
\put(155, 49){\line(0, 1){1}}
|
|
% Railing
|
|
\multiput(117, 50)(5, 0){8}{\line(0, 1){6}} % Vertical posts
|
|
\put(117, 56){\line(1, 0){35}} % Top rail
|
|
|
|
% Upper Sliding Door/Window (Right Section)
|
|
\put(122, 51){\framebox(25, 15){}} % Frame
|
|
\put(132.5, 51){\line(0, 1){15}} % Vertical divider
|
|
|
|
% Right Section Roof
|
|
|
|
\put(113, 78){\line(1, 1){22}} % Roof edge overhang left
|
|
\put(157, 78){\line(-1, 1){22}} % Roof edge overhang right
|
|
\put(113, 78){\line(1,0){44}} % Bottom roof edge line
|
|
|
|
\put(114, 78){\line(1, 1){21}}
|
|
\put(156, 78){\line(-1, 1){21}}
|
|
|
|
% --- Landscaping Details ---
|
|
|
|
% Plant Pot (Left of main section)
|
|
\put(70, 32){\oval(6, 4)[b]} % Bottom half of pot
|
|
\put(67, 32){\line(0,1){5}}
|
|
\put(73, 32){\line(0,1){5}}
|
|
\put(70, 37){\oval(6, 4)[t]} % Top half of pot rim
|
|
% Plant leaves (simplified lines)
|
|
\put(70, 37){\line(0, 1){5}}
|
|
\put(70, 37){\line(-1, 1){4}}
|
|
\put(70, 37){\line(1, 1){4}}
|
|
\put(70, 37){\line(-2, 1){5}}
|
|
\put(70, 37){\line(2, 1){5}}
|
|
|
|
% Bush (Near middle window)
|
|
\qbezier(85, 30)(90, 36)(95, 30)
|
|
\qbezier(90, 30)(95, 35)(100, 30)
|
|
\put(85, 30){\line(1,0){15}} % base line
|
|
|
|
% Simple Grass representation (random dots)
|
|
\multiput(11, 16)(3, 0){18}{\multiput(0,0)(0, 2){7}{.}} % Left lawn area
|
|
\multiput(105, 16)(2, 0){5}{\multiput(0,0)(0, 2.5){4}{.}} % Small area right of path
|
|
|
|
\put(180, 90){\circle{12}}
|
|
|
|
\end{picture}
|
|
\caption{Vektorový obrázek domu z jistého animovaného seriálu}
|
|
\label{fig:cartoon_house}
|
|
\end{figure}
|
|
\end{landscape}
|
|
|
|
\end{document} |