2

I am fairly new to Latex and I am struggeling with the tikz package. I am making an automatic resume generator, which prints the skills of a person along with a progress bar. This skill tree is in fact a growing environment depending on how many skills a person wants to list on their resume.

The problem that I am facing is that the tikzpicture enviroment does not automatically inserts a page break when the skills tree reaches to the bottom of the page. Due to this, the skill tree does not automatically continue on the next page.

Instead every tikzpicture below the bottom of the page disseapears. How can I make this growing skill tree progress onto the next page?

my MWE:

class file:

    \ProvidesClass{CV_Tool}
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}

%----------------------------------------------------------------------------------------
%    REQUIRED PACKAGES
%----------------------------------------------------------------------------------------

\RequirePackage[sfdefault]{ClearSans}
\RequirePackage[T1]{fontenc}
\RequirePackage{tikz}
\RequirePackage{xcolor}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{ragged2e}
\RequirePackage{etoolbox}
\RequirePackage{ifmtarg}
\RequirePackage{ifthen}
\RequirePackage{pgffor}
\RequirePackage{marvosym}
\RequirePackage{parskip}
\RequirePackage{color}
\RequirePackage{graphicx}

%----------------------------------------------------------------------------------------
%    COLOURS
%----------------------------------------------------------------------------------------

\definecolor{white}{RGB}{255,255,255}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{main}{HTML}{0E5484}
\definecolor{barshade}{HTML}{B9B9B9}

%----------------------------------------------------------------------------------------
%    MISC CONFIGURATIONS
%----------------------------------------------------------------------------------------

\newlength{\TotalSectionLength}                                     % Define a new length to hold the remaining line width after the section title is printed
\newlength{\SectionTitleLength}                                         % Define a new length to hold the width of the section title
\newcommand{\profilesection}[1]{%
    \setlength\TotalSectionLength{\linewidth}                           % Set the total line width
    \settowidth{\SectionTitleLength}{\huge #1 }                         % Calculate the width of the section title
    \addtolength\TotalSectionLength{-\SectionTitleLength}                   % Subtract the section title width from the total width
    \addtolength\TotalSectionLength{-2.22221pt}                         % Modifier to remove overfull box warning
    \vspace{8pt}                                            % Whitespace before the section title
    {\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}      % Print the title and auto-width rule
}

%----------------------------------------------------------------------------------------
%   SKILL PROGRESS BARS
%----------------------------------------------------------------------------------------
% Command for printing skill progress bars
\newcommand\skills[1]{ 
    \renewcommand{\skills}{
        \begin{tikzpicture}[scale=1]
            \foreach [count=\i] \x/\y in {#1}{
                \draw[fill=barshade,barshade] (0,\i) rectangle (6,\i+0.4);
                \draw[fill=white,main](0,\i) rectangle (\y,\i+0.4);
                \large
                \node [above right] at (-0.15,\i+0.3) {\x};
            }
        \end{tikzpicture}
    }
}

% Command for printing skills text
\newcommand\skillstext[1]{ 
    \renewcommand{\skillstext}{
        \begin{flushleft}[scale=1]
            \foreach [count=\i] \x/\y in {#1}{ 
                \x$ \star $\y
            }
        \end{flushleft}
    }
}



%----------------------------------------------------------------------------------------
%    SIDEBAR LAYOUT
%----------------------------------------------------------------------------------------

\newcommand{\makeprofile}{


    \begin{textblock}{6}(0.5, 0.2)



        \profilesection{Skills}

        \skills
        \skillstext
        \scriptsize

        %------------------------------------------------

    \end{textblock}
}

.tex file:

\documentclass[a4paper]{CV_Tool}
\begin{document}

%----------------------------------------------------------------------------------------
%    SKILLS
%----------------------------------------------------------------------------------------

        \skills{
            {Coaching/3},                       %{<Skill>/{<value between 0 and 6>
            {consulting/3},                     %{<Skill>/{<value between 0 and 6>
            {aerodynamics/3},                       %{<Skill>/{<value between 0 and 6>
            {python/3},                     %{<Skill>/{<value between 0 and 6>
            {matlab/3},                     %{<Skill>/{<value between 0 and 6>
            {flow/3},                       %{<Skill>/{<value between 0 and 6>
            {stress/3},                     %{<Skill>/{<value between 0 and 6>
            {engineering/3},                        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {ICT/5.5}}                          %{<Skill>/{<value between 0 and 6>

        \makeprofile % Print the sidebar
\end{document} 

Thanks! please notify me if additional clarification is required.

Balraj Boyal
  • 93
  • 2
  • 5
  • Everything seems to be placed inside a single textblock, this presumably prevents a page break. As a solution you can try to generate multiple textblocks or remove the textblock altogether. – Marijn Feb 19 '18 at 14:57
  • Like Marijn explained, also a tikzpicture is like a character so it's an indivisible block. But you can redefine skills command to use an independent tikzpicture for each skill instead of one large tikzpicture for all of them. – Ignasi Feb 19 '18 at 15:04
  • Alright, I understand what you are trying to say @Ignasi. However, how would I rededine my skills command to use an independemt tikzpicture? moving the the \begin{tikzpicture} in the \foreach statement does not seems to work for me. Thanks – Balraj Boyal Feb 19 '18 at 15:14
  • You might start dissecting the problem with having your skill bar a regular tikz picture inside an article class and see everything is OK with it. Then trying to move it around with a simpler stuff in it and focus on why it doesn't move etc. Right now everything is in so it is tough to debug. – percusse Feb 19 '18 at 15:37

1 Answers1

4

This is a partial solution. It defines a new skills command which draws every skill as a different tikzpicture on a different line and breaks at end of page. It doesn't use the original .cls.

\documentclass{article}
\usepackage{tikz}

\definecolor{white}{RGB}{255,255,255}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{main}{HTML}{0E5484}
\definecolor{barshade}{HTML}{B9B9B9}

\newcommand{\skills}[1]{
    \foreach \i/\j in {#1}{%
        \noindent
        \begin{tikzpicture}
        \draw[fill=barshade,barshade] (0,0) rectangle ++(6,.4);
        \draw[fill=white,main] (0,0) rectangle ++(\j,.4);
        \node[font=\large, above right] at (-.15,.3){\i};
        \end{tikzpicture}\\}}

\begin{document}

        \skills{
            {Coaching/3},                       %{<Skill>/{<value between 0 and 6>
            {consulting/3},                     %{<Skill>/{<value between 0 and 6>
            {aerodynamics/3},                       %{<Skill>/{<value between 0 and 6>
            {python/3},                     %{<Skill>/{<value between 0 and 6>
            {matlab/3},                     %{<Skill>/{<value between 0 and 6>
            {flow/3},                       %{<Skill>/{<value between 0 and 6>
            {stress/3},                     %{<Skill>/{<value between 0 and 6>
            {engineering/3},                        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {Business Strategy/4},              %{<Skill>/{<value between 0 and 6>
            {Outsourcing/4},                    %{<Skill>/{<value between 0 and 6>
            {Change Management/4.5},            %{<Skill>/{<value between 0 and 6>
            {Management Consulting/5},          %{<Skill>/{<value between 0 and 6>
            {Interim Management/5.5},           %{<Skill>/{<value between 0 and 6>
            {Operations Management/5.5},        %{<Skill>/{<value between 0 and 6>
            {ICT/5.5}}                          %{<Skill>/{<value between 0 and 6>

\end{document}

enter image description here

Ignasi
  • 136,588