summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty
blob: c839f386342b6680c11dd165cc81c3798905b74e (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
\usepackage{hypdoc}
\PassOptionsToPackage{writefile}{listings}
\usepackage[
	loadHyperref=false,
	createIndexEntries=false
]{doctools}

\PageIndex
\EnableCrossrefs

\usepackage{lstdoc}
\usepackage{textcomp} % needed for listings
\usepackage{xparse}
\usepackage{xkeyval}
\usepackage{changepage}
\usepackage{mdframed}

\usepackage[color]{changelog}

\errorcontextlines 10

\newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}}
\newcommand{\https}[1]{\href{https://#1}{\texttt{#1}}}
\newcommand{\todo}[1]{\begin{itemize}\item[\textbf{To-do:}] #1 \end{itemize}}
\newcommand{\note}[1]{\begin{itemize}\item[\textbf{Note:}] #1 \end{itemize}}
\newcommand{\ctan}[1]{\href{https://ctan.org/pkg/#1}{\package{#1}}}
\NewExpandableDocumentCommand{\Th}{O{l} m}
	{\multicolumn{1}{#1}{\textbf{#2}}}
\newcommand{\ext}[1]{\texttt{.#1}}
\newcommand{\filename}[1]{\texttt{#1}}
\newcommand{\noterepo}[1]{\note{Browse the sources, contribute, or complain at \\
	\https{github.com/#1}}}

\newcommand{\cl}{\ctan{changelog}}
\newcommand{\keepachangelog}{\https{keepachangelog.com}}

% definition copied from doc package \DescribeMacro
\lstnewenvironment{latexfile}[1]
	{\lstset{style=lstDemoStyleLaTeXCode}%
	}
	{}

\NewDocumentEnvironment{ctandescription}{}
	{\NewDocumentCommand{\pkg}{m}{\item[\ctan{##1}]}
	\begin{description}}
	{\end{description}}

% a list of colors; use \color{colorname}
\newenvironment{colorlist}
	{\begin{itemize}
		\let\old@item\item
		\renewcommand{\item}[1]{%
			\old@item[\fcolorbox{black}{##1}{\vphantom{X}\hspace{1em}}]
			\texttt{##1}
		}
	}
	{\end{itemize}}

\newif\ifsidebyside@first
\newcommand{\sidebyside@maybehfill}{%
	\ifsidebyside@first
		\hfill
		\sidebyside@firstfalse
	\fi
}
\newenvironment{sidebyside}{%

	\lstnewenvironment{code}[1][]{%
		\lstset{style=lstDemoStyleLaTeXCode,
			basicstyle=\ttfamily\small,
			frame=single,
			linewidth=0.45\linewidth,
			##1}%
		}
		{%
		\sidebyside@maybehfill
		}%
	\newenvironment{example}{%
		\begin{mdframed}[userdefinedwidth=0.45\linewidth]
		}
		{%
		\end{mdframed}\sidebyside@maybehfill
		}%
	\sidebyside@firsttrue
	\medskip
	\noindent
	}
	{%
	}