mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
Bugfixes, improvements and new symbols/nosymbols option for all styles (#34)
* fix Researcher ID (still) doesn't display Issue #29. * make options 'symbols' and 'nosymbols' available to all styles to toggle whether symbols should be used or not. Include symbols in oldstyle by default. * migrate older newcommand syntax in moderncvcollection.sty to the xparse syntax. * Fix resumé typo in template. Is now résumé. * remove loading lmodern fonts in all styles as they can produce issues with german characters, see https://tex.stackexchange.com/questions/496630/lualatex-problems-with-german-characters. * remove loading inputenc package by default. Only load the package when pdflatex is used.
This commit is contained in:
parent
caa0cb8dbf
commit
35138209d3
13 changed files with 143 additions and 60 deletions
|
|
@ -27,42 +27,48 @@
|
|||
|
||||
% creates a new collection
|
||||
% usage: \collectionnew{<collection name>}
|
||||
\newcommand*{\collectionnew}[1]{%
|
||||
\newcounter{collection@#1@count}}
|
||||
\NewDocumentCommand\collectionnew{m}{%
|
||||
\newcounter{collection@#1@count}%
|
||||
}%
|
||||
|
||||
% adds an item to a collection
|
||||
% usage: \collectionadd[<optional key>]{<collection name>}{<item to add>}
|
||||
\newcommand*{\collectionadd}[3][]{%
|
||||
\NewDocumentCommand\collectionadd{ O{} m m }{%
|
||||
\expandafter\def\csname collection@#2@item\roman{collection@#2@count}\endcsname{#3}%
|
||||
\if\relax\noexpand#1\relax% if #1 is empty
|
||||
\else\expandafter\def\csname collection@#2@key\roman{collection@#2@count}\endcsname{#1}\fi%
|
||||
\stepcounter{collection@#2@count}}
|
||||
|
||||
\def\optional@FirstArg{#1}%
|
||||
\ifdefempty{\optional@FirstArg}{%
|
||||
\relax% if #1 is empty
|
||||
}{%
|
||||
\expandafter\def\csname collection@#2@key\roman{collection@#2@count}\endcsname{#1}%
|
||||
}%
|
||||
\stepcounter{collection@#2@count}%
|
||||
}%
|
||||
% returns the number of items in a collection
|
||||
% usage: \collectioncount{<collection name>}
|
||||
\newcommand*{\collectioncount}[1]{%
|
||||
\value{collection@#1@count}}
|
||||
|
||||
\NewDocumentCommand\collectioncount{m}{%
|
||||
\value{collection@#1@count}%
|
||||
}%
|
||||
% gets an item from a collection
|
||||
% usage: \collectiongetitem{<collection name>}{<element id>}
|
||||
% where <element id> is an integer between 0 and (collectioncount-1)
|
||||
\newcommand*{\collectiongetitem}[2]{%
|
||||
\csname collection@#1@item\romannumeral #2\endcsname}
|
||||
\NewDocumentCommand\collectiongetitem{m m}{%
|
||||
\csname collection@#1@item\romannumeral #2\endcsname%
|
||||
}%
|
||||
|
||||
% gets a key from a collection
|
||||
% usage: \collectiongetkey{<collection name>}{<element id>}
|
||||
% where <element id> is an integer between 0 and (collectioncount-1)
|
||||
\newcommand*{\collectiongetkey}[2]{%
|
||||
\csname collection@#1@key\romannumeral #2\endcsname}
|
||||
|
||||
\NewDocumentCommand\collectiongetkey{m m}{%
|
||||
\csname collection@#1@key\romannumeral #2\endcsname%
|
||||
}%
|
||||
% loops through a collection and perform the given operation on every element
|
||||
% usage: \collectionloop{<collection name>}{<operation sequence>}
|
||||
% where <operation sequence> is the code sequence to be evaluated for each collection item,
|
||||
% code which can refer to \collectionloopid, \collectionloopkey, \collectionloopitem and
|
||||
% \collectionloopbreak
|
||||
\newcounter{collection@iterator}
|
||||
\newcommand*{\collectionloopbreak}{\let\iterate\relax}
|
||||
\newcommand*{\collectionloop}[2]{%
|
||||
\NewDocumentCommand\collectionloopbreak{}{\let\iterate\relax}
|
||||
\NewDocumentCommand\collectionloop{m m}{%
|
||||
\setcounter{collection@iterator}{0}%
|
||||
\loop\ifnum\value{collection@iterator}<\value{collection@#1@count}%
|
||||
\def\collectionloopid{\arabic{collection@iterator}}%
|
||||
|
|
@ -70,14 +76,15 @@
|
|||
\def\collectionloopkey{\collectiongetkey{#1}{\collectionloopid}}%
|
||||
#2%
|
||||
\stepcounter{collection@iterator}%
|
||||
\repeat}
|
||||
\repeat%
|
||||
}
|
||||
|
||||
% loops through a collection and finds the (first) element matching the given key
|
||||
% usage: \collectionfindbykey{<collection name>}{key>}
|
||||
\newcommand*{\collectionfindbykey}[2]{%
|
||||
\NewDocumentCommand\collectionfindbykey{m m}{%
|
||||
\collectionloop{#1}{%
|
||||
\ifthenelse{\equal{\collectionloopkey}{#2}}{\collectionloopitem\collectionloopbreak}{}}}
|
||||
|
||||
\ifthenelse{\equal{\collectionloopkey}{#2}}{\collectionloopitem\collectionloopbreak}{}}%
|
||||
}%
|
||||
|
||||
\endinput
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue