mirror of
https://github.com/wnagrodzki/CocoaProgrammingGuidelines.git
synced 2025-05-06 19:11:47 +02:00
Adds syntax highlighting.
This commit is contained in:
parent
5156651b8e
commit
3bc5a8d7e9
2 changed files with 8 additions and 6 deletions
Binary file not shown.
|
@ -23,6 +23,7 @@
|
||||||
\usepackage[framemethod=TikZ]{mdframed}
|
\usepackage[framemethod=TikZ]{mdframed}
|
||||||
\usepackage{hyperref}
|
\usepackage{hyperref}
|
||||||
\usepackage{tabto}
|
\usepackage{tabto}
|
||||||
|
\usepackage{minted}
|
||||||
|
|
||||||
|
|
||||||
% Define section, subsection and subsubsection font size and color
|
% Define section, subsection and subsubsection font size and color
|
||||||
|
@ -84,9 +85,10 @@
|
||||||
|
|
||||||
% Lists a code inside of a blue border
|
% Lists a code inside of a blue border
|
||||||
\definecolor{BaliHaiColor}{HTML}{7CA1B3}
|
\definecolor{BaliHaiColor}{HTML}{7CA1B3}
|
||||||
\newenvironment{codelisting}
|
\newminted[codelisting]{objective-c}{tabsize=4, fontsize=\footnotesize}
|
||||||
{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]\verbatim}
|
\usemintedstyle{xcode}
|
||||||
{\endverbatim\endmdframed\vspace{12pt}\normalsize}
|
\BeforeBeginEnvironment{codelisting}{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]}%
|
||||||
|
\AfterEndEnvironment{codelisting}{\endmdframed\vspace{12pt}\normalsize}
|
||||||
|
|
||||||
|
|
||||||
% Lists text inside yellow border
|
% Lists text inside yellow border
|
||||||
|
@ -384,7 +386,7 @@ This approach has one more advantage, it is easier to add an error handling late
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
*error = [NSError errorWithDomain:ExampleDomain
|
*error = [NSError errorWithDomain:ExampleDomain
|
||||||
code:1001
|
code:1001
|
||||||
userInfo:@{NSLocalizedDescriptionKey: @"User name must have..."}];
|
userInfo:@{NSLocalizedDescriptionKey: @"User has to..."}];
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,11 +394,11 @@ This approach has one more advantage, it is easier to add an error handling late
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
*error = [NSError errorWithDomain:ExampleDomain
|
*error = [NSError errorWithDomain:ExampleDomain
|
||||||
code:1002
|
code:1002
|
||||||
userInfo:@{NSLocalizedDescriptionKey: @"Password must have..."}];
|
userInfo:@{NSLocalizedDescriptionKey: @"Password has to..."}];
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
// logging in code
|
// actual logging code
|
||||||
}
|
}
|
||||||
\end{codelisting}
|
\end{codelisting}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue