将图片置于中心

将图片置于中心
  \documentclass[a4paper,10pt]{article}
    \usepackage[T1]{fontenc}

    \usepackage{geometry}
    \geometry{left=2cm,right=2cm,top=1.5cm,bottom=1.5cm}

    \usepackage{pifont}
    \usepackage{sectsty}

    \usepackage{graphicx}
    \usepackage{amsmath,amsfonts,amsthm}

    \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}

    \frenchspacing
    \sectionfont{%
      \fontfamily{phv}\bfseries
      \sectionrule{0pt}{0pt}{-5pt}{1pt}%
    }
    \pagestyle{empty}

    \begin{document}

    %%%%%%%%%%%%%%%%%% Photo et title %%%%%%%%%%%%%%%%%%%%%%%%%

    \bigskip

    \begin{flushleft}

    \makebox[0pt][l]{%
      \fontfamily{phv}\large
      \begin{tabular}{@{}l@{}}
      \Huge\bfseries Name Name \\[1ex]
      Curriculum Vitae\\ (\today)
      \end{tabular}%
    }
    \hspace*{\fill}%
    \begin{tabular}{@{}c@{}}
      \includegraphics[width=0.15\textwidth]{example-image-9x16}
    \end{tabular}
    \end{flushleft}

    \section*{Informations personelles}
    \end{document} 

我想将以下图片置于中心

在此处输入图片描述

答案1

这是对标题设置的一个细微调整,使用零宽度的l左对齐框作为名称,然后使用(默认c输入的)\linewidth框作为图像。

在此处输入图片描述

\documentclass{article}

\usepackage{geometry}
\geometry{hmargin=2cm,vmargin=1.5cm}

\usepackage{pifont,graphicx}

\pagestyle{empty}

\begin{document}

\noindent
\makebox[0pt][l]{%
  \fontfamily{phv}\large
  \begin{tabular}[b]{@{}l@{}}
  \Huge\bfseries Name Name \\[1ex]
  Curriculum Vitae \\ (\today)
  \end{tabular}%
}%
\makebox[\linewidth]{% Default centered
  \includegraphics[height=5\baselineskip]{example-image-9x16}
}

\section*{Informations personelles}

\end{document}

相关内容