Working with margins

presumably you're redacting for someone else.

is there a publisher involved? does the publisher have a preferred style? that's the first consideration.

if no guidance there, look at the "item labels". how wide are they relative to the margin? it's not a good idea to get too close either to the outside edge (where something might get cut off) or to the binding (where something might be obscured). if they're really wide, would it be permissible to set them on multiple lines (being careful to align the top baselines), and what do you do if the number of lines required by the label is greater than the number of lines in the text?

if you consider setting everything within the main text block, you still need to consider the width of the labels, as what you do will affect the width of the area available for the text. again, with wide labels, do you look at a multi-line approach (as for the in-the-margin case) or do you just decide on a decent width for the text, and, if any label is wider than the available space, let it encroach on the text area, and start the actual text on a new line?

this is pretty subjective, and i'd start by looking for the "worst case" in the job. (there may be several "worst cases" -- the absolute widest label; a wide label with short text; labels just wide enough to make the decision about how much space to leave between label and text a nasty one.) if you can handle those successfully, the rest should be relatively straightforward.

one thing i would recommend though is that (as you point out) a uniform approach throughout the job will produce a more professional looking result than something that can be perceived as random.


One way to get what you want (second option) is to define the environment with an argument that contains the widest entry:

\newlength{\xdescwd}
\newenvironment{xdesc}[1]
  {\settowidth{\xdescwd}{\textbf{#1:}}%
   \begin{description}[leftmargin=\dimexpr\xdescwd+.5em\relax,
     labelindent=0pt,labelsep=.5em,
     labelwidth=\xdescwd,align=right]}
  {\end{description}}

Here's the complete example

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[shortlabels]{enumitem}
\usepackage{graphicx}
\usepackage{pifont}
\usepackage{titlesec}
\usepackage[spanish]{babel}

\newlength{\xdescwd}
\newenvironment{xdesc}[1]
  {\settowidth{\xdescwd}{\textbf{#1:}}%
   \begin{description}[leftmargin=\dimexpr\xdescwd+.5em\relax,
     labelindent=0pt,labelsep=.5em,
     labelwidth=\xdescwd,align=right]}
  {\end{description}}

\setlist[enumerate]{itemsep=-1mm}
\setlist[itemize]{itemsep=-1mm}

\begin{document}

En un contexto determinado, las palabras poseen, además de su significado literal, también una dimensión intencional. Un texto es la manifestación lingüística de la intención del emisor dirigida a un receptor. Si consideramos, pues, los actos ilocutivos implicados, un texto cumplirá funciones diferentes.

La función textual es el efecto de los textos en una situación comunicativa según los objetivos que queremos alcanzar. Un texto puede desempeñar las siguientes funciones:

\begin{xdesc}{Representativa}% argument is the widest label
\item[Representativa:] llamada también asertiva, cuando se afirma o se anuncia algo que se considera verdadero.
\item[Informativa:] cuando se presenta algo de manera neutra, sin énfasis que pueda denotar emotividad, como por ejemplo un titular de una noticia.
\item[Prescriptiva:] cuando se establecen normas. En la legislación, por ejemplo, se emplean formas modales deónticas (deber + infinitivo) para expresar una orden.
\item[Persuasiva:] cuando se trata de convencer al interlocutor
\item[Comisiva:] cuando se promete, jura, ofrece, etc.
\item[Fática:] cuando el emisor se centra en el interlocutor y procura mantener el contacto con él, como por ejemplo “Oye…”
\item[Expresiva:] cuando el emisor se alegra, agradece, felicita.
\end{xdesc}

\end{document}

enter image description here


With a two-pass approach one can avoid guessing at the widest label:

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[shortlabels]{enumitem}
\usepackage[spanish]{babel}

\newlength{\xdescwd}
\usepackage{environ}
\makeatletter
\NewEnviron{xdesc}{%
  \setbox0=\vbox{\hbadness=\@M \global\xdescwd=0pt
    \def\item[##1]{%
      \settowidth\@tempdima{\textbf{##1}:}%
      \ifdim\@tempdima>\xdescwd \global\xdescwd=\@tempdima\fi}
  \BODY}
  \begin{description}[leftmargin=\dimexpr\xdescwd+.5em\relax,
    labelindent=0pt,labelsep=.5em,
    labelwidth=\xdescwd,align=left]\BODY\end{description}}
\makeatother

\begin{document}

En un contexto determinado, las palabras poseen, además de su significado literal, también una dimensión intencional. Un texto es la manifestación lingüística de la intención del emisor dirigida a un receptor. Si consideramos, pues, los actos ilocutivos implicados, un texto cumplirá funciones diferentes.

La función textual es el efecto de los textos en una situación comunicativa según los objetivos que queremos alcanzar. Un texto puede desempeñar las siguientes funciones:

\begin{xdesc}
\item[Representativa:] llamada también asertiva, cuando se afirma o se anuncia algo que se considera verdadero.
\item[Informativa:] cuando se presenta algo de manera neutra, sin énfasis que pueda denotar emotividad, como por ejemplo un titular de una noticia.
\item[Prescriptiva:] cuando se establecen normas. En la legislación, por ejemplo, se emplean formas modales deónticas (deber + infinitivo) para expresar una orden.
\item[Persuasiva:] cuando se trata de convencer al interlocutor
\item[Comisiva:] cuando se promete, jura, ofrece, etc.
\item[Fática:] cuando el emisor se centra en el interlocutor y procura mantener el contacto con él, como por ejemplo “Oye…”
\item[Expresiva:] cuando el emisor se alegra, agradece, felicita.
\end{xdesc}

\end{document}

This actually requires typesetting the environment twice: one for gathering the label widths, the second time for the real typesetting.


I decided for the second option. My reasons are that (1) the margins would be too narrow for long labels to fit and (2) the first option would look ugly.

Using the second solution from egreg's answer, then this scheme in Marco Daniel's answer with the add of this page, without forgetting some tweaking, I came up with a solution:

\documentclass[12pt]{article}
\usepackage[a4paper, margin=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[shortlabels]{enumitem}
\usepackage{graphicx}
\usepackage{pifont}
\usepackage{titlesec}

\newenvironment{xdesc}[0]
  {\begin{description}[leftmargin=4cm,
     labelindent=0pt,labelsep=1cm,
     labelwidth=3cm,align=right]}
  {\end{description}}

\setlist[enumerate]{itemsep=-1mm}
\setlist[itemize]{itemsep=-1mm}

\begin{document}

En un contexto determinado, las palabras poseen, además de su significado literal, también una dimensión intencional. Un texto es la manifestación lingüística de la intención del emisor dirigida a un receptor. Si consideramos, pues, los actos ilocutivos implicados, un texto cumplirá funciones diferentes.

La función textual es el efecto de los textos en una situación comunicativa según los objetivos que queremos alcanzar. Un texto puede desempeñar las siguientes funciones:

\begin{xdesc}
\item[Representativa:] llamada también asertiva, cuando se afirma o se anuncia algo que se considera verdadero.
\item[Informativa:] cuando se presenta algo de manera neutra, sin énfasis que pueda denotar emotividad, como por ejemplo un titular de una noticia.
\item[Prescriptiva:] cuando se establecen normas. En la legislación, por ejemplo, se emplean formas modales deónticas (deber + infinitivo) para expresar una orden.
\item[Persuasiva:] cuando se trata de convencer al interlocutor
\item[Comisiva:] cuando se promete, jura, ofrece, etc.
\item[Fática:] cuando el emisor se centra en el interlocutor y procura mantener el contacto con él, como por ejemplo “Oye…”
\item[Expresiva:] cuando el emisor se alegra, agradece, felicita.
\end{xdesc}

\end{document}

which produces the following output:

output

I have still problems because the first item crosses the margin line and the item-explanations are too spaced, but it's a start.

Tags:

Margins