Curricula Vitae / RésumésConsistent spacing after section title

ModernCV, Friggeri, Plasmati, Classicthesis-CV, and more
Post Reply
ronwelty
Posts: 3
Joined: Sun Jul 10, 2016 7:03 am

Consistent spacing after section title

Post by ronwelty »

I am using the awesome Friggeri template. Everything is fine, except for the fact that "contact" on the left column is of a smaller size when compared to "education" on the right hand side. Since they lie on the same line, different font sizes look sloppy.
The second issue is that the vertical space right after the section title is greater in the right hand side with respect to the left sidebar. I managed to add a

Code: Select all

\par\vspace{parskip}
after the definition of the section command but the compilation returns the "There's no line to break" error, even if the result looks exactly as I want. Ideas to suppress the error?
Thanks.
Last edited by ronwelty on Sun Jul 10, 2016 11:07 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Consistent spacing after section title

Post by Johannes_B »

Please show a minimal working example and give a link to the template you are using.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Consistent spacing after section title

Post by Stefan Kottwitz »

Hi ronwelty,

welcome to the forum!

I'm sure the solution is simple. Just post your compilable code here, so we can fix it. Either use the "Code" button, or click on "Upload attachment" when writing a post.

Stefan
LaTeX.org admin
ronwelty
Posts: 3
Joined: Sun Jul 10, 2016 7:03 am

Consistent spacing after section title

Post by ronwelty »

Hello and thank to both of you. I am using the Friggeri template, so that the minimal working example might be a little bit too long to paste.
I'll try to rephrase. The aside environment is defined as so in the .cls file:

Code: Select all

\RequirePackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\newenvironment{aside}{%
  \let\oldsection\section
  \renewcommand{\section}[1]{
    \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}
  }

  \begin{textblock}{3.6}(1.5, 4.33)
  \begin{flushright}
  \obeycr
}{%
  \restorecr
  \end{flushright}
  \end{textblock}
  \let\section\oldsection
}
while the main structure is defined as so:

Code: Select all

\renewcommand{\section}[1]{
  \par\vspace{\parskip}
  {%
    \LARGE\headingfont\color{headercolor}%
    \@sectioncolor #1%
  }
  \par\vspace{\parskip}
}

\renewcommand{\subsection}[1]{
  \par\vspace{.5\parskip}%
  {\Large\headingfont\color{headercolor} #1}
  \par\vspace{.25\parskip}%
}

\renewcommand{\subsubsection}[2]{
  \par\vspace{.5\parskip}%
  {\Large\headingfont\color{headercolor} #2}
  \par\vspace{.25\parskip}%
}

\pagestyle{empty}
This makes the Section titles use \LARGE font, while the side bar simply \Large. Since the first sections titles will always lie on the same line, it looks pretty sloppy. I changed the aside environment section titles to \LARGE so that it looks better now, I thought this might help someone.

About the second issue, it looks like the vertical space after the section title is governed by the

Code: Select all

\par\vspace{\parskip}
that is after the definition of the heading font, so that in the main structure there is a nice space in between the section title and the first line of text. This does not occur in the aside environment, but when i try to add such space (so that they look the same on the first line, looks very sloppy otherwise) I get a compilation error
! LaTeX Error: There's no line here to end.
even if the compiled version looks fine (the space I want is there so that it looks ok). Any ideas on how to get it in a cleaner way?
Thanks a lot.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Re: Consistent spacing after section title

Post by Stefan Kottwitz »

If it's too long to paste, you could add it as attachment.

Let me translate: "I won't bore you with long but easy compilable code, so I'll give you short snippets and let each one of you complete it to build own code for testing - with some luck your code might behave like mine". ;-)

Here it's late at night, I would have tested code, something else is a bit theoretical.

Stefan
LaTeX.org admin
ronwelty
Posts: 3
Joined: Sun Jul 10, 2016 7:03 am

Consistent spacing after section title

Post by ronwelty »

Since it requires the use of something which is publicly available, I did not see the need to do that. Since it looks like it is required, here you go.
After you download the .cls file, the MWE is the following:

Code: Select all

\documentclass[]{friggeri-cv}
\begin{document}
\header{Your}{Name}{Whatever}
\begin{aside} % In the aside, each new line forces a line break
\section{contact}
Your Street
Your Street Again
~
Your Number
\end{aside}
\section{Your Section}
Your text.
\end{document}
Image

Now there's two issues with this:
1. the "Contact" and "Your Section" text lie on the same line but have different sizes. It looks sloppy.
2. the space after "Contact" is different from the space after "Your Section".

The first issues is addressed as I explained in my previous comment.
How to address the second?
Attachments
friggeri-cv.cls
Friggeri-cv
(6.95 KiB) Downloaded 346 times
Post Reply