# [Tex/LaTex] Aligned \description

descriptionhorizontal alignment

### Code

\documentclass[a4paper,twoside,12pt]{book}
\usepackage[utf8]{inputenc}

\begin{document}
\noindent Let us define:
\begin{description}
\item[$C_{DEP}$] (\euro) depreciation of the machine.
\item[$C_{EN}$] (\euro) energy cost.
\item[$CE$] (\euro /year) energy cost per year.
\item[$CMAT_{(W \geq W_L)}$] (\euro\textcentoldstyle) cost of raw material regarding the conforming'' packages.
\item[$CMAT_{(W < W_L)}$] (\euro\textcentoldstyle) cost of raw material regarding the non conforming'' packages.
\item[$CS$] (\euro\textcentoldstyle) cost of sorting.
\item[$CP$] (\euro\textcentoldstyle) cost of the packaging material.
\item[$c_{pack}$] (\euro /kg) cost of the packaging material per kilogram.
\item[$c_u$] (\euro\textcentoldstyle/g) cost of the raw material per gram.
\item[$\delta$] dummy variable to consider both rework and scrap packages.
\item[$DEP$] (\euro /year) depreciation of the machine per year.
\item[$E(W|W \geq W_L)$] (g/package) expected weight value of the conforming'' packages.
\item[$E(W|W < W_L)$] (g/package) expected weight value of the non conforming'' packages.
\item[$LAB$] (\euro /h) labor cost per hour.
\item[$n_B$] number of conforming'' packages.
\item[$P$] number of packages produced in a specific time interval.
\item[$Q_{pack}$] (kg/package) quantity of the packaging material per package.
\item[$t$] (hours/package) production time.
\item[$W$] (g/package) quantity of product delivered in each package, it can be modeled as a random variable with an unknown distribution.
\item[$W_L$]              (g/package) legal weight of the package. The tolerable negative error in the contents of a prepackage is fixed in accordance with the table below:

\begin{table}[htbp]
\captionsetup{font=small} % Set the caption font size
\begin{center}
\begin{tabular}{cc | cc}

\toprule
\multicolumn{2}{c}{$W_T$ in \si{\gram} or \si{\ml}} & \multicolumn{2}{|c}{Tolerable negative error}\\
\midrule
from    &   to              &   as \% of $W_T$  &     \si{\gram} or \si{\ml}\\
\midrule
5       &   50              &   9               &   -       \\
50      &   100             &   -               &   4.5     \\
100     &   200             &   4.5             &   -       \\
200     &   300             &   -               &   9       \\
300     &   500             &   3               &   -       \\
500     &   1000            &   -               &   15      \\
1000    &   \num{10000}     &   1.5             &   -       \\
\bottomrule

\end{tabular}
\vspace{5pt} % a little space to shift the caption down
\caption{tolerable negative error}
\label{tab:legislation}
\end{center}
\end{table}
\item[$W_T$] (g) Target weight value of a package.
\item[$TI$] (s) time used to take care of the non conforming'' packages.
\item[$WH$] (hours/year) working hours of the machine per year.

\end{description}
\end{document}


### Question

Is there any easy way to align symbols, Units of measurement and descriptions? I'd like to avoid using tables to align. I'd like something like:

SYMBOL    (Units)    Long long long long long long long long long long long long long
SYMBOL_2  (Units)    Long long long long long long long long long long long long long
Long long long long long long long long long long long long long


This possible solution utilizes the technique introduced in Description list with aligned descriptions and define a macro called abox box of 3cm length, with left alignment, for the symbols, so that a second column alignment is established.

Code

\documentclass[a4paper,twoside,12pt]{book}
\usepackage[margin=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{eurosym,booktabs}
%\usepackage{amsmath,amssymb,latexsym}
\usepackage{textcomp,siunitx,caption}
\usepackage{calc}
\usepackage{enumitem}

\def\abox#1{\leavevmode\hbox to 3cm{#1\ \hfill}}

\begin{document}

\noindent Let us define:
\begin{description}[leftmargin=6.2cm,labelwidth=\widthof{$E(W|W < W_L)$}]
\item[$C_{DEP}$]  \abox{(\euro)} depreciation of the machine.
\item[$C_{EN}$]   \abox{(\euro)}  energy cost.
\item[$CE$]       \abox{(\euro/year)} energy cost per year.
\item[$CMAT_{(W \geq W_L)}$] \abox{(\euro\textcentoldstyle)} cost of raw material regarding the conforming'' packages.
\item[$CMAT_{(W < W_L)}$]    \abox{(\euro\textcentoldstyle)} cost of raw material regarding the non conforming'' packages.
\item[$CS$]       \abox{(\euro\textcentoldstyle)} cost of sorting.
\item[$CP$]       \abox{(\euro\textcentoldstyle)} cost of the packaging material.
\item[$c_{pack}$] \abox{(\euro /kg)} cost of the packaging material per kilogram.
\item[$c_u$]      \abox{(\euro\textcentoldstyle/g)} cost of the raw material per gram.
\item[$\delta$]   \abox{} dummy variable to consider both rework and scrap packages.
\item[$DEP$]      \abox{(\euro /year)} depreciation of the machine per year.
\item[$E(W|W \geq W_L)$]\abox{(g/package)} expected weight value of the conforming'' packages.
\item[$E(W|W < W_L)$]   \abox{(g/package)} expected weight value of the non conforming'' packages.
\item[$LAB$]      \abox{(\euro /h)} labor cost per hour.
\item[$n_B$]      \abox{} number of conforming'' packages.
\item[$P$]        \abox{} number of packages produced in a specific time interval.
\item[$Q_{pack}$] \abox{(kg/package)} quantity of the packaging material per package.
\item[$t$]        \abox{(hours/package)} production time.
\item[$W$]        \abox{(g/package)} quantity of product delivered in each package, it can be modeled as a random variable with an unknown distribution.
\item[$W_L$]      \abox{(g/package)} legal weight of the package. The tolerable negative error in the contents of a prepackage is fixed in accordance with the table below:

\begin{table}[htbp]
\captionsetup{font=small} % Set the caption font size
\begin{center}
\begin{tabular}{cc | cc}

\toprule
\multicolumn{2}{c}{$W_T$ in \si{\gram} or \si{\ml}} & \multicolumn{2}{|c}{Tolerable negative error}\\
\midrule
from    &   to              &   as \% of $W_T$  &     \si{\gram} or \si{\ml}\\
\midrule
5       &   50              &   9               &   -       \\
50      &   100             &   -               &   4.5     \\
100     &   200             &   4.5             &   -       \\
200     &   300             &   -               &   9       \\
300     &   500             &   3               &   -       \\
500     &   1000            &   -               &   15      \\
1000    &   \num{10000}     &   1.5             &   -       \\
\bottomrule

\end{tabular}
\vspace{5pt} % a little space to shift the caption down
\caption{tolerable negative error}
\label{tab:legislation}
\end{center}
\end{table}
\item[$W_T$] \abox{(g)} Target weight value of a package.
\item[$TI$]  \abox{(s)} time used to take care of the non conforming'' packages.
\item[$WH$]  \abox{(hours/year)} working hours of the machine per year.
\end{description}
\end{document}