开发者

align-like environment in LaTeX for lines of texts

I am looking for a LaTeX environment, that is capable of formatting given paragraph(s) with a slight indentation and increasing line counters within parenthesis, e.g.:

(1) Lorem Ipsum

(2) Dolor Sit

These numbers should continue to increase throughout the document, i.e. there should be no number used twice. It would behave almost like the align environment- including the possibility to \ref to ind开发者_开发百科ividual lines, except that I do not wish to use it for math but rather for text snippets.

Unfortunately, I am not that LaTeX savvy, so I cannot really define such an environment myself.


Is this what you're looking for?

\documentclass{article}
\usepackage{lipsum} % just for blind text
\usepackage{enumitem}
\newlist{masterlist}{enumerate}{1}
\setlist[masterlist]{label=(\arabic*),resume}


\begin{document}

\lipsum[1]

\begin{masterlist}
\item foo
\item bar
\end{masterlist}

\lipsum[2-3]

\begin{masterlist}
\item baz
\item boo
\end{masterlist}

\end{document}


In fact you want an enumerate list with number in a non default presentation. An easy way for this is the enumerate package:

\documentclass{article}
\usepackage{enumerate}
\begin{document}
  \begin{enumerate}[(1)]
  \item test1
  \item test2
  \end{enumerate}
\end{document}


You could use the align environment (or other math-based environments) and typeset your text using \text{...}. Example:

\begin{equation}\label{mylabel}
    \text{Numbered like an equation, typeset like text.}
\end{equation}

Beware, though, that this is only suitable for short snippets of text, since you are, after all, inside a math environment, so there's no automatic line wrapping.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