| 1 |
# enumsub - Aligned inline sublists for enumitem |
| 2 |
|
| 3 |
## Overview |
| 4 |
|
| 5 |
The `enumsub` package provides seamless integration between `enumitem` and inline sublists with perfect alignment and automatic numbering. It solves the common alignment inconsistencies that occur when trying to combine `enumitem` and `tasks` packages. |
| 6 |
|
| 7 |
## Features |
| 8 |
|
| 9 |
- Perfect alignment of inline sub-items with dynamic label styling |
| 10 |
- Multiple numbering schemes (Roman, alphabetic, Arabic) |
| 11 |
- Customizable spacing and dimensions |
| 12 |
- Easy-to-use semicolon-separated syntax |
| 13 |
- Non-breaking inline layout with consistent spacing |
| 14 |
- Multiple convenience aliases |
| 15 |
- Automatic counter reset at each `\item` |
| 16 |
|
| 17 |
## Quick Start |
| 18 |
|
| 19 |
```latex |
| 20 |
\documentclass{article} |
| 21 |
\usepackage[roman]{enumsub} % Options: roman, alpha, arabic |
| 22 |
|
| 23 |
\begin{document} |
| 24 |
\begin{enumerate} |
| 25 |
\item Main question |
| 26 |
\begin{enumerate} |
| 27 |
\item \enumsub{yes; no; maybe} |
| 28 |
\item \enumsub{option A; option B} |
| 29 |
\end{enumerate} |
| 30 |
\end{enumerate} |
| 31 |
\end{document} |
| 32 |
``` |
| 33 |
|
| 34 |
## Installation |
| 35 |
|
| 36 |
### Manual Installation |
| 37 |
1. Download `enumsub.dtx` and `enumsub.ins` |
| 38 |
2. Run: `latex enumsub.ins` |
| 39 |
3. Move `enumsub.sty` to your LaTeX tree |
| 40 |
4. Run: `texhash` (if using TeX Live) |
| 41 |
|
| 42 |
### Generate Documentation |
| 43 |
```bash |
| 44 |
pdflatex enumsub.dtx |
| 45 |
makeindex -s gind.ist enumsub.idx |
| 46 |
makeindex -s gglo.ist -o enumsub.gls enumsub.glo |
| 47 |
pdflatex enumsub.dtx |
| 48 |
pdflatex enumsub.dtx |
| 49 |
``` |
| 50 |
|
| 51 |
## Package Options |
| 52 |
|
| 53 |
| Option | Description | Example Output | |
| 54 |
|----------|--------------------------------|----------------| |
| 55 |
| `roman` | Roman numerals (default) | (i), (ii), (iii) | |
| 56 |
| `alpha` | Alphabetic numbering | (a), (b), (c) | |
| 57 |
| `arabic` | Arabic numerals | (1), (2), (3) | |
| 58 |
|
| 59 |
## Commands |
| 60 |
|
| 61 |
### Main Command |
| 62 |
- `\enumsub{item1; item2; item3}` - Creates aligned inline sublists |
| 63 |
|
| 64 |
### Aliases |
| 65 |
- `\subparts{...}` - Same as `\enumsub` |
| 66 |
- `\AutoSubpartsAligned{...}` - Same as `\enumsub` |
| 67 |
- `\inlineparts{...}` - Same as `\enumsub` |
| 68 |
|
| 69 |
### Customization |
| 70 |
- `\setenumsublabelwidth{width}` - Adjust label column width |
| 71 |
- `\setenumsubitemwidth{width}` - Adjust item column width |
| 72 |
|
| 73 |
### Predefined Styles |
| 74 |
- `mainq` - Main question style |
| 75 |
- `subq` - Sub-question style |
| 76 |
|
| 77 |
## Examples |
| 78 |
|
| 79 |
### Basic Usage |
| 80 |
```latex |
| 81 |
\begin{enumerate}[label=\textbf{\arabic*.}] |
| 82 |
\item What is your favorite color? |
| 83 |
\begin{enumerate}[label=\textbf{(\alph*)}] |
| 84 |
\item \enumsub{red; blue; green} |
| 85 |
\item \enumsub{yellow; purple} |
| 86 |
\end{enumerate} |
| 87 |
\end{enumerate} |
| 88 |
``` |
| 89 |
|
| 90 |
### With Different Numbering |
| 91 |
```latex |
| 92 |
\usepackage[alpha]{enumsub} |
| 93 |
% Now \enumsub produces (a), (b), (c) instead of (i), (ii), (iii) |
| 94 |
``` |
| 95 |
|
| 96 |
### Custom Spacing |
| 97 |
```latex |
| 98 |
\setenumsublabelwidth{3em} |
| 99 |
\setenumsubitemwidth{2cm} |
| 100 |
\enumsub{longer option 1; longer option 2} |
| 101 |
``` |
| 102 |
|
| 103 |
|
| 104 |
## Problem Solved |
| 105 |
|
| 106 |
This package specifically addresses the alignment issues when combining `enumitem` and `tasks`: |
| 107 |
|
| 108 |
**Before (misaligned):** |
| 109 |
``` |
| 110 |
1. Question |
| 111 |
(a) option 1 option 2 |
| 112 |
↑ misaligned with enumitem labels |
| 113 |
``` |
| 114 |
|
| 115 |
**After (perfectly aligned):** |
| 116 |
``` |
| 117 |
1. Question |
| 118 |
(a) (i) option 1 (ii) option 2 |
| 119 |
↑ perfect alignment maintained |
| 120 |
``` |
| 121 |
|
| 122 |
## Requirements |
| 123 |
|
| 124 |
- LaTeX2e (2020/10/01 or later) |
| 125 |
- `enumitem` package |
| 126 |
- `xparse` package |
| 127 |
- `array` package |
| 128 |
- `etoolbox` package |
| 129 |
|
| 130 |
## Compatibility |
| 131 |
|
| 132 |
- Works with all standard document classes |
| 133 |
- Compatible with `babel` and `polyglossia` |
| 134 |
- Works with `hyperref` |
| 135 |
- Compatible with `beamer` |
| 136 |
|
| 137 |
## Changelog |
| 138 |
|
| 139 |
### Version 1.0 (2025-08-04) |
| 140 |
- Initial release |
| 141 |
- Basic `\enumsub` functionality |
| 142 |
- Package options for numbering styles |
| 143 |
- Customizable spacing |
| 144 |
- Multiple command aliases |
| 145 |
|
| 146 |
## License |
| 147 |
|
| 148 |
This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. |
| 149 |
|
| 150 |
## Support |
| 151 |
|
| 152 |
- **Issues:** [GitHub Issues](https://github.com/srikanth-mk/enumsub-tex/issues) |
| 153 |
- **Email:** [email protected] |
| 154 |
|
| 155 |
## Contributing |
| 156 |
|
| 157 |
Contributions are welcome! Please: |
| 158 |
1. Fork the repository |
| 159 |
2. Create a feature branch |
| 160 |
3. Submit a pull request |
| 161 |
|
| 162 |
## Acknowledgments |
| 163 |
|
| 164 |
This package was inspired by questions on TeX StackExchange about alignment issues between `enumitem` and `tasks` packages. Special thanks to the LaTeX community for identifying this common problem. |
| 165 |
[Stack Exchange Issue](https://tex.stackexchange.com/questions/749213/aligning-the-labels-from-enumerate-and-task) |