summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/komacv-rg/komacv-addons.dtx
blob: dfcdc859395b5810b0fed299c8522c01950c00f2 (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
% \iffalse meta-comment
%
% Copyright (C) 2017-2018 by Richard Grewe <r-g+tex@posteo.net> % -------------------------------------------------------
% 
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
%    http://www.latex-project.org/lppl.txt
%
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{komacv-addons.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{komacv-addons}
%<*package>
    [2018/11/02 v1.1 Various small addons and fixes to komacv]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage[columns=2]{idxlayout}
\usepackage{showexpl}
\usepackage{xspace}
\newcommand\ThisPackage{\textsf{komacv-addons}\xspace}
\usepackage{hypdoc}
\usepackage[capitalise,noabbrev,nameinlink]{cleveref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{komacv-addons.dtx}
  \PrintChanges
  \PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \changes{v1}{2017/08/30}{Initial documented version}
% \changes{v1.1}{2018/11/02}{Package author's name change}
%
% \GetFileInfo{komacv-addons.dtx}
%
% \DoNotIndex{\newcommand,\newenvironment,\def,\gdef,\edef}
%
% \title{The \ThisPackage Package\thanks{This document
%   corresponds to \ThisPackage~\fileversion, dated \filedate.
%   The package is available online at
%   \url{http://www.ctan.org/pkg/komacv-rg} and
%   \url{https://github.com/Ri-Ga/komacv-rg}.}}
% \author{Richard Grewe \\ \texttt{r-g+tex@posteo.net}}
%
% \maketitle
%
% \section{Introduction}
% \label{sec:Introduction}
%
% This package provides a few extensions and fixes to the \textsf{komacv}
% class.
%
% \StopEventually{}
%\iffalse
%<*package>
%\fi
%
% \section{Extensions}
%
% \begin{macro}{\Signature}
% The |\Signature|\oarg{width} draws a line of width \meta{width} (default:
% $38.2\%$ of the text width (where $38.2\%=1-\frac{1}{\varphi}$, with $\varphi$
% being the golden ratio).
% \begin{macro}{\signaturecity}
% Below the line, the macro puts the name of the city, which is expected in the
% |\signaturecity| macro, and the current date (via |\today|).
% Use |\renewcommand{\signaturecity}{...}| to specify the city.
% \begin{macro}{\beforesigvspace}
% Before the signature line, a vertical space of |\beforesigvspace| (default:
% 3cm) is inserted. Use |\renewcommand{\beforesigvspace}{...}| to specify
% another distance.
%    \begin{macrocode}
\newcommand*\signaturecity{}
\newcommand*\beforesigvspace{3cm}
\newcommand\Signature[1][0.382\textwidth]{%
  \par
  \begin{tabular}{@{}p{#1}@{}}
    \rule{0pt}{\beforesigvspace}\\\hline
    \signaturecity, \today\hfill
  \end{tabular}}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \section{\textsf{komacv} Fixes}
%
% The construction of |\cvitem| based on a |tabular| environment seems to
% sometimes produce undesired vertical space below a sequence of |\cvitem|s.
% The following fix redefines |\cvitem|, based on its original definition, to
% fix this vertical spacing problem.
%    \begin{macrocode}
\RequirePackage{letltxmacro}
\LetLtxMacro{\kcvml@origcvitem}{\cvitem}
\renewcommand*{\cvitem}[3][\@afterelementsvspace]{%
  \kcvml@origcvitem[#1]{#2}{\@minipagetrue #3}}
%    \end{macrocode}
%
% We also fix the default setup of |\@listdbitemmaincolwidth|. The only change
% is that we also subtract |\@sepcolwidth| from |\@maincolwidth|, because
% |\cvlistdoubleitem| does include a horizontal separation of that width.
%    \begin{macrocode}
\AtEndPreamble{
  \ifdimequal{\listdbitemmaincolwidth}{0pt}{%
    \setlength{\@listdbitemmaincolwidth}
              {\@maincolwidth-\@sepcolwidth-\@listitemsymbolwidth}%
    \setlength{\@listdbitemmaincolwidth}{0.475\@listdbitemmaincolwidth}%
  }{}%
}
%    \end{macrocode}
%
%\iffalse
%</package>
%\fi
% \Finale
\endinput