表格环境中的元素不会右对齐

表格环境中的元素不会右对齐

我正在尝试格式化我的简历,一切都运行正常,除了一个表格中的日期无法右对齐。奇怪的是,我在另一个表格环境中使用完全相同的代码,它运行正常。需要帮助弄清楚如何解决这个问题。这是我使用的 tex 文件https://www.dropbox.com/s/kref3cnudug88qu/AnonReddit.tex?dl=0

答案1

您正在将列定义为。请在包\begin{tabular}{p{13cm} r}的帮助下定义这些列array

\usepackage{array}
\newcolumntype{L}{@{}>{\raggedright\arraybackslash}p{0.65\linewidth}}
\newcolumntype{R}{>{\raggedleft\arraybackslash}p{\dimexpr0.35\linewidth-2\tabcolsep\relax}@{}}

然后像使用它们一样

\begin{tabular}{LR}

示例代码:

\documentclass{article}
\usepackage[cm]{fullpage}
\usepackage{graphicx}   %% remove demo
\usepackage{multirow}
\usepackage{color,showframe}   %% showframe just for demo, remove
\usepackage{array}
\newcolumntype{L}{@{}>{\raggedright\arraybackslash}p{0.65\linewidth}}
\newcolumntype{R}{>{\raggedleft\arraybackslash}p{\dimexpr0.35\linewidth-2\tabcolsep\relax}@{}}
\begin{document}
\thispagestyle{empty}
\pagestyle{empty}
\begin{table}
\small
\begin{tabular}{@{} p{0.45\textwidth} p{0.25\textwidth} p{0.25\textwidth}@{} }
  \multirow{4}{*}{\includegraphics[scale=0.25]{example-image-a}}
  & Engineering Co-op Program & Phone 604 822 3022 \\
  & Faculty of Applied Science & Fax 604 822 3449 \\
  & 2385 East Mall & [email protected]\\
  & Vancouver, BC Canada V6T 1Z4 & www.ubcengineeringcoop.com \\
\end{tabular}
\end{table}
\begin{center}
\LARGE
\textbf{First Last}\\
\end{center}
\begin{flushleft}

\subsection*{\color{cyan}EDUCATION}

\begin{tabular}{LR}
\large\textbf{University of British Columbia} & \textbf{September, 2013 - January, 2015} \\
\textbf{\textit{Bachelor of Applied Science - Mechanical Engineering }}  (GPA: 3.4 / 4.33)  \\
\end{tabular}
\subsection*{\color{cyan}TECHNICAL SKILLS}
    \begin{tabular}{p{5.5cm} p{5.5cm} p{5.5cm}}
    \textbf{Computer} & \textbf{Electrical} & \textbf{Mechanical} \\
    $\bullet$ MATLAB & $\bullet$ Oscilloscope & $\bullet$ Basic Machining Safety \\
    $\bullet$ SolidWorks & $\bullet$ Signal Generator & $\bullet$ Mechanical Design \\
    $\bullet$ C & $\bullet$ Soldering Iron\\
    $\bullet$ LaTex & $\bullet$ Breadboard\\
    $\bullet$ Excel
    \end{tabular}

\subsection*{\color{cyan}TECHNICAL PROJECTS}

\begin{tabular}{LR}
\large \textbf{UBC Baja} & \textbf{October, 2014 - Present}\\
$\bullet$ Recreated a complex gearbox to establish accurate sizing and mounting points relative to each other to ensure proper fit in vehicle\\
$\bullet$ Independently constructed a basic chassis model in SolidWorks, using many\\ instances of reference geometry and weldments \\
\\

\large\textbf{Graphing Script} & \textbf{October, 2014} \\
$\bullet$ Developed a MATLAB script that analyzes track data from the UBC Electrical Car Club E-Beetle and produces useful graphs  \\
\end{tabular}

\subsection*{\color{cyan}WORK EXPERIENCE}

\begin{tabular}{LR}
\large \textbf{Hatch} & \textbf{March, 2013 } \\
\textbf{\textit{Student Job Shadow}} \\
$\bullet$ Used Microsoft Excel to calculate percent slurry produced from a basic flow diagram
$\bullet$ Delivered a humorous presentation on Microsoft PowerPoint about my student work week experience  \\
\\
\large \textbf{BC Soccer} & \textbf{September, 2011 - March, 2013} \\
\textbf{\textit{Junior Referee}} \\
$\bullet$ Established a pressure free environment in which kids could learn from mistakes while also managing enthusiastic coaches and parents \\
\end{tabular}
\end{flushleft}
\end{document}

在此处输入图片描述

还有其他小错误,例如:

\large是一个开关,使用 like \large textnot \large{Text}。最好像我在第一个表中所做的那样,在几个地方添加@{}以消除空格。

答案2

你可以用 来实现tabularx。我还习惯于enumitem插入 itemìze 环境,它可以简化你的代码(更少的行)并更好地控制垂直间距:

\documentclass{article}
\usepackage[cm]{fullpage}
\usepackage[demo]{graphicx}
\usepackage{multirow, array, tabularx}
\usepackage{color}
\usepackage{enumitem}
\setlist[itemize]{wide=0pt, noitemsep, topsep=4pt}
\begin{document}
\pagestyle{empty}
\begin{table}
  \small
  \begin{tabular}{ p{0.45\textwidth} p{0.25\textwidth} p{0.25\textwidth} }
    \multirow{4}{*}{\includegraphics[scale=0.25]{s2b282.png}}
      & Engineering Co-op Program & Phone 604 822 3022 \\
      & Faculty of Applied Science & Fax 604 822 3449 \\
      & 2385 East Mall & [email protected] \\
      & Vancouver, BC Canada V6T 1Z4 & www.ubcengineeringcoop.com \\
  \end{tabular}
\end{table}
\begin{center}
  \LARGE
  \textbf{First Last}\\
\end{center}
\begin{flushleft}

  \subsection*{\color{cyan}EDUCATION}

  \begin{tabularx}{\linewidth}{X >{\bfseries}r}
    \large{\textbf{University of British Columbia}} & September, 2013 -- January, 2015 \\
    \textbf{\textit{Bachelor of Applied Science - Mechanical Engineering }} (GPA: 3.4 / 4.33) \\
  \end{tabularx}
  \subsection*{\color{cyan}TECHNICAL SKILLS}
  \begin{tabular}{p{5.5cm} p{5.5cm} p{5.5cm}}
    \textbf{Computer}
    \begin{itemize}
    \item MATLAB
    \item SolidWorks
    \item C
    \item LaTeX
    \item Excel
    \end{itemize}
      & \textbf{Electrical}
    \begin{itemize}
    \item Oscilloscope
    \item Signal Generator
    \item Soldering Iron
    \item Breadboard
    \end{itemize}
      & \textbf{Mechanical}
    \begin{itemize}
    \item Basic Machining Safety
    \item Mechanical Design
    \end{itemize}
  \end{tabular}

  \subsection*{\color{cyan}TECHNICAL PROJECTS}

  \begin{tabularx}{\linewidth}{X >{\bfseries}r}
    %{\large\textbf{UBC Baja}} \\
    %$\bullet$ Recreated a complex gearbox to establish accurate sizing and mounting points relative to each other to ensure proper fit in vehicle\\
    %$\bullet$ Independently constructed a basic chassis model in SolidWorks, using many\\ instances of reference geometry and weldments
    {\large\textbf{UBC Baja}}
    \begin{itemize}
    \item Recreated a complex gearbox to establish accurate sizing and mounting points relative to each other to ensure proper fit in vehicle
    \item Independently constructed a basic chassis model in SolidWorks, using many instances of reference geometry and weldments
    \end{itemize}
      & October, 2014 -- Present \\[1.5ex]
    {\large\textbf{Graphing Script}}
    \begin{itemize}
    \item Developed a MATLAB script that analyzes track data from the UBC Electrical Car Club E-Beetle and produces useful graphs
    \end{itemize}
      & October, 2014
    \\
  \end{tabularx}

  \subsection*{\color{cyan}WORK EXPERIENCE}

  \begin{tabularx}{\linewidth}{X >{\bfseries}r}
    {\large\textbf{Hatch}}\newline
    \textbf{\textit{Student Job Shadow}}
    \begin{itemize}
    \item Used Microsoft Excel to calculate percent slurry produced from a basic flow diagram
    \item Delivered a humorous presentation on Microsoft PowerPoint about my student work week experience
    \end{itemize}
      & March, 2013
    \\
    {\large\textbf{BC Soccer}} \newline
    \textbf{\textit{Junior Referee}}
    \begin{itemize}
    \item Established a pressure free environment in which kids could learn from mistakes while also managing enthusiastic coaches and parents
    \end{itemize}
      & September, 2011 -- March, 2013
  \end{tabularx}

  \subsection*{\color{cyan}VOLUNTEER WORK EXPERIENCE}

  \begin{tabularx}{\linewidth}{X >{\bfseries}r}
    {\large\textbf{First United Church}}\newline
    \textbf{\textit{Student Volunteer}}
    \begin{itemize}
    \item Managed the front desk, monitored phone calls and handed out needed supplies
    \item Worked in a team to move heavy donated furniture to the Church
    \end{itemize}
      & April, 2013
    \\[1.5ex]
    {\large\textbf{Highschool Secondary}} \newline
    \textbf{\textit{Grade Nine Basketball Coach}}
    \begin{itemize}
    \item Helped construct the team through decisive evaluations during try-outs
    \item Instructed players how to run a full-court trap independently
    \end{itemize}
      & September, 2011 -- March, 2013
  \end{tabularx}

\end{flushleft}

\end{document}

在此处输入图片描述

相关内容