LaTeX Exam package: Align choices with oneparchoices

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












4















I'm a fairly new LaTeX user, so please excuse me if this is a simple newbie question.



I am using the exam package to create, well, an exam. I use both the choices and oneparchoices environments and I would like them to be aligned instead of the choices ones being far more indented. This MWE should illustrate my point:



documentclassexam

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


This is what I get.



I'm sure the more experienced users can solve this easily, but I'm stuck.










share|improve this question
























  • did you try the noindent command after beginchoice?

    – Yorgos
    Jan 18 at 8:21












  • @Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

    – Martin Scharrer
    Jan 18 at 8:50











  • @Yorgos. Yes, I tried that. Should have mentioned it.

    – andhewoulddarkenthememory
    Jan 18 at 9:04















4















I'm a fairly new LaTeX user, so please excuse me if this is a simple newbie question.



I am using the exam package to create, well, an exam. I use both the choices and oneparchoices environments and I would like them to be aligned instead of the choices ones being far more indented. This MWE should illustrate my point:



documentclassexam

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


This is what I get.



I'm sure the more experienced users can solve this easily, but I'm stuck.










share|improve this question
























  • did you try the noindent command after beginchoice?

    – Yorgos
    Jan 18 at 8:21












  • @Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

    – Martin Scharrer
    Jan 18 at 8:50











  • @Yorgos. Yes, I tried that. Should have mentioned it.

    – andhewoulddarkenthememory
    Jan 18 at 9:04













4












4








4








I'm a fairly new LaTeX user, so please excuse me if this is a simple newbie question.



I am using the exam package to create, well, an exam. I use both the choices and oneparchoices environments and I would like them to be aligned instead of the choices ones being far more indented. This MWE should illustrate my point:



documentclassexam

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


This is what I get.



I'm sure the more experienced users can solve this easily, but I'm stuck.










share|improve this question
















I'm a fairly new LaTeX user, so please excuse me if this is a simple newbie question.



I am using the exam package to create, well, an exam. I use both the choices and oneparchoices environments and I would like them to be aligned instead of the choices ones being far more indented. This MWE should illustrate my point:



documentclassexam

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


This is what I get.



I'm sure the more experienced users can solve this easily, but I'm stuck.







indentation exam






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 18 at 8:44









AboAmmar

33.6k22883




33.6k22883










asked Jan 18 at 8:07









andhewoulddarkenthememoryandhewoulddarkenthememory

233




233












  • did you try the noindent command after beginchoice?

    – Yorgos
    Jan 18 at 8:21












  • @Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

    – Martin Scharrer
    Jan 18 at 8:50











  • @Yorgos. Yes, I tried that. Should have mentioned it.

    – andhewoulddarkenthememory
    Jan 18 at 9:04

















  • did you try the noindent command after beginchoice?

    – Yorgos
    Jan 18 at 8:21












  • @Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

    – Martin Scharrer
    Jan 18 at 8:50











  • @Yorgos. Yes, I tried that. Should have mentioned it.

    – andhewoulddarkenthememory
    Jan 18 at 9:04
















did you try the noindent command after beginchoice?

– Yorgos
Jan 18 at 8:21






did you try the noindent command after beginchoice?

– Yorgos
Jan 18 at 8:21














@Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

– Martin Scharrer
Jan 18 at 8:50





@Yorgos: As choices is a list environment noindent will not work. The indention is done using leftmargin not indent.

– Martin Scharrer
Jan 18 at 8:50













@Yorgos. Yes, I tried that. Should have mentioned it.

– andhewoulddarkenthememory
Jan 18 at 9:04





@Yorgos. Yes, I tried that. Should have mentioned it.

– andhewoulddarkenthememory
Jan 18 at 9:04










1 Answer
1






active

oldest

votes


















3














Having a look at the source code of the exam class shows me that the left margin (realized as leftmargin in LaTeX) is set by choices using a hard coded line settowidthleftmarginW.hskiplabelsephskip 2.5em%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).



