[Tex/LaTex] insert the picture on the left

cvpositioningtemplates

Good night

I want just to get the picture to be displayed on the left side and so My name right next to it and about the personal info is it advisable to make them get aligned and come from the right edge of the paper.

thanks in advance and thanks for your help (I'm a beginner in Latex so please go easy on me ^^)

here is the template link:
https://fr.overleaf.com/latex/examples/recreating-business-insiders-cv-of-marissa-mayer-using-altacv/gtqfpbwncfvp

Best Answer

Well, you can add the following code to your preamble:

\makeatletter
\renewcommand{\makecvheader}{%
  \begingroup
    \begin{minipage}{\@photodiameter}
    \if@normalphoto
      \includegraphics[width=\linewidth]{\@photo}
    \else
      \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
    \fi%
    \end{minipage}%
    \hfill%
    \ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-2em}}{}%
    \raggedleft\color{emphasis}%
    {\Huge\bfseries\MakeUppercase{\@name}\par}
    \medskip
    {\large\bfseries\color{accent}\@tagline\par}
    \medskip
    {\footnotesize\bfseries\@personalinfo\par}
    \ifdef{\@photodiameter}{\end{minipage}\par}{}%
  \endgroup\medskip
}
\makeatother

That redefines the header.

Please see the following complete mwe (based on the code for your last question):

\documentclass[10pt,a4paper,ragged2e]{altacv}

%% AltaCV uses the fontawesome and academicon fonts
%% and packages.
%% See texdoc.net/pkg/fontawecome and http://texdoc.net/pkg/academicons for full list of symbols. You MUST compile with XeLaTeX or LuaLaTeX if you want to use academicons.

% Change the page layout if you need to
\geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm}

% Change the font if you want to, depending on whether
% you're using pdflatex or xelatex/lualatex
\ifxetexorluatex
  % If using xelatex or lualatex:
  \setmainfont{Lato}
\else
  % If using pdflatex:
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage[default]{lato}
\fi
\usepackage{fontawesome}

\makeatletter % <=======================================================
\renewcommand{\makecvheader}{%
  \begingroup
    \begin{minipage}{\@photodiameter}
    \if@normalphoto
      \includegraphics[width=\linewidth]{\@photo}
    \else
      \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
    \fi%
    \end{minipage}%
    \hfill%
    \ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-2em}}{}%
    \raggedleft\color{emphasis}%
    {\Huge\bfseries\MakeUppercase{\@name}\par}
    \medskip
    {\large\bfseries\color{accent}\@tagline\par}
    \medskip
    {\footnotesize\bfseries\@personalinfo\par}
    \ifdef{\@photodiameter}{\end{minipage}\par}{}%
  \endgroup\medskip
}
\makeatother % <========================================================

% Change the colours if you want to
\definecolor{VividPurple}{HTML}{3E0097}
\definecolor{SlateGrey}{HTML}{2E2E2E}
\definecolor{LightGrey}{HTML}{666666}
\colorlet{heading}{VividPurple}
\colorlet{accent}{VividPurple}
\colorlet{emphasis}{SlateGrey}
\colorlet{body}{LightGrey}

% Change the bullets for itemize and rating marker
% for \cvskill if you want to
\renewcommand{\itemmarker}{{\small\textbullet}}
\renewcommand{\ratingmarker}{\faCircle}

%% sample.bib contains your publications
\addbibresource{sample.bib}


\begin{document}
\name{Marissa Mayer}
\tagline{Business Woman \& Proud Geek}
% Cropped to square from https://en.wikipedia.org/wiki/Marissa_Mayer#/media/File:Marissa_Mayer_May_2014_(cropped).jpg, CC-BY 2.0
\photo{2.5cm}{mmayer-wikipedia-cc-by-2_0}
\personalinfo{%
  % Not all of these are required!
  % You can add your own with \printinfo{symbol}{detail}
  \email{mmayer@yahoo-inc.com}
%   \phone{000-00-0000}
  \mailaddress{Address, Street, 00000 County}
  \location{Sunnyvale, CA}
  \homepage{marissamayr.tumblr.com/}
  \twitter{@marissamayer}
  \linkedin{linkedin.com/in/marissamayer}
%   \github{github.com/mmayer} % I'm just making this up though.
%   \orcid{orcid.org/0000-0000-0000-0000} % Obviously making this up too. If you want to use this field (and also other academicons symbols), add "academicons" option to \documentclass{altacv}
}

