5

I have a description like below. The main issue is if the text is to long it runs underneath the beginning.

\begin{description}
    \item[Languages:] C, C++,Python, Ruby, Shell Scripting (Bash), JavaScript, PHP, Ruby On Rails. Java, C\#, X86, MIPS, Lisp, Standard ML, Scheme, XML, HTML
    \item[OS:] Windows, Ubuntu, Mint, Fedora, AIX, UNIX
\end{description}

What happens is the end of the languages item goes under "Languages". It starts about right in the middle. I want it to go and start right under C. I desire it to look like so

Languages: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
           AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
           AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

not

Languages: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
      AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

MWE

\documentclass[11pt]{article}

\usepackage{url,fancyhdr}
\usepackage{enumitem}

\begin{document}
\newcommand{\marginhead}[1]    {  \marginpar{\textsf{{\footnotesize\vspace{-1em}\flushright #1}}}}

\def\ind{\hangindent=1 true cm\hangafter=1 \noindent}

\def\labelitemi{~}
\renewcommand{\labelitemii}{~}

\reversemarginpar

\marginhead{{\vskip 0.3em}Entertainment}
\medskip

\begin{description}[align=right,labelindent=!]
\addtolength{\itemsep}{-0.5\baselineskip}
\item[Sports:] Football, Baseball, Soccer, Rugby, Tennis, Basketball, badminton, swimming, track and field, diving, 
\item[Television Shows:] The Sopranos, The price is right, Dr. Phil, Dexter, CSI, CSI New York, CSI Miami, Las Vegas, Breaking Bad, LA Law, Law and Order.
\end{description}

\end{document}

2 Answers 2

2

I find the package eqlist to be very helpful for such instances. The code given by hpesoj626 can be rewritten as

\documentclass{article}

\usepackage{lipsum}
\usepackage{eqlist}

\begin{document}
\begin{eqlist}
    \item[Languages:] C, C++,Python, Ruby, Shell Scripting (Bash), JavaScript, PHP, Ruby On Rails. Java, C\#, X86, MIPS, Lisp, Standard ML, Scheme, XML, HTML
    \item[OS:] Windows, Ubuntu, Mint, Fedora, AIX, UNIX
    \item[lipsum:] \lipsum[1]
\end{eqlist}
\end{document}
2
  • Welcome to TeX.sx! When compiling the (completely different MWE) provided by OP, use \longitem for Telivision shows.
    – hpesoj626
    Jan 12, 2013 at 1:55
  • This version worked well.
    – Bobdul
    Jan 25, 2013 at 3:55
7

Will this do for you?

Code

%http://tex.stackexchange.com/questions/91122/uniform-indent-on-description
\documentclass{article}

\usepackage{lipsum}
\usepackage{enumitem}

\begin{document}
\begin{description}[align=right,labelindent=!]
    \item[Languages:] C, C++,Python, Ruby, Shell Scripting (Bash), JavaScript, PHP, Ruby On Rails. Java, C\#, X86, MIPS, Lisp, Standard ML, Scheme, XML, HTML
    \item[OS:] Windows, Ubuntu, Mint, Fedora, AIX, UNIX
    \item[lipsum:] \lipsum[1]
\end{description}
\end{document}

Output

enter image description here

For the MWE provided: 2013/01/12

I don't know what you are using the difinition of \labelitemi and \labelitemii so I removed them from the solution below. With enumitem you can use the option leftmargin=<length> to manually set up the horizontal distance from the left margin. You can replace 1.75\marginparwidth with a length you prefer, say 1.5in. I just included the showframe option to geometry package so that you can see the borders for the margins.

\documentclass[11pt]{article}

\usepackage[showframe]{geometry}
\usepackage{url,fancyhdr}
\usepackage{enumitem}
\usepackage{lipsum}

\newcommand{\marginhead}[1]{\marginpar{\textsf{{\footnotesize\vspace{-1em}\flushright #1}}}}

\reversemarginpar

\begin{document}

\marginhead{{\vskip 0.3em}Entertainment}
\medskip

\begin{description}[align=right,labelindent=!,leftmargin=1.75\marginparwidth]
%\addtolength{\itemsep}{-0.5\baselineskip}
\item[Sports:] Football, Baseball, Soccer, Rugby, Tennis, Basketball, badminton, swimming, track and field, diving, 
\item[Television Shows:] The Sopranos, The price is right, Dr. Phil, Dexter, CSI, CSI New York, CSI Miami, Las Vegas, Breaking Bad, LA Law, Law and Order.
\item[Languages:] C, C++,Python, Ruby, Shell Scripting (Bash), JavaScript, PHP, Ruby On Rails. Java, C\#, X86, MIPS, Lisp, Standard ML, Scheme, XML, HTML
\item[OS:] Windows, Ubuntu, Mint, Fedora, AIX, UNIX
\item[lipsum:] \lipsum[1]
\end{description}

\end{document}
7
  • Doesn't seem to work. It first complains like so ! Missing number, treated as zero. <to be read again> ! l.199 ...n{description}[align=right,labelindent=!] If I add a number in where ! is it just shifts over the entire item lines
    – Bobdul
    Jan 10, 2013 at 3:33
  • @Bobdul Can you put \listfiles in your preamble and look at your .log file to see the versions of packages you are running? I run this with enumitem 2011/09/28 v.3.5.2. What operating system are you using anyway?
    – hpesoj626
    Jan 10, 2013 at 3:38
  • I am using Ubuntu 12.04. Seems I have an older version enumitem.sty 2009/05/18 v2.2 Customized lists
    – Bobdul
    Jan 10, 2013 at 5:05
  • I suggest you install TeXLive 2012. See this post on how to install Vanilla TeXLive 2012: tex.stackexchange.com/questions/1092/…. There is also a post in askubuntu: askubuntu.com/questions/163682/…. As for installing individual packages. See also this post if you want to install individual packages from CTAN: tex.stackexchange.com/questions/73016/…
    – hpesoj626
    Jan 10, 2013 at 5:32
  • I installed the newest Texlive. one issue I have though is the overall items are being moved over to the left onto the margin. They aren't staying put. Even if I cut the longer lines with \\ the item is still moving over. If I don't use [align=right,labelindent=!] it goes away. Thanks again.
    – Bobdul
    Jan 11, 2013 at 3:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .