parent
ae130bf35f
commit
b2d9498850
@ -1,204 +0,0 @@ |
||||
% tabto.sty |
||||
% |
||||
% version 1.3 (Mar 2013) |
||||
% |
||||
% Tabbing to fixed positions in a paragraph. |
||||
% |
||||
% Copyright 2006,2009,2012,2013 by |
||||
% Donald Arseneau, Vancouver, Canada (asnd@triumf.ca) |
||||
% Permission to use, distribute and modify this software is granted |
||||
% under the conditions of the LaTeX Project Public License, either |
||||
% version 1.3 or (at your option) any later version. The license is |
||||
% found at http://www.latex-project.org/lppl.txt, and is part of all |
||||
% recent distributions of LaTeX. |
||||
% |
||||
% This work has the LPPL maintenance status `maintained' (by author). |
||||
% |
||||
% Two new text positioning commands are defined: \tabto and \tab. |
||||
% |
||||
% \tabto{<length>} |
||||
% Tab to a position relative to the left margin in a paragraph (any |
||||
% indentation due to a list or \leftskip is part of the `margin' in |
||||
% this context). If the text on the line already goes past the desired |
||||
% position, the tab starts a new line and moves to the requested |
||||
% horizontal position. |
||||
% |
||||
% \tabto*{<length>} |
||||
% Similar to \tabto, except it will perform backspacing, and over- |
||||
% print previous text on the line whenever that text is already |
||||
% longer than the specified length (i.e., no linebreak is produced). |
||||
% Line-breaks are suppressed immediately after \tabto or \tabto*. |
||||
% |
||||
% The length register "\CurrentLineWidth" will report the width |
||||
% of the existing text on the line, and it may be used in the |
||||
% <length> argument (using calc.sty, for example). Also, there |
||||
% is "\TabPrevPos" which gives the "\CurrentLineWidth" from the |
||||
% previous tab command, and can be used to return to that position |
||||
% if no line breaks have occurred in between. |
||||
% |
||||
% \tab |
||||
% Tab to the next tab-stop chosen from a list of tab positions, in |
||||
% the traditional style of typewriters. A \tab will always move |
||||
% to the next tab stop (or the next line), even if it is already |
||||
% exactly at a tab stop. Thus, "\tab" at the beginning of a line, |
||||
% or "\tab\tab" elsewhere skips a position. A linebreak is permitted |
||||
% immediately following a \tab, in case the ensuing text does not |
||||
% fit well in the remaining space. |
||||
% |
||||
% If you do not want to skip positions, use "\tabto{\NextTabStop}" |
||||
% instead of "\tab". This is particularly useful when you want to |
||||
% use \tab in some other command, but do not want to skip a column |
||||
% for the first item. |
||||
% |
||||
% The tab-stop positions are declared using either \TabPositions |
||||
% or \NumTabs: |
||||
% |
||||
% \TabPositions{<length>, <length>,...<length>} |
||||
% Declares the tab stops as a comma-separated list of positions |
||||
% relative to the left margin. A tab-stop at 0pt is implicit, and |
||||
% need not be listed. |
||||
% |
||||
% \NumTabs{<number>} |
||||
% Declares a list of <number> equally-spaced tabs, starting at the |
||||
% left margin and spanning \linewidth. For example \NumTabs{2} |
||||
% declares tab-stops at 0pt and 0.5\linewidth, the same as |
||||
% \TabPositions{0pt, 0.5\linewidth} or \TabPositions{0.5\linewidth} |
||||
% |
||||
% After these declarations, the list of tab positions is saved in |
||||
% \TabStopList, and the next tab position, relative to the current |
||||
% position, is given by \NextTabStop. You do not normally need |
||||
% to access them, but they are available. |
||||
% |
||||
% Problems: |
||||
% |
||||
% Tall objects after a tab stop may overlap the line above, rather |
||||
% than forcing a greater separation between lines. |
||||
|
||||
\ProvidesPackage{tabto}[2013/03/25 \space v 1.3 \space |
||||
Another tabbing mechanism]\relax |
||||
|
||||
\newdimen\CurrentLineWidth |
||||
\let\TabPrevPos\z@ |
||||
|
||||
\newcommand\tabto[1]{% |
||||
\leavevmode |
||||
\begingroup |
||||
\def\@tempa{*}\def\@tempb{#1}% |
||||
\ifx\@tempa\@tempb % \tab* |
||||
\endgroup |
||||
\TTo@overlaptrue % ... set a flag and re-issue \tabto to get argument |
||||
\expandafter\tabto |
||||
\else |
||||
\ifinner % in a \hbox, so ignore |
||||
\else % unrestricted horizontal mode |
||||
\null% \predisplaysize will tell the position of this box (must be box) |
||||
\parfillskip\fill |
||||
\everydisplay{}\everymath{}% |
||||
\predisplaypenalty\@M \postdisplaypenalty\@M |
||||
$$% math display so we can test \predisplaysize |
||||
\lineskiplimit=-999pt % so we get pure \baselineskip |
||||
\abovedisplayskip=-\baselineskip \abovedisplayshortskip=-\baselineskip |
||||
\belowdisplayskip\z@skip \belowdisplayshortskip\z@skip |
||||
\halign{##\cr\noalign{% |
||||
% get the width of the line above |
||||
\ifdim\predisplaysize=\maxdimen %\message{Mixed R and L, so say the line is full. }% |
||||
\CurrentLineWidth\linewidth |
||||
\else |
||||
\ifdim\predisplaysize=-\maxdimen |
||||
% \message{Not in a paragraph, so call the line empty. }% |
||||
\CurrentLineWidth\z@ |
||||
\else |
||||
\ifnum\TTo@Direction<\z@ |
||||
\CurrentLineWidth\linewidth \advance\CurrentLineWidth\predisplaysize |
||||
\else |
||||
\CurrentLineWidth\predisplaysize |
||||
\fi |
||||
% Correct the 2em offset |
||||
\advance\CurrentLineWidth -2em |
||||
\advance\CurrentLineWidth -\displayindent |
||||
\advance\CurrentLineWidth -\leftskip |
||||
\fi\fi |
||||
\ifdim\CurrentLineWidth<\z@ \CurrentLineWidth\z@\fi |
||||
% Enshrine the tab-to position; #1 might reference \CurrentLineWidth |
||||
\@tempdimb=#1\relax |
||||
%\message{*** Tab to \the\@tempdimb, previous width is \the\CurrentLineWidth. ***}% |
||||
% Save width for possible return use |
||||
\xdef\TabPrevPos{\the\CurrentLineWidth}% |
||||
% Build the action to perform |
||||
\protected@xdef\TTo@action{% |
||||
\vrule\@width\z@\@depth\the\prevdepth |
||||
\ifdim\CurrentLineWidth>\@tempdimb |
||||
\protect\hskip\the\CurrentLineWidth\hskip5pt\relax |
||||
\else |
||||
\protect\nobreak |
||||
\protect\hskip\the\@tempdimb\relax |
||||
\fi |
||||
}% |
||||
%\message{\string\TTo@action: \meaning \TTo@action. }% |
||||
% get back to the baseline, regardless of its depth. |
||||
\vskip-\prevdepth |
||||
\prevdepth-99\p@ |
||||
\vskip\prevdepth |
||||
}}% |
||||
$$ |
||||
% Don't count the display as lines in the paragraph |
||||
\count@\prevgraf \advance\count@-4 \prevgraf\count@ |
||||
\TTo@action |
||||
%% \penalty\@m % to allow a penalized line break |
||||
\fi |
||||
\endgroup |
||||
\TTo@overlapfalse |
||||
\ignorespaces |
||||
\fi |
||||
} |
||||
|
||||
% \tab -- to the next position |
||||
% \hskip so \tab\tab moves two positions |
||||
% Allow a (penalized but flexible) line-break right after the tab. |
||||
% |
||||
\newcommand\tab{\leavevmode\hskip2sp\tabto{\NextTabStop}% |
||||
\nobreak\hskip\z@\@plus 30\p@\penalty4000\hskip\z@\@plus-30\p@\relax} |
||||
|
||||
|
||||
% Expandable macro to select the next tab position from the list |
||||
|
||||
\newcommand\NextTabStop{% |
||||
\expandafter \TTo@nexttabstop \TabStopList,\maxdimen,>% |
||||
} |
||||
|
||||
\def\TTo@nexttabstop #1,{% |
||||
\ifdim#1<\CurrentLineWidth |
||||
\expandafter\TTo@nexttabstop |
||||
\else |
||||
\ifdim#1<0.9999\linewidth#1\else\z@\fi |
||||
\expandafter\strip@prefix |
||||
\fi |
||||
} |
||||
\def\TTo@foundtabstop#1>{} |
||||
|
||||
\newcommand\TabPositions[1]{\def\TabStopList{\z@,#1}} |
||||
|
||||
\newcommand\NumTabs[1]{% |
||||
\def\TabStopList{}% |
||||
\@tempdimb\linewidth |
||||
\divide\@tempdimb by#1\relax |
||||
\advance\@tempdimb 1sp % counteract rounding-down by \divide |
||||
\CurrentLineWidth\z@ |
||||
\@whiledim\CurrentLineWidth<\linewidth\do {% |
||||
\edef\TabStopList{\TabStopList\the\CurrentLineWidth,}% |
||||
\advance\CurrentLineWidth\@tempdimb |
||||
}% |
||||
\edef\TabStopList{\TabStopList\linewidth}% |
||||
} |
||||
|
||||
% default setting of tab positions: |
||||
\TabPositions{\parindent,.5\linewidth} |
||||
|
||||
\newif\ifTTo@overlap \TTo@overlapfalse |
||||
|
||||
\@ifundefined{predisplaydirection}{ |
||||
\let\TTo@Direction\predisplaysize |
||||
\let\predisplaydirection\@undefined |
||||
}{ |
||||
\let\TTo@Direction\predisplaydirection |
||||
} |
@ -0,0 +1,60 @@ |
||||
|
||||
%% CTUTHESIS CONFIG |
||||
|
||||
\ctusetup{ |
||||
xdoctype = M, |
||||
front-list-of-tables = false, |
||||
mainlanguage = english, |
||||
% |
||||
author = {Ondřej Hruška}, |
||||
supervisor = {doc. Ing. Radislav Šmíd, Ph.D.}, |
||||
% |
||||
title-english = {Learning and automation GPIO platform}, |
||||
title-czech = {Výuková a automatizační GPIO platforma}, |
||||
% |
||||
xfaculty = F3, |
||||
department-czech = {Katedra měření}, |
||||
fieldofstudy-czech = {Kybernetika a~robotika}, |
||||
subfieldofstudy-czech = {Senzory a~přístrojová technika}, |
||||
% |
||||
department-english = {Department of Measurement}, |
||||
fieldofstudy-english = {Cybernetics and Robotics}, |
||||
subfieldofstudy-english = {Sensors and Instrumentation}, |
||||
front-specification = true, |
||||
specification-file = {zadani-zakryto.pdf}, |
||||
%specification-file = {zadani-doc.pdf}, |
||||
%specification-file = {zadani-doc.pdf}, |
||||
% |
||||
keywords-czech = {}, |
||||
keywords-english = {}, |
||||
% |
||||
day = 0, % ??? |
||||
month = 0, % ??? |
||||
year = 2018, % ??? |
||||
} |
||||
|
||||
\ctuprocess |
||||
|
||||
\hypersetup{ |
||||
pdftitle = {Learning and automation GPIO platform}, |
||||
pdfauthor = {Ondřej Hruška} |
||||
} |
||||
|
||||
% Extra info na titulní stránce |
||||
\addto\ctucaptionsczech{% |
||||
\def\supervisorname{Vedoucí}% |
||||
\def\subfieldofstudyname{Studijní program}% |
||||
} |
||||
|
||||
% Abstrakt, poděkování atd |
||||
\ctutemplateset{maketitle twocolumn default}{ |
||||
\begin{twocolumnfrontmatterpage} |
||||
\ctutemplate{twocolumn.thanks} |
||||
\ctutemplate{twocolumn.declaration} |
||||
\ctutemplate{twocolumn.abstract.in.titlelanguage} |
||||
\ctutemplate{twocolumn.abstract.in.secondlanguage} |
||||
\ctutemplate{twocolumn.tableofcontents} |
||||
\ctutemplate{twocolumn.listoffigures} |
||||
\end{twocolumnfrontmatterpage} |
||||
} |
||||
|
@ -0,0 +1,88 @@ |
||||
\newcommand{\cfield}[1]{\item {\color{RubineRed} \texttt{#1}\,}} % \tabto{1cm} |
||||
|
||||
\newcommand{\cname}[1]{\textbf{#1}\newline} |
||||
|
||||
% https://tex.stackexchange.com/questions/157389/how-to-center-column-values-in-a-table |
||||
% P will be a centered column that can have width |
||||
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}} |
||||
|
||||
% this is put before a response that follows a request |
||||
% this is needed for nice looking spacing |
||||
\newcommand*{\cjoin}{\null\vspace*{-2pt}} |
||||
|
||||
% This is a table of commands of events |
||||
\newenvironment{cmdlist} |
||||
{ |
||||
\tabulinesep=5pt |
||||
\begin{longtabu} to \textwidth {P{2.2em} X[3] X[3,l]} |
||||
\toprule |
||||
\textbf{Code} & \textbf{Function} & \textbf{Structure} \\ |
||||
\midrule |
||||
\endhead |
||||
|
||||
\bottomrule |
||||
\endfoot |
||||
}{ |
||||
\end{longtabu} |
||||
} |
||||
|
||||
% a list of generic payload fields |
||||
\newenvironment{pldlist} |
||||
{ |
||||
\begin{itemize}[ |
||||
leftmargin=.7cm, |
||||
nosep |
||||
] |
||||
} |
||||
{ |
||||
\end{itemize} |
||||
} |
||||
|
||||
|
||||
% a list of request fields, with a caption |
||||
\newenvironment{cmditemlistenv}[1] |
||||
{ |
||||
\begin{minipage}[t]{\linewidth} |
||||
|
||||
\begin{flushleft} % fix weird spacing in wrapped lines |
||||
|
||||
\textit{#1} % the caption, like Request: or Response: |
||||
\begin{pldlist} |
||||
} |
||||
{ |
||||
\end{pldlist} |
||||
\end{flushleft} |
||||
|
||||
% the minipage somehow fixes vertical alignment |
||||
% and also removes mysterious spacing around the itemize |
||||
\end{minipage} |
||||
} |
||||
|
||||
|
||||
% a list of request fields, with a caption |
||||
\newenvironment{cmdreq} |
||||
{ |
||||
\begin{cmditemlistenv}{Request:} |
||||
} |
||||
{ |
||||
\end{cmditemlistenv} |
||||
} |
||||
|
||||
% a list of request fields, with a caption |
||||
\newenvironment{cmdresp} |
||||
{ |
||||
\begin{cmditemlistenv}{Response:} |
||||
} |
||||
{ |
||||
\end{cmditemlistenv} |
||||
} |
||||
|
||||
% a list of payload fields, with a caption |
||||
\newenvironment{cmdpld} |
||||
{ |
||||
\begin{cmditemlistenv}{Payload:} |
||||
} |
||||
{ |
||||
\end{cmditemlistenv} |
||||
} |
||||
|
@ -0,0 +1,7 @@ |
||||
%% MINTED |
||||
\usepackage{minted} % code listings |
||||
\usepackage{xpatch,letltxmacro} |
||||
\LetLtxMacro{\cminted}{\minted} |
||||
\let\endcminted\endminted |
||||
\xpretocmd{\cminted}{\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}{}{} |
||||
\newminted{ini}{frame=leftline,autogobble=true} |
@ -0,0 +1,43 @@ |
||||
|
||||
%% SPACING |
||||
|
||||
% Booktabs |
||||
\setlength{\heavyrulewidth}{0.5mm} |
||||
\setlength{\lightrulewidth}{0.25mm} |
||||
\setlength{\cmidrulewidth}{0.25mm} |
||||
|
||||
% More space in table cells |
||||
\renewcommand{\arraystretch}{1.4} |
||||
|
||||
% Fix overful hbox |
||||
\setlength{\emergencystretch}{.5em} |
||||
|
||||
% -- odstavce -- |
||||
\setlength\parskip{1.5ex plus 1pt minus 1 pt} |
||||
%\setlength{\parskip}{1.5ex plus 0.2ex minus 0.1ex} % po změně je potřeba doladit nadpisy |
||||
%\renewcommand{\baselinestretch}{1.1} |
||||
\setlength\parindent{.5cm} |
||||
|
||||
% add blank page unless current is left |
||||
%\newcommand*\cleartoleftpage{% |
||||
% \clearpage |
||||
% \ifodd\value{page}\hbox{}\newpage\fi |
||||
%} |
||||
|
||||
% don't clear page before chapter |
||||
%\renewcommand{\cleardoublepage}{\clearpage} |
||||
|
||||
% section on new page, except first |
||||
%\pretocmd{\section}{% |
||||
% \ifnum\value{section}=0 \else\clearpage\fi |
||||
%}{}{} |
||||
|
||||
% ??? what does this do |
||||
\makeatletter |
||||
\newcommand*{\centerfloat}{% |
||||
\parindent \z@ |
||||
\leftskip \z@ \@plus 1fil \@minus \textwidth |
||||
\rightskip\leftskip |
||||
\parfillskip \z@skip} |
||||
\makeatother |
||||
|
@ -0,0 +1,24 @@ |
||||
|
||||
%% HELPER MACROS |
||||
|
||||
\newcommand\nobr[1]{\mbox{#1}} |
||||
|
||||
% monospace |
||||
\newcommand\mono[1]{\texttt{#1}} |
||||
|
||||
% library name |
||||
\newcommand\lib[1]{\textit{#1}} |
||||
|
||||
% název listing figure |
||||
% \renewcommand\listingscaption{Program} |
||||
|
||||
% \newcommand\zdroj[1]{\textit{Zdroj: #1}} |
||||
|
||||
|
||||
%% UNITS |
||||
|
||||
\newcommand{\uF}{\micro\farad} |
||||
\newcommand{\nF}{\nano\farad} |
||||
\newcommand{\cm}{\centi\metre} |
||||
\newcommand{\VperA}{\V/\A} |
||||
|
Binary file not shown.
Loading…
Reference in new issue