mirror of
https://github.com/wnagrodzki/AppleDocumentationStyleLatexTemplate.git
synced 2025-05-07 03:21:43 +02:00
Adds syntax highlighting support.
This commit is contained in:
parent
5077234b90
commit
ffcdb8c5f8
4 changed files with 20 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{lipsum}
|
\usepackage{lipsum}
|
||||||
|
\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
|
||||||
|
@ -167,7 +169,7 @@
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +177,7 @@
|
||||||
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
|
// logging in code
|
||||||
|
|
14
README.md
14
README.md
|
@ -1,6 +1,18 @@
|
||||||
Apple Documentation Style - LaTeX Template
|
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
|
||||||
|
|
||||||

|

|
||||||
|
@ -17,4 +29,4 @@ Code listing
|
||||||
- [x] Table of contents
|
- [x] Table of contents
|
||||||
- [x] Section, subcectio, and subsubsection style
|
- [x] Section, subcectio, and subsubsection style
|
||||||
- [x] Code listing
|
- [x] Code listing
|
||||||
- [ ] Syntax highlighting
|
- [x] Syntax highlighting
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 113 KiB |
Loading…
Add table
Reference in a new issue