1

enter image description here I'm trying to add a link in the personal info part of my CV. I tried using

\url , \ref and \href

none of them is working with xelatex (you can see my code and the output down-below. I get an error " Undefined control sequence".
To be able to test this piece of code, you would need as well AltaCV Can anyone help me ?

\documentclass[10pt,a4paper,normalphoto]{altacv}
 \geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm}
    \ifxetexorluatex
    \else
      % If using pdflatex:
      \usepackage[utf8]{inputenc}
      \usepackage[T1]{fontenc}
      \usepackage[default]{lato}
      \usepackage[misc]{ifsym}
      \usepackage{fontawesome}
      \usepackage{fontawesome5}
      \usepackage{hyperref}
      \usepackage{tikz}
      \usepackage{textpos}
      \usepackage{url}
      \usepackage{logreq}
      \usepackage{xetex}

    \fi


\begin{document}
\name{Someone}
\personalinfo{%
  \faLinkedin{}{ \url{http://facebook.com/}} \\
  \faLinkedin{}{ \href{http://facebook.com/}{blabla}} \\
   \faLinkedin{}{ \ref{http://facebook.com/}{blabla}} \\
  }

\begin{fullwidth}
\makecvheader
\end{document}
4
  • altacv is not a public class, so your example can not be tested (and it contains lots of \[ which would give errors anyway). Nov 28 '19 at 10:31
  • @UlrikeFischer right, sorry. To be able to test it you would need : github.com/liantze/AltaCV/blob/master/altacv.cls
    – Jason
    Nov 28 '19 at 10:42
  • 1
    There is this \ifxetexorluatex..\else..\fi-thingie with a lot of \usepackage in the else-branch. To me it seems maybe packages like hyperref, textpos, url, logreq and probably some others are needed also when running XeLaTeX but are not loaded as due to the \ifxetexorluatex..\else..\fi-thingie they are only loaded in case the TeX-engine running is based neither on XeTeX nor on LuaTeX. Nov 28 '19 at 11:01
  • @UlrichDiez thanks, it worked :)
    – Jason
    Nov 28 '19 at 12:32
2

You need a \tagline command and should load hyperref

\documentclass[10pt,a4paper,normalphoto]{altacv}
\geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm}
\usepackage{hyperref}
\begin{document}
\name{Someone}
\personalinfo{blb}{\faLinkedin{}{ \url{http://facebook.com/}}}
\tagline{blub}
\begin{fullwidth}
\makecvheader
\end{fullwidth}
\end{document}
1

Your sample document does not compile because

  1. the fullwidth environment is not closed
  2. A \tagline{} seems to be mandatory
  3. You are not loading the hyperref package because it is in the \else part of \ifxetexorluatex.

Fixing all these things I get

\documentclass[10pt,a4paper,normalphoto]{altacv}
\geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm}
\usepackage{hyperref}

\begin{document}
\name{Someone}
\tagline{Your Position or Tagline Here}
\personalinfo{%
  \faLinkedin{}{ \url{http://facebook.com/}} \\
  \faLinkedin{}{ \href{http://facebook.com/}{blabla}} \\
   \faLinkedin{}{ \ref{http://facebook.com/}{blabla}} \\
  }

\begin{fullwidth}
    \makecvheader
\end{fullwidth}
\end{document}

Which compiles to

enter image description here

Notes:

  • I have removed the complete \ifxetexorluatex\else ... \fi, since you are using XeLaTeX.
  • \ref is for internal references, not external ones. The two question marks indicate that there is no label http://facebook.com/ defined.
1
  • For my humble opinion....all answers and question ...approved! :-)
    – Sebastiano
    Nov 28 '19 at 16:29

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.