-
Notifications
You must be signed in to change notification settings - Fork 3
/
pgfplotsedt.tex
101 lines (90 loc) · 2.82 KB
/
pgfplotsedt.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
90
91
92
93
94
95
96
97
98
99
100
101
% ! TeX program = lualatex
% Use `l3build doc` to compile the documentation.
% Set the environment variable PPEDT_LANG to choose the language to compile.
\documentclass{l3doc}
% Language selection
\directlua{local doc_lang = os.getenv("PPEDT_LANG")
if doc_lang~=nil then
tex.print("\\newcommand{\\langSuffix}{_" .. doc_lang .. "}")
end}
\providecommand{\langSuffix}{}
\newcommand{\langSuffixEN}{}
\newcommand{\langSuffixCHS}{_chs}
\ifx\langSuffix\langSuffixCHS
\usepackage[fontset=fandol]{ctex}
\else
\usepackage{fontspec}
\fi
% Make the number in the margin
% https://tex.stackexchange.com/a/55198
\usepackage{titlesec}
\newlength\titleindent
\setlength\titleindent{2cm}
\titleformat{\section}
{\normalfont\Large\bfseries}{\llap{\parbox[t]{\titleindent}{\thesection\hfill}}}{0em}{}
\titleformat{\subsection}
{\normalfont\large\bfseries}{\llap{\parbox[t]{\titleindent}{\thesubsection\hfill}}}{0em}{\bfseries}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\llap{\parbox[t]{\titleindent}{\thesubsubsection}}}{0em}{\bfseries}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage{graphicx}
% https://tex.stackexchange.com/a/316469
\makeatletter
% jpg will be inserted directly
% png will be replaced by pdf
\preto\Gin@extensions{png,}
\DeclareGraphicsRule{.png}{pdf}{.pdf}{\noexpand\[email protected]}
% Limit the figure width
\setkeys{Gin}{width=\ifdim\Gin@nat@width>\linewidth
\linewidth
\else
\Gin@nat@width
\fi}
\makeatother
\graphicspath{{../../}} % compatible with l3build
\usepackage{float}
% make table `h' for here
\makeatletter
\renewcommand*{\fps@table}{H}
\makeatother
\usepackage{minted}
\setminted{linenos}
\usepackage{markdown}
\markdownSetup{
cacheDir=cache,
underscores=false,
fencedCode,
contentBlocks,
pipeTables,
tableCaptions,
hybrid,
notes,
gfmAutoIdentifiers,
renderers = {
headingOne = {\title{#1}},
headingTwo = {\section{#1}},
headingThree = {\subsection{#1}},
headingFour = {\subsubsection{#1}},
headingFive = {\paragraph{#1}},
headingSix = {\subparagraph{#1}},
link = {\href{#3}{#1}},
image = {\begin{figure}[H]\centering\includegraphics{#2}\caption{#1}\end{figure}},
blockQuoteBegin = {\begin{quote}},
blockQuoteEnd = {\end{quote}},
}
}
% Workaround for those logos
\let\oldTeX\TeX
\def\TeX{\text{\oldTeX}}
\let\oldLaTeX\LaTeX
\def\LaTeX{\text{\oldLaTeX}}
\let\oldtitle\title
\def\title#1{\oldtitle{#1}\maketitle}
\author{\href{https://github.com/LogCreative}{Log Creative}}
\date{\InputIfFileExists{../res/VERSION}{}{}\InputIfFileExists{../../../res/VERSION}{}{}} % make sure one of the file could be read
\begin{document}
\edef\mdFilename{README\langSuffix.md}
\markdownInput\mdFilename
\end{document}