如何明确设置文本的右边距

如何明确设置文本的右边距

在此处输入图片描述

我有兴趣为日期设置右边距2014在同一条线上全国信息学奥林匹克竞赛与其上方的日期垂直对齐并具有相似的格式。

我曾尝试使用\hfill

\item{
  \textbf{National Olympiad of Informatics}
  \hfill{2014}
}

但是正如您可能从上述图片中注意到的那样,文本被推得有点太靠右,从而造成了对齐不一致。

有什么方法可以为单个项目设置右边距吗?有什么方法可以为更多项目通用右边距吗?

代码:

% -------------------------
% Resume in Latex
% Author : Sourabh Bajaj
% Website: https://github.com/sb2nov/resume
% License : MIT
%------------------------

\documentclass[letterpaper,11pt]{article}

\usepackage{latexsym}
\usepackage[empty]{fullpage}
\usepackage{titlesec}
\usepackage{marvosym}
\usepackage[usenames,dvipsnames]{color}
\usepackage{verbatim}
\usepackage{enumitem}
\usepackage[pdftex]{hyperref}
\usepackage{fancyhdr}


\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

% Adjust margins
\addtolength{\oddsidemargin}{-0.375in}
\addtolength{\evensidemargin}{-0.375in}
\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.97\textwidth}{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
    \end{tabular*}\vspace{-5pt}
}

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]}
\newcommand{\resumeSubHeadingListEnd}{\end{itemize}}
\newcommand{\resumeItemListStart}{\begin{itemize}}
\newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

\definecolor{mygray}{gray}{0.35}


%-------------------------------------------
%%%%%%  CV STARTS HERE  %%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}

%----------HEADING-----------------
\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r}
  \textbf{\Large {UHUU SOMBODY}} \\
  \\
    \textcolor{mygray}{\large Curriculum Vitae} &  Email   :  [email protected]\\
    &  Mobile   :   (+40) ..--..--7138 \\
   & Address    :   UK, Southampton Burgess Road, .... .... 
\end{tabular*}


%-----------EDUCATION-----------------
\section{Education}
  \resumeSubHeadingListStart
    \resumeSubheading
      {University of Southampton}{Southampton, UK}
      {Bachelor of Mathematics with Computer Science }{Oct. 2018 -- July. 2021}
      \resumeItemListStart
        \resumeItem{Modules Covered 1st Year}{Programming I \& II, Algorithmics, Calculus, Linear Algebra I \& II, Multivariable Calculus, Statistics, Operational Research I and Mathematical Computing}
      \resumeItemListEnd
    \resumeSubheading
      {Filadelfia Theoretical High School}{Suceava, Romania}
      {Mathematics and Computer Science Diploma with GPA of 9.85/10.0}{2014 -- 2018}
      \resumeItemListStart
              \item{

            \textbf{National Olympiad of Informatics}
            \hfill{2014}

        }
        \resumeItem{National Physics Contest}{\textit{Marin Dacian Bica}, Silver Medal (2015)}
        \item{\textbf{Baccalaureate Diploma} with GPA of 9.41/10.0 (2018)}
      \resumeItemListEnd
  \resumeSubHeadingListEnd


%-----------EXPERIENCE-----------------
\section{Experience}
  \resumeSubHeadingListStart

    \resumeSubheading
      {Center of Excellence in Informatics}{Suceava, Romania}
      {Teaching assistant \& Member}{Dec. 2017}
      \resumeItemListStart
        \resumeItem{Teaching assistant}
          {I helped children aged 13 to 15 achieve great results in Informatics Olympiads, teaching them C++ and OOP in Visual Studio - C\#.}

    \resumeItem{Member}
          {Member of a team (formed by the top 15 high-school students in the county) that developed technology to be presented at the interantional conference \textbf{\textit{Space for Science - Implementing Innovations in Science Education.}} }

      \resumeItemListEnd

  \resumeSubHeadingListEnd


%-----------PROJECTS-----------------
\section{Projects}
  \resumeSubHeadingListStart
    \resumeSubItem{International Young Scientist Conference \textit{Space for Science} - Norway\textit{ (2015)}}
      {Used my knowledge of Physics and Computer Science to build a wind turbine generator from scratch. Developed my social skills and became more aware of contemporary problems such as renewable and suistanable energy.
      }
    \resumeSubItem{Smart Home Simulator in Java\textit{ (2018)}}
      {The  aim  of  this  coursework  was  to  construct  a simulation  of  the energy  consumption --  and energy generation -- of a smart house. Developed my Object Oriented Programming (OOP) concepts The gist of the coursework was to improve our OOP concepts.}
%     \resumeSubItem{Mac Setup}
%       {Book that gives step by step instructions on setting up developer environment on Mac OS.}
  \resumeSubHeadingListEnd

%
%--------PROGRAMMING SKILLS------------
\section{Programming Skills}
 \resumeSubHeadingListStart
 \setlength\itemsep{0.01em}
   \item{
     \textbf{Intermediate}{: C++, Java, C\#}
   }

   \item{
     \textbf{Basic}{: Python, R, HTML5, CSS, MySQL \& Database Management}
   }
   \item{
    \textbf{\textit{Original European Computer Driving License:}}
        \resumeSubHeadingListStart
            \resumeItem{Security for IT Users}{IT User Fundamentals}
            \resumeItem{Advanced Word Processing, Spreadsheets, Database, Presentation}{(\textit{Microsoft Office 2010)}}
        \resumeSubHeadingListEnd
   }
 \resumeSubHeadingListEnd

\section{Linguistic \hfill Certificates}

    \resumeSubHeadingListStart
    \setlength\itemsep{0.01em}
    \item{ 
    \textbf{Romanian} (native language)
    \hfill
    \textbf{Certificate of Language Proficiency}

    }
    \item{
        \textbf{English} (fluent)
        \hfill
        \textbf{Certificate in Advanced English - C1}
    }
    \item{
        \textbf{Italian} (basic phrases and words)
    }
        \item{
        \textbf{German} (beginner)
    }

    \resumeSubHeadingListEnd

\section{Interests}
    \resumeSubHeadingListStart
    \item{ 
        \textbf{Sports}
        \resumeSubHeadingListStart
            \item{Member of Men's second Team of Volleyball - University of Southampton
            \hfill
            \textit{2018 Oct. -- Present}
            }
        \resumeSubHeadingListEnd
    }
    \resumeSubHeadingListEnd

%-------------------------------------------
\end{document}

编辑:如果我增加 \textwidth 的值,就会出现另一个问题,正如@Sigur 在评论中提到的那样。虚线列表中的点会因为奇怪的原因被向上推。您对这个问题有什么解决方案吗?

图像: 点项目列表问题

相关内容