%% Make the header extend all the way to the right, if you want.
\begin{fullwidth}
\makecvheader
\end{fullwidth}

%% Depending on your tastes, you may want to make fonts of itemize environments slightly smaller
\AtBeginEnvironment{itemize}{\small}

%% Provide the file name containing the sidebar contents as an optional parameter to \cvsection.
%% You can always just use \marginpar{...} if you do
%% not need to align the top of the contents to any
%% \cvsection title in the "main" bar.
\cvsection[mmayer-p1sidebar]{Experience}

\cvevent{President \& CEO}{Yahoo!}{July 2012 -- Ongoing}{Sunnyvale, CA}
\begin{itemize}
\item Led the \$5 billion acquisition of the company with Verizon -- the entity which believed most in the immense value Yahoo!\ has created
\item Acquired Tumblr for \$1.1 billion and moved the company's blog there
\item Built Yahoo's mobile, video and social businesses from nothing in 2011 to \$1.6 billion in GAAP revenue in 2015
\item Tripled the company's mobile base to over 600 million monthly active users and generated over \$1 billion of mobile advertising revenue last year
\end{itemize}

\divider

\cvevent{Vice President of Location \& Services}{Google}{Oct 2010 -- July 2012}{Palo Alto, CA}
\begin{itemize}
\item Position Google Maps as the world leader in mobile apps and navigation
\item Oversaw 1000+ engineers and product managers working on Google Maps, Google Places and Google Earth
\end{itemize}

\divider

\cvevent{Vice President of Search Products \& UX}{Google}{2005 --  2010}{Palo Alto, CA}

\divider

\cvevent{Product Manager \& UI Lead}{Google}{Oct 2001 -- July 2005}{Palo Alto, CA}

\begin{itemize}
\item Appointed by the founder Larry Page in 2001 to lead the Product Management and User Interaction teams
\item Optimized Google's homepage and A/B tested every minor detail to increase usability (incl.~spacing between words, color schemes and pixel-by-pixel element alignment)
\end{itemize}

\cvsection{A Day of My Life}

% Adapted from @Jake's answer from http://tex.stackexchange.com/a/82729/226
% \wheelchart{outer radius}{inner radius}{
% comma-separated list of value/text width/color/detail}
% Some ad-hoc tweaking to adjust the labels so that they don't overlap
\wheelchart{1.9cm}{0.7cm}{% <=========================================== {1.5cm}{0.5cm}
  7/10em/accent!30/Modélisation \ UML,
  25/9em/accent!60/ Programmation orientée \ Objets,
  5/10em/accent!10/\footnotesize\\ Compétences Génie logiciel, % <====== 5/13em -> 5/10em
  20/15em/accent!40/Algorithmique,
  5/8em/accent!20/\footnotesize XML,
  30/9em/accent/Python /& bibliothèques annexes,
  5/8em/accent!20/Qt
}

\end{document}

and its result:

resulting new header

To change now the layout for name and personal info, the header has to be changed once more. You did not exactly tell what you want so I added the personal info to be ragged left. Then I found that there is an error in the used dimensions for the header and therefore I need to add the following code to the preamble:

\renewenvironment{fullwidth}{%
  \begin{adjustwidth}{}
  {\dimexpr-\marginparwidth-\marginparsep-2em\relax} % <================ added -2em
  }
  {\end{adjustwidth}}

This corrects the display for the personal info to be ragged left and in one line with the following text.

I changed the code for the header like this (see the marked code lines with <====):

