-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
89 lines (71 loc) · 2.25 KB
/
main.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
\documentclass{article}
\usepackage[letterpaper, margin=1in]{geometry}
% Add Japanese language and furigana support
\usepackage{xeCJK}
\usepackage[overlap]{ruby}
% Adds the adjustwidth command
\usepackage{changepage}
% Set paragraph auto indent to 0
\usepackage{parskip}
% Adds 'Set' command for multiple lines in braces
\usepackage{braket}
% Create a hyperlinked table of contents
\usepackage{hyperref}
\hypersetup{
linktoc=all % hyperlink both sections and subsections
}
%%%%%%%%%%% stolen from https://tex.stackexchange.com/a/48549 because soul package was being a pain
\usepackage{xcolor}
\usepackage[normalem]{ulem} % use normalem to protect \emph
\newcommand\hl{\bgroup\markoverwith
{\textcolor{yellow}{\rule[-.5ex]{1pt}{2.5ex}}}\ULon}
%%%%%%%%%%%%
% Set font for Japanese
\setCJKmainfont{IPAexGothic}
% Set font for English
\setmainfont{Arial}
% Configure furigana separation and font size
\renewcommand{\rubysep}{0.2ex}
\renewcommand{\rubysize}{0.6}
%%%%%%%%%%%% Convenience commands
%%% stolen from https://tex.stackexchange.com/questions/141367/how-can-i-reference-the-current-subsection-number
% Grabs current section number
\makeatletter
\newcommand{\getCurrentSectionNumber}{%
\ifnum\c@section=0 %
\thechapter
\else
\ifnum\c@subsection=0 %
\thesection
\else
\ifnum\c@subsubsection=0 %
\thesubsection
\else
\thesubsubsection
\fi
\fi
\fi
}
\makeatother
%%%
% Create a 40mm long 1pt thick line. Good to separate parts within a section
\newcommand{\sectionSplit}{\rule{40mm}{1pt}}
% Creates a new chapter named after argument 1, creates a label, and includes latex from document in argument 2
\newcommand{\inputchapter}[2]{\section{Chapter #1}\label{\getCurrentSectionNumber}\input{chapters/#2}}
% Create a subsection named after argument 1, creates a label, and indents the contents of argument 2
\newcommand{\sub}[2]{\subsection{#1}\label{\getCurrentSectionNumber}{\begin{adjustwidth}{10mm}{0pt}#2\end{adjustwidth}}}
%%%%%%%%%%%%
\title{Genki Grammar}
\begin{document}
% \maketitle
\tableofcontents
\inputchapter{1}{01.tex}
\inputchapter{2}{02.tex}
\inputchapter{3}{03.tex}
\inputchapter{4}{04.tex}
\inputchapter{5}{05.tex}
\inputchapter{6}{06.tex}
\inputchapter{7}{07.tex}
\inputchapter{8}{08.tex}
\inputchapter{9}{09.tex}
\end{document}