summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tzplot/tzplot-doc.tex
blob: ea53095183967e5bffb2ed85c52ff179f4426af7 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
%!TEX program = arara
% arara: xelatex: {shell: yes, synctex: yes}
% arara: xelatex: {shell: yes, synctex: yes}
% arara: makeindex: {style: tzplot} 
% arara: xelatex: {shell: yes, synctex: yes}
% arara: xelatex: {shell: yes, synctex: yes}

%% 2021/02/28 v1.0
\def\tmpdate{2021/02/28}
\def\tmpversion{1.0}

%------------------------------------------------------
\def\myincludeonly{%
\includeonly{%
tzplot-doc-A-v\tmpversion,  % getting ready
tzplot-doc-B-v\tmpversion,  % intuitive introductions (getting started)
tzplot-doc-C-v\tmpversion,  % points, lines, and curves
tzplot-doc-D-v\tmpversion,  % plotting graphs
%tzplot-eco-v\tmpversion,    % economics
}}
%------------------------------------------------------

\documentclass[a4paper,amsmath,chapter]{oblivoir}

\gdef\clearforchapter{} % no clearpage for chapter

\usepackage{tzplot}

% ndh
\usepackage{etoolbox}
\input{tzplot-oblivoirpartstyle}

\usepackage{fapapersize}
\usefapapersize{*,*,30mm,*,28mm,*}
%\setsecnumdepth{subsubsection}
%\settocdepth{subsubsection}
%\setlength\cftsubsubsectionindent{4.5em}

\renewcommand*\contentsname{Contents}
\renewcommand*\figurename{Figure}
\renewcommand*\tablename{Table}
\renewcommand*\abstractname{Abstract}
\renewcommand*\indexname{Index}
\renewcommand*\pagerefname{\kern-4pt}

\hypersetup{pdfborder={0 0 0}} % to suppress the hyperlink red box

%%====================================== (ndh)
\SetHangulspace{1.025}{1}
%%% part 
\renewcommand*\prepartnum{\noindent\partnamefont\textsc{Part}\space}
\renewcommand*\partnamenum{}
\renewcommand*\postpartnum{}
\renewcommand*\hparttitlehead{Part\space\thepart}
\renewcommand*\beforepartskip{\vskip 0pt plus 2pt minus 0pt}
\renewcommand*\midpartskip{\newline}
\renewcommand*\afterpartskip{\vskip 2\onelineskip}

%\makeatletter
%\patchcmd\@part{\centering}{}{}{}
%\makeatother
\renewcommand*\obparttitlealignment{}

\renewcommand\partnumfont{\bfseries\Large}
\renewcommand\partnamefont{\partnumfont}
\renewcommand\parttitlefont{\bfseries\LARGE}

%%% for toc
\setlength\cftpartnumwidth{5.2em}
\setlength\cftchapternumwidth{1.8em}
\setlength\cftsectionindent{1.8em}
\setlength\cftsectionnumwidth{2.7em}
\setlength\cftsubsectionindent{4.5em}
\setlength\cftsubsectionnumwidth{3em}

%%% chapter style
\makechapterstyle{tzdoc}{%
	\reparticle
	\renewcommand\prechapternum{}
	\renewcommand\postchapternum{}
	\renewcommand\hchaptertitlehead{\thechapter}
}
%%================================

%\usepackage{xparse}  %% oblivoir loads xparse
\usepackage{tikz}


\usepackage{makecell}
\usepackage{multido}
\usepackage[normalem]{ulem} % [normalem] to correct the pdf bookmark broken characters
\usepackage{idxlayout}