\renewcommand{\makecvheader}{%
  \begingroup
    \begin{minipage}{\@photodiameter}
    \if@normalphoto
      \includegraphics[width=\linewidth]{\@photo}
    \else
      \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
    \fi%
    \end{minipage}%
    \hfill%
    \ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-3em}}{}% <=======
    \begin{minipage}{0.6\linewidth} % <=================================
      \raggedright\color{emphasis}%
      {\Huge\bfseries\MakeUppercase{\@name}\par}
      \medskip
      {\large\bfseries\color{accent}\@tagline\par}
    \end{minipage}
    \hfill
    \begin{minipage}{0.35\linewidth} % <================================
      {\raggedleft\footnotesize\bfseries\@personalinfo\par}
    \end{minipage}
    \ifdef{\@photodiameter}{\end{minipage}\par}{}%
  \endgroup\medskip
}

Depending on the length of your name it could be that you need to change the length of {0.6\linewidth} and then of course {0.35\linewidth} ...

With the following mwe

\documentclass[10pt,a4paper,ragged2e]{altacv}

%% AltaCV uses the fontawesome and academicon fonts
%% and packages.
%% See texdoc.net/pkg/fontawecome and http://texdoc.net/pkg/academicons for full list of symbols. You MUST compile with XeLaTeX or LuaLaTeX if you want to use academicons.

% Change the page layout if you need to
\geometry{left=1cm,right=9cm,marginparwidth=6.8cm,marginparsep=1.2cm,top=1.25cm,bottom=1.25cm}

% Change the font if you want to, depending on whether
% you're using pdflatex or xelatex/lualatex
\ifxetexorluatex
  % If using xelatex or lualatex:
  \setmainfont{Lato}
\else
  % If using pdflatex:
  \usepackage[utf8]{inputenc}
  \usepackage[T1]{fontenc}
  \usepackage[default]{lato}
\fi
\usepackage{fontawesome}

\makeatletter % <=======================================================
\renewcommand{\makecvheader}{%
  \begingroup
    \begin{minipage}{\@photodiameter}
    \if@normalphoto
      \includegraphics[width=\linewidth]{\@photo}
    \else
      \tikz\path[fill overzoom image={\@photo}]circle[radius=0.5\linewidth];
    \fi%
    \end{minipage}%
    \hfill%
    \ifdef{\@photodiameter}{\begin{minipage}{\dimexpr\linewidth-\@photodiameter-3em}}{}% <=======
    \begin{minipage}{0.6\linewidth} % <=================================
      \raggedright\color{emphasis}%
      {\Huge\bfseries\MakeUppercase{\@name}\par}
      \medskip
      {\large\bfseries\color{accent}\@tagline\par}
    \end{minipage}
    \hfill
    \begin{minipage}{0.35\linewidth} % <================================
      {\raggedleft\footnotesize\bfseries\@personalinfo\par}
    \end{minipage}
    \ifdef{\@photodiameter}{\end{minipage}\par}{}%
  \endgroup\medskip
}

\renewenvironment{fullwidth}{%
  \begin{adjustwidth}{}
  {\dimexpr-\marginparwidth-\marginparsep-2em\relax} % <================ added -2em
  }
  {\end{adjustwidth}}
\makeatother % <========================================================

% Change the colours if you want to
\definecolor{VividPurple}{HTML}{3E0097}
\definecolor{SlateGrey}{HTML}{2E2E2E}
\definecolor{LightGrey}{HTML}{666666}
\colorlet{heading}{VividPurple}
\colorlet{accent}{VividPurple}
\colorlet{emphasis}{SlateGrey}
\colorlet{body}{LightGrey}

% Change the bullets for itemize and rating marker
% for \cvskill if you want to
\renewcommand{\itemmarker}{{\small\textbullet}}
\renewcommand{\ratingmarker}{\faCircle}

%% sample.bib contains your publications
\addbibresource{sample.bib}


