~xdanaux/moderncv/trunk

« back to all changes in this revision

Viewing changes to moderncv.cls

  • Committer: Xavier Danaux
  • Date: 2014-02-17 21:00:06 UTC
  • Revision ID: xdanaux@gmail.com-20140217210006-ijlxs0ew1rhr1tff
Introduced code for header, body and footer variants

Show diffs side-by-side

added added

removed removed

Lines of Context:
310
310
% usage: \makefooter
311
311
\newcommand*{\makefooter}{}%
312
312
 
313
 
% loads a style variant
 
313
% loads a style variant (a combination of header, body and footer)
314
314
% usage: \moderncvstyle{<style variant name>}
315
315
\newcommand*{\moderncvstyle}[2][]{
316
316
  \RequirePackage[#1]{moderncvstyle#2}}
 
317
 
 
318
% loads a header variant
 
319
% usage: \moderncvheader{<header variant number>}
 
320
\newcommand*{\moderncvheader}[1]{
 
321
  \RequirePackage{moderncvheader#1}}
 
322
 
 
323
% loads a body variant
 
324
% usage: \moderncvbody{<body variant number>}
 
325
\newcommand*{\moderncvbody}[1]{
 
326
  \RequirePackage{moderncvbody#1}}
 
327
 
 
328
% loads a footer variant
 
329
% usage: \moderncvfooter{<footer variant number>}
 
330
\newcommand*{\moderncvfooter}[1]{
 
331
  \RequirePackage{moderncvfooter#1}}
317
332
  
318
333
% loads a color scheme
319
334
% usage: \moderncvcolor{<color scheme name>}
326
341
  \RequirePackage{moderncvicons#1}}
327
342
 
328
343
% recomputes all automatic lengths
 
344
\newcommand*{\recomputeheadlengths}{\recomputecvheadlengths}
 
345
\newcommand*{\recomputebodylengths}{\recomputecvbodylengths}
 
346
\newcommand*{\recomputefootlengths}{\recomputecvfootlengths}
329
347
\newcommand*{\recomputelengths}{\recomputecvlengths}
330
348
\AtBeginDocument{\recomputelengths{}}
331
349
 
332
350
% creates a length if not yet defined
333
351
\newcommand*{\@initializelength}[1]{%
334
 
  \ifdefined#1\else\newlength{#1}\fi}
 
352
  \ifdefined#1
 
353
    \setlength{#1}{0pt}%
 
354
  \else%
 
355
    \newlength{#1}\fi}
 
356
 
 
357
% creates a savebox if not yet defined
 
358
\newcommand*{\@initializebox}[1]{%
 
359
  \ifdefined#1
 
360
    \savebox{#1}{}%
 
361
  \else%
 
362
    \newsavebox{#1}\fi}
335
363
 
336
364
 
337
365
%-------------------------------------------------------------------------------
370
398
\newcommand*{\pagenumberstyle}[1]{{\pagenumberfont#1}}
371
399
 
372
400
% recompute all resume lengths
373
 
\newcommand*{\recomputecvlengths}{}
 
401
\newcommand*{\recomputecvheadlengths}{}
 
402
\newcommand*{\recomputecvbodylengths}{}
 
403
\newcommand*{\recomputecvfootlengths}{}
 
404
\newcommand*{\recomputecvlengths}{%
 
405
  \recomputecvheadlengths%
 
406
  \recomputecvbodylengths%
 
407
  \recomputecvfootlengths}
374
408
 
375
409
% internal maketitle command to issue a new line only when required
376
410
\newif\if@firstdetailselement\@firstdetailselementtrue
605
639
  \def\@enclosure{#2}}
606
640
 
607
641
% recompute all letter lengths
608
 
\newcommand*{\recomputeletterlengths}{}
 
642
\newcommand*{\recomputeletterheadlengths}{}
 
643
\newcommand*{\recomputeletterbodylengths}{}
 
644
\newcommand*{\recomputeletterfootlengths}{}
 
645
\newcommand*{\recomputeletterlengths}{%
 
646
  \recomputeletterheadlengths%
 
647
  \recomputeletterbodylengths%
 
648
  \recomputeletterfootlengths}
609
649
 
610
650
% makes the letter title
611
651
% usage: \makelettertitle