Text FormattingMaking an environment for examples and propositions

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sleft
Posts: 16
Joined: Fri Nov 12, 2010 4:19 pm

Making an environment for examples and propositions

Post by Sleft »

I'm looking for a way to make an environment which when given no argument gives an enumeration such as
(1) Bla bla
(2) Bla bla
(a) Bla bla
(b) Bla bla
(i) Bla bla
(ii) Bla bla
(3) Bla bla
where a \ref to ii prints (2aii). When the environment is used with an argument and if the argument string starts with "\ref" it gives (if the argument is "\ref{bla} which prints T") the following list
(T$_1$)
(T$_2$)
(a)
(b)
(i)
(ii)
(T$_3$)
where a \ref to ii prints (T$_2$aii). And if the argument string is anything else (for instance "T") gives the following list
(T)
(a)
(b)
(i)
(ii)
where a \ref to ii prints (Taii). Also if arguments for the environment is used it adds the list items to an index so a list of them and the page they appear on can be printed. For the labels not set by hand, every label except T and T$_n$ in my example, every first level label should automatically use enumitems resume option. So if i use the enivorment again its first level start where it stopped counting on last use. So if I use it now it should continue from the first example since it's the only one with unmodified first level labels, such as:
(4)
(5)
(a)
(b)
(i)
(ii)
(6)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply