Adds syntax highlighting support.

This commit is contained in:
Wojciech Nagrodzki 2014-11-28 22:14:23 +01:00
parent 5077234b90
commit ffcdb8c5f8
Signed by: wnagrodzki
GPG key ID: E9D0EB0302264569
4 changed files with 20 additions and 6 deletions

Binary file not shown.

View file

@ -23,6 +23,7 @@
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{minted}
% Define section, subsection and subsubsection font size and color
@ -84,9 +85,10 @@
% Lists a code inside of a blue border
\definecolor{BaliHaiColor}{HTML}{7CA1B3}
\newenvironment{codelisting}
{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]\verbatim}
{\endverbatim\endmdframed\vspace{12pt}\normalsize}
\newminted[codelisting]{objective-c}{tabsize=4, fontsize=\footnotesize}
\usemintedstyle{xcode}
\BeforeBeginEnvironment{codelisting}{\footnotesize\mdframed[middlelinewidth=0.5pt, middlelinecolor=BaliHaiColor, skipabove=15pt]}%
\AfterEndEnvironment{codelisting}{\endmdframed\vspace{12pt}\normalsize}
% Lists text inside yellow border
@ -167,7 +169,7 @@
if (error != NULL)
*error = [NSError errorWithDomain:ExampleDomain
code:1001
userInfo:@{NSLocalizedDescriptionKey: @"User name must have..."}];
userInfo:@{NSLocalizedDescriptionKey: @"User has to..."}];
return NO;
}
@ -175,7 +177,7 @@
if (error != NULL)
*error = [NSError errorWithDomain:ExampleDomain
code:1002
userInfo:@{NSLocalizedDescriptionKey: @"Password must have..."}];
userInfo:@{NSLocalizedDescriptionKey: @"Password has to..."}];
return NO;
// logging in code

View file

@ -1,6 +1,18 @@
Apple Documentation Style - LaTeX Template
====================================
To enable syntax highlighting you need to install Pygments and use xelatex for compilation:
1. sudo easy_install Pygments
2. xelatex -file-line-error -synctex=1 -shell-escape -interaction=nonstopmode "File.tex"
To integrate the template with TeXShop:
1. navigate to ~/Library/TeXShop/Engines
2. open XeLaTeX.engine file
3. add two additional parameters -shell-escape -interaction=nonstopmode
Table Of Contents
![Table Of Contents](https://raw.github.com/wnagrodzki/AppleDocumentationStyleLatexTemplate/master/Screen%20Shots/TOC.png "Table Of Contents")
@ -17,4 +29,4 @@ Code listing
- [x] Table of contents
- [x] Section, subcectio, and subsubsection style
- [x] Code listing
- [ ] Syntax highlighting
- [x] Syntax highlighting

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 113 KiB