如何使我的标题和副标题居中?

如何使我的标题和副标题居中?

我在 overleaf 上加载了一个模板来创建我的简历。它在标题左侧留有空间用于放置图片,在右侧留有姓名和“口号”;但是,由于在我目前的工作环境中,包含图片被认为不太专业,所以我想将标题居中,但我不知道该怎么做。这是当前的布局:

\documentclass[paper=a4,fontsize=11pt]{scrartcl} % KOMA-article class                   
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}     % Math packages
\usepackage{graphicx}                    % Enable pdflatex
\usepackage[svgnames]{xcolor}            % Colors by their 'svgnames'
\usepackage{geometry}
   \textheight=700px                    % Saving trees ;-)
\usepackage{url}

\frenchspacing              % Better looking spacings after periods
\pagestyle{empty}           % No pagenumbers/headers/footers

%%% Custom sectioning (sectsty package)
%%% ------------------------------------------------------------
\usepackage{sectsty}

\sectionfont{%                      % Change font of \section command
   \usefont{OT1}{cmr}{b}{n}%       % bch-b-n: CharterBT-Bold font
   \sectionrule{0pt}{0pt}{-5pt}{1pt}}

%%% Macros
%%% ------------------------------------------------------------
\newlength{\spacebox}
\settowidth{\spacebox}{8888888888}          % Box to align text
\newcommand{\sepspace}{\vspace*{1em}}       % Vertical space macro

\newcommand{\MyName}[1]{ % Name
       \Huge \usefont{OT1}{cmr}{b}{n} \hfill #1
       \par \normalsize \normalfont}
       
\newcommand{\MySlogan}[1]{ % Slogan (optional)
       \large \usefont{OT1}{cmr}{m}{n}\hfill #1
       \par \normalsize \normalfont}

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}

\newcommand{\PersonalEntry}[2]{
       \noindent\hangindent=2em\hangafter=0 % Indentation
       \parbox{\spacebox}{        % Box to align text
       \textit{#1}}               % Entry name (birth, address, etc.)
       \hspace{1.5em} #2 \par}    % Entry value

\newcommand{\SkillsEntry}[2]{      % Same as \PersonalEntry
       \noindent\hangindent=2em\hangafter=0 % Indentation
       \parbox{\spacebox}{        % Box to align text
       \textit{#1}}               % Entry name (birth, address, etc.)
       \hspace{1.5em} #2 \par}    % Entry value    
       
\newcommand{\EducationEntry}[4]{
       \noindent \textbf{#1} \hfill      % Study
       \colorbox{White}{%
           \parbox{5cm}{%
           \hfill\color{Black}#2}} \par  % Duration
       \noindent \textit{#3} \par        % School
       \noindent\hangindent=2em\hangafter=0 \small #4 % Description
       \normalsize \par}

\newcommand{\WorkEntry}[4]{               % Same as \EducationEntry
       \noindent \textbf{#1} \hfill      % Jobname
       \noindent\colorbox{Black}{\color{White}#2} \par  % Duration
       \noindent \textit{#3} \par              % Company
       \noindent\hangindent=2em\hangafter=0 \small #4 % Description
       \normalsize \par}

%%% Begin Document
%%% ------------------------------------------------------------
\begin{document}
% you can upload a photo and include it here...
%\begin{wrapfigure}{l}{0.5\textwidth}
%   \vspace*{-2em}
%       \includegraphics[width=0.15\textwidth]{photo}
%\end{wrapfigure}

\MyName{Andrés Piñón Gómez}
\MySlogan{Grado bilingüe en Economía con mención en Finanzas}

\sepspace
\end{document}

https://www.overleaf.com/latex/templates/plantilla-cv-espanol/ttbgvmyjcpfb

答案1

使用

\newcommand{\MyName}[1]{ % Name
    {\centering \Huge \usefont{OT1}{phv}{b}{n}  #1
        \par \normalsize \normalfont}}
        
\newcommand{\MySlogan}[1]{ % Slogan (optional)
    {\centering \large \usefont{OT1}{phv}{m}{n} \textit{#1}
        \par \normalsize \normalfont}}

A

相关内容