summaryrefslogtreecommitdiff
path: root/info/latex-doc-ptr/latex-doc-ptr.sty
blob: c9982ad369305c9bf6f3e2d2bbd364a5248c5a06 (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
% latex-doc-ptr.sty  style for LaTeX doc pointer document  
% 2021-Jan-02 Jim Hefferon, Karl Berry  public domain


% include graphics
\usepackage{graphicx} % needed for \XeLaTeX command

% Color, for links and titles
\usepackage{xcolor}
% Color theme from Rodryggo Sylva
% https://color.adobe.com/explore?page=2
\definecolor{darkblue}{HTML}{274375} % {023059}
\definecolor{lightblue}{HTML}{094085} %{023E73}
% \definecolor{papyrus}{HTML}{D9D8D7}
\definecolor{papyrus}{HTML}{E4E4E4}
\definecolor{darkred}{HTML}{BF1E0F}
\definecolor{lightred}{HTML}{F24141}
% \pagecolor{papyrus}


%\usepackage{dash}
% \usepackage{url}

\usepackage{hyperref}
\hypersetup{colorlinks,breaklinks,
            linkcolor=black,citecolor=lightblue,
            filecolor=blue,urlcolor=lightblue,
            pdfpagemode=UseNone}

% fonts
% \usepackage{cochineal}
\usepackage[light,lining]{spectral}
\usepackage[T1]{fontenc}

\usepackage{microtype}


% ====== Page design =========
% margins, multicolumn
\usepackage[margin=1in]{geometry}
\usepackage{multicol}
\setlength{\columnsep}{2.5em}

% space between paragraphs
\setlength{\parskip}{.15ex plus .02ex minus .01ex}

% Page headers and footers
\pagestyle{empty}

% Section titles
\usepackage{titlesec}
\titleformat{\section}[hang]{\color{black}\large\bf}{}{0pt}{}
% \titlespacing{\section}{0pt}{2ex plus 0.1ex minus 0.05ex}{0.85ex plus 0.05ex}
\titlespacing{\section}{0pt}{*2}{*0.66}

\titleformat{\subsection}[runin]{\color{black}\normalsize\bf}{}{0.65em}{}
% \titlespacing{\subsection}{0pt}{0.5ex plus 0.1ex minus 0.05ex}{0.15ex plus 0.05ex}
\titlespacing{\subsection}{0pt}{*0.5}{*1}

\setcounter{secnumdepth}{0} % Number the sections only if level -1 or less 


% footnotes and package macro\patchcmd{\@makefntext}{.5em}{0em}{}{}
\usepackage{ragged2e}
\usepackage{etoolbox} % for patchcmd
\usepackage{endnotes}
\usepackage[para, norule, hang]{footmisc} % from https://tex.stackexchange.com/a/60949
\patchcmd{\@makefntext}{.5em}{0em}{}{}
\def\theendnotes{\immediate\closeout\@enotes \global\@enotesopenfalse
  \begingroup
    \makeatletter
    \edef\@tempa{`\string >}%
    \ifnum\catcode\@tempa=12%
      \let\@ResetGT\relax
    \else
      \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
      \@makeother\>%
    \fi
    \def\@doanenote##1##2>{\def\@theenmark{##1}\begingroup
        \@ResetGT
        \edef\@currentlabel{\csname p@endnote\endcsname\@theenmark}%
        \enoteformat}
    \def\@endanenote{\hspace{0.65em plus 0.1em}\endgroup}%
    \enoteheading
    \enotesize % worth a look: \RaggedRight
    \input{\jobname.ent}%
  \endgroup}
% ENDNOTE INDENT
% \patchcmd{\enoteformat}{1.8em}{0em}{}{}
% \def\makeenmark{\hbox{XX$^\theenmark$}}
\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=0em
  \leavevmode\hbox{\makeenmark}}

\renewcommand\enoteheading{% from https://tex.stackexchange.com/a/62425
  \setcounter{secnumdepth}{-2}
  \section{\notesname}
  % \mbox{}\par\vskip-\baselineskip
  \mbox{}\par\vspace{-1.08\baselineskip}%  \vskip-0.9\baselineskip
  \let\@afterindentfalse\@afterindenttrue
}
\renewcommand{\notesname}{Package names, for texdoc}
% \long\def\@makefntext#1{\leavevmode
% \@makefnmark\nobreak
% \hskip.04em\relax#1%
% }

% computer code
\usepackage{listings}
\lstset{basicstyle = \small\ttfamily,
        keepspaces=true,
        columns=fullflexible,
        xleftmargin=10pt}
\usepackage{upquote}

% Get ISO dates
\usepackage[style=iso]{datetime2}

% Definitions for this doc

% Refer to texdoc
\newcommand{\texdoc}[1]{\footnote{\protect\pkg{#1}}}
\let\footnote=\endnote

% Name package by CTAN and texdoc name
\newcommand{\pkglink}[2]{\href{https://ctan.org/pkg/#1}{\texttt{#2}}}
% \newcommand{\pkg}[1]{\href{https://ctan.org/pkg/#1}{\texttt{#1}}}
\newcommand{\pkg}[1]{\pkglink{#1}{#1}}


% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} 
%            optional * [ALTHEADING]{HEADING}
%    Generic command to start a section.  
%    NAME       : e.g., 'subsection'
%    LEVEL      : a number, denoting depth of section -- e.g., chapter=1,
%                 section = 2, etc.  A section number will be printed if
%                 and only if LEVEL < or = the value of the secnumdepth
%                 counter.
%    INDENT     : Indentation of heading from left margin
%    BEFORESKIP : Absolute value = skip to leave above the heading.  
%                 If negative, then paragraph indent of text following 
%                 heading is suppressed.
%    AFTERSKIP  : if positive, then skip to leave below heading,
%                       else - skip to leave to right of run-in heading.
%    STYLE      : commands to set style
%  If '*' missing, then increments the counter.  If it is present, then
%  there should be no [ALTHEADING] argument.  A sectioning command
%  is normally defined to \@startsection + its first six arguments.

% \makeatletter
% \def\section{\@startsection {section}{1}{\z@}{-3ex plus -.45ex minus 
%     -.20ex}{4.75ex plus .45ex minus .20ex}{\centering\Large\bf}}
% \def\subsection{\@startsection {subsection}{2}{\z@}{-2.5ex plus -.15ex minus 
%     -.10ex}{.80ex plus .1ex}{\centering\large\bf}}
% \def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-.85ex plus -.15ex minus 
%    -.05ex}{-.75em}{\normalsize\sc}}
% \makeatother

% \newcommand{\program}[1]{\texttt{#1}}
% \newcommand{\package}[1]{\textit{#1}}
% Used for backslash
\newcommand\SLASH{\char`\\}
% Last thing before the document: define the \XeTeX logo (stolen from
% TUGboat).  This requires reflecting the first E, hence we complain if
% the graphics package is not present.  (For plain documents, this can
% be loaded via Eplain.)  Also, at Barbara's suggestion, if the current
% font is slanted, we rotate by 180 instead of reflecting so there is at
% least a chance to look ok.
% 
%    \begin{macrocode}
% \def\tubreflect#1{%
%   \ifx\reflectbox\relax
%     \errmessage{A graphics package must be loaded for \string\XeTeX}%
%   \else
%     \ifdim \fontdimen1\font>0pt
%       \raise 1.35ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em
%     \else
%       \reflectbox{#1}%
%     \fi
%   \fi
% }
% \def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 }
% \DeclareRobustCommand\Xe[1]{\leavevmode
%   \tubhideheight{\hbox{X%
%     \setbox0=\hbox{\TeX}\setbox1=\hbox{E}%
%     \lower\dp0\hbox{\raise\dp1\hbox{\kern-.125em\tubreflect{E}}}%
%     \kern-.1667em #1}}}
% \newcommand{\xetex}{\Xe\TeX}
% \newcommand{\pdftex}{pdf\TeX}
% \newcommand{\luatex}{Lua\TeX}
% \newcommand{\texworks}{\TeX{}works}



% Logos and acronyms, some of them to match TUGboat commands
% \RequirePackage{mflogo} % for MetaPost \MP
 
% \newcommand\pdfLaTeX{pdf\LaTeX}
% \newcommand\PDFLaTeX{\pdfLaTeX}
% \newcommand\LuaLaTeX{Lua\LaTeX}

% Stuff from ltugboat.cls
\def\smc{\sc}
\def\ninepoint{\small}
\DeclareRobustCommand{\SMC}{%
  \ifx\@currsize\normalsize\small\else
   \ifx\@currsize\small\footnotesize\else
    \ifx\@currsize\footnotesize\scriptsize\else
     \ifx\@currsize\large\normalsize\else
      \ifx\@currsize\Large\large\else
       \ifx\@currsize\LARGE\Large\else
        \ifx\@currsize\scriptsize\tiny\else
         \ifx\@currsize\tiny\tiny\else
          \ifx\@currsize\huge\LARGE\else
           \ifx\@currsize\Huge\huge\else
            \small\SMC@unknown@warning
 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
}
\newcommand{\SMC@unknown@warning}{\TBWarning{\string\SMC: nonstandard
    text font size command -- using \string\small}}
\newcommand{\textSMC}[1]{{\SMC #1}}
\newcommand{\acro}[1]{\textSMC{#1}\@}

\def\tubreflect#1{%
  \@ifundefined{reflectbox}{%
    \TBerror{A graphics package must be loaded for \string\XeTeX}%
  }{%
    \ifdim \fontdimen1\font>0pt
      \raise 1.75ex \hbox{\kern.1em\rotatebox{180}{#1}}\kern-.1em
    \else
      \reflectbox{#1}%
    \fi
  }%
}
\def\tubhideheight#1{\setbox0=\hbox{#1}\ht0=0pt \dp0=0pt \box0 }
\def\XekernbeforeE{-.125em}
\def\XekernafterE{-.1667em}
\DeclareRobustCommand{\Xe}{\leavevmode
  \tubhideheight{\hbox{X%
    \setbox0=\hbox{\TeX}\setbox1=\hbox{E}%
    \lower\dp0\hbox{\raise\dp1\hbox{\kern\XekernbeforeE\tubreflect{E}}}%
    \kern\XekernafterE}}}
\def\XeTeX{\Xe\TeX}
\def\XeLaTeX{\Xe{\kern.11em \LaTeX}}
\def\LuaTeX{Lua\TeX}
\def\pdfTeX{pdf\TeX}

\def\Bib{%
  \ifdim \fontdimen1\font>0pt
     B{\SMC\SMC IB}%
  \else
     B\textsc{ib}%
  \fi
}
\def\BibLaTeX{\Bib\kern.02em \LaTeX}
\def\BibTeX{\Bib\kern-.08em \TeX}

\newcommand{\PDF}{\acro{PDF}}
\newcommand{\CTAN}{\acro{CTAN}}
\newcommand{\URL}{\acro{URL}}
\newcommand{\TikZ}{Ti{\textit k}Z}  % from TUB
\newcommand{\Asymptote}{Asymptote} % the manual uses typewriter
\newcommand{\gnuplot}{Gnuplot} % the FAQ says lower case first letter

% Style I chopped out of ltugboat.cls
\usepackage{dash}


\newcommand{\program}[1]{\texttt{#1}}
\newcommand{\package}[1]{#1}
% stubs
% \newcommand{\texdoc}[1]{\relax}

% Give paras just a bit of room
% \setlength{\parskip}{0.45ex}

\pagestyle{empty}