Me gustaría generar una lista de "Objetivos" (1,2,3...etc) como \item
etiqueta, con el texto del objetivo ubicado al lado (con \hspace{Xmm}
). Para elementos que exceden el ancho de la línea, la alineación de la segunda línea no es deseable. Me gustaría que quedara al ras.
Esto es lo que tengo hasta ahora:
\documentclass{article}
\usepackage{enumitem}
\usepackage[top=1in, bottom=1.5in, left=1in, right=1in]{geometry}
\begin{document}
\begin{itemize}[leftmargin=*,align=left]
\item[Aim 1] \hspace{10mm} This aim fits nicely on to a single line.
\item[Aim 2] \hspace{10mm} Unfortunately, the details of this aim are such that they will not fit on to a single line. Instead, the text aligns strangely beneath the "Aim 2" item label :(
\end{itemize}
\end{document}
Anteriormente intenté esto con tabbing
, que se acercó mucho al resultado deseado, sin embargo, el segundo objetivo no se ajustaba al ancho de la página:
\documentclass{article}
\usepackage{enumitem}
\usepackage[top=1in, bottom=1.5in, left=1in, right=1in]{geometry}
\begin{document}
\begin{tabbing}
\= \hspace{20mm} \= \\
\> {\bf Aim 1:} \> This aim fits nicely on to a single line.\\[10pt]
\> {\bf Aim 2:} \> Unfortunately, the details of this aim are such that they willnot fit on to a single line. Instead, the text aligns strangely beneath the "Aim 2" item label :(
\end{tabbing}
\end{document}
Muchas gracias de antemano por cualquier ayuda/consejos.
Respuesta1
Otra opción sería utilizar elenumitem
paquete para definir una nueva lista que tenga el diseño deseado (la showframe
opción para geometry
solo se usó como guía visual):
\documentclass{article}
\usepackage{enumitem}
\usepackage[showframe]{geometry}
\newlist{aims}{enumerate}{1}
\setlist[aims,1]{
label={Aim~\arabic*},
leftmargin=*,
align=left,
labelsep=10mm,
itemindent=\dimexpr\labelsep+\labelwidth+7pt\relax
}
\begin{document}
\begin{aims}
\item This aim fits nicely on to a single line.
\item The details of this aim are such that they will not fit on to a single line. Now the text aligns with the margin.
\item This aim fits nicely on to a single line.
\item The details of this aim are such that they will not fit on to a single line. Now the text aligns with the margin.
\end{aims}
\end{document}
Como no estaba seguro de la alineación deseada, aquí hay otra posibilidad:
\documentclass{article}
\usepackage{enumitem}
\usepackage[showframe]{geometry}
\newlist{aims}{enumerate}{1}
\setlist[aims,1]{
label={Aim~\arabic*},
leftmargin=*,
align=left,
labelsep=10mm,
}
\begin{document}
\begin{aims}
\item This aim fits nicely on to a single line.
\item The details of this aim are such that they will not fit on to a single line. Now the text aligns with the margin.
\item This aim fits nicely on to a single line.
\item The details of this aim are such that they will not fit on to a single line. Now the text aligns with the margin.
\end{aims}
\end{document}
Respuesta2
No estoy seguro exactamente de lo que quieres, pero aquí tienes un intento:
\documentclass{article}
\newcounter{myenumi}
\renewcommand{\themyenumi}{(\roman{myenumi})}
\newenvironment{myenumerate}{%
% stuff for beginning of environment goes here
\setlength{\parindent}{0pt}% don't indent paragraphs
\setcounter{myenumi}{0}% restart numbering
\bigskip% skip a line
\renewcommand{\item}{% new definition of item
\par% start a new line
\refstepcounter{myenumi}% advance counter
\makebox[2.5em][l]{\themyenumi}% print counter to width of 3em, aligned to left
}% end of definition of item
}{% at end of environment
\par% start new paragraph
\bigskip% skip a line
\noindent% don't indent new paragraph
\ignorespacesafterend% ignore spaces after environment
}
\pagestyle{empty}
\begin{document}
\noindent Here is some regular text, and I'm going to go on a bit just to see where it wraps and all that.
\begin{myenumerate}
\item Here is the first item which goes on a bit so we can see how it wraps, and it still needs to be longer.
\item Here is another item.
\item Here is yet another item.
\item And this item is going to be much much longer so we can see another example of one that wraps.
\end{myenumerate}
Here is some more regular text, and let's go on a bit here too, just in case it's important how that looks too.
\end{document}
PD: No recuerdo de dónde saqué este código originalmente, pero no es mío. (Si puedes reconocer esto como algo que has escrito o sabes quién lo ha escrito, házmelo saber; luego borraré mi respuesta y te dejaré publicarla).