# How to align all description labels with section

I am using this code

\documentclass[paper=a4, paper=portrait, pagesize=auto]{scrartcl}

\usepackage[inline]{enumitem}
\usepackage[table]{xcolor}
\definecolor{orange}{HTML}{FFC296}
\begin{document}
\setlist[description,1]{align=rightbox,labelsep=0pt,leftmargin=0pt}
\section{Student 93b427156c}
\begin{description}
\item[number] 93b4s27156c
\item[name] Note that this analysis of a formative as a pair of sets of features is necessary
to impose an interpretation on an important distinction in language use.
\end{description}
\end{document}


and its giving this output

Is there any way to align all the labels under Student Section not the left side of Section

-
Would you please provide an image of the output you're after, since it's not very clear from your description what you mean by "align all the labels under Student Section"? – Werner May 3 '13 at 5:20

The idea is to use your code, and then to use an additional list (with the help of the changepage package), as a wrapper, to get the desired leftmargin. The newly defined environment mdesc needs to know the widest label, to make the necessary calculations; this longest label must be given as a mandatory argument to the environment:

\documentclass[paper=a4, paper=portrait, pagesize=auto]{scrartcl}
\usepackage[inline]{enumitem}
\usepackage{calc}
\usepackage{changepage}

\setlist[description,1]{labelsep=0pt,leftmargin=0pt}

\newenvironment{mdesc}[1]
{
\begin{description}[before={
\renewcommand\makelabel[1]{%
}

\begin{document}

\section{Student 93b427156c}

\begin{mdesc}{number}
\item[number] 93b4s27156c
\item[name] Note that this analysis of a formative as a pair of sets of features is necessary
to impose an interpretation on an important distinction in language use.
\end{mdesc}

\end{document}


-

I'm not sure how to directly align the paragraph with the section name. Someone else probably will. Instead, here is a way to mock up a similar layout, using longtable. See what you think.

\documentclass[paper=a4, paper=portrait, pagesize=auto]{scrartcl}

\usepackage{longtable}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{graphicx}
\definecolor{orange}{HTML}{FFC296}
\begin{document}

\begin{longtable}[l]{ l l p{10cm}}
\textbf{{\Large 1}} & \multicolumn{2}{l}{\textbf{{\Large Student 93b4s27156c}}} \\[2ex]
& \textbf{number} & 93b4s27156c \\[2ex]
& \textbf{name} & Note that this analysis of a formative as a pair of sets of features is necessary to impose an interpretation on an important distinction in language use.h \\[2ex]
\end{longtable}

%\setlist[description,1]{align=rightbox,labelsep=0pt,leftmargin=0pt}
\section{Student 93b427156c}
\begin{description}
\item[number] 93b4s27156c
\item[name] Note that this analysis of a formative as a pair of sets of features is necessary to impose an interpretation on an important distinction in language use.
\end{description}
\end{document}


And this is the result (with what you originally had, below it.):

-

You have the framework already in place- the only thing to change is the section formatting. The titlesec is very helpful here- the only thing I had to add was

% custom section
\titleformat{\section}
{\normalfont\Large\bfseries}
{\llap{\thesection\hskip.5cm}}
{0pt}
{}


Here's the output

% arara: pdflatex
% !arara: indent: {overwrite: on}
\documentclass{article}

\usepackage[inline]{enumitem}
\usepackage{titlesec}

% custom section
\titleformat{\section}
{\normalfont\Large\bfseries}
{\llap{\thesection\hskip.5cm}}
{0pt}
{}

\begin{document}