\documentclass[a5paper, UTF8, openright]{book}
\usepackage[absolute,overlay,showboxes]{textpos}
% \usepackage[lining]{ebgaramond}
\usepackage[CJKspace]{xeCJK}
\usepackage{tocbibind} % for toc show inside pdf
\usepackage[
%urlbordercolor = {1 1 1},
%linkbordercolor = {1 1 1},
%citebordercolor = {1 1 1},
bookmarksnumbered, % add bookmark number in pdf output
urlcolor = blue,
colorlinks = true,
citecolor = black,
linkcolor = black]{hyperref}
\usepackage{graphicx}
\usepackage{xltxtra}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{indentfirst}
\usepackage{framed,color}
\usepackage{footnpag}
\usepackage{listings}
\usepackage{array}
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}
\usepackage{titlesec} % texlive-latex-extra package
\usepackage[titletoc]{appendix} % this is used for \appendices
\usepackage{xltxtra}
\usepackage{upquote}
\usepackage{changepage}
\usepackage{pdfpages}
\usepackage[bindingoffset=0.5cm, margin=1.5cm, includeheadfoot]{geometry}
% To support tables so required tabulary package
\usepackage{longtable,tabulary}
\definecolor{colorchapter}{RGB}{0,0,0} % All black
\definecolor{colorsection}{RGB}{0,0,0}
\definecolor{colorsubsection}{RGB}{0,0,0}
\definecolor{colorheader}{RGB}{0,0,0,}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.3,.3,.3}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\definecolor{editorGray}{rgb}{0.95, 0.95, 0.95}
\definecolor{editorOcher}{rgb}{1, 0.5, 0} % #FF7F00 -> rgb(239, 169, 0)
\definecolor{editorGreen}{rgb}{0, 0.4, 0.1} % #007C00 -> rgb(0, 150, 25)
% for pandoc
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
keywordstyle=\color{blue}\bfseries,
ndkeywords={class, export, boolean, throw, implements, import, this, public, static, int, char, string, ref, float, double},
ndkeywordstyle=\color{editorGreen}\bfseries,
identifierstyle=\color{black},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
morestring=[b]',
morestring=[b]"
}
\lstset{
language=JavaScript,
backgroundcolor=\color{lightgray},
extendedchars=true,
basicstyle=\footnotesize\ttfamily,
showstringspaces=false,
showspaces=false,
numbers=left,
numberstyle=\footnotesize,
numbersep=5pt,
tabsize=2,
breaklines=true,
showtabs=false,
captionpos=b,
xleftmargin=20pt,
frame=tb,
framexleftmargin=20pt
}
\lstdefinelanguage{JS}{
morekeywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
morecomment=[s]{/*}{*/},
morecomment=[l]//,
morestring=[b]",
morestring=[b]'
}
\lstdefinelanguage{HTML5}{
language=html,
sensitive=true,
alsoletter={<>=-},
otherkeywords={
% HTML tags
,
, , , , , ,