\begin{document}
\name{Marissa Mayer}
%\name{Marissa Mayertest}
\tagline{Business Woman \& Proud Geek}
% Cropped to square from https://en.wikipedia.org/wiki/Marissa_Mayer#/media/File:Marissa_Mayer_May_2014_(cropped).jpg, CC-BY 2.0
\photo{2.5cm}{mmayer-wikipedia-cc-by-2_0}
\personalinfo{%
  % Not all of these are required!
  % You can add your own with \printinfo{symbol}{detail}
  \email{mmayer@yahoo-inc.com}
%   \phone{000-00-0000}
  \mailaddress{Address, Street, 00000 County}
  \location{Sunnyvale, CA}
  \homepage{marissamayr.tumblr.com/}
  \twitter{@marissamayer}
  \linkedin{linkedin.com/in/marissamayer}
%   \github{github.com/mmayer} % I'm just making this up though.
%   \orcid{orcid.org/0000-0000-0000-0000} % Obviously making this up too. If you want to use this field (and also other academicons symbols), add "academicons" option to \documentclass{altacv}
}

%% Make the header extend all the way to the right, if you want.
\begin{fullwidth}
\makecvheader
\end{fullwidth}

%% Depending on your tastes, you may want to make fonts of itemize environments slightly smaller
\AtBeginEnvironment{itemize}{\small}

%% Provide the file name containing the sidebar contents as an optional parameter to \cvsection.
%% You can always just use \marginpar{...} if you do
%% not need to align the top of the contents to any
%% \cvsection title in the "main" bar.
\cvsection[mmayer-p1sidebar]{Experience}

\cvevent{President \& CEO}{Yahoo!}{July 2012 -- Ongoing}{Sunnyvale, CA}
\begin{itemize}
\item Led the \$5 billion acquisition of the company with Verizon -- the entity which believed most in the immense value Yahoo!\ has created
\item Acquired Tumblr for \$1.1 billion and moved the company's blog there
\item Built Yahoo's mobile, video and social businesses from nothing in 2011 to \$1.6 billion in GAAP revenue in 2015
\item Tripled the company's mobile base to over 600 million monthly active users and generated over \$1 billion of mobile advertising revenue last year
\end{itemize}

\divider

\cvevent{Vice President of Location \& Services}{Google}{Oct 2010 -- July 2012}{Palo Alto, CA}
\begin{itemize}
\item Position Google Maps as the world leader in mobile apps and navigation
\item Oversaw 1000+ engineers and product managers working on Google Maps, Google Places and Google Earth
\end{itemize}

\divider

\cvevent{Vice President of Search Products \& UX}{Google}{2005 --  2010}{Palo Alto, CA}

\divider

\cvevent{Product Manager \& UI Lead}{Google}{Oct 2001 -- July 2005}{Palo Alto, CA}

\begin{itemize}
\item Appointed by the founder Larry Page in 2001 to lead the Product Management and User Interaction teams
\item Optimized Google's homepage and A/B tested every minor detail to increase usability (incl.~spacing between words, color schemes and pixel-by-pixel element alignment)
\end{itemize}

\cvsection{A Day of My Life}

% Adapted from @Jake's answer from http://tex.stackexchange.com/a/82729/226
% \wheelchart{outer radius}{inner radius}{
% comma-separated list of value/text width/color/detail}
% Some ad-hoc tweaking to adjust the labels so that they don't overlap
\wheelchart{1.9cm}{0.7cm}{% <=========================================== {1.5cm}{0.5cm}
  7/10em/accent!30/Modélisation \ UML,
  25/9em/accent!60/ Programmation orientée \ Objets,
  5/10em/accent!10/\footnotesize\\ Compétences Génie logiciel, % <====== 5/13em -> 5/10em
  20/15em/accent!40/Algorithmique,
  5/8em/accent!20/\footnotesize XML,
  30/9em/accent/Python /& bibliothèques annexes,
  5/8em/accent!20/Qt
}

\end{document}

you get the following result:

resulting pdf two

Related Question