summaryrefslogtreecommitdiff
path: root/info/install-latex-guide-zh-cn/install-latex-guide-zh-cn.tex
blob: c170b00ab80b95b3da8e7663869bb3fc3bb2d02c (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
\documentclass[fontset=fandol]{ctexrep}
\usepackage{accsupp}
\usepackage[margin=2.4cm]{geometry}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{fontawesome5}
\usepackage[pdfpagelayout=SinglePage,bookmarksnumbered]{hyperref}
\usepackage[os=win,hyperrefcolorlinks]{menukeys}

\ctexset{
  chapter        = {
    format       = \huge\bfseries\raggedright,
    number       = \arabic{chapter},
    name         = {},
    tocline      = \CTEXifname{\protect\numberline{\thechapter}}{}#2,
  },
  section/format = \Large\bfseries\raggedright,
}

\lstset{
  backgroundcolor = \color{lightgray!30},
  keywordstyle    = \color{blue},
  stringstyle     = \color{brown},
  basicstyle      = {\small\ttfamily},
  breaklines      = true,
  tabsize         = 4,
  gobble          = 2,
  numbers         = left,
  numberstyle     = \tiny\emptyaccsupp,
  frame           = single,
  xleftmargin     = \ccwd,
  numbersep       = \ccwd,
  columns         = fullflexible,
%  emphstyle       = {\color{blue}\small\ttfamily},
%  emph            = {mkdir,rmdir,sudo,mount,umount,rm},
}

\newcommand\emptyaccsupp[1]{%
  \BeginAccSupp{ActualText={}}#1\EndAccSupp{}%
}

\renewmenumacro{\menu}[>]{angularmenus}
\renewmenumacro{\keys}[+]{shadowedroundedkeys}

\title{\bfseries 一份简短的关于 \LaTeX{} 安装的介绍%
  \thanks{\url{https://github.com/OsbertWang/install-latex-guide-zh-cn}}%
}
\author{王然%
  \thanks{\href{mailto:ranwang.osbert@outlook.com}%
    {\ttfamily ranwang.osbert@outlook.com}}%
}
\date{\today}

\usepackage{booktabs}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, calc}

\tikzset{
  score stars/.style={
    % shape
    star, star points=5, star point ratio=2.25, scale=0.8,
    % color
    draw=gray, fill=#1,
    % others
    inner sep=0.14em, anchor=outer point 3
  }
}

\newcommand\stars[1]{%
  \begin{tikzpicture}
    % Draw five stars. For #1 = "2.3", fill the 1st and 2nd stars as gray,
    % and fill the 3rd to 5th stars as white.
    \foreach \i in {1, ..., 5} {
      \pgfmathsetmacro\starcolor{\i<=#1 ? "gray" : "white"}
      \node[score stars=\starcolor] (star\i) at (\i*0.8em, 0) {};
    }
    % For #1 = "2.3", let \partstar = "3" and \starpart = "0.3".
    % Then fill the left 30% part of the 3rd star as gray after clipping.
    \pgfmathsetmacro\partstar{#1>int(#1) ? int(#1+1) : 0}
    \ifnum\partstar>0
      \pgfmathsetmacro\starpart{#1-(int(#1))}
      \coordinate (upper left)
        at (star\partstar.outer point 2 |- star\partstar.outer point 1);
      \coordinate (upper right)
        at (star\partstar.outer point 5 |- star\partstar.outer point 1);
      \coordinate (lower right)
        at (star\partstar.outer point 5 |- star\partstar.outer point 4);
      \clip (upper left) rectangle
            ({$ (upper left)!\starpart!(upper right) $} |- lower right);
      \node[score stars=gray] at (\partstar*0.8em, 0) {};
    \fi
  \end{tikzpicture}%
}

\begin{document}
  
\maketitle
\include{./chapter/preface}

\tableofcontents

\include{./chapter/windows}
\include{./chapter/ubuntu}
\include{./chapter/macos}
\include{./chapter/wsl}
\include{./chapter/editor}
\include{./chapter/overleaf}

\appendix
\include{./appendix/mirror}
\include{./appendix/addition}
\include{./appendix/offline}
\include{./appendix/updateinfo}

\end{document}