I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between makeatletter and makeatother, and change the above line to setlengthleftmargin<your prefered length>. I would recommend here 15pt which is the normal parindent. Your can't apparently not use parindent directly as the list environment in choices seems to redefine it.

You also need to change newcommand to renewcommand of course.



documentclassexam

makeatletter
% from exam.cls, line 4107:
renewenvironmentchoices%
listchoicelabel%
usecounterchoicedefmakelabel##1hssllap##1%
setlengthleftmargin15pt%
defchoice%
if@correctchoice
color@endgroup
endgroup
fi
item
do@choice@pageinfo
% choice
defCorrectChoice%
if@correctchoice
color@endgroup
endgroup
fi
ifprintanswers
ifhmode unskipunskipunvboxvoidb@x fi
begingroup color@begingroup @correctchoicetrue
CorrectChoice@Emphasis
fi
item
do@choice@pageinfo
% CorrectChoice
letcorrectchoiceCorrectChoice
labelwidthleftmarginadvancelabelwidth-labelsep
topsep=0pt
partopsep=0pt
choiceshook
%
%
if@correctchoice color@endgroup endgroup fi endlist
makeatother

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


enter image description here






share|improve this answer

























  • Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

    – andhewoulddarkenthememory
    Jan 18 at 9:05










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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470651%2flatex-exam-package-align-choices-with-oneparchoices%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









3














Having a look at the source code of the exam class shows me that the left margin (realized as leftmargin in LaTeX) is set by choices using a hard coded line settowidthleftmarginW.hskiplabelsephskip 2.5em%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).



I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between makeatletter and makeatother, and change the above line to setlengthleftmargin<your prefered length>. I would recommend here 15pt which is the normal parindent. Your can't apparently not use parindent directly as the list environment in choices seems to redefine it.

You also need to change newcommand to renewcommand of course.



documentclassexam

makeatletter
% from exam.cls, line 4107:
renewenvironmentchoices%
listchoicelabel%
usecounterchoicedefmakelabel##1hssllap##1%
setlengthleftmargin15pt%
defchoice%
if@correctchoice
color@endgroup
endgroup
fi
item
do@choice@pageinfo
% choice
defCorrectChoice%
if@correctchoice
color@endgroup
endgroup
fi
ifprintanswers
ifhmode unskipunskipunvboxvoidb@x fi
begingroup color@begingroup @correctchoicetrue
CorrectChoice@Emphasis
fi
item
do@choice@pageinfo
% CorrectChoice
letcorrectchoiceCorrectChoice
labelwidthleftmarginadvancelabelwidth-labelsep
topsep=0pt
partopsep=0pt
choiceshook
%
%
if@correctchoice color@endgroup endgroup fi endlist
makeatother

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


enter image description here






share|improve this answer

























  • Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

    – andhewoulddarkenthememory
    Jan 18 at 9:05















3














Having a look at the source code of the exam class shows me that the left margin (realized as leftmargin in LaTeX) is set by choices using a hard coded line settowidthleftmarginW.hskiplabelsephskip 2.5em%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).



I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between makeatletter and makeatother, and change the above line to setlengthleftmargin<your prefered length>. I would recommend here 15pt which is the normal parindent. Your can't apparently not use parindent directly as the list environment in choices seems to redefine it.

You also need to change newcommand to renewcommand of course.



documentclassexam

makeatletter
% from exam.cls, line 4107:
renewenvironmentchoices%
listchoicelabel%
usecounterchoicedefmakelabel##1hssllap##1%
setlengthleftmargin15pt%
defchoice%
if@correctchoice
color@endgroup
endgroup
fi
item
do@choice@pageinfo
% choice
defCorrectChoice%
if@correctchoice
color@endgroup
endgroup
fi
ifprintanswers
ifhmode unskipunskipunvboxvoidb@x fi
begingroup color@begingroup @correctchoicetrue
CorrectChoice@Emphasis
fi
item
do@choice@pageinfo
% CorrectChoice
letcorrectchoiceCorrectChoice
labelwidthleftmarginadvancelabelwidth-labelsep
topsep=0pt
partopsep=0pt
choiceshook
%
%
if@correctchoice color@endgroup endgroup fi endlist
makeatother

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