\usepackage{tcolorbox}
\tcbuselibrary{minted,listings,breakable}
\tcbset{%
  listing engine=minted,breakable,
  after={\par\vspace{.5\baselineskip}\noindent}
}
\tcbset{%
  colback=yellow!5!white,
  colframe=blue!30,
  listing outside text,
  righthand width=.3\linewidth,
  center upper,
  center lower,
  sidebyside gap=5pt,
  listing options={%
    style=tcblatex,
    keywordstyle=\color{blue},
    commentstyle=\color{black!20!green},
    morekeyword={
      tzline,tzlines,tzdot,tzdots,
      tznode,tznodes
    },
  }
}

\newtcblisting{tzdef}[1]{colback=blue!5!white,listing only,#1}
\newtcblisting{tzsty}[1]{colback=green!5!white,listing only,#1}
\newtcblisting{tztikz}[1]{colback=white,colframe=gray!15,listing only,#1}
\newtcblisting{tzcode}[2][]{righthand width=\expandafter#2\linewidth,#1}

\NewDocumentEnvironment{mytcblisting}{O{}}
{ \medskip
  \begin{tcblisting}{#1} 
}
{ \end{tcblisting} 
  \medskip
}


\linespread{1}

\newcommand*\Tikz{Ti\textit{k}Z}
\let\TikZ\Tikz

\newenvironment{keywords}{%
	\par\vskip2pt
	\noindent\hangfrom{\textsc{Keywords: }}%
}


%% index
%\renewcommand\cmd[1]{\cmdprint{#1}}
\ExplSyntaxOn
\renewcommand \cmd [1]
{
  \texorpdfstring 
    { \cmdprint {#1} }
    { \textbackslash \cs_to_str:N #1 }
}
\ExplSyntaxOff

\newcommand\xem[1]{\emph{#1}}
\newcommand\xw[1]{\cmd{#1}}
\newcommand\xttw[1]{\texttt{#1}}
\newcommand\pkg[1]{\textsf{#1}}
\newcommand\env[1]{\textsf{#1}}
% index
\newcommand\isw[1]{#1\index{#1}}                        % simple word in text/index
\newcommand\ixsw[1]{\cmd{#1}\index{#1}}      % texttt in text, simple word in index
\newcommand\iisw[1]{\textit{#1}\index{#1}}     % textit in text, simple word in index
\newcommand\iscw[1]{\textsc{#1}\index{#1@\textsc{#1}}}  % textsc in text/index
\newcommand\ixxw[1]{\texttt{#1}\index{#1@\texttt{#1}}}  % texttt in text/index
\newcommand\ixw[1]{\textsf{#1}\index{#1@\textsf{#1}}}   % textsf in text/index
\newcommand\ixttw[1]{\texttt{#1}\index{#1@\texttt{#1}}} % texttt in text/index
\newcommand\ipkg[1]{\textsf{#1}\index{#1@\textsf{#1}}}
\newcommand\ienv[1]{\textsf{#1}\index{#1@\textsf{#1}}}

\makeatletter
\newcommand{\icmd}[1]{\cmdprint{#1}%
  \index{\expandafter\@gobble\string#1@\string\cmdprint{\string#1}}}
\makeatother

\makeindex


%% lazy macros
\newcommand\mysection[1]{\pagebreak[3]\section[\normalsize #1]{\Huge #1}}
\NewDocumentCommand\mysubsection{sm}
{\IfBooleanTF #1
  {\pagebreak[3]\subsection{#2}}
  {\pagebreak[3]\subsection{\protect\cmd{#2}}}
}
\NewDocumentCommand\mysubsubsection{sm}
{\IfBooleanTF #1
  {\pagebreak[3]\subsubsection{#2}}
  {\pagebreak[3]\subsubsection{\protect\cmd{#2}}}
}

\NewExpandableDocumentCommand\xcol{mO{c|}m}
  {\multicolumn{#1}{#2}{\ensuremath{#3}}}

%% more lazy macros
\newcommand\xbigskip[1]{\multido{}{#1}\bigskip}
\newcommand\xmedskip[1]{\multido{}{#1}\medskip}
\newcommand\xsmallskip[1]{\multido{}{#1}\smallskip}
\def\hpara{\hangpara{1.52em}{1}}
\def\listdivider{\leavevmode\smallskip\hrule width 1.5em\smallskip}

\newcommand\remark{\bigskip\noindent \textbf{Remark: }}
\newcommand\warning{\bigskip\noindent \textbf{Warning: }}
\newcommand\threeways{\textsc{Three Ways}}


%\parindent=0pt

\title{\texttt{tzplot.sty} \\ Plot Graphs with \Tikz\ Abbreviations}\author{In-Sung Cho \\  \texttt{ischo <at> ktug.org}}
\date{Economics, Kongju National University\\[3pt] 
      \tmpdate\quad version \tmpversion}

\def\tmpclearpage{\clearpage}

\AtBeginDocument{\MakeShortVerb{\|}}

%%% english based document: \flushbottom
%%% korean document: \raggedbottom (by default in oblivoir)
\AddToHook{env/document/before}{\flushbottom}
%%% same as \AtBeginDocument
\AddToHook{env/document/begin}{%
	\chapterstyle{tzdoc}
%	\pagestyle{headings}
}

\myincludeonly

%=============================================================
\begin{document}

\frontmatter
\maketitle

\renewcommand{\abstracttextfont}{\normalfont\small\noindent\ignorespaces}
\begin{abstract}
This is a \LaTeX{} package that provides \Tikz\ based macros to make it easy to draw graphs.
The macros provided in the \pkg{tzplot} package are just \emph{abbreviations} for \Tikz\ codes, which can be complicated, but using the package, hopefully, makes drawing easier, especially when drawing repeatedly. The macros were chosen and developed with an emphasis on drawing graphs in \emph{economics}.

\begin{keywords}
lines, dots, curves, axes, functions, 
projection, ticks, intersections, tangent lines
\end{keywords}
\end{abstract}

\tableofcontents*

\mainmatter

\include{tzplot-doc-A-v\tmpversion}

\include{tzplot-doc-B-v\tmpversion}

\include{tzplot-doc-C-v\tmpversion}

\include{tzplot-doc-D-v\tmpversion}

%\include{tzplot-eco-v\tmpversion}


\chapter*{Version history}
\addcontentsline{toc}{chapter}{Version history}

\begin{itemize}
\item v\tmpversion (\tmpdate) upload to CTAN
\item v0.999a (2021/02/27)
  \begin{itemize}
  \item writing document
  \item some |\tz<...>AtBegin| and |\tz<...>AtEnd| not documented
  \end{itemize}
\item v0.999 (2021/02/24)
  \begin{itemize}
  \item fixed the title. ``Plot Graphs with \Tikz\ Abbreviations"
  \item changed the default |\tzpathstyle| and |\tzlinkstyle| from `|--|' to `|to|' (no harm)
  \item added |\tzpathlayer| and |\settzpathlayer|, for later use. (currently not used)
  \item removed explanation of the option |<+or++>| in the document (considering to remove later)
  \item changed the delimiter |<path style>| to |[<path style>]| in |\tzpath| and |\tzlink(s)| (critical change)
  \item added |text opactiy=1| everywhere |fill opacity=.3| is used
  \end{itemize}
%%%\item v0.99j (2021/02/18)
%%%  \begin{itemize}
%%%  \item added |\tzplotcurve*| to show dots
%%%  \item discarded |<code.append>| for |\tznode| and the like.
%%%  \end{itemize}
%%%\item v0.99i (2021/02/17)
%%%  \begin{itemize}
%%%  \item added |\tzaxes*| to set the current state as a |bounding box|
%%%  \item redefined |\tztangentat| and |\tztangent|
%%%    \begin{itemize}
%%%    \item Now the tangent line is drawn over the domain, which is mandatory.
%%%    \end{itemize}
%%%  \item redefined |\tzsecantat| and |\tzsecant|
%%%    \begin{itemize}
%%%    \item Now the secant line is drawn over the domain, when the optional domain is given.
%%%    \item If there is no domain option, it draw a secant line segment.
%%%    \end{itemize}
%%%  \end{itemize}
%%%\item v0.99h (2021/02/12)
%%%  \begin{itemize}
%%%  \item redefined |\tztangentat| and |\tztangent|
%%%    \begin{itemize}
%%%    \item to resolve the discrepancy issue, when repeated
%%%    \item if two mandatory arguments are the same, no redefine |(bbTop)| and |(bbBottom)|
%%%    \item and clear for every start of |\tikzpicture|
%%%    \end{itemize}
%%%  \item redefined |\tzslopeat| and |\tzslope| to resolve the discrepancy issue
%%%  \item redefined |\tzbezier+| 
%%%        to make the last coordinate relative to the first
%%%  \item redefined |\tzparabola+| 
%%%        to make the last coordinate relative to the first
%%%  \end{itemize}
%%%\item v0.99g (2021/02/10)
%%%  \begin{itemize}
%%%  \item added |\tzbbox|
%%%  \item added |\tzhelplines*| to make it serve as a bounding box
%%%  \item added |\tzspy|
%%%  \end{itemize}
%%%\item v0.99f (2021/02/01)
%%%  \begin{itemize}
%%%  \item added |\settztangentlayer|, |\tzsecantlayer|, and |\tzslopelayer|
%%%  \item corrected |\tzvfn|, |\tzhfn| for |<shift coor>|
%%%  \item corrected |\tztangent|, |\tztangentat| to resolve `inconsistent' issue
%%%  \item changed |\xdef| to |\def|
%%%  \end{itemize}
%%%\item v0.99e (2021/01/25)
%%%  \begin{itemize}
%%%  \item redefined |\tzsecant| to resolve \Tikz\ issue of path name with layer.
%%%  \item added |\tzsnake|.
%%%  \end{itemize}
%%%\item v0.99d (2021/01/20)
%%%  \begin{itemize}
%%%  \item applied |<shift coor>| to (almost) all macros.
%%%  \end{itemize}
%%%\item v0.99c (2021/01/14)
%%%  \begin{itemize}
%%%  \item redesigned macros for |<shift coor>|
%%%  \end{itemize}
%%%\item v0.99b (2021/01/14)
%%%  \begin{itemize}
%%%  \item corrected y ticks position with ticks: |\tztikcs|, |\tzticksy|
%%%  \item changed the order of arguments for consistency: |\tzplot|, |\tzplotcurve|
%%%  \item redefined |\tzhfn| and |\tzvfn| to have a mandatory argument
%%%  \item added |<shift coor>| to macros related to lines or curves: 
%%%  \end{itemize}
%%%\item v0.99a (2021/01/12)
%%%  \begin{itemize}
%%%  \item to do: |<shift coor>| for |\tzto|, |\tzfn|, |\tzline|, ...
%%%  \item to do: |\tzconvexcomb| and |\tzconvexcombs|
%%%  \end{itemize}
\end{itemize}


\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement}

I am grateful to Kangsoo Kim of KTUG (Korean TeX Users Group) who wrote many packages including |oblivoir.cls| for helping to implement the idea of the semicolon version with |expl3|.

\chapter*{References}
\addcontentsline{toc}{chapter}{Reference}

\hpara{}Casteleyn, Jean Pierre~(2016), ``Visual PSTricks," version 2.30.

\hpara{}\uline{\hphantom{Casteleyn, Jean Pierre}}~(2018), ``Visual TikZ," version 0.66.

\hpara{}Tantau, Till~(2020), ``\TikZ\ and PGF: Manual for version 3.1.8b," \url{http://sourceforge.net/projects/pgf}.

\clearpage
\printindex

\end{document}

%% ====================================================
%% ====================================================
%% ====================================================