无法将元素向右移动

无法将元素向右移动

我有以下文件testCV.tex

%testCV.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV - RESUME CLASS FILE
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% This class file defines the structure and design of the template. 
%
% Original header:
% Copyright (C) 2010 by Trey Hunner
%
% Copying and distribution of this file, with or without modification,
% are permitted in any medium without royalty provided the copyright
% notice and this notice are preserved. This file is offered as-is,
% without any warranty.
%
% Created by Trey Hunner and modified by www.LaTeXTemplates.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{testcls} % Use the custom testcls.cls style
\usepackage[left=0.5in,top=0.5in,right=0.5in,bottom=0.5in]{geometry} % Document margins
\begin{document}
    \begin{rSection}{Projects}{LinkToGitHub}
    \end{rSection}
\end{document}

其关联testcls.cls文件包含:

\ProvidesClass{testcls}
\LoadClass[11pt,letterpaper]{article} % Font size and paper type
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\pagestyle{empty} % Suppress page numbers

% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[2]{ % 1st input argument - section name, 2nd input argument - relevant links.
  \sectionskip
  \MakeUppercase{{\bf #1}} \hfill {#2} % Section title and relevant links
  \sectionlineskip
  \hrule % Horizontal line
}

\def\sectionlineskip{\medskip} % The space above the horizontal line for each section 
\def\sectionskip{\medskip} % The space after the heading section

问题是LinkToGitHub它的右侧有一个奇怪的缩进,我无法删除。

在此处输入图片描述

我是 LaTeX 的初学者,所以我拿了一个简历模板,开始摆弄它。到目前为止一切都很好,直到这次。

答案1

使用当前的 MWE,您可以更改类文件中的以下宏:

\newenvironment{rSection}[2]{ % 1st input argument - section name, 2nd input argument - relevant links.
  \sectionskip
  \MakeUppercase{{\bf #1}} \hfill {#2} % Section title and relevant links
  \sectionlineskip
  \hrule % Horizontal line
}

到:

\newenvironment{rSection}[2]{% 1st input argument - section name, 2nd input argument - relevant links.
  \sectionskip%
  \hbox to \textwidth{\MakeUppercase{\bf #1}\hfill #2}% Section title and relevant links
  \sectionlineskip
  \hrule % Horizontal line
}{}

答案2

我不知道为什么有人会使用简历模板,因为无论如何你都想要改变。我真的很困惑

以下应该可以满足您的要求。我\usepackage[parfill]{parskip}从类文件中删除了它,因为它会导致这种行为。相反,我只是将更改为零parindent。这对于 CV 文档来说是可以的。

我还稍微改变了有问题的环境,例如end缺少了某个部分。

阿毗迪韦卡

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Medium Length Professional CV
% LaTeX Template
% Version 2.0 (8/5/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Trey Hunner (http://www.treyhunner.com/)
%
% Important note:
% This template requires the resume.cls file to be in the same directory as the
% .tex file. The resume.cls file provides the resume style used for structuring the
% document.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass{resume} % Use the custom resume.cls style

\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry} % Document margins

\name{John Smith} % Your name
\address{123 Broadway \\ City, State 12345} % Your address
\address{123 Pleasant Lane \\ City, State 12345} % Your secondary addess (optional)
\address{(000)~$\cdot$~111~$\cdot$~1111 \\ [email protected]} % Your phone number and email

\usepackage{showframe}% visual aid
\setlength{\parindent}{0pt}
\begin{document}
\renewenvironment{rSection}[2]{% 1st input argument - section name, 2nd input argument - relevant links.
    \sectionskip%
    \MakeUppercase{{\bfseries#1}}\hfill #2 \par% Section title and relevant links
    \vspace{-.5\baselineskip}
    \rule{\textwidth}{.4pt}% Horizontal line
    \sectionlineskip%
}{}

\begin{rSection}{Projects}{LinkToGitHub}
    wombat
\end{rSection}
\end{document}

相关内容