5

How would one implement the Friggeri CV1[2] in ConTeXt? I'm new to TeX and have read:

For the year-entry timeline I'm thinking either tabulation or paragraph columns. For the actual entries (title, place, short italic description) a three-argument macro wrapping either a newly-defined head or concept. That, or typeset myself using font switches and \hfill.

My main problems are twofold

  • the full pagewidth grey-background header on only the first page
  • column split between contact information and the main content

Regular columns or column sets aren't compatible because the columns overflow into each other. They also don't handle smaller fonts or varying interline spacing. Pseudo-columns as per "It's in the details" using vtops manually aligned to the grid are really only suitable for static non-text layouts such as magazine covers. You have to recreate the layout on each new page and manually split the content across pages. I've had the most luck using margin blocks with a wide left margin but unfortunately - and I think this is due to the float positioning - the inter-block (heads, paragraphs) spacing is all wonky and I can't adjust it.

I've tried to use custom headers, heads, overlays, and/or framed text to simulate the topmost head containing the full name. The main stumbling block is placing content outside of a predefined section - margin, header, foot, text, etc. In this case it must span the topspace, the header, and the headerdistance from the left edge to the right edge.

1 http://www.latextemplates.com/templates/curriculum_vitaes/10/cv_10.pdf

[2] https://github.com/akanosora/friggeri-cv/blob/master/friggeri-cv.cls

New to ConTeXt, so if you post something not covered in the material I've read (above) I'd appreciate if you could explain it or link to explanatory documentation.

Here is where I setup the misaligned columns and try to use a header for the top part:

\setuppapersize[letter]

\setuplayout
    [ backspace=2.5in,
      width=5.5in,
      leftmargin=1.75in,
      rightmargin=0in,
      leftmargindistance=0.25in,
    ]

%\setuplayout
%    [ backspace=0.3\pagewidth,
%      width=0.65\pagewidth,
%      leftmargin=0.2\pagewidth,
%      rightmargin=0in,
%      leftmargindistance=0.03\pagewidth,
%    ]

\setupmarginblock
    [ location=left,
      width=\leftmarginwidth,
      align=flushright,
    ]

\definehead[mhead][subject]
\setuphead[mhead][margin=0cm,align=flushright]

\definehead[phead][subject]
\setuphead[phead][margin=0cm]

\startsetups[headertext]
  \startframed
    [ location=middle,
      frame=off,
      offset=-20cm,
      height=2cm,
      width=\pagewidth,
      background=color,
      backgroundcolor=blue
    ]
    jkl
  \stopframed
\stopsetups

\setupheadertexts[\directsetup{headertext}]

\setupheader[margin][state=none]
\setupheader[edge][state=none]
\setupheader[text][state=none]

\showframe

\starttext

\startmarginblock
    \mhead{Doesn't}
    \input ward
\stopmarginblock

\phead{Align}
\input knuth

\stoptext

And here I try to use framed text instead of a header. The options aren't documented so I kind-of took a shotgun approach:

\setuppapersize[letter]

\definehead[name][title]
\setuphead[name]
    [ align=left,
      alterantive=middle,
      margin=-2.55cm,
      textcolor=white,
    ]

\setupheader[state=none]

\showframe

\starttext

\name{

\framed
    [ height=5cm,
      background=color,
      backgroundcolor=darkgray,
      width=\pagewidth,
      frame=off,
      location=top,
      offset=overlay,
      leftframe=on,
      margin=no,
    ]
    {ASDF}
}


\stoptext

And this is why pseudo-columns don't work: ignoring \setupwhitespace and not overflowing to the next page:

\setuppapersize[letter]

\setupwhitespace[big]

\setuplayout
    [ grid=yes
    , columndistance=12pt
    , columns=3
    ]

\showgrid

\definelayer [text] \setupbackgrounds [text] [background=text]

\starttext
    \setlayer [text] [column=1,line=12,location=grid]
        {\vtop {\hsize\layoutcolumnwidth
            \startalignment[flushright,nothyphenated]
            nitty

            \input knuth

            \input ward
            \stopalignment
            }}
\stoptext

Here is an example showing the alignment problem I encountered when extending the answer with \defineparagraphs:

\setuppapersize[letter]

\setuplayout
    [backspace=2.5in,
     width=5.5in,
     leftmargin=1.75in,
     rightmargin=0in,
     leftmargindistance=0.25in,
     %
     topspace=1.5in,
     height=9.25in,
     header=0.25in,
     headerdistance=0in,
     footer=0.25in,
     footerdistance=0.25in,
    ]

\setupbodyfont[sans]

\setupmarginblock
    [location=left,
     width=\leftmarginwidth,
     align=flushright,
    ]

\defineparagraphs[timeline][n=2]

\setupparagraphs[timeline][1][width=4em]

\define[1]\heading{
    \leavevmode{
        \bfb
        \setupinterlinespace
        \strut#1
    }
    \blank[small]
}

\defineparagraphs[testpar]
\setupparagraphs[testpar][each][before={\blank[back]},]

\starttext

\startmarginblock
    \heading{Does}
    \input ward
\stopmarginblock

\heading{Align}

%\startparagraph
%This paragraph is aligned to the one in the margin.
%\stopparagraph

% To see the problem, comment out the previous paragraph and uncomment this
% paragraph.
\starttestpar
This paragraph is aligned well below the one in the margin.
\stoptestpar

% Same problem with tabulation
%\starttabulate[|w(4em)|p|]
%\NC 2011-2012
%\NC \input knuth
%\NC\NR
%\stoptabulate

\stoptext

enter image description here

  • 2
    Could you please add a minimal working example (MWE) which demonstrates some of the issues you discuss in your question? Currently it's a bit hard to see what your actual problem is. – Henri Menke Nov 13 '18 at 20:27
  • You're using section headings in the margin. I don't recommend that because they insert vertical space in several places. For the header you might just want to use a layer. – Henri Menke Nov 13 '18 at 22:58
  • @HenriMenke Layers seem very promising. I assume that I'll need two layouts (to adjust header/topspace to the layer), one for the first page and a default for all the remaining pages... unless you have better idea? So what do you recommend for a sidebar allowing headings? No margin, a large backspace, and a \vtop where the margin used to be? Is it possible to place the \vtop without using layers? – user19087 Nov 14 '18 at 2:21
5

I recommend that you just use your own macro for headings within your CV, I therefore defined a macro \heading. For the header, I suggest you use a layer.

\setuppapersize[letter]

\setupbodyfont[dejavu-condensed,sans,8pt]

\setuppagenumbering
  [location={footer,inleft}]

\setupinteraction
  [state=start,
   color=,
   contrastcolor=,
   style=]

\setuplayout
  [% horizontal
   backspace=2.5in,
   leftmargin=1.75in,
   leftmargindistance=0.25in,
   width=5.5in,
   rightmargin=0in,
   % vertical
   topspace=0pt,
   header=1.2in,
   headerdistance=.1in,
   height=middle,
   footerdistance=0pt,
   footer=\lineheight,
   bottomspace=.5in]

\setupmarginblock
  [location=left,
   width=\leftmarginwidth,
   align={flushright,broad}]

\definelayer
  [pagebackground]
  [x=0pt,
   y=0pt,
   width=\paperwidth,
   height=\paperheight]

\setupbackgrounds
  [page]
  [background=pagebackground]

\defineitemgroup
  [timeline]
  [before=,
   inbetween=,
   width=6em]

\setuplines[before=,after=,command=\strut]

\define[1]\heading{%
  \dontleavehmode{\bfb\setupinterlinespace\strut#1}%
  \blank[big,samepage]
}
\define[1]\subheading{%
  \dontleavehmode{\bfa\setupinterlinespace\strut#1}%
  \blank[small,samepage]
}

\starttext

\setlayerframed
  [pagebackground]
  []
  [background=color,
   framecolor=darkgray,
   backgroundcolor=darkgray,
   foregroundcolor=white,
   width=\paperwidth,
   height=\dimexpr\topspace+\headerheight\relax]
  {%
    \dontleavehmode{\tfd john\bold{smith}}\blank[medium]
    junior business analyst
  }

\startmarginblock
  \heading{contact}
  \startlines
    123 Broadway
    City, State 12345
    Country
    ~
    +0 (000) 111 1111
    +0 (000) 111 1112
    ~
    \goto{john@smith.com}[url(mailto:john@smith.com)]
    \goto{http://www.smith.com}[url(http://www.smith.com)]
    \goto{fb://jsmith}[url(http://facebook.com/johnsmith)]
  \stoplines

  \heading{languages}
  \startlines
    english mother tongue
    spanish \& italian fluency
  \stoplines

  \heading{programming}
  \startlines
    \color[red]{♥} JavaScript
    Python, C++, PHP
    CSS3 \& HTML5
  \stoplines
\stopmarginblock

\heading{\color[cyan]{edu}cation}

\starttimeline
\sym{2011--2012} \bold{Masters} of Commerce\hfill
  \color[darkgray]{\tfx The University of California, Berkeley}

  \emph{Money Is The Root Of All Evil -- Or Is It?}

  This thesis explored the idea that money has been the cause of
  untold anguish and suffering in the world. I found that it has, in
  fact, not.

\sym{2007--2008} \bold{Bachelor} of Business Studies\hfill
  \color[darkgray]{\tfx The University of California, Berkeley}

  Specialization in Commerce
\stoptimeline

\heading{\color[magenta]{exp}erience}

\subheading{Full Time}

\starttimeline
\sym{2012--Now} \bold{LEHMAN BROTHERS}\hfill
  \color[darkgray]{\tfx Los Angeles, California}

  \emph{1\high{st} Year Analyst}

  Developed spreadsheets for risk analysis on exotic derivatives on a
  wide array of commodities (ags, oils, precious and base metals),
  managed blotter and secondary trades on structured notes, liaised
  with Middle Office, Sales and Structuring for bookkeeping.\par
  Detailed achievements:
  \startitemize[packed]
  \item Learned how to make amazing coffee
  \item Finally determined the reason for PC LOAD LETTER:
    \startitemize[packed]
    \item Paper jam
    \item Software issues:
      \startitemize[packed]
      \item Word not sending the correct data to printer
      \item Windows trying to print in letter format
      \stopitemize
    \item Coffee spilled inside printer
    \stopitemize
  \item Broke the office record for number of kitten pictures in cubicle
  \item Learned how to make more amazing coffee on a new machine
  \stopitemize
\stoptimeline

\subheading{Part Time}

\starttimeline
\sym{2010--2011} \bold{LEHMAN BROTHERS}\hfill
  \color[darkgray]{\tfx London, United Kingdom}

  \emph{Summer Intern}

  Received pre-placed offer from the Exotics Trading Desk as a result
  of very positive reviews. Rated "truly distinctive" for Analytical
  Skills and Teamwork.

\sym{2008-2009} \bold{Buy More}\hfill
  \color[darkgray]{\tfx Burbank, California}

  \emph{Computer Repair Specialist}

  Worked in the Nerd Herd and helped to solve computer problems by
  asking customers to turn their computers off and on again.
\stoptimeline

\heading{\color[orange]{awa}rds}

\starttimeline
\sym{2011} \bold{Postgraduate Scholarship}\hfill
  \color[darkgray]{\tfx School of Business, The University of California}

  Awarded to the top student in their final year of a Bachelors
  degree. Mastered the art of filing accurate TPS reports.
\stoptimeline

\heading{\color[green]{com}munication skills}

\starttimeline
\sym{2011} \bold{Oral Presentation}\hfill
  \color[darkgray]{\tfx California Business Conference}

  Presented the research I conducted for my Masters of Commerce
  degree.

\sym{2010} \bold{Poster}\hfill
  \color[darkgray]{\tfx Annual Business Conference, Oregon}

  As part of the course work for BUS320, I created a poster analyzing
  several local businesses and presented this at a conference.
\stoptimeline

\heading{\color[red]{int}erests}

\bold{professional:} data analysis, company profiling, risk analysis,
economics, web design, web app creation, software design, marketing
\bold{personal:} piano, chess, cooking, dancing, running

\stoptext

enter image description here

  • Thanks. Out of curiosity I'd like to compare \heading to the built-in headings, how? Specifically, why is \leavevmode necessary, as won't that happen when the engine encounters text ("Does" or "Align")? – user19087 Nov 14 '18 at 3:19
  • @user19087 Yes it does but there are a lot of problems when a paragraph starts inside a group. – Henri Menke Nov 14 '18 at 4:07
  • I have a small problem with this. Modify \heading to use \blank[small]. Then replace \samplefile{knuth} with \startparagraph ... \stopparagraph. So far everything is alright - the left and right texts are still aligned. Then define a custom paragraph. No matter how I define it, I can't get the left and right texts to remain aligned. – user19087 Nov 14 '18 at 18:35
  • @user19087 What are you trying to achieve by wrapping it in \start...\stopparagraph? You know that the ConTeXt paragraphs (multiple columns) are very different from LaTeX paragraphs (sectioning command)? – Henri Menke Nov 14 '18 at 21:06
  • I don't know anything about LaTeX, but I'm using two-column paragraphs for the year-entry timeline. I run into the same problem with \start...\stoptabulate. I don't understand why regular \start..\stopparagraph works whereas custom paragraph blocks (even one-column paragraphs with before= or before=\nowhitespace) seem to have different vertical spacing. – user19087 Nov 14 '18 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.