Formatting a question consistently
I'm trying to format my assignment in a question and answer format.
newcommand{question}[2]{textbf{Question #1}\#2\}
This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as
newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}
This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.

formatting
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
|
show 1 more comment
I'm trying to format my assignment in a question and answer format.
newcommand{question}[2]{textbf{Question #1}\#2\}
This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as
newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}
This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.

formatting
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3
Why wouldn't you use theenumerateenvironment?
– David Purton
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things withenumitemand it will work fine.
– David Purton
7 hours ago
|
show 1 more comment
I'm trying to format my assignment in a question and answer format.
newcommand{question}[2]{textbf{Question #1}\#2\}
This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as
newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}
This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.

formatting
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I'm trying to format my assignment in a question and answer format.
newcommand{question}[2]{textbf{Question #1}\#2\}
This command is fine for my intents and purposes. No indentation required. No funny business. I have subquestions however, which require indentations, and I'm not sure how to achieve it in latex. Currently, my subquestion new command is defined as
newcommand{pquestion}[2]{${}^{}qquad$textbf{#1) } #2\}
This works fine when the subquestion is one line, but I want the next line to be aligned with the first line, when it does spill over to the next line.

formatting
formatting
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 7 hours ago
MichaelMichael
1
1
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Michael is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3
Why wouldn't you use theenumerateenvironment?
– David Purton
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things withenumitemand it will work fine.
– David Purton
7 hours ago
|
show 1 more comment
3
Why wouldn't you use theenumerateenvironment?
– David Purton
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things withenumitemand it will work fine.
– David Purton
7 hours ago
3
3
Why wouldn't you use the
enumerate environment?– David Purton
7 hours ago
Why wouldn't you use the
enumerate environment?– David Purton
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things with
enumitem and it will work fine.– David Purton
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things with
enumitem and it will work fine.– David Purton
7 hours ago
|
show 1 more comment
1 Answer
1
active
oldest
votes
David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.
documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}
question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}

Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Michael is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483901%2fformatting-a-question-consistently%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.
documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}
question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}

Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.
add a comment |
David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.
documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}
question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}

Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.
add a comment |
David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.
documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}
question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}

Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.
David Purton's comment solves the problem. Here I only make some developments: using counters to reduce the number of arguments to the question command and use setlist for global settings of subquestions.
documentclass{article}
usepackage[shortlabels]{enumitem}
setlength{parindent}{0pt}
newcounter{question}
newcommandquestion[1]{%
stepcounter{question}
textbf{large Question arabic{question}}par#1par}
setlist[enumerate,1]{{bfseries a)}}
usepackage{lipsum}
begin{document}
question{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibu-lum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris.}
begin{enumerate}
item Pellentesque habitant morbi tristique senectus et ne-tus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metusrhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eutellus sit amet tortor gravida placerat.
item Integer sapien est, iaculis in, pretiumquis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aeneanfaucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur-abitur auctor semper nulla
end{enumerate}
question{Calculate the value of $1+1$?}
begin{enumerate}
item Hence, calculate the value of $1+2$.
item Is $2$ the only sum of $1$ and $1$? Give an explanation.
end{enumerate}
end{document}

Nevertheless, please check out some available classes and packages for exam papers (I don't use them often though, so I can't provide anything here). They are much more customizable.
answered 7 hours ago
JouleVJouleV
11.9k22561
11.9k22561
add a comment |
add a comment |
Michael is a new contributor. Be nice, and check out our Code of Conduct.
Michael is a new contributor. Be nice, and check out our Code of Conduct.
Michael is a new contributor. Be nice, and check out our Code of Conduct.
Michael is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483901%2fformatting-a-question-consistently%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Why wouldn't you use the
enumerateenvironment?– David Purton
7 hours ago
Don't use \ for that purpose!
– JouleV
7 hours ago
@DavidPurton Yes, an enumerate might work. but my whole document will be in a big enumerate environment at that point, and I'm not 100% sure how I feel about that. Whatever works though, right?
– Michael
7 hours ago
@Michael It will definitely work with a long document.
– JouleV
7 hours ago
I wouldn't worry about big enumerate environments. You can customise things with
enumitemand it will work fine.– David Purton
7 hours ago