我正在用 LaTeX 写简历,目前有一个左对齐的标题部分,我想知道如何让它在文档中居中。我想让图片中的所有内容都居中(姓名、网站和图标栏)。
\documentclass[letterpaper,11pt]{article}
\usepackage{fontawesome}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{tabularx}
\usepackage[document]{ragged2e}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{enumitem,amssymb,graphicx}
\DeclareFontFamily{U}{fontawesomeOne}{}
\DeclareFontShape{U}{fontawesomeOne}{m}{n}
{<-> FontAwesome--fontawesomeone}{}
\DeclareRobustCommand\FAone{\fontencoding{U}\fontfamily{fontawesomeOne}\selectfont}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Adjust margins
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.5in}
\addtolength{\textheight}{1.0in}
\urlstyle{same}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
% Sections formatting
\titleformat{\section}{
\vspace{-4pt}\scshape\raggedright\large
}{}{0em}{}[\color{black}\titlerule \vspace{-5pt}]
%-------------------------
% Custom commands
\newcommand{\resumeItem}[2]{
\item\small{
\textbf{#1}{: #2 \vspace{-2pt}}
}
}
\newcommand{\resumeSubheading}[4]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
{\small#3} & {\small #4} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubheadingSmall}[2]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubheadingBig}[6]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
{\small#3} & {\small #4} \\
{\small#5} & {\small #6} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}
\renewcommand{\labelitemi}{}
\renewcommand{\labelitemii}{\scalebox{0.5}{\raisebox{0.65ex}{$\blacksquare$}}}
\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}
%-------------------------------------------
%%%%%% CV STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
\textbf{\LARGE Name}\\
\href{https://mywebsite.com/}{website.com}\\\\
\raisebox{-0.20\height}{\Large \faInbox} \space \href{mailto:[email protected]}{Email} \quad \space \space
\raisebox{-0.20\height}{\Large \faPhone} \space (555) 555-55555 \quad \space \space
\raisebox{-0.20\height}{\Large \faLinkedinSquare} \space \href{https://www.linkedin.com/in/linkedin/}{LinkedIn} \quad \space \space
\raisebox{-0.20\height}{\Large \faGithub} \space \href{https://github.com/github}{GitHub} \quad \space \space
\raisebox{-0.20\height}{\Large \faStackOverflow} \space \href{https://stackoverflow.com/users/12584129/mwjones96}{mwjones96}
\end{tabular*}
%-----------EDUCATION-----------------
\section{Education}
\resumeSubHeadingListStart
\resumeSubheading
{University of Southern California}{Los Angeles, CA}
{Master of Science in Computer Science -- 3.55/4.00}{May 2020}
\resumeSubheadingBig
{University of Exeter}{Exeter, UK}
{Master of Engineering in Electronic Engineering and Computer Science -- 2:1}{July 2018}
{Bachelor of Engineering in Electronic Engineering and Computer Science -- 2:1}{July 2017}
\resumeSubHeadingListEnd
%-----------SKILLS-----------------
\section{Skills}
\resumeSubHeadingListStart
\resumeSubItem{Languages}
{Python, Java, Kotlin, C, C++, JavaScript, Go, PHP}
\resumeSubItem{Full Stack}
{HTML, CSS, Flask, Node.js, Angular, MySQL, MongoDB, DynamoDB, AWS, GCP, Azure}
\resumeSubItem{Other}
{Unix/Linux, Android SDK, Git, Jira, Maven, Gradle, JUnit}
\resumeSubHeadingListEnd
\renewcommand{\labelitemi}{}
%-----------EXPERIENCE-----------------
\section{Experience}
\resumeSubHeadingListStart
\resumeSubheading
{Amazon}{Seattle, WA}
{Software Development Engineer Intern}{May 2019 -- August 2019}
\resumeItemListStart
\item {Designed, built and deployed AlexaHEAT dashboard using Java, JavaScript and DynamoDB, providing over 300 Amazon employees easy access to real-time tailored datasets for their own projects.}
\item {Implemented backend to fetch and organize data sets from database to be embedded on the webpage using JSP templates, and built frontend for custom tooltips, animations and DOM manipulation.}
\item {Reduced time taken by employees to find and export data for their workflow by 70\%.}
\item {Demonstrated final dashboard and delivered presentation to over 50 employees in the Alexa Organization.}
\resumeItemListEnd
\resumeSubheading
{University of Wales, Trinity Saint David}{Swansea, UK}
{Software Developer Intern}{June 2018 -- August 2018}
\resumeItemListStart
\item
{Integrated two programs, Teddy and Bear, into a C++ Qt GUI application called TeddyBear, eliminating the need for intermediate file formats.}
\item
{Designed adapter to map the output of Teddy from RAM into the input of Bear for seamless integration, aiding future usage by saving time, money and disk space.}
\item
{Developed TeddyBear for research use by CyDen, the second largest light-based hair removal company in the UK, reaching over 400,000 customers annually.}
\item
{Presented TeddyBear to CyDen's Chief Scientific Officer and University supervisors.}
\resumeItemListEnd
\resumeSubHeadingListEnd
%-----------PROJECTS-----------------
\section{Projects}
\resumeSubHeadingListStart
\resumeSubItem{Research Portal}
{Co-ordinated with team of 6 others to build new website for USC CSSE, rebuilding old WordPress tech stack into Node.js, connecting USC students, staff and alumni worldwide.}
\resumeSubItem{EZ-ML - SB Hacks V}
{Developed and deployed SaaS web app made with a team of 3 others, allowing users to create ML models without writing code, using Python, Flask, Bootstrap, GCP Cloud Functions and Twilio API.}
\resumeSubItem{Weenix OS}
{Programmed core functionality with team of 3 others for custom Operating System written in C, including processes, threads, scheduler, file system and virtual memory.}
\resumeSubItem{eBay Search}
{Created comprehensive web app using Node.js, Express, Angular, Bootstrap and JavaScript using eBay API to search for products and provide detailed information to the user. Reused existing backend code and made new Android app using Java to act as an alternative frontend for mobile users.}
\resumeSubHeadingListEnd
%-----------Extra-Curricular Activities-----------------
\section{Extra-Curricular Activities}
\resumeSubHeadingListStart
\resumeSubItem{HackSC}
{Mentored students at one of largest Hackathons in California, with more than 800 participants.}
\resumeSubItem{IEEE BTAS}
{Supervised conference with more than 130 international researchers.}
\resumeSubItem{UKMT Senior Mathematical Challenge}
{Achieved 3rd highest score out of more than 100 test-takers.}
\resumeSubItem{Duke of Edinburgh Award}
{Completed modules in skill, volunteering, sport and expedition.}
\resumeSubHeadingListEnd
%-------------------------------------------
\end{document}
答案1
在你的情况下,你可以简单地使用\Centering
来自包ragged2e
(已加载)的命令来代替你的表格,如下所示:
%\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
{\Centering % <=========================================================
\textbf{\LARGE Name}\\
\href{https://mywebsite.com/}{website.com}\\\vspace{\baselineskip} % <======
\raisebox{-0.20\height}{\Large \faInbox} \space \href{mailto:[email protected]}{Email} \hfill % <======
\raisebox{-0.20\height}{\Large \faPhone} \space (555) 555-55555 \hfill % <======
\raisebox{-0.20\height}{\Large \faLinkedinSquare} \space \href{https://www.linkedin.com/in/linkedin/}{LinkedIn} \hfill % <======
\raisebox{-0.20\height}{\Large \faGithub} \space \href{https://github.com/github}{GitHub} \hfill % <======
\raisebox{-0.20\height}{\Large \faStackOverflow} \space \href{https://stackoverflow.com/users/12584129/mwjones96}{mwjones96}
} % <===================================================================
%\end{tabular*}
% <======
查看代码中标有的重要代码更改...
附有完整的 tex 代码
\documentclass[letterpaper,11pt]{article}
\usepackage{fontawesome}
\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{tabularx}
\usepackage[document]{ragged2e}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{enumitem,graphicx}
\usepackage{showframe} % <============= to visualize typing area and margins
\usepackage[hidelinks]{hyperref} % <================ last package to be called
\DeclareFontFamily{U}{fontawesomeOne}{}
\DeclareFontShape{U}{fontawesomeOne}{m}{n}
{<-> FontAwesome--fontawesomeone}{}
\DeclareRobustCommand\FAone{\fontencoding{U}\fontfamily{fontawesomeOne}\selectfont}
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Adjust margins
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1in}
\addtolength{\topmargin}{-.5in}
\addtolength{\textheight}{1.0in}
\urlstyle{same}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
% Sections formatting
\titleformat{\section}{
\vspace{-4pt}\scshape\raggedright\large
}{}{0em}{}[\color{black}\titlerule \vspace{-5pt}]
%-------------------------
% Custom commands
\newcommand{\resumeItem}[2]{
\item\small{
\textbf{#1}{: #2 \vspace{-2pt}}
}
}
\newcommand{\resumeSubheading}[4]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
{\small#3} & {\small #4} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubheadingSmall}[2]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubheadingBig}[6]{
\vspace{-1pt}\item
\begin{tabular*}{0.98\textwidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
{\small#3} & {\small #4} \\
{\small#5} & {\small #6} \\
\end{tabular*}\vspace{-5pt}
}
\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}
\renewcommand{\labelitemi}{}
\renewcommand{\labelitemii}{\scalebox{0.5}{\raisebox{0.65ex}{$\blacksquare$}}}
\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}
%-------------------------------------------
%%%%%% CV STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
{\Centering % <=========================================================
\textbf{\LARGE Name}\\
\href{https://mywebsite.com/}{website.com}\\\vspace{\baselineskip} % <======
\raisebox{-0.20\height}{\Large \faInbox} \space \href{mailto:[email protected]}{Email} \hfill % <======
\raisebox{-0.20\height}{\Large \faPhone} \space (555) 555-55555 \hfill % <======
\raisebox{-0.20\height}{\Large \faLinkedinSquare} \space \href{https://www.linkedin.com/in/linkedin/}{LinkedIn} \hfill % <======
\raisebox{-0.20\height}{\Large \faGithub} \space \href{https://github.com/github}{GitHub} \hfill % <======
\raisebox{-0.20\height}{\Large \faStackOverflow} \space \href{https://stackoverflow.com/users/12584129/mwjones96}{mwjones96}
} % <===================================================================
%\end{tabular*}
%-----------EDUCATION-----------------
\section{Education}
\resumeSubHeadingListStart
\resumeSubheading
{University of Southern California}{Los Angeles, CA}
{Master of Science in Computer Science -- 3.55/4.00}{May 2020}
\resumeSubheadingBig
{University of Exeter}{Exeter, UK}
{Master of Engineering in Electronic Engineering and Computer Science -- 2:1}{July 2018}
{Bachelor of Engineering in Electronic Engineering and Computer Science -- 2:1}{July 2017}
\resumeSubHeadingListEnd
%-----------SKILLS-----------------
\section{Skills}
\resumeSubHeadingListStart
\resumeSubItem{Languages}
{Python, Java, Kotlin, C, C++, JavaScript, Go, PHP}
\resumeSubItem{Full Stack}
{HTML, CSS, Flask, Node.js, Angular, MySQL, MongoDB, DynamoDB, AWS, GCP, Azure}
\resumeSubItem{Other}
{Unix/Linux, Android SDK, Git, Jira, Maven, Gradle, JUnit}
\resumeSubHeadingListEnd
\renewcommand{\labelitemi}{}
%-----------EXPERIENCE-----------------
\section{Experience}
\resumeSubHeadingListStart
\resumeSubheading
{Amazon}{Seattle, WA}
{Software Development Engineer Intern}{May 2019 -- August 2019}
\resumeItemListStart
\item {Designed, built and deployed AlexaHEAT dashboard using Java, JavaScript and DynamoDB, providing over 300 Amazon employees easy access to real-time tailored datasets for their own projects.}
\item {Implemented backend to fetch and organize data sets from database to be embedded on the webpage using JSP templates, and built frontend for custom tooltips, animations and DOM manipulation.}
\item {Reduced time taken by employees to find and export data for their workflow by 70\%.}
\item {Demonstrated final dashboard and delivered presentation to over 50 employees in the Alexa Organization.}
\resumeItemListEnd
\resumeSubheading
{University of Wales, Trinity Saint David}{Swansea, UK}
{Software Developer Intern}{June 2018 -- August 2018}
\resumeItemListStart
\item
{Integrated two programs, Teddy and Bear, into a C++ Qt GUI application called TeddyBear, eliminating the need for intermediate file formats.}
\item
{Designed adapter to map the output of Teddy from RAM into the input of Bear for seamless integration, aiding future usage by saving time, money and disk space.}
\item
{Developed TeddyBear for research use by CyDen, the second largest light-based hair removal company in the UK, reaching over 400,000 customers annually.}
\item
{Presented TeddyBear to CyDen's Chief Scientific Officer and University supervisors.}
\resumeItemListEnd
\resumeSubHeadingListEnd
%-----------PROJECTS-----------------
\section{Projects}
\resumeSubHeadingListStart
\resumeSubItem{Research Portal}
{Co-ordinated with team of 6 others to build new website for USC CSSE, rebuilding old WordPress tech stack into Node.js, connecting USC students, staff and alumni worldwide.}
\resumeSubItem{EZ-ML - SB Hacks V}
{Developed and deployed SaaS web app made with a team of 3 others, allowing users to create ML models without writing code, using Python, Flask, Bootstrap, GCP Cloud Functions and Twilio API.}
\resumeSubItem{Weenix OS}
{Programmed core functionality with team of 3 others for custom Operating System written in C, including processes, threads, scheduler, file system and virtual memory.}
\resumeSubItem{eBay Search}
{Created comprehensive web app using Node.js, Express, Angular, Bootstrap and JavaScript using eBay API to search for products and provide detailed information to the user. Reused existing backend code and made new Android app using Java to act as an alternative frontend for mobile users.}
\resumeSubHeadingListEnd
%-----------Extra-Curricular Activities-----------------
\section{Extra-Curricular Activities}
\resumeSubHeadingListStart
\resumeSubItem{HackSC}
{Mentored students at one of largest Hackathons in California, with more than 800 participants.}
\resumeSubItem{IEEE BTAS}
{Supervised conference with more than 130 international researchers.}
\resumeSubItem{UKMT Senior Mathematical Challenge}
{Achieved 3rd highest score out of more than 100 test-takers.}
\resumeSubItem{Duke of Edinburgh Award}
{Completed modules in skill, volunteering, sport and expedition.}
\resumeSubHeadingListEnd
%-------------------------------------------
\end{document}
您将获得以下第一页