如何在不同的居中环境中将多个表格条目居中?

如何在不同的居中环境中将多个表格条目居中?

我快要抓狂了。我想知道是否有人可以给我一些提示或指导我以正确的方式正确格式化我的居中表格条目。我只想让我的居中表格部分对齐,但它们总是根据我输入的文本量而变化。我想知道是否有快速解决此问题的方法。我已将我的文档包含在下面的代码中。

\documentclass{article}
\usepackage[top=2cm, bottom=2cm, left=1.5cm, right=1cm,headsep=1cm]    {geometry}
\usepackage{fancyhdr}
\usepackage{calc}
\usepackage{comment}
\pagestyle{fancy}
\parindent=0pt
\fancyfoot{}
\begin{document}
\lhead{{\Huge Robert Plummer II}  
\hfill
\begin{tabular}{ l c  }
337-353-9679 &2609 South Vienna Street\\
[email protected] &Ruston, La 71270  \\
\end{tabular}} 

{\bf\Large Education:}  
\begin{center}
\begin{tabular}{ l c r  }
{\bf Louisiana Tech University \hspace{1in}2008-2012} \hfill \\  
\hspace{.25in}Bachelor of Science Degree, Computer Science Expected 5/12\\
\hspace{.25in}Minor: Mathematics\\ 
\hspace{.25in}Computer Science GPA: 3.06\\
\hspace{.25in}Cumulative GPA: 2.8\\
 \hfill\\
 {\bf Curriculum Highlights} \hfill \\
 \hspace{.25in}System Programming\\ 
 \hspace{.25in}Operating Systems\\
 \hspace{.25in}Advanced Algorithm Design\\
 \hspace{.25in}Networking\\
 \hspace{.25in}Digital Design and Computer Architecture\\
\hspace{.25in}Digital Forensics\\
\hspace{.25in}Cyber Security\\
\hfill\\
\end{tabular}
\end{center}

{\bf\Large Technical Skills:} \\ 
\begin{center}
\begin{tabular}{ l c r  }
{\bf Programming Languages} \hfill\\
\hspace{.25in} Experience using C/C++, Python, Java, Javascript, HTML, CSS, PHP.\\
\hfill\\
{\bf Platforms} \hfill \\
\hspace{.25in} Comfortable working on a Windows, OS X, or Unix machine.\\
\end{tabular}
\end{center}

{\bf\Large Coursework/Projects:} \\ 
\begin{center}
\begin{tabular}{ l c r  }
{\bf Networking} \hfill \\
\hspace{.25in}Implemented a chat program that uses TCP to communicate.\\
\hspace{.25in}Used raw sockets to implement TCP.\\ 
\hfill\\
{\bf Digital Forensics} \hfill \\
\hspace{.25in}Implemented a Windows Recycle Bin .info/R-I parser\\
 \hspace{.25in}Windows registry extractor that is compatible with Windows XP, Vista, and 7.\\
\hfill\\
{\bf Software Engineering} \hfill \\
\hspace{.25in}Project Manager for new Computer Science website for Louisiana Tech University.\\
\hspace{.25in}Responsible for creating a web interface to interact with the SQL database for the new website.\\
\hspace{.25in}Wrote code that used AJAX and PHP to generate the web pages that use content from a database.
\end{tabular}
\end{center}

\begin{center} References available upon request \end{center}

\end{document}

抱歉代码太多了,但我想确保每个人都能看到这个问题。感谢您的时间。

答案1

总的来说,我必须同意@AlanMunn 的评论。下面是我尝试(i)通过以下方式简化布局:不是Palatino使内容居中,并始终使用左对齐的布局,以及 (ii) 通过使用(通过mathpazo包)旧式数字而不是 Computer Modern,使整个文档看起来更有吸引力。

\documentclass[letterpaper]{article}
\usepackage[vmargin=3cm, hmargin=1in, headsep=1cm]{geometry}
\usepackage{fancyhdr}
\usepackage{calc}
\usepackage{comment}
\pagestyle{fancy}
\parindent=0pt
\fancyfoot{}
\usepackage[osf]{mathpazo}
\frenchspacing
\begin{document}
\lhead{{\Huge Robert Plummer II}  
\hfill
\begin{tabular}{ l l@{} }
337-353-9679      & 2609 South Vienna Street\\
[email protected] & Ruston LA 71270  \\
\end{tabular}} 

\section*{Education}  

\begin{tabular}{@{}p{0.25in}p{0.25in}p{5.5in}}
& \multicolumn{2}{@{}l}{\bfseries Louisiana Tech University, 2008 to 2012} \\  
 & & Bachelor of Science Degree, Computer Science, exp.\ May 2012\\
 & & Minor: Mathematics\\ 
 & & Computer Science GPA: 3.06\\
 & & Cumulative GPA: 2.8\\[1ex]
 & \multicolumn{2}{@{}l}{\bfseries Curriculum Highlights}\\
 & & System Programming\\ 
 & & Operating Systems\\
 & & Advanced Algorithm Design\\
 & & Networking\\
 & & Digital Design and Computer Architecture\\
 & & Digital Forensics\\
 & & Cyber Security\\
