Debian Codegraph @

texmf-dist/source/latex/komacv-rg/komacv-multilang.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2016-2018 by Richard Grewe <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.2
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.2 or later is part of all distributions of LaTeX
14 % version 1999/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{komacv-multilang.dtx}
21 %</driver>
22 %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
23 %<package>\ProvidesPackage{komacv-multilang}
24 %<*package>
25 [2018/11/02 v0.9.2 Package for multi-lingual extension to komacv]
26 %</package>
27 %
28 %<*driver>
29 \RequirePackage{scrlfile}
30 \ReplaceClass{article}{scrartcl}
31 \BeforePackage{doc}{\let\oldmaketitle\maketitle}
32 \PassOptionsToClass{emulatestandardclasses,DIV=11}{scrartcl}
33 \documentclass{ltxdoc}
34 \usepackage[utf8]{inputenc}
35 \usepackage[T1]{fontenc}
36 \usepackage[columns=2]{idxlayout}
37 \usepackage{xspace}
38 \usepackage{enumitem}
39 \newlist{ExampleAspects}{enumerate*}{1}\setlist[ExampleAspects]{label=(\arabic*)}
40 \usepackage{showexpl}
41 \lstset{gobble=2,frame=trbl,backgroundcolor=\color{black!5!white},width=0.55\textwidth}
42 \lstset{basicstyle=\footnotesize\fontfamily{pcr}\selectfont}
43 \lstset{explpreset={columns=fixed,numbers=none,language={}}}
44 \lstset{preset={\small\sffamily},overhang=3cm,pos=r,varwidth=false}
45 \setkomafont{captionlabel}{\usekomafont{descriptionlabel}}
46 \usepackage{pbox}
47 \usepackage{csquotes}\MakeOuterQuote{"}
48 \renewcommand*\figureformat{\textbf{\figurename~\thefigure}\autodot}
49 \newcommand\NiceDescribeStuff[2]{% #1=margin text, #2=body text
50 \medskip\par\noindent\leavevmode%
51 \marginpar{\hfill\hbox to 0pt{\hss\pbox[t]{4\marginparwidth}{\ttfamily #1}}%
52 \hspace*{-0.85\marginparsep}}% NOTE: the 0.85 fixes an otherwise too close placement
53 \ifstrempty{#2}{\ignorespaces}{#2\smallskip\\}}
54 \newcommand\NiceDescribeEnv[3][]{% #1=index list, #2=envname, #3=parameters
55 \NiceDescribeStuff{%
56 \textcolor{gray}{\cs{begin}}\string{#2\string}\\
57 \textcolor{gray}{\cs{end}}\string{#2\string}}{#3}%
58 \ifstrempty{#1}
59 {\SpecialEnvIndex{#1}}%
60 {\forcsvlist{\SpecialEnvIndex}{#1}}%
61 \ignorespaces}
62 \newcommand\NiceDescribeMacro[2]{% #1=macro, #2=parameters
63 \NiceDescribeStuff{\hbox to 0pt{\hss\string#1}}{#2}%
64 \SpecialUsageIndex{#1}\ignorespaces}
65 \newcommand\NiceDescribeConstant[1]{% #1=constant
66 \NiceDescribeStuff{#1\quad\kern 0pt\relax}{}}
67 \newcommand\ThisPackage{\textsf{komacv-multilang}\xspace}
68 \newcommand\BasePackage{\textsf{komacv}\xspace}
69 \usepackage{hypdoc}
70 \usepackage[capitalise,noabbrev,nameinlink]{cleveref}
71 % The following packages are for the examples.
72 % Note that for the documentation purpose we fake loading the \textsf{komacv}
73 % class as a package. We disable loading of class files and rather load
74 % \textsf{scrartcl} as the class of this document (see the hack above). We save
75 % sectioning commands as \textsf{komacv} redefines them.
76 \usepackage{letltxmacro,etoolbox}
77 % backup stuff before loading komacv
78 \LetLtxMacro{\NormalSection}{\section}
79 \LetLtxMacro{\NormalSubSection}{\subsection}
80 \LetLtxMacro{\NormalSubSubSection}{\subsubsection}
81 \newcommand\GetKomaFont[2]{\letcs#1{scr@fnt@#2}\expandafter\let\expandafter#1#1}
82 \newcommand\LetKomaFont[2]{\setkomafont{#1}{#2}}
83 \GetKomaFont\NormalSectionFont{section}
84 \GetKomaFont\NormalSubSectionFont{subsection}
85 \makeatletter
86 % disable stuff
87 \renewcommand\LoadClass[2][]{}
88 \let\oldhypersetup=\hypersetup\def\hypersetup#1{}%
89 % load komacv
90 \@fileswithoptions\@clsextension[style=casual]{komacv}
91 % restore stuff
92 \parindent=1em\relax% seems to be the default
93 \let\hypersetup\oldhypersetup
94 \let\maketitle\oldmaketitle
95 \LetLtxMacro{\CVSection}{\section}\GetKomaFont\CVSectionFont{section}\LetKomaFont{section}{\NormalSectionFont}
96 \LetLtxMacro{\CVSubSection}{\subsection}\GetKomaFont\CVSubSectionFont{subsection}\LetKomaFont{subsection}{\NormalSubSectionFont}
97 \LetLtxMacro{\CVSubSubSection}{\subsubsection}
98 \lstset{preset={%
99 \LetLtxMacro{\section}{\CVSection}\LetKomaFont{section}{\CVSectionFont}%
100 \LetLtxMacro{\subsection}{\CVSubSection}\LetKomaFont{subsection}{\CVSubSectionFont}%
101 \LetLtxMacro{\subsubsection}{\CVSubSubSection}%
102 % fix the width of columns in each listing based on \linewidth
103 \setlength{\@hintscolwidth}{0.3\linewidth}%
104 \setlength{\@maincolwidth}{\linewidth-\@sepcolwidth-\@hintscolwidth}%
105 \setlength{\@dbitemmaincolwidth}{%
106 \@maincolwidth-\@hintscolwidth-2\@sepcolwidth}%
107 \setlength{\@dbitemmaincolwidth}{0.33\@dbitemmaincolwidth}%
108 % NOTE: \@sepcolwidth is actually missing in komacv...
109 \setlength{\@listdbitemmaincolwidth}{\@maincolwidth-\@sepcolwidth-\@listitemsymbolwidth}%
110 \setlength{\@listdbitemmaincolwidth}{0.475\@listdbitemmaincolwidth}%
111 }}
112 \LetLtxMacro{\section}{\NormalSection}
113 \LetLtxMacro{\subsection}{\NormalSubSection}
114 \LetLtxMacro{\subsubsection}{\NormalSubSubSection}
115 \makeatother
116 \usepackage[german,english]{babel}
117 \usepackage[languages={english,german}]{komacv-multilang}
118 % end of examples packages
119 \EnableCrossrefs
120 \CodelineIndex
121 \RecordChanges
122 \begin{document}
123 \DocInput{komacv-multilang.dtx}
124 \PrintChanges
125 \PrintIndex
126 \end{document}
127 %</driver>
128 % \fi
129 %
130 % \CheckSum{0}
131 %
132 % \CharacterTable
133 % {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
134 % 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
135 % Digits \0\1\2\3\4\5\6\7\8\9
136 % Exclamation \! Double quote \" Hash (number) \#
137 % Dollar \$ Percent \% Ampersand \&
138 % Acute accent \' Left paren \( Right paren \)
139 % Asterisk \* Plus \+ Comma \,
140 % Minus \- Point \. Solidus \/
141 % Colon \: Semicolon \; Less than \<
142 % Equals \= Greater than \> Question mark \?
143 % Commercial at \@ Left bracket \[ Backslash \\
144 % Right bracket \] Circumflex \^ Underscore \_
145 % Grave accent \` Left brace \{ Vertical bar \|
146 % Right brace \} Tilde \~}
147 %
148 % \changes{v0.1}{2016/09/03}{Initial version (unpublished)}
149 % \changes{v0.9}{2017/08/30}{Complete rewrite, splits off \textsf{multilang} package}
150 % \changes{v0.9.2}{2018/11/02}{Package author's name change}
151 %
152 % \GetFileInfo{komacv-multilang.dtx}
153 %
154 % \DoNotIndex{\newcommand,\newenvironment,\def,\gdef,\edef}
155 %
156 %
157 % \title{The \ThisPackage Package\thanks{This document
158 % corresponds to \ThisPackage~\fileversion, dated \filedate.
159 % The package is available online at
160 % \url{http://www.ctan.org/pkg/komacv-rg} and
161 % \url{https://github.com/Ri-Ga/komacv-rg}.}}
162 % \author{Richard Grewe \\ \texttt{[email protected]}}
163 %
164 % \maketitle
165 %
166 % \section{Introduction}
167 %
168 % The goal of \ThisPackage is to simplify the specification and maintenance of a
169 % CV in multiple languages. More concretely, \ThisPackage enables one
170 % \begin{itemize}[noitemsep]
171 % \item to specify translations for pieces of content such that they are located
172 % closely together and easily identifiable as belonging together; and
173 % \item to change the document's language as simple as changing the
174 % \textsf{babel} or \textsf{polyglossia} language.
175 % \end{itemize}
176 % That is, with \ThisPackage, you can continuously expand and improve your CV in
177 % more than one language and when you actually want to use the CV, you choose a
178 % language and restrict the content to what you want to show.
179 %
180 % The \ThisPackage package is realized as proxy to the \BasePackage class. The
181 % latter package enables one to typeset CVs in one of three styles provided by
182 % the package or in a custom-made style. \ThisPackage uses the
183 % \textsf{multilang} package to define a set of macros and environments that
184 % establish a multilingual interface to
185 % \BasePackage's macros and
186 % \LaTeX's sectioning and list macros and environments.
187 % The macros and environments of \ThisPackage provide a proxy to all macros of
188 % \BasePackage that produce CV entries.
189 % That is, with \ThisPackage, it should not be necessary to use \BasePackage
190 % directly for CV entries, even though it is still possible to use \BasePackage
191 % macros.
192 %
193 % The remainder of this introduction provides an example based on \BasePackage's
194 % "casual" style.
195 % The \ThisPackage package is not limited to a specific style but bases on the
196 % macro interface provided by the core \BasePackage class (i.e., macros like
197 % |\cvitem| and |\cventry|).
198 % The example shows a toy excerpt of a multilingual CV with \ThisPackage
199 % (\cref{fig:Example-multilang}). For comparison, the same CV is also produced
200 % with pure \BasePackage (\cref{fig:Example-komacv}) and an ad-hoc approach to
201 % specifying the translations.
202 %
203 % The example shows the document preamble, sectioning, a simple as
204 % well as a more involved CV entry, date range specification, and list entries.
205 % The example can be used for getting an intuition about \ThisPackage as well as
206 % for deciding whether to use \ThisPackage (or rather an ad-hoc approach as in
207 % \cref{fig:Example-komacv}).
208 %
209 % \begin{figure}[p]
210 % \begin{LTXexample}[pos=t,width=\textwidth,overhang=0cm]
211 % % in preamble
212 % \documentclass[style=casual]{komacv}
213 % \usepackage[english]{babel}
214 % \usepackage[languages={english,german}]{komacv-multilang}
215 % % in document
216 % \begin{Section}{
217 % title/english = Education,
218 % title/german = Schulische Ausbildung}
219 % \BasicEntry{
220 % header/english = {date of birth},
221 % header/german = {Geburtsdatum},
222 % text/date = {1970-01-01},
223 % }
224 % \EducationEntry{
225 % when/daterange = {2010-08-01}{2015-07-31},
226 % degree/english = M.Sc.{} Computer Science,
227 % degree/german = Master Informatik,
228 % institution = UCSB,
229 % where/english = {California, USA},
230 % where/german = {Kalifornien, USA},
231 % grade/english = 4.00 GPA,
232 % grade/german = {Gesamtnote 1,0},
233 % details/list = {
234 % \Item{
235 % value/english = {cryptography},
236 % value/german = {Kryptographie},
237 % }
238 % \Item{
239 % value/english = {software engineering},
240 % value/german = {Software-Engineering},
241 % }
242 % },
243 % }
244 % \end{Section}
245 % \end{LTXexample}
246 % \caption{Multilingual CV with \ThisPackage}
247 % \label{fig:Example-multilang}
248 % \end{figure}
249 %
250 % \begin{figure}[p]
251 % \begin{LTXexample}[pos=t,width=\textwidth,overhang=0cm]
252 % % in preamble
253 % \documentclass[style=casual]{komacv}
254 % \usepackage[english]{babel}
255 % \newcommand\inEnglish[1]{#1}
256 % \newcommand\inGerman[1]{}
257 % % in document
258 % \section{\inEnglish {Education}%
259 % \inGerman {Schulische Ausbildung}}
260 % \cvitem{\inEnglish {date of birth}%
261 % \inGerman {Geburtsdatum}}
262 % {\inEnglish {January 1, 1970}%
263 % \inGerman {1.{} Januar 1970}}
264 % \cventry {08/2010 -- 07/2015}
265 % {\inEnglish {M.Sc.{} Computer Science}%
266 % \inGerman {Master Informatik}}
267 % {UCSB}
268 % {\inEnglish {California, USA}%
269 % \inGerman {Kalifornien, USA}}
270 % {\inEnglish {4.00 GPA}%
271 % \inGerman {Gesamtnote 1,0}}%
272 % {\begin{compactitem}
273 % \item\inEnglish {cryptography}%
274 % \inGerman {Kryptographie}
275 % \item\inEnglish {software engineering}%
276 % \inGerman {Software-Engineering}
277 % \end{compactitem}}
278 % \end{LTXexample}
279 % \caption{Multilingual CV with \BasePackage}\medskip
280 % \label{fig:Example-komacv}
281 % \end{figure}
282 % \clearpage
283 %
284 %
285 % \section{Usage}
286 %
287 %
288 % \subsection{Package Loading}
289 %
290 % The \ThisPackage package is loaded like any other package.
291 % The only requirements to pay attention to are,
292 % firstly, \ThisPackage must be loaded after \textsf{babel} or
293 % \textsf{polyglossia}, and
294 % secondly, \ThisPackage must be loaded after the \BasePackage class.
295 % This ensures that \ThisPackage can detect the document's language and that it
296 % can apply fixes to \BasePackage.
297 %
298 % \NiceDescribeConstant{languages}
299 % The \ThisPackage package has one package option: |languages|.
300 % Through this option, the set of languages known to \ThisPackage is specified,
301 % as a comma-separated list.
302 % The following section includes an example of loading \ThisPackage.
303 %
304 %
305 % \subsection{Sections}
306 %
307 % The \ThisPackage package utilizes \textsf{multilang-sect} for sectioning
308 % environments. Under the \BasePackage class, these environments produce
309 % sections in the respective loaded \BasePackage style.
310 % The following documentation essentially repeats what is also stated in the
311 % \textsf{multilang} documentation.
312 %
313 % \NiceDescribeEnv{Section}{\marg{data}}
314 % This environment shows a section.
315 % It has a single, mandatory argument, named |title|.
316 % It is a disablable environment, i.e., the argument |disabled| can be used in
317 % \meta{data} to disable the display of the whole section.
318 % This environment acts as a proxy for the |\section| macro as it is used by
319 % \BasePackage (i.e., without optional argument and without the star).
320
321 % \NiceDescribeEnv{SubSection}{\marg{data}}
322 % This environment is analogous to the |Section| environment, just for
323 % sub-sections.
324 % Examples:
325 %
326 % \begin{LTXexample}[morekeywords={Section,SubSection}]
327 % % in preamble
328 % \documentclass[style=casual]{komacv}
329 % \usepackage[english]{babel}
330 % \usepackage[languages={english,german}]
331 % {komacv-multilang}
332 % % in document
333 % \begin{Section}{
334 % title/english = Work Experience,
335 % title/german = Berufserfahrungen,
336 % }
337 % (section content)
338 % \begin{SubSection}{
339 % title/english = Teaching,
340 % title/german = Lehre,
341 % }
342 % (subsection content)
343 % \end{SubSection}
344 % \end{Section}
345 % \end{LTXexample}
346 % The example shows several aspects:
347 % \begin{ExampleAspects}
348 % \item how the \ThisPackage package is loaded and how its |languages| option
349 % is used
350 % and
351 % \item how the |Section| and |SubSection| environments can be used.
352 % \end{ExampleAspects}
353 %
354 %
355 % \subsection{CV Entries}
356 %
357 % The \BasePackage provides a set of macros for typesetting CV entries. In the
358 % following, we introduce the proxies for these macros provided by \ThisPackage.
359 %
360 %
361 % \NiceDescribeMacro{\BasicEntry}{\marg{data}}
362 % This macro has two mandatory arguments, named |header| and |text|, and one
363 % optional argument, named |spacing|.
364 % The argument alias |both| can be used to specify the |header| and |text|
365 % simultaneously.
366 % It is a disablable macro, i.e., the argument |disabled| can be used in
367 % \meta{data} to disable the display of the entry.
368 % This macro acts as a proxy for \BasePackage's |\cvitem| macro.
369 % That is, the value of the |header| argument is displayed in the hint column
370 % and the |text| is displayed in the main column.
371 % The value of the |spacing| argument specifies the vertical spacing below the
372 % CV entry. Examples:
373 %
374 % \begin{LTXexample}[morekeywords={BasicEntry}]
375 % \BasicEntry{
376 % header/english = date of birth,
377 % header/german = Geburtsdatum,
378 % text/date = 1970-01-01,
379 % }
380 % \BasicEntry{disabled,
381 % both/english = {marital status}{single},
382 % both/german = {Familienstand}{ledig},
383 % }
384 % \end{LTXexample}
385 % The example shows several aspects:
386 % \begin{ExampleAspects}
387 % \item how translated values for the arguments |header| and |text| are
388 % specified,
389 % \item how a date can be specified (in the |yyyy-mm-dd| format) for a localized
390 % display,
391 % \item how the display of an entry can be disabled,
392 % \item how the |both| argument can be used,
393 % and
394 % \item how the \LaTeX{} source code can be aligned such that it is easily
395 % readable despite the presence of translations.
396 % \end{ExampleAspects}
397 %
398 %
399 % \NiceDescribeMacro{\CommentedEntry}{\marg{data}}
400 % This macro has three mandatory arguments, named |header|, |text|, and
401 % |comment|, as well as one optional argument named |spacing|.
402 % The argument alias |all| can be used to specify |header|, |text|, and
403 % |comment| simultaneously.
404 % It is a disablable macro, i.e., the argument |disabled| can be used in
405 % \meta{data} to disable the display of the entry.
406 % This macro acts as a proxy for \BasePackage's |\cvitemwithcomment| macro.
407 % That is, the value of the |header| argument is displayed in the hint column,
408 % the |text| is displayed in the main column and the |comment| is displayed
409 % right-aligned in the main column.
410 % The value of the |spacing| argument specifies the vertical spacing below the
411 % CV entry. Examples:
412 %
413 % \begin{LTXexample}[morekeywords={CommentedEntry}]
414 % \CommentedEntry{
415 % all/english = {English}{fluent}
416 % {(oral and written)},
417 % all/german = {Englisch}{flie{\ss}end}
418 % {(in Wort und Schrift)}
419 % }
420 % \CommentedEntry{
421 % header/english = German,
422 % header/german = Deutsch,
423 % text/english = mother tongue,
424 % text/german = Muttersprache,
425 % comment = {},
426 % }
427 % \end{LTXexample}
428 % The example shows several aspects:
429 % \begin{ExampleAspects}
430 % \item how the |all| argument alias can be used,
431 % \item how arguments can be broken into multiple lines,
432 % \item how translated values for the arguments |header|, |text|, and |comment|
433 % are specified,
434 % and
435 % \item how an argument can be left empty in all languages (|comment|).
436 % \end{ExampleAspects}
437 %
438 %
439 % \NiceDescribeMacro{\DoubleEntry}{\marg{data}}
440 % This macro has four mandatory arguments, named
441 % |header1|, |text1|, |header2|, and |text2|,
442 % as well as one optional argument named |spacing|.
443 % The argument aliases |first| and |second| can be used to specify |header1|,
444 % and |text1|, respectively, |header2| and |text2| simultaneously.
445 % It is a disablable macro, i.e., the argument |disabled| can be used in
446 % \meta{data} to disable the display of the entry.
447 % This macro acts as a proxy for \BasePackage's |\cvdoubleitem| macro.
448 % That is, the value of the |header1| argument is displayed in the hint column,
449 % and the values of |text1|, |header2|, and |text2| are displayed in a columned
450 % fashion in the main column.
451 % The value of the |spacing| argument specifies the vertical spacing below the
452 % CV entry. Example:
453 %
454 % \begin{LTXexample}[morekeywords={DoubleEntry}]
455 % \DoubleEntry{
456 % first = {h1}{t1},
457 % second = {h2}{t2},
458 % }
459 % \end{LTXexample}
460 % The example shows
461 % how the |first| and |second| argument aliases can be used.
462 % Further possibilities for specifying the arguments, including translations,
463 % are analogous to the cases of |\BasicEntry| and |\DoubleEntry|.
464 %
465 %
466 % \NiceDescribeMacro{\EducationEntry}{\marg{data}}
467 % This macro has five mandatory arguments, named
468 % |when|, |degree|, |institution|, |where|, and |grade|,
469 % as well as two optional arguments, named |spacing| and |details|.
470 % It is a disablable macro, i.e., the argument |disabled| can be used in
471 % \meta{data} to disable the display of the entry.
472 % This macro acts as a proxy for \BasePackage's |\cventry| macro.
473 % That is, the value of the |where| argument is displayed in the hint column,
474 % whereas the values for the other arguments are displayed in the main column
475 % (in the order they are listed).
476 % The value of the |spacing| argument specifies the vertical spacing below the
477 % CV entry. Example:
478 %
479 % \begin{LTXexample}[morekeywords={EducationEntry}]
480 % \EducationEntry{
481 % when/daterange = {2010-08-01}{2015-07-31},
482 % degree/english = M.Sc.{} Computer Science,
483 % degree/german = Master Informatik,
484 % institution = UCSB,
485 % where/english = {California, USA},
486 % where/german = {Kalifornien, USA},
487 % grade/english = 4.00 GPA,
488 % grade/german = {Gesamtnote 1,0},
489 % details = {(e.g., honors, awards)},
490 % }
491 % \end{LTXexample}
492 % The example shows a few notable aspects:
493 % \begin{ExampleAspects}
494 % \item how the arguments can be used,
495 % \item how a date range can be specified (for the |when| argument),
496 % and
497 % \item how curly braces can be used to deal with commas in argument values
498 % (for the |where|, |grade|, and |details| arguments).
499 % \end{ExampleAspects}
500 %
501 %
502 % \NiceDescribeMacro{\EmploymentEntry}{\marg{data}}
503 % This macro has four mandatory arguments, named
504 % |when|, |title|, |employer|, and |where|,
505 % as well as two optional arguments, named |spacing| and |description|.
506 % It is a disablable macro, i.e., the argument |disabled| can be used in
507 % \meta{data} to disable the display of the entry.
508 % This macro acts as a proxy for \BasePackage's |\cventry| macro, as also
509 % |\EducationEntry|.
510 % The |\EmploymentEntry| specializes to detailed entries about professional/work
511 % experiences.
512 % Example:
513 %
514 % \begin{LTXexample}[morekeywords={EmploymentEntry}]
515 % \EmploymentEntry{
516 % when/daterange = {2015-08-01}{*},
517 % title/english = Software engineer,
518 % title/german = Softwareentwickler,
519 % employer = XYZ Development,
520 % where/english = {California, USA},
521 % where/german = {Kalifornien, USA},
522 % description = {Java, JavaScript},
523 % }
524 % \end{LTXexample}
525 %
526 % \NiceDescribeMacro{\AchievementEntry}{\marg{data}}
527 % This macro has two mandatory arguments, named
528 % |when| and |title|,
529 % as well as four optional arguments, named |spacing|, |occasion|, |where|, and |description|.
530 % It is a disablable macro, i.e., the argument |disabled| can be used in
531 % \meta{data} to disable the display of the entry.
532 % This macro acts as a proxy for \BasePackage's |\cventry| macro, as also
533 % |\EducationEntry| and |\EmploymentEntry|.
534 % The |\AchievementEntry| specializes to entries about achievements.
535 % Example:
536 %
537 % \begin{LTXexample}[morekeywords={AchievementEntry}]
538 % \AchievementEntry{
539 % when/date = 2016-05-01,
540 % title/english = employee of the month,
541 % title/german = Mitarbeiter des Monats,
542 % where = XYZ Development,
543 % }
544 % \end{LTXexample}
545 %
546 %
547 % \NiceDescribeMacro{\EntryListItem}{\marg{data}}
548 % This macro has one mandatory argument, |item|, and one optional argument,
549 % |label|.
550 % It is a disablable macro, i.e., the argument |disabled| can be used in
551 % \meta{data} to disable the display of the entry.
552 % This macro acts as a proxy for \BasePackage's |\cvlistitem| macro.
553 %
554 % \NiceDescribeMacro{\EntryListDblItem}{\marg{data}}
555 % This macro has two mandatory arguments, |first| and |second|, and one optional
556 % argument, |spacing|.\footnote{Note that contrary to the \BasePackage
557 % documentation, the optional argument to \cs{cvlistitem} and
558 % \cs{cvlistdoubleitem} is also the spacing and not a label.}
559 % The argument alias |both| can be used to specify |first| and |second|
560 % simultaneously.
561 % It is a disablable macro, i.e., the argument |disabled| can be used in
562 % \meta{data} to disable the display of the entry.
563 % This macro acts as a proxy for \BasePackage's |\cvlistdoubleitem| macro.
564 % Examples:
565 %
566 % \begin{LTXexample}[morekeywords={EntryListDblItem,EntryListItem}]
567 % \BasicEntry{
568 % header/english = programming,
569 % header/german = Programmiersprachen,
570 % text/english = {I am proficient in:},
571 % text/german = {Ich beherrsche:}}
572 % \EntryListDblItem{both = {Java}{C/C++}}
573 % \EntryListItem {item = PHP}
574 % \end{LTXexample}
575 %
576 %
577 % \subsection{Dates and Lists}
578 %
579 % The \ThisPackage package defines several datatypes, such as |date| and
580 % |daterange|, which are illustrated multiple times above.
581 % The following is a complete list of all defined datatypes.
582 %
583 % \begin{description}
584 % \item[|date|:]
585 % This datatype expects a date in the format |yyyy-mm-dd| and displays it in
586 % the regional format for dates.
587 %
588 % \item[|daterange|:]
589 % This datatype expects two dates in the format |yyyy-mm-dd| and displays them
590 % in the same format as |shortdate|, with a ``--'' in between.
591 % If the second date is ``|*|'', the text ``today'' (in the selected
592 % language) is displayed.
593 %
594 % \item[|shortdate|:]
595 % This datatype expects a date in the format |yyyy-mm-dd| and displays it in
596 % the format ``mm/yyyy''.
597 %
598 % \item[|list|:]
599 % This datatype expects a list of items and displays the items in a compact
600 % form. Items can be specified with the standard |\item| macro as well as with
601 % the multilingual |\Item|\marg{data} macro, whose \meta{data} parameter
602 % expected one mandatory argument, |value|.
603 % The following example shows both possibilities.\smallskip
604 %
605 % \begin{LTXexample}[morekeywords={list,Item}]
606 % \BasicEntry{
607 % header/english = programming languages,
608 % header/german = Programmiersprachen,
609 % text/list = {
610 % \item PHP
611 % \Item{value = Java}
612 % \Item{
613 % value/english = C and C++,
614 % value/german = C und C++}}}
615 % \end{LTXexample}
616 %
617 % \end{description}
618 %
619 %
620 % \subsection{Tags}
621 %
622 % The \ThisPackage package utilizes \textsf{multilang-tags} for tag support.
623 % Tag support enables one to easily switch between granularities and focuses of
624 % a CV.
625 % The following just provides an example from the context of typesetting CVs.
626 % For more information, please consult the \textsf{multilang} documentation.
627 %
628 % \begin{LTXexample}[morekeywords={tags,DefineTagFilter,UseTagFilter}]
629 % \DefineTagFilter{Programmer}{accept}{
630 % accept=PLDetails, deny=OfficeDetails}
631 % \DefineTagFilter{Consultant}{accept}{
632 % accept=OfficeDetails, deny=PLDetails}
633 % \UseTagFilter{Consultant}
634 % \begin{Section}{
635 % title/english = Skills,
636 % title/german = Qualifikationen}
637 % \BasicEntry{
638 % header/english = Programming,
639 % header/german = Programmiersprachen,
640 % text/list = {
641 % \Item{value = {Java, C/C++}}
642 % \Item{tags = PLDetails,
643 % value = {\LaTeX, Bash}}}}
644 % \BasicEntry{header = Software,
645 % text/list = {
646 % \Item{value = MS Office}
647 % \Item{tags = OfficeDetails,
648 % value = Adobe InDesign}}}
649 % \end{Section}
650 % \end{LTXexample}
651 %
652 % \clearpage
653 %
654 % \StopEventually{}
655 %\iffalse
656 %<*package>
657 %\fi
658 %
659 %
660 % \section{Implementation}
661 %
662 % The \textsf{multilang} package provides the core feature of \ThisPackage:
663 % defining multilingual macros and environments. We load the package with the
664 % same options as \ThisPackage. That is, the |languages| option of \ThisPackage
665 % is passed on to \textsf{multilang}.
666 % We also utilize the \textsf{multilang} extensions for tags and sectioning macros.
667 % \begin{macrocode}
668 \RequirePackageWithOptions{multilang}
669 \RequirePackage{multilang-tags}
670 \RequirePackage{multilang-sect}
671 % \end{macrocode}
672 % For the date datatypes, we use the following packages:
673 % \begin{macrocode}
674 \PassOptionsToPackage{useregional}{datetime2}
675 \RequirePackage{datetime2,datetime2-calc}
676 \RequirePackage{translations}
677 % \end{macrocode}
678 %
679 %
680 % \subsection{Datatypes}
681 %
682 % We define the datatypes before we define the multilingual macros and
683 % environments, such that the datatypes are available in the macros and
684 % environments.
685 %
686 % \subsubsection{Date Formatting}
687 %
688 % First, we define the three datatypes. The code largely speaks for itself.
689 % \begin{macrocode}
690 \NewMultilangType{date}{\DTMdate{#1}}
691 \NewMultilangType{shortdate}{%
692 \DTMsetdatestyle{Myyyy}\DTMdate{#1}\DTMsetdatestyle{default}}
693 \NewMultilangType[2]{daterange}{%
694 \DTMsetdatestyle{Myyyy}\DTMdate{#1} --
695 % \end{macrocode}
696 % If the second argument to |daterange| equals ``|*|'', then the text ``today''
697 % (in the translation for the current language) is displayed rather than a date.
698 % \begin{macrocode}
699 \ifstrequal{#2}{*}%
700 {\GetTranslation{today}}%
701 {\DTMdate{#2}}\DTMsetdatestyle{default}}
702 % \end{macrocode}
703 % Next, we define the |Myyyy| date format, which we use for the |shortdate| and
704 % |daterange| style.
705 % \begin{macrocode}
706 \DTMnewdatestyle{Myyyy}{%
707 \def\DTMdisplaydate##1##2##3##4{\DTMtwodigits{##2}/##1}}
708 % \end{macrocode}
709 % Finally, we provide a small set of initial translations for the ``today'' in
710 % |daterange|.
711 % \begin{macrocode}
712 \DeclareTranslation{english}{today}{today}
713 \DeclareTranslation{german}{today}{heute}
714 \DeclareTranslation{french}{today}{aujourd'hui}
715 % \end{macrocode}
716 %
717 %
718 % \subsubsection{List Formatting}
719 %
720 % First, we define the list type, |list|.
721 % \begin{macrocode}
722 \NewMultilangType{list}{\kcvml@list{#1}}
723 % \end{macrocode}
724 %
725 % \begin{macro}{\kcvml@list}
726 % For the |list| datatype, the |\kcvml@list|\marg{items} macro formats an
727 % itemized list of multiple items. The items of the list are specified by
728 % \meta{items}. The items can be specified with |\item| macros as well as with
729 % multilingual |\Item| macros (i.e., |\kcvml@listitem|).
730 % \begin{macrocode}
731 \newcommand\kcvml@list[1]{%
732 % \end{macrocode}
733 % To ensure a proper spacing, we use \textsf{komacv}'s |compactitem| environment
734 % and encapsulate this environment inside a |minipage|.
735 % Only inside this environment, we enable the |\Item| macro.
736 % \changes{v0.9.1}{2018/05/01}{Permit empty |list|s}
737 % \begin{macrocode}
738 \begin{minipage}[t]{\linewidth}%
739 \let\Item=\kcvml@listitem
740 \let\@noitemerr\relax
741 \compactitem
742 #1%
743 % \end{macrocode}
744 % For the case that the last line of the last list item has a small depth, the
745 % |minipage| might yield a bad spacing to content following the list.
746 % Hence, we add a |\strut| here.
747 % \begin{macrocode}
748 \ifhmode\unskip\strut\fi
749 \endcompactitem
750 \end{minipage}}
751 % \end{macrocode}
752 % \end{macro}
753 %
754 % \begin{macro}{\kcvml@listitem}
755 % The |\kcvml@listitem|\marg{data} enables multilingual items as a proxy to
756 % the |\item| macro. We treat |\item| here as a macro with one argument, as it
757 % usually does not harm to write ``|\item{text}|'' rather than ``|\item text|''.
758 % \begin{macrocode}
759 \NewMultilangCmd{\kcvml@listitem}{disablable,
760 command=\item, margs=value}
761 % \end{macrocode}
762 % \end{macro}
763 %
764 %
765 % \subsection{CV Entries}
766 %
767 % \begin{macro}{\BasicEntry}
768 % The |\BasicEntry|\marg{data} is a proxy to the |\cvitem| macro of
769 % \BasePackage.
770 % \begin{macrocode}
771 \NewMultilangCmd{\BasicEntry}{disablable,
772 command=\cvitem,
773 oargs={spacing},
774 margs={header,text},
775 alias/both={header,text},
776 }
777 % \end{macrocode}
778 % \end{macro}
779 %
780 % \begin{macro}{\CommentedEntry}
781 % The |\CommentedEntry|\marg{data} is a proxy to the |\cvitemwithcomment| macro
782 % of \BasePackage.
783 % \begin{macrocode}
784 \NewMultilangCmd{\CommentedEntry}{disablable,
785 command=\cvitemwithcomment,
786 oargs={spacing},
787 margs={header,text,comment},
788 alias/all={header,text,comment},
789 }
790 % \end{macrocode}
791 % \end{macro}
792 %
793 % \begin{macro}{\DoubleEntry}
794 % The |\DoubleEntry|\marg{data} is a proxy to the |\cvdoubleitem| macro of
795 % \BasePackage.
796 % \begin{macrocode}
797 \NewMultilangCmd{\DoubleEntry}{disablable,
798 command=\cvdoubleitem,
799 oargs={spacing},
800 margs={header1,text1,header2,text2},
801 alias/first={header1,text1},
802 alias/second={header2,text2},
803 }
804 % \end{macrocode}
805 % \end{macro}
806 %
807 % \begin{macro}{\EducationEntry}
808 % The |\EducationEntry|\marg{data} is a proxy to the |\cventry| macro of
809 % \BasePackage, specialized for education-related entries.
810 % \begin{macrocode}
811 \NewMultilangCmd{\EducationEntry}{disablable,
812 command=\cventry,
813 oargs={spacing},
814 margs={when,degree,institution,where,grade,details},
815 defaults={details={}},
816 }
817 % \end{macrocode}
818 % \end{macro}
819 %
820 % \begin{macro}{\EmploymentEntry}
821 % The |\EmploymentEntry|\marg{data} is a proxy to the |\cventry| macro of
822 % \BasePackage, specialized for main work-related entries.
823 % \begin{macrocode}
824 \NewMultilangCmd{\EmploymentEntry}{disablable,
825 command=\cventry,
826 oargs={spacing},
827 margs={when,title,employer,where,@grade,description},
828 defaults={@grade={}, description={}},
829 }
830 % \end{macrocode}
831 % \end{macro}
832 %
833 % \begin{macro}{\AchievementEntry}
834 % The |\AchievementEntry|\marg{data} is a proxy to the |\cventry| macro of
835 % \BasePackage, specialized for achievements.
836 % \begin{macrocode}
837 \NewMultilangCmd{\AchievementEntry}{disablable,
838 command=\cventry,
839 oargs={spacing},
840 margs={when,title,occasion,where,@grade,description},
841 defaults={@grade={}, occasion={}, where={}, description={}},
842 }
843 % \end{macrocode}
844 % \end{macro}
845 %
846 % \begin{macro}{\EntryListItem}
847 % The |\EntryListItem|\marg{data} is a proxy to the |\cvlistitem| macro of
848 % \BasePackage.
849 % \begin{macrocode}
850 \NewMultilangCmd{\EntryListItem}{disablable,
851 command=\cvlistitem,
852 oargs={spacing},
853 margs={item},
854 }
855 % \end{macrocode}
856 % \end{macro}
857 %
858 % \begin{macro}{\EntryListDblItem}
859 % The |\EntryListDblItem|\marg{data} is a proxy to the |\cvlistdoubleitem|
860 % macro of \BasePackage.
861 % \begin{macrocode}
862 \NewMultilangCmd{\EntryListDblItem}{disablable,
863 command=\cvlistdoubleitem,
864 oargs={spacing},
865 margs={first,second},
866 alias/both={first,second},
867 }
868 % \end{macrocode}
869 % \end{macro}
870 %
871 %\iffalse
872 %</package>
873 %\fi
874 % \Finale
875 \endinput