8

I am trying to create a CV and for the heading information I am using a minipage to display my name and Curriculum Vitae inline with smaller text containing my contact information.

The code works fine, but I cannot figure out why the left edge of the minipage is indented further than the section heading and text and which come below it.

Any ideas and help would be very appreciate.

Here is the code:

%-------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%-------------------------------------------------------------------
\documentclass[10pt]{article}
\usepackage{array, xcolor, lipsum, bibentry}
\usepackage[
    paper=letterpaper,
    includefoot,            % Uncomment to put page number above margin
    marginparwidth=1in,     % Length of section titles
    marginparsep=.05in,     % Space between titles and text
    margin=1in,         % 1 inch margins
    ]{geometry}

\usepackage{showframe}  

% Shrink spacing around section headings
\usepackage{titlesec}
\titleformat*{\section}{\large\bfseries}
\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}

% Break tables across pages
\usepackage{supertabular}

% Set column sizes and color
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.1225\textwidth}}
\newcolumntype{R}{p{0.81\textwidth}}
\newcolumntype{X}{>{\raggedleft}p{0.05\textwidth}}
\newcolumntype{Y}{p{0.9\textwidth}}

% Commands to simplify starting a table
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\newcommand\smalltab{\begin{supertabular}{L!{\VRule}R}}
\newcommand\medtab{\begin{supertabular}{X!{\VRule}Y}}
\newcommand\longtab{\begin{supertabular}{L!{\VRule}R}}

\begin{document}
%------------------------------------------------------------------- 
% NAME AND CONTACT INFO
%-------------------------------------------------------------------

\begin{minipage}[b]{0.65\textwidth}
\begin{flushleft}
    \Huge{\textsc{Here is my name\\}}
    \Large{Curriculum Vitae}
\end{flushleft} 
\end{minipage}
\begin{minipage}[b]{0.35\textwidth}
    \small{Street Address\\
    City, State 12345\\
    emailaddress@gmail.com\\
    www.website.com\\
    1-555-555-5551}
\end{minipage}

%-------------------------------------------------------------------
% EDUCATION
%-------------------------------------------------------------------
\section*{Education}
\smalltab
    2011--present & PhD in Stuff, Very Awesome School.\\[2.5pt]
    2009--2011 & Masters in Stuff, Just OK School.\\[2.5pt]
    2004--2008 & Bachelors in Things, Relatively Awesome School.\\
\end{supertabular}

\end{document}  
  • a minipage is positioned line a letter so there is a paragraph indentation before the first and a word-space before the second. Note \small \large etc do not take an argument so the {} are superfluous. – David Carlisle Jan 5 '14 at 20:21
  • 1
    LaTeX doesn't care but using \smalltab ... \end{supertabular} totally obscures the environment nesting in your source which will most likely confuse any syntax highlighting in your editor (and any human readers of the source:-) – David Carlisle Jan 5 '14 at 20:25
  • Certainly confused me! – cfr Jan 5 '14 at 20:58
  • David, thank you very much for your comments and suggestions. Perhaps you can tell, this is my first LaTeX document... I will fix these things. I suppose I was doing the \smalltab things limit the amount of typing (and also to get a hang on creating commands), but you're right, it obscures things a little. – double c Jan 5 '14 at 20:59
6

This avoids the problem, I think:

%-------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%-------------------------------------------------------------------
\documentclass[10pt]{article}
\usepackage{array, xcolor, lipsum, bibentry}
\usepackage[
    paper=letterpaper,
    includefoot,            % Uncomment to put page number above margin
    marginparwidth=1in,     % Length of section titles
    marginparsep=.05in,     % Space between titles and text
    margin=1in,         % 1 inch margins
    ]{geometry}

\usepackage{showframe}

% Shrink spacing around section headings
\usepackage{titlesec}
\titleformat*{\section}{\large\bfseries}
\titlespacing\section{0pt}{12pt plus 4pt minus 2pt}{0pt plus 2pt minus 2pt}

% Break tables across pages
\usepackage{supertabular}

% Set column sizes and color
\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.1225\textwidth}}
\newcolumntype{R}{p{0.81\textwidth}}
\newcolumntype{X}{>{\raggedleft}p{0.05\textwidth}}
\newcolumntype{Y}{p{0.9\textwidth}}

% Commands to simplify starting a table
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}
\newcommand\smalltab{\begin{supertabular}{L!{\VRule}R}}
\newcommand\medtab{\begin{supertabular}{X!{\VRule}Y}}
\newcommand\longtab{\begin{supertabular}{L!{\VRule}R}}

\begin{document}
%-------------------------------------------------------------------
% NAME AND CONTACT INFO
%-------------------------------------------------------------------

\hspace*{-\parindent}%
\begin{minipage}[b]{0.65\textwidth}
\begin{flushleft}
    \Huge{\textsc{Here is my name\\}}
    \Large{Curriculum Vitae}
\end{flushleft}
\end{minipage}%
\begin{minipage}[b]{0.35\textwidth}
    \small{Street Address\\
    City, State 12345\\
    emailaddress@gmail.com\\
    www.website.com\\
    1-555-555-5551}
\end{minipage}

%-------------------------------------------------------------------
% EDUCATION
%-------------------------------------------------------------------
\section*{Education}
\smalltab
    2011--present & PhD in Stuff, Very Awesome School.\\[2.5pt]
    2009--2011 & Masters in Stuff, Just OK School.\\[2.5pt]
    2004--2008 & Bachelors in Things, Relatively Awesome School.\\
\end{supertabular}

\end{document}

Basically, TeX is treating the first minipage as the beginning of a paragraph and indenting it accordingly. Putting in negative space equal to the paragraph indentation fixes the problem:

set minipage left with negative horizontal space equal to paragraph indent

  • 8
    Would it not be simpler to use \noindent? – Charles Staats Jan 5 '14 at 21:01
  • Thanks very much cfr for the explanation of what's going on and the fix! – double c Jan 5 '14 at 21:02
  • Charles, I just tried \noindent and it worked as well. Thanks! – double c Jan 5 '14 at 21:07
  • Indeed, that also works. Whether it is simpler or not I don't know. For me, it is not but that's just habit. Are there any advantages to one method versus the other? – cfr Jan 5 '14 at 21:09
  • 2
    @cfr: As a general rule that does admit exceptions, I tend to assume that commands designed for a particular purpose (such as \noindent for preventing indentation) will be the safest way to accomplish that purpose, since whoever wrote the command may have included subtleties that I would overlook. In this case, I would venture to say that \noindent is more readable and has fewer potential typos than \hspace*{-\parindent}, but I don't know if there are any technical differences in how the two commands behave. – Charles Staats Jan 5 '14 at 21:51
0

Use \noindent:

\noindent
\begin{minipage}[b]{0.65\textwidth}

Thanks Charles Staats

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.