TransWikia.com

How to make newbox respect margin page ends

TeX - LaTeX Asked on December 27, 2021

enter image description hereI’m writing math practicing textbooks to students and I intend to provide an answer key at the end of them. I’m trying to implement the answer key using a storing box with all solutions. But I can’t make the solutions respect the paragraph. I would very much appreciate splitting the answer key page into two columns. I know I still typeset such a noob. That’s becouse I’ve been studying LaTeX for a couple of months. Sorry about that. Anyway, I’ll appreciate any help.

documentclass[10pt]{exam}
usepackage[hmargin=1.27cm,tmargin=1.37cm, bmargin=1.5cm]{geometry}
usepackage{indentfirst}
usepackage[brazil]{babel}
usepackage{amsmath,amsfonts,amssymb}
usepackage[T1]{fontenc}
usepackage{multicol, multirow, array, booktabs, adjustbox} % pacotes pra construção de tabelas
setlengthextrarowheight{2pt} % define a altura de uma célula em uma tabela
usepackage[utf8]{inputenc}



renewcommand{solutiontitle}{noindenttextbf{$;$}enspace}


printanswers
unframedsolutions
% Box of all answers in the solution environment----------------------------

newboxallanswers
setboxallanswershbox{}

renewenvironment{solution}{globalsetboxallanswers=hboxbgroupunhboxallanswers}{egroup}

newcommand{showallanswers}{noindentuseboxallanswers}
%----------------------------------------------------------------------------


begin{document}

begin{questions}

% Question 1--------------------------------------------------------------------

question Os séculos são representados através de algarismos romanos. O século I iniciou-se no ano 1 da era cristã (A.D.), tendo como referência o nascimento de Jesus Cristo. O século XX encerrou-se em 2000, e século XXI começou a partir do ano 2001 e se encerrará no ano 2100, iniciando-se, em 2101, o século XXII.\ Escreva a que século pertence:
begin{parts}
begin{minipage}{.48linewidth}
bigskip
item o ano 1999;
hrule width.9textwidth
begin{solution}
textbf{thequestion. }textbf{thepartno)} $XX$
end{solution}
bigskip
item o ano 1851;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $XIX$
end{solution}
bigskip 
item o ano 1700;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $XVII$
end{solution}
bigskip
item o ano 345;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $IV$
end{solution}
bigskip
end{minipage}
begin{minipage}{.48linewidth}
bigskip
item o ano 1601;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $XVII$
end{solution}
bigskip
item o ano 598;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $VI$
end{solution}
bigskip
item o ano 33;
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $I$
end{solution}
bigskip
item o ano 1201.
hrule width.9textwidth
begin{solution}
textbf{thepartno)} $XIII$
end{solution}
bigskip
end{minipage}
end{parts} 
 
% Question 2------------------------------------------------------------------
 
question Escreva os seguintes números usando símbolos romanos: 

begin{parts}
vspace{1mm}
begin{minipage}{.48linewidth}
bigskip
item 99
begin{solution}
textbf{thequestion. }textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 149
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 13
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 29
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 88
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 94
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
end{minipage}
begin{minipage}{.48linewidth}
bigskip
item 648
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 2103
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 781
hrule width.9textwidth
bigskip
item 302
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 1103
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
item 69
begin{solution}
textbf{thepartno)} $XX$
end{solution}
hrule width.9textwidth
bigskip
end{minipage}
end{parts}

% Question 3-----------------------------------------------------------------

question Determine o menor e o maior número de três algarismos diferentes que se pode escrever com os algarismos 0, 5, 6, 8 e 9. 
fillwithlines{.7cm}
 begin{solution}
textbf{thequestion. }$2135$ e $3216$
end{solution}
end{questions}

begin{center}
Answer Key
end{center}


showallanswers% show all answers------------------------------------------------

end{document}

One Answer

Why not trying

newcommand{showallanswers}{noindentunhboxallanswers}

instead of

newcommand{showallanswers}{noindentuseboxallanswers}

to avoid overfull

Answered by domperor on December 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP