项目和子标题

项目和子标题
\newcommand{\ressubheading}[4]{
\begin{tabular*}{6.5in}{l@{\extracolsep{\fill}}r}
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-6pt}}

我正在使用这个命令

\ressubheading{Graph Plotter (Course Project)}{CSE, XYZ} {Guide: Prof.ABC}{Autumn, 2013}

但项目符号和文本起始处有一点偏移。

我该如何解决它?

答案1

首先打开水晶球!您很可能正在使用这个模板:

\documentclass[letterpaper,11pt]{article}

%-----------------------------------------------------------
%Margin setup

\setlength{\voffset}{0.1in}
\setlength{\paperwidth}{8.5in}
\setlength{\paperheight}{11in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{11in}
\setlength{\textheight}{9.5in}
\setlength{\topmargin}{-0.25in}
\setlength{\textwidth}{7in}
\setlength{\topskip}{0in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
%-----------------------------------------------------------
%\usepackage{fullpage}
\usepackage{shading1}
%\textheight=9.0in
\pagestyle{empty}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}

%-----------------------------------------------------------
%Custom commands
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{{\large \parashade[.9]{sharpcorners}{\textbf{#1 \vphantom{p\^{E}}}}}}
\newcommand{\ressubheading}[4]{
\begin{tabular*}{6.5in}[t]{l@{\extracolsep{\fill}}r}
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-6pt}}
%-----------------------------------------------------------


\begin{document}

\begin{tabular*}{7in}{l@{\extracolsep{\fill}}r}
\textbf{\Large David Grant}  & 604-555-5555\\
\#666-1234 Main Street &  davidgrant-at-gmail.com \\
Vancouver, BC A1B 2C3 & http://www.davidgrant.ca\\
\end{tabular*}
\\

\vspace{0.1in}

\resheading{Education}
\begin{itemize}
\item
    \ressubheading{University of Waterloo}{Waterloo, ON}{M.A.Sc., Electrical Engineering (Grades: 80\%)}{Sep. 2002 - May. 2004}
    \begin{itemize}
        \resitem{Relevant courses: Semiconductor Devices: Physics and Modelling, Digital VLSI Design, Amorphous Silicon, Mixed-signal modelling with VHDL-AMS}
    \end{itemize}

\item
    \ressubheading{University of British Columbia}{Vancouver, BC}{B.A.Sc. Engineering Physics (Electrical Engineering Option)}{1997-2002}
    \begin{itemize}
        \resitem{Graduated with Honors, \textbf{86\%} cumulative average, and Dean's Honour List each year.}
        \resitem{Relevant courses: Solid-state physics, Quantum Mechanics, Semiconductor Devices (BJT, HBT, FET, analog IC layout and simulation), Digital Systems Design using VHDL, Waveguides and Photonics, RF, Analog/Digital Communications Systems, Analog Hardware Design}
    \end{itemize}

\end{itemize}
\ressubheading{Graph Plotter (Course Project)}{CSE, XYZ}
                {Guide: Prof.ABC}{Autumn, 2013}

\end{document}

在此模板中,页面布局定义准确,因此可以安全使用

\begin{tabular*}{6.5in}

但是当你改变布局时,奇怪的事情就会发生。

\documentclass{article}
\usepackage{showframe}   %% just for demo
%-----------------------------------------------------------
\newcommand{\ressubheading}[4]{
\begin{tabular*}{6.5in}[t]{l@{\extracolsep{\fill}}r}
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-6pt}}
%-----------------------------------------------------------

\begin{document}


\ressubheading{Graph Plotter (Course Project)}{CSE, XYZ}
                {Guide: Prof.ABC}{Autumn, 2013}

\end{document}

在此处输入图片描述

6.5 英寸在这里太大了,因此右侧的东​​西溢出了。\indent表格前面还有一点需要注意

将定义更改为:

\newcommand{\ressubheading}[4]{%     %%%<--- Better to put a % here
\noindent                            %% < this added
\begin{tabular*}{\linewidth}[t]{l@{\extracolsep{\fill}}r}     %%% 6.5in → \linewidth
        \textbf{#1} & #2 \\
        \textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-6pt}}

你得到:

在此处输入图片描述

相关内容