\end{tabular}

\section*{Technical Skills}

\begin{tabular}{@{}p{0.25in}p{0.25in}p{5.5in}}
& \multicolumn{2}{@{}l}{\bfseries Programming Languages}\\
 & & Experience using C/C$+{}+$, Python, Java, Javascript, HTML, CSS, and PHP\\[1ex]
& \multicolumn{2}{@{}l}{\bfseries Platforms}\\
 & & Comfortable working on Windows, MacOS\,X, and Unix machines\\
\end{tabular}


\section*{Coursework and Projects} 

\begin{tabular}{@{}p{0.25in}p{0.25in}p{5.75in}}
& \multicolumn{2}{@{}l}{\bfseries Networking}  \\
 & & Implemented a chat program that uses TCP to communicate\\
 & & Used raw sockets to implement TCP\\[1ex]
& \multicolumn{2}{@{}l}{\bfseries Digital Forensics}  \\
 & & Implemented a Windows Recycle Bin .info/R-I parser\\
 & & Wrote Windows registry extractor that is compatible with Windows XP/Vista/7\\[1ex]
& \multicolumn{2}{@{}l}{\bfseries Software Engineering}  \\
 & & Project Manager for new Computer Science website for Louisiana Tech University\\
 & & Responsible for creating web interface to interact with SQL database for new website\\
 & & Wrote code that used AJAX and PHP to generate web pages that use content from  database
\end{tabular}


\section*{References}

\hspace{0.25in} Available upon request.

\end{document}

在此处输入图片描述

答案2

维护基于将所有内容放入tabular环境中的 CV 将来会成为噩梦。此外,您永远不应该手动格式化 LaTeX 文档中的元素:LaTeX 的全部意义在于您为文档元素定义语义标记,并通过修改标记定义来决定这些元素的格式。话虽如此,即使只有很少的特殊标记,我们也可以用很少的努力将其变成一个漂亮的文档,并保留一些长期可维护的内容。

正如我在评论中提到的,我已经用两个包实现了所有内容:

  • titlesec使用此包并将其设置secnumdepth为 0,我们可以对 CV 的逻辑部分使用常规分段命令;该small选项似乎大小合适,因此不需要进一步修改。
  • enumitem使用此包,我们可以对子部分的子部分使用简单的逐项列表。这使得它们易于重新排序或更多次排列,因为每个元素都只是一个\item。我删除了标签,并将间距设置为非常紧凑。

\documentclass[11pt]{article}
\usepackage[top=2cm, bottom=2cm, left=1.5cm, right=1cm,headsep=1cm]    {geometry}
\usepackage{fancyhdr}
\usepackage{calc}
\usepackage{enumitem}
\setlist[itemize]{label={},nolistsep}
\usepackage[small]{titlesec}
\usepackage{comment}
\pagestyle{empty}
\parindent=0pt
\setcounter{secnumdepth}{0}
\begin{document}
{\Huge Robert Plummer II}
\hfill 
\begin{tabular}{lc}
337-353-9679 &2609 South Vienna Street\\
[email protected] &Ruston, La 71270 
\end{tabular}
\hrule

\section{Education}  

\subsection{Louisiana Tech University \hspace{1in}2008-2012}
\begin{itemize}     
    \item Bachelor of Science Degree, Computer Science Expected 5/12
    \item Minor: Mathematics 
    \item Computer Science GPA: 3.06
    \item Cumulative GPA: 2.8
\end{itemize}

\subsection {Curriculum Highlights}  
\begin{itemize}
    \item System Programming 
    \item Operating Systems
    \item Advanced Algorithm Design
    \item Networking
    \item Digital Design and Computer Architecture
    \item Digital Forensics
    \item Cyber Security
\end{itemize}

\section{Technical Skills}
\subsection{Programming Languages} 
\begin{itemize}
    \item  Experience using C/C++, Python, Java, Javascript, HTML, CSS, PHP.
\end{itemize}

\subsection{Platforms}  
\begin{itemize}
    \item  Comfortable working on a Windows, OS X, or Unix machine.
\end{itemize}

\section{Coursework/Projects} 
\subsection{Networking}  
\begin{itemize}
    \item Implemented a chat program that uses TCP to communicate.
    \item Used raw sockets to implement TCP. 
\end{itemize}

\subsection{Digital Forensics}  
\begin{itemize}
    \item Implemented a Windows Recycle Bin .info/R-I parser
    \item Windows registry extractor that is compatible with Windows XP, Vista, and 7.
\end{itemize}

\subsection{Software Engineering}  
\begin{itemize}
    \item Project Manager for new Computer Science website for Louisiana Tech University.
    \item Responsible for creating a web interface to interact with the SQL database for the new website.
    \item Wrote code that used AJAX and PHP to generate the web pages that use content from a database.
\end{itemize}
\section{References}
\begin{itemize}
\item Available on request.
\end{itemize}

\end{document}

代码输出

相关内容