enter image description here






share|improve this answer

























  • Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

    – andhewoulddarkenthememory
    Jan 18 at 9:05













3












3








3







Having a look at the source code of the exam class shows me that the left margin (realized as leftmargin in LaTeX) is set by choices using a hard coded line settowidthleftmarginW.hskiplabelsephskip 2.5em%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).



I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between makeatletter and makeatother, and change the above line to setlengthleftmargin<your prefered length>. I would recommend here 15pt which is the normal parindent. Your can't apparently not use parindent directly as the list environment in choices seems to redefine it.

You also need to change newcommand to renewcommand of course.



documentclassexam

makeatletter
% from exam.cls, line 4107:
renewenvironmentchoices%
listchoicelabel%
usecounterchoicedefmakelabel##1hssllap##1%
setlengthleftmargin15pt%
defchoice%
if@correctchoice
color@endgroup
endgroup
fi
item
do@choice@pageinfo
% choice
defCorrectChoice%
if@correctchoice
color@endgroup
endgroup
fi
ifprintanswers
ifhmode unskipunskipunvboxvoidb@x fi
begingroup color@begingroup @correctchoicetrue
CorrectChoice@Emphasis
fi
item
do@choice@pageinfo
% CorrectChoice
letcorrectchoiceCorrectChoice
labelwidthleftmarginadvancelabelwidth-labelsep
topsep=0pt
partopsep=0pt
choiceshook
%
%
if@correctchoice color@endgroup endgroup fi endlist
makeatother

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


enter image description here






share|improve this answer















Having a look at the source code of the exam class shows me that the left margin (realized as leftmargin in LaTeX) is set by choices using a hard coded line settowidthleftmarginW.hskiplabelsephskip 2.5em%, i.e. it is set to the width of W. + labelsep + 2.5em (em is relative to your font size).



I don't see an easy way to change that as there is no setting for this provided. You only could copy the definition of choices from exam.cls into your document, between makeatletter and makeatother, and change the above line to setlengthleftmargin<your prefered length>. I would recommend here 15pt which is the normal parindent. Your can't apparently not use parindent directly as the list environment in choices seems to redefine it.

You also need to change newcommand to renewcommand of course.



documentclassexam

makeatletter
% from exam.cls, line 4107:
renewenvironmentchoices%
listchoicelabel%
usecounterchoicedefmakelabel##1hssllap##1%
setlengthleftmargin15pt%
defchoice%
if@correctchoice
color@endgroup
endgroup
fi
item
do@choice@pageinfo
% choice
defCorrectChoice%
if@correctchoice
color@endgroup
endgroup
fi
ifprintanswers
ifhmode unskipunskipunvboxvoidb@x fi
begingroup color@begingroup @correctchoicetrue
CorrectChoice@Emphasis
fi
item
do@choice@pageinfo
% CorrectChoice
letcorrectchoiceCorrectChoice
labelwidthleftmarginadvancelabelwidth-labelsep
topsep=0pt
partopsep=0pt
choiceshook
%
%
if@correctchoice color@endgroup endgroup fi endlist
makeatother

begindocument

beginquestions

question
Question 1

beginoneparchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endoneparchoices

question
Question 2

beginchoices
correctchoice Answer 1
choice Answer 2
choice Answer 3
endchoices

endquestions

enddocument


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 18 at 8:58

























answered Jan 18 at 8:49









Martin ScharrerMartin Scharrer

201k45636818




201k45636818












  • Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

    – andhewoulddarkenthememory
    Jan 18 at 9:05

















  • Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

    – andhewoulddarkenthememory
    Jan 18 at 9:05
















Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

– andhewoulddarkenthememory
Jan 18 at 9:05





Thanks a lot! That is well beyond my current knowledge of LaTeX. But with the code you provided I got it to work. :)

– andhewoulddarkenthememory
Jan 18 at 9:05

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470651%2flatex-exam-package-align-choices-with-oneparchoices%23new-answer', 'question_page');

);

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






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?