Text Formatting ⇒ Attempting to customize the description environment
Attempting to customize the description environment
I am really hoping someone can assist me with this formatting issue. I am attempting to create a template as follows for an itemized list.
(##) 1. Item
The information in the (##) will be numbers that will change at random and the indent is a standard 5 space indent. I would like to enumerate using the 1. portion of the label. I would also like to have the item text appear so that text flowing to the next line would be aligned with the beginning of the item on the first line I would also like to be able to nest these types of items and have them line up appropriately as in the standard enumerate environment. I would also prefer if the (##) and 1. not be bold face. I have experimented with the mdwtools package and with the enumitem package and I am have trouble making either of them work. Does anyone have any suggestions or any code that might do the trick?
Thank you so much for any assistance you can lend.
Sincerely,
Heather
(##) 1. Item
The information in the (##) will be numbers that will change at random and the indent is a standard 5 space indent. I would like to enumerate using the 1. portion of the label. I would also like to have the item text appear so that text flowing to the next line would be aligned with the beginning of the item on the first line I would also like to be able to nest these types of items and have them line up appropriately as in the standard enumerate environment. I would also prefer if the (##) and 1. not be bold face. I have experimented with the mdwtools package and with the enumitem package and I am have trouble making either of them work. Does anyone have any suggestions or any code that might do the trick?
Thank you so much for any assistance you can lend.
Sincerely,
Heather
NEW: TikZ book now 40% off at Amazon.com for a short time.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Attempting to customize the description environment
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Attempting to customize the description environment
Regarding lcg, I could be wrong, but I'd guess that Heather doesn't mean that the numbers will be random, but rather needs to be something that is specified anew for each item in the list, with no predictable pattern.
One might use a list like this, for example, in a formal derivation, to specify which previous lines are hypotheses the current line depends upon, or something like that.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Attempting to customize the description environment
This would be »arbitrary« or »indiscriminate« to me. But we will not know until there is a reaction by the OP. It should be taken into account that in this forum there are not only people with English as their mother tongue. So there should be appropriate explanations if necessary.frabjous wrote:Regarding lcg, I could be wrong, but I'd guess that Heather doesn't mean that the numbers will be random, but rather needs to be something that is specified anew for each item in the list, with no predictable pattern. […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Attempting to customize the description environment
I apologize for the confusion. Those number will not be random. This is a format for homework assignments and those numbers will correspond to the point values for the given problem and thus will be different for each problem, but will be specified. I have attempted to use the mdwlist package in the following fashion:
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{0.75in}}
\item [(25) \hspace{0.12in} 1.] Evaluate the following integrals:
\begin{basedescript}{\desclabelstyle{}\desclabelwidth{0.2in}}
\item [\hspace{0.0cm} (a)] $\ds \int 3x^{2} \sin(2x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (b)] $\ds \int \sin^{2}(3x) \cos^{2}(3x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (c)] $\ds \int_{0}^{\pi} \sin^{3} x \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (d)] $\ds \int \frac{x^{2}}{\sqrt{1-x^{2}}} \, \, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (e)] $\ds \int \frac{2x}{(x+1)(2-x)} \, \, dx$
\end{basedescript}
But as you can see I am having to manage the spacing with brute force and in the following example you can see how the text is not lining up on the second line:
\item [(5) \hspace{0.2in} 2.] The arc length of the function $y=f(x)$ between $x=a$ and $x=b$ is given by
\begin{equation*}
L = \int_{a}^{b} \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Use this to find the arc length of $\ds y=x^3 + \frac{1}{12x}$ between $x=\frac{1}{2}$ and $x=2$.
Any assistance would be enormously appreciated.
Heather
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{0.75in}}
\item [(25) \hspace{0.12in} 1.] Evaluate the following integrals:
\begin{basedescript}{\desclabelstyle{}\desclabelwidth{0.2in}}
\item [\hspace{0.0cm} (a)] $\ds \int 3x^{2} \sin(2x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (b)] $\ds \int \sin^{2}(3x) \cos^{2}(3x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (c)] $\ds \int_{0}^{\pi} \sin^{3} x \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (d)] $\ds \int \frac{x^{2}}{\sqrt{1-x^{2}}} \, \, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (e)] $\ds \int \frac{2x}{(x+1)(2-x)} \, \, dx$
\end{basedescript}
But as you can see I am having to manage the spacing with brute force and in the following example you can see how the text is not lining up on the second line:
\item [(5) \hspace{0.2in} 2.] The arc length of the function $y=f(x)$ between $x=a$ and $x=b$ is given by
\begin{equation*}
L = \int_{a}^{b} \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Use this to find the arc length of $\ds y=x^3 + \frac{1}{12x}$ between $x=\frac{1}{2}$ and $x=2$.
Any assistance would be enormously appreciated.
Heather
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Attempting to customize the description environment
Please do not post useless code snippets but a minimal working example (MWE) instead. Nobody is willing to guess where this basedscript environment comes from. And please use the code environment to tag code as such. For your purpose I would suggest to use the examdesign class or similar classes or packages. There might be other solutions in case this doesn't fit your ideas.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Attempting to customize the description environment
My apologies for not posting the complete working code. I have looked at the examdesign package and it doesn't appear to have what I need. The basedescrip is part of the mdwlist package, but I have also attempted to do this with just the normal description environment. The current working code follows:
\documentclass[12pt]{article}
\textwidth=6.5in
\oddsidemargin=0in
\topmargin=-.75in
\textheight=9in
\thispagestyle{empty}
\usepackage{amsmath, epsfig, pstricks}
\usepackage{mdwlist}
%
\def\ds{\displaystyle}
\def\spc{\vspace{0.3in}}
\begin{document}
\begin{flushleft} \textbf{Homework \#0} \hfill Name:\underline{\hspace{2.5in}} \end{flushleft}
\vspace{-0.22in}
\begin{flushleft} Math 273 \hfill 18 January 2010 \end{flushleft}
\vspace{-0.22in}
\begin{flushleft} Spring 2010 \\ H. Moreland \end{flushleft}
\noindent This homework assignment is due at the beginning of class on Tuesday, January 18th. Please work the problems on clean sheets of paper (no spirals), but use this page as
a cover sheet when you turn it in (stapled). \textbf{I expect your solutions to be written up neatly, showing all steps in a clear fashion using the correct notation. I should not receive a first draft with mistakes and things crossed-out.} You may work together, but please do not discuss the problems with other instructors/professors. The work you turn in must be your own and represent your understanding of the material. The point total for each problem is in the left margin.
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{0.75in}}
\item [(25) \hspace{0.12in} 1.] Evaluate the following integrals:
\begin{basedescript}{\desclabelstyle{}\desclabelwidth{0.2in}}
\item [\hspace{0.0cm} (a)] $\ds \int 3x^{2} \sin(2x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (b)] $\ds \int \sin^{2}(3x) \cos^{2}(3x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (c)] $\ds \int_{0}^{\pi} \sin^{3} x \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (d)] $\ds \int \frac{x^{2}}{\sqrt{1-x^{2}}} \, \, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (e)] $\ds \int \frac{2x}{(x+1)(2-x)} \, \, dx$
\end{basedescript}
\spc
\item [(5) \hspace{0.2in} 2.] The arc length of the function $y=f(x)$ between $x=a$ and $x=b$ is given by
\begin{equation*}
L = \int_{a}^{b} \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Use this to find the arc length of $\ds y=x^3 + \frac{1}{12x}$ between $x=\frac{1}{2}$ and $x=2$.
\spc
\item [(5) \hspace{0.2in} 3.] The area of the surface of revolution by rotating the graph of $y=f(x)$ about the $x-$axis between between $x=a$ and $x=b$ is given by
\begin{equation*}
A = \int_{a}^{b} 2 \pi f(x) \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Apply this formula to $\ds y=sqrt{4+3x}$ between $x=0$ and $x=2$.
\spc
\item [(3) \hspace{0.2in} 4.] $\ds \int \frac{s+10}{(2s-1)(s+3)} \,\,\, ds$
\spc
\item [(4) \hspace{0.2in} 5.] $\ds \int \frac{\sqrt{x^{2}-25}}{x} \,\,\, dx$
\end{basedescript}
\end{document}
Thank you for your time, assistance, and patience. I am still a Latex rookie, but am eager to learn so that I can convert all of my teaching files to Latex rather than having to use MS Word.
Heather
\documentclass[12pt]{article}
\textwidth=6.5in
\oddsidemargin=0in
\topmargin=-.75in
\textheight=9in
\thispagestyle{empty}
\usepackage{amsmath, epsfig, pstricks}
\usepackage{mdwlist}
%
\def\ds{\displaystyle}
\def\spc{\vspace{0.3in}}
\begin{document}
\begin{flushleft} \textbf{Homework \#0} \hfill Name:\underline{\hspace{2.5in}} \end{flushleft}
\vspace{-0.22in}
\begin{flushleft} Math 273 \hfill 18 January 2010 \end{flushleft}
\vspace{-0.22in}
\begin{flushleft} Spring 2010 \\ H. Moreland \end{flushleft}
\noindent This homework assignment is due at the beginning of class on Tuesday, January 18th. Please work the problems on clean sheets of paper (no spirals), but use this page as
a cover sheet when you turn it in (stapled). \textbf{I expect your solutions to be written up neatly, showing all steps in a clear fashion using the correct notation. I should not receive a first draft with mistakes and things crossed-out.} You may work together, but please do not discuss the problems with other instructors/professors. The work you turn in must be your own and represent your understanding of the material. The point total for each problem is in the left margin.
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{0.75in}}
\item [(25) \hspace{0.12in} 1.] Evaluate the following integrals:
\begin{basedescript}{\desclabelstyle{}\desclabelwidth{0.2in}}
\item [\hspace{0.0cm} (a)] $\ds \int 3x^{2} \sin(2x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (b)] $\ds \int \sin^{2}(3x) \cos^{2}(3x) \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (c)] $\ds \int_{0}^{\pi} \sin^{3} x \,\, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (d)] $\ds \int \frac{x^{2}}{\sqrt{1-x^{2}}} \, \, dx$
\vspace{0.1in}
\item [\hspace{0.0cm} (e)] $\ds \int \frac{2x}{(x+1)(2-x)} \, \, dx$
\end{basedescript}
\spc
\item [(5) \hspace{0.2in} 2.] The arc length of the function $y=f(x)$ between $x=a$ and $x=b$ is given by
\begin{equation*}
L = \int_{a}^{b} \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Use this to find the arc length of $\ds y=x^3 + \frac{1}{12x}$ between $x=\frac{1}{2}$ and $x=2$.
\spc
\item [(5) \hspace{0.2in} 3.] The area of the surface of revolution by rotating the graph of $y=f(x)$ about the $x-$axis between between $x=a$ and $x=b$ is given by
\begin{equation*}
A = \int_{a}^{b} 2 \pi f(x) \sqrt{1 + [ f'(x) ] ^{2}} \,\, dx
\end{equation*}
Apply this formula to $\ds y=sqrt{4+3x}$ between $x=0$ and $x=2$.
\spc
\item [(3) \hspace{0.2in} 4.] $\ds \int \frac{s+10}{(2s-1)(s+3)} \,\,\, ds$
\spc
\item [(4) \hspace{0.2in} 5.] $\ds \int \frac{\sqrt{x^{2}-25}}{x} \,\,\, dx$
\end{basedescript}
\end{document}
Thank you for your time, assistance, and patience. I am still a Latex rookie, but am eager to learn so that I can convert all of my teaching files to Latex rather than having to use MS Word.
Heather
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Attempting to customize the description environment
At first, please use the code environment of the forum software when posting longer pieces of source code to keep a post clear.
My first idea was to work out a solution based on your example with the enumitem package to customize the lists and a new command to place the points for each question properly. But this solution seems not to be close enough to what you want. In the meantime I found out that the exam class seems to be what you need. It provides structures that can be handled like the known list environments. This solutions comes very close to your ideas. Further customization of the lists is possible and the class provides many other comfortable stuff. Regarding the setup of page and paper dimensions you should take a look at l2tabu.
My first idea was to work out a solution based on your example with the enumitem package to customize the lists and a new command to place the points for each question properly. But this solution seems not to be close enough to what you want. In the meantime I found out that the exam class seems to be what you need. It provides structures that can be handled like the known list environments. This solutions comes very close to your ideas. Further customization of the lists is possible and the class provides many other comfortable stuff. Regarding the setup of page and paper dimensions you should take a look at l2tabu.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Attempting to customize the description environment
Thank you so much for your assistance! I have been trying different things in the exam document class and I am wondering if there is a way to adjust the settings so that the horizontal left margin will be 1 inch on the entire page? That is, the point values will also have a 1 inch distance from the left of the page.
Thank you again so much for helping to educate me on the best and most current methods for coding in LaTeX.
Heather
Thank you again so much for helping to educate me on the best and most current methods for coding in LaTeX.
Heather
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Attempting to customize the description environment
The class plans to place the points this way. If you are not pleased with that, you should take a deeper look into the manual in order to find out if another placement is possible or do something manually. That could be modifying the concerned code of the class file or building your own structures without using the class. But this would be the original problem and we've come full circle. You may take a look at the CTAN Catalogue [1]. Perhaps there is a class or package that does a better job.moremath wrote:[...] I have been trying different things in the exam document class and I am wondering if there is a way to adjust the settings so that the horizontal left margin will be 1 inch on the entire page? That is, the point values will also have a 1 inch distance from the left of the page. [...]
But with regard to your planned issue of the homework (presumably in about one week or so) I'd say you might run out of time. My solution is all I can offer at the moment (still limited knowledge of TeX internals, limited time to spend, you know). Sometimes you have to accept compromises. But perhaps there is somebody else who can offer help to get exactly the result you desire.
[1] The TeX Catalogue Online, Topic Index - Typesetting Exam Scripts, Quizzes, Flashcards, and Questionnaires
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10