在 ConTeXt 中实现 Friggeri

在 ConTeXt 中实现 Friggeri

如何实现 Friggeri CV1[2] 在 ConTeXt 中?我是 TeX 新手,阅读过:

对于年份条目时间线,我考虑的是制表或段落列。对于实际条目(标题、地点、简短斜体描述),使用三参数宏包装新定义的标题或概念。或者使用字体开关和 自行排版\hfill

我的主要问题有两个

  • 仅第一页上有全页宽灰色背景页眉
  • 联系信息和主要内容之间的列分割

常规列或列集不兼容,因为列会溢出到彼此中。它们也无法处理较小的字体或不同的行间距。按照“细节决定成败”的伪列使用手动与网格对齐的 vtop,实际上仅适用于静态非文本布局,例如杂志封面。您必须在每个新页面上重新创建布局,并手动将内容拆分到各个页面。我最幸运的是使用具有较宽左边距的边距块,但不幸的是 - 我认为这是由于浮动定位 - 块间(标题、段落)间距都很不稳定,我无法调整它。

我尝试使用自定义页眉、标题、覆盖和/或框架文本来模拟包含全名的最顶部标题。主要障碍是将内容放置在预定义部分(边距、页眉、页脚、文本等)之外。在这种情况下,它必须跨越顶部空间、页眉和从左边缘到右边缘的页眉距离。

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

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

我是 ConTeXt 的新手,因此如果您发布一些我读过的材料(上面)中未涉及的内容,如果您能解释一下或链接到解释文档,我将不胜感激。

这是我设置未对齐的列并尝试使用标题作为顶部的地方:

\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

这里我尝试使用带框的文本而不是标题。选项没有记录,所以我采取了一种散弹枪式的方法:

\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

这就是伪列不起作用的原因:忽略\setupwhitespace并且不会溢出到下一页:

\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

下面是一个示例,展示了我在扩展答案时遇到的对齐问题\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

在此处输入图片描述

答案1

我建议您在简历中使用自己的宏来制作标题,因此我定义了一个宏\heading。对于标题,我建议您使用层。

\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{[email protected]}[url(mailto:[email protected])]
    \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

在此处输入图片描述

相关内容