2

I downloaded a resume template and try to modify it. However, when I modify the email address on the left aside. Since my email address is much longer than the previous mail address within the file. So the email address in the generated pdf just stretched to the main content. How to let LaTeX automatically detect line break within the aside panel so I don't need to adjust it by my own? Thank you very much!

Code:

\documentclass[]{friggeri-cv}
\addbibresource{bibliography.bib}

\begin{document}
\header{Songlin}{Yang}
       {social network analyst}


% In the aside, each new line forces a line break
\begin{aside}
  \section{about}
    2925 Dufferin Street
    North York
    Ontario
    ~
    \href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@mail.utoronto.ca}
    ~
  \section{languages}
    English
    Chinese
  \section{programming}
    {\color{red} $\varheartsuit$} JavaScript
    (ES5, node.js)
    Python, C, OCaml
    CSS3 \& HTML5
\end{aside}

Result

  • Why detect automatically? Just break it (wherever you like): \href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@\\mail.utoronto.ca} (Note: it will probably look better if you use the colorlinks option.) – jon Feb 6 '15 at 4:36
  • But if this happens often, manual line breaking will be inconvenient and even affect the symmetry – sjtupuzhao Feb 6 '15 at 4:46
  • Well, without an actual file to test, I can't tell how often it will happen. The snippet you provide suggests that it is using something like \obeylines, so you already are manually breaking your lines. The email address is different because it is one, continuous series of letters, etc. How many other words are going to be about 20+ characters long? – jon Feb 6 '15 at 4:54
  • Oh, just tested, \\ doesn't affect the symmetry at all. The builder started to recognize the line width of the aside panel again if the length of words is shorter than the total width of the panel. – sjtupuzhao Feb 6 '15 at 5:25
  • I'm not sure what you mean -- is that good or bad? Another idea: do \href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@} and on the next line: \href{mailto:songlin.yang@mail.utoronto.ca}{mail.utoronto.ca}. (Not automatic, I know....) – jon Feb 6 '15 at 5:30
3

friggeri-cv.cls downloaded at http://www.latextemplates.com/template/friggeri-resume-cv.

To have a break in your email address, you can simply add a space in it:

\href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@ mail.utoronto.ca}

MWE:

\documentclass[]{friggeri-cv}

\addbibresource{bibliography.bib}

\begin{document}
\header{Songlin}{Yang}
       {social network analyst}


% In the aside, each new line forces a line break
\begin{aside}
  \section{about}
    2925 Dufferin Street
    North York
    Ontario
    ~
    \href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@ mail.utoronto.ca}
    ~
  \section{languages}
    English
    Chinese
  \section{programming}
    {\color{red} $\varheartsuit$} JavaScript
    (ES5, node.js)
    Python, C, OCaml
    CSS3 \& HTML5
\end{aside}
\end{document} 

Output

enter image description here

Otherwise, you can make more room for the aside environment, patching this environment.

That is, add the following lines in your preamble:

\patchcmd{\aside}
  {\begin{textblock}{3.6}(1.5, 4.33)}
  {\begin{textblock}{5.3}(0, 4.33)}
  {}{}

MWE:

\documentclass[]{friggeri-cv}

\patchcmd{\aside}
  {\begin{textblock}{3.6}(1.5, 4.33)}
  {\begin{textblock}{5.3}(0, 4.33)}
  {}{}

\addbibresource{bibliography.bib}

\begin{document}
\header{Songlin}{Yang}
       {social network analyst}


% In the aside, each new line forces a line break
\begin{aside}
  \section{about}
    2925 Dufferin Street
    North York
    Ontario
    ~
    \href{mailto:songlin.yang@mail.utoronto.ca}{songlin.yang@mail.utoronto.ca}
    ~
  \section{languages}
    English
    Chinese
  \section{programming}
    {\color{red} $\varheartsuit$} JavaScript
    (ES5, node.js)
    Python, C, OCaml
    CSS3 \& HTML5
\end{aside}
\end{document} 

Output:

enter image description here

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.