Guest User

Untitled

a guest
Nov 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 KB | None | 0 0
  1. documentclass[12pt,a4paper]{book}
  2. usepackage{amsmath,amsthm}
  3. usepackage{ifthen,amsfonts,amssymb,dsfont}
  4. usepackage{etoolbox,multicol}
  5. documentclass[12pt,a4paper]{book}
  6. usepackage{amsmath,amsthm}
  7. usepackage{ifthen,amsfonts,amssymb,dsfont}
  8. usepackage{etoolbox,multicol}
  9. usepackage[english]{babel}
  10. usepackage{blindtext}
  11. usepackage{geometry}
  12. usepackage{lmodern}
  13. usepackage[T1]{fontenc}
  14. usepackage{enumitem,kantlipsum}
  15. usepackage[dvips]{graphicx,color}
  16. usepackage{verbatim, pstricks,ulem}
  17. usepackage{syntonly}
  18. newcommand{newmatrix}[2]{left(begin{array}{#1} #2end{array}right)}
  19.  
  20. newboxallanswerkeys
  21. setboxallanswerkeys=vbox{}
  22. newenvironment{answerkey}{%
  23. globalsetboxallanswerkeys=vboxbgroup
  24. unvboxallanswerkeys
  25. }%
  26. {%
  27. bigbreak
  28. egroup
  29. }
  30.  
  31. newcommand{showallanswerkeys}{parunvboxallanswerkeys}
  32.  
  33. newcommand*{getanswerkeys}[6]{%
  34. item[theenumi.]begin{answerkey}(#5)end{answerkey}
  35. }
  36.  
  37. newboxallanswers
  38. setboxallanswers=vbox{}
  39.  
  40. newenvironment{answer}{%
  41. globalsetboxallanswers=vboxbgroup
  42. unvboxallanswers
  43. }%
  44. {%
  45. bigbreak
  46. egroup
  47. }
  48.  
  49. newcommand{showallanswers}{parunvboxallanswers}
  50.  
  51. newcommand*{getanswer}[6]{%
  52. ifthenelse{equal{#6}{}}{}{
  53. item[theenumi.]begin{answer}(#5)~#6end{answer}
  54. }}
  55.  
  56. setlengthparindent{0pt}
  57.  
  58. newcommand{fourch}[6]{
  59. par
  60. begin{tabular}{*{4}{@{}p{0.23textwidth}}}
  61. (a)~#1 & (b)~#2 & (c)~#3 & (d)~#4
  62. end{tabular}
  63. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  64. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  65. }
  66.  
  67. newcommand{twoch}[6]{
  68. par
  69. begin{tabular}{*{2}{@{}p{0.46textwidth}}}
  70. (a)~#1 & (b)~#2
  71. end{tabular}
  72. par%vspace{4pt}
  73. begin{tabular}{*{2}{@{}p{0.46textwidth}}}
  74. (c)~#3 & (d)~#4
  75. end{tabular}
  76. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  77. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  78. }
  79.  
  80. newcommand{onech}[6]{
  81. %par
  82. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  83. (a) & #1
  84. end{tabular}vspace{2pt}
  85. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  86. (b) & #2
  87. end{tabular}vspace{2pt}
  88. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  89. (c) & #3
  90. end{tabular}vspace{2pt}
  91. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  92. (d) & #4
  93. end{tabular}
  94.  
  95. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  96. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  97. }
  98.  
  99. newlengthwidthcha
  100. newlengthwidthchb
  101. newlengthwidthchc
  102. newlengthwidthchd
  103. newlengthwidthch
  104. newlengthtabmaxwidth
  105.  
  106. setlengthtabmaxwidth{0.96textwidth}
  107. newlengthfourthtabwidth
  108. setlengthfourthtabwidth{0.25textwidth}
  109. newlengthhalftabwidth
  110. setlengthhalftabwidth{0.5textwidth}
  111.  
  112. newcommand{choice}[6]{%
  113. settowidthwidthcha{AM.#1}setlength{widthch}{widthcha}%
  114. settowidthwidthchb{BM.#2}%
  115. ifdimwidthch<widthchbrelaxsetlength{widthch}{widthchb}fi%
  116. settowidthwidthchb{CM.#3}%
  117. ifdimwidthch<widthchbrelaxsetlength{widthch} {widthchb}fi%
  118. settowidthwidthchb{DM.#4}%
  119. ifdimwidthch<widthchbrelaxsetlength{widthch} {widthchb}fi%
  120.  
  121. ifdimwidthch>halftabwidth
  122. onech{#1}{#2}{#3}{#4}{#5}{#6}
  123. elseifdimwidthch<halftabwidth
  124. ifdimwidthch>fourthtabwidth
  125. twoch{#1}{#2}{#3}{#4}{#5}{#6}
  126. else
  127. fourch{#1}{#2}{#3}{#4}{#5}{#6}
  128. fififi}
  129.  
  130. newcommand{mcq}[8]{
  131. item #2
  132. choice{#3}{#4}{#5}{#6}{#7}{#8}
  133. }
  134.  
  135. defdatabaseone{
  136. mcq{245}{Let $A$ be a symmetric matrix of order $n$ and $B$ be a skew- symmetric matrix of order $n$. Then which one of the following is a skew-symmetric matrix?}{$A^{2}$}{$B^{2}$}{$AB+BA$}{$AB-BA$}{c}{}{}
  137.  
  138. mcq{248}{A square matrix is a diagonal matrix if and only if it is}{upper triangular}{lower triangular}{both upper triangular and lower triangular}{none of these}{c}{}{}
  139.  
  140. mcq{249}{Let $A$ be a non-singular matrix of order $3$. Then the rank of matrix $A^{2018}$ is}{$1$}{$2$}{$3$}{$9$}{c}{Note that $A^{2018}$ is a non-singular matrix of order $3$. Hence rank $(A^{2018})=3$.}{}
  141.  
  142. mcq{250}{If $A=newmatrix{ccc}{0 & 1 & 0\0 & 0 & 1\1 & 0 & 0}$, then rank of the matrix $A+A^{2}+A^{3}$ is}{$1$}{$2$}{$3$}{none of these}{a}{Note that $A+A^{2}+A^{3}=protectnewmatrix{ccc}{1 & 1 & 1\1 & 1 & 1\1 & 1 & 1}$. Hence rank $(A+A^{2}+A^{3})=1$}{}
  143. }
  144.  
  145. begin{document}
  146. chapter{One}
  147. begin{enumerate}
  148. databaseone
  149. end{enumerate}
  150.  
  151. bigskip
  152. Huge{Answer Key:}
  153. bigskip
  154.  
  155. begin{center}
  156. begin{multicols}{6}
  157. showallanswerkeys
  158. end{multicols}
  159. end{center}
  160.  
  161. bigskip
  162. Huge{Hint/Explanation of Selected Problems:}
  163. bigskipbigskip
  164. showallanswers
  165.  
  166. chapter{Two}
  167. begin{enumerate}
  168. databaseone
  169. end{enumerate}
  170.  
  171. bigskip
  172. Huge{Answer Key:}
  173. bigskip
  174.  
  175. begin{center}
  176. begin{multicols}{6}
  177. showallanswerkeys
  178. end{multicols}
  179. end{center}
  180.  
  181. bigskip
  182. Huge{Hint/Explanation of Selected Problems:}
  183. bigskipbigskip
  184. showallanswers
  185. end{document}
  186.  
  187. documentclass[12pt,a4paper]{book}
  188. usepackage{amsmath,amsthm}
  189. usepackage{ifthen,amsfonts,amssymb,dsfont}
  190. usepackage{etoolbox,multicol}
  191.  
  192.  
  193. %%NO!!! two documentclass documentclass[12pt,a4paper]{book}
  194. %% NO already loaded usepackage{amsmath,amsthm}
  195. %% NO already loaded usepackage{ifthen,amsfonts,amssymb,dsfont}
  196. %% NO already loaded usepackage{etoolbox,multicol}
  197. usepackage[english]{babel}
  198.  
  199. % not in areal document usepackage{blindtext}
  200. usepackage{geometry}
  201. usepackage{lmodern}
  202. usepackage[T1]{fontenc}
  203. usepackage{enumitem,
  204. % not in a real documentkantlipsum
  205. }
  206. usepackage[
  207. % NO dvips
  208. ]{graphicx,color}
  209. usepackage{verbatim, pstricks,ulem}
  210. %NO! This disables almost all of latex if you use it usepackage{syntonly}
  211.  
  212. % No use pmatrix from amsmath newcommand{newmatrix}[2]{left(begin{array}{#1} #2end{array}right)}
  213.  
  214. newboxallanswerkeys
  215. setboxallanswerkeys=vbox{}
  216. newenvironment{answerkey}{%
  217. globalsetboxallanswerkeys=vboxbgroup
  218. unvboxallanswerkeys
  219. }%
  220. {%
  221. bigbreak
  222. egroup
  223. }
  224.  
  225. newcommand{showallanswerkeys}{parunvboxallanswerkeys}
  226.  
  227. newcommand*{getanswerkeys}[6]{%
  228. item[theenumi.]begin{answerkey}(#5)end{answerkey}
  229. }
  230.  
  231. newboxallanswers
  232. setboxallanswers=vbox{}
  233.  
  234. newenvironment{answer}{%
  235. % OK but this is not colour safe, don't use colour in this environment
  236. globalsetboxallanswers=vboxbgroup
  237. unvboxallanswers
  238. }%
  239. {%
  240. bigbreak
  241. egroup
  242. }
  243.  
  244. newcommand{showallanswers}{parunvboxallanswers}
  245.  
  246. newcommand*{getanswer}[6]{%
  247. ifthenelse{equal{#6}{}}{}{
  248. item[theenumi.]begin{answer}(#5)~#6end{answer}
  249. }}
  250.  
  251. setlengthparindent{0pt}
  252.  
  253. newcommand{fourch}[6]{
  254. par
  255. begin{tabular}{*{4}{@{}p{0.23textwidth}}}
  256. (a)~#1 & (b)~#2 & (c)~#3 & (d)~#4
  257. end{tabular}
  258. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  259. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  260. }
  261.  
  262. newcommand{twoch}[6]{
  263. par
  264. begin{tabular}{*{2}{@{}p{0.46textwidth}}}
  265. (a)~#1 & (b)~#2
  266. end{tabular}
  267. par%vspace{4pt}
  268. begin{tabular}{*{2}{@{}p{0.46textwidth}}}
  269. (c)~#3 & (d)~#4
  270. end{tabular}
  271. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  272. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  273. }
  274.  
  275. newcommand{onech}[6]{
  276. %par
  277. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  278. (a) & #1
  279. end{tabular}vspace{2pt}
  280. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  281. (b) & #2
  282. end{tabular}vspace{2pt}
  283. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  284. (c) & #3
  285. end{tabular}vspace{2pt}
  286. begin{tabular}{@{}p{0.04textwidth}@{}p{0.91textwidth}}
  287. (d) & #4
  288. end{tabular}
  289.  
  290. getanswer{#1}{#2}{#3}{#4}{#5}{#6}
  291. getanswerkeys{#1}{#2}{#3}{#4}{#5}{#6}
  292. }
  293.  
  294. newlengthwidthcha
  295. newlengthwidthchb
  296. newlengthwidthchc
  297. newlengthwidthchd
  298. newlengthwidthch
  299. newlengthtabmaxwidth
  300.  
  301. setlengthtabmaxwidth{0.96textwidth}
  302. newlengthfourthtabwidth
  303. setlengthfourthtabwidth{0.25textwidth}
  304. newlengthhalftabwidth
  305. setlengthhalftabwidth{0.5textwidth}
  306.  
  307. newcommand{choice}[6]{%
  308. settowidthwidthcha{AM.#1}setlength{widthch}{widthcha}%
  309. settowidthwidthchb{BM.#2}%
  310. ifdimwidthch<widthchbrelaxsetlength{widthch}{widthchb}fi%
  311. settowidthwidthchb{CM.#3}%
  312. ifdimwidthch<widthchbrelaxsetlength{widthch} {widthchb}fi%
  313. settowidthwidthchb{DM.#4}%
  314. ifdimwidthch<widthchbrelaxsetlength{widthch} {widthchb}fi%
  315.  
  316. ifdimwidthch>halftabwidth
  317. onech{#1}{#2}{#3}{#4}{#5}{#6}
  318. elseifdimwidthch<halftabwidth
  319. ifdimwidthch>fourthtabwidth
  320. twoch{#1}{#2}{#3}{#4}{#5}{#6}
  321. else
  322. fourch{#1}{#2}{#3}{#4}{#5}{#6}
  323. fififi}
  324.  
  325. newcommand{mcq}[8]{
  326. item #2
  327. choice{#3}{#4}{#5}{#6}{#7}{#8}
  328. }
  329.  
  330. defdatabaseone{
  331. mcq{245}{Let $A$ be a symmetric matrix of order $n$ and $B$ be a
  332. % no space in skew- symmetric
  333. skew-symmetric matrix of order $n$. Then which one of the following is a skew-symmetric matrix?}{$A^{2}$}{$B^{2}$}{$AB+BA$}{$AB-BA$}{c}{}{}
  334.  
  335. mcq{248}{A square matrix is a diagonal matrix if and only if it is}{upper triangular}{lower triangular}{both upper triangular and lower triangular}{none of these}{c}{}{}
  336.  
  337. mcq{249}{Let $A$ be a non-singular matrix of order $3$. Then the rank of matrix $A^{2018}$ is}{$1$}{$2$}{$3$}{$9$}{c}{Note that $A^{2018}$ is a non-singular matrix of order $3$. Hence rank $(A^{2018})=3$.}{}
  338.  
  339. mcq{250}{If $A=begin{pmatrix}0 & 1 & 0\0 & 0 & 1\1 & 0 & 0end{pmatrix}$, then rank of the matrix $A+A^{2}+A^{3}$ is}{$1$}{$2$}{$3$}{none of these}{a}{Note that $A+A^{2}+A^{3}=protectbegin{pmatrix}1 & 1 & 1\1 & 1 & 1\1 & 1 & 1protectend{pmatrix}$. Hence rank $(A+A^{2}+A^{3})=1$}{}
  340. }
  341.  
  342. begin{document}
  343. chapter{One}
  344. begin{enumerate}
  345. databaseone
  346. end{enumerate}
  347.  
  348. %bigskip
  349. % NO (this makes entire document Huge Huge{Answer Key:}
  350. section*{Answer Key:}
  351. %bigskip
  352.  
  353. begin{center}
  354. begin{multicols}{6}
  355. showallanswerkeys
  356. end{multicols}
  357. end{center}
  358.  
  359. %bigskip
  360. %Huge
  361. section*{Hint/Explanation of Selected Problems:}
  362. %bigskipbigskip
  363. showallanswers
  364.  
  365. chapter{Two}
  366. begin{enumerate}
  367. databaseone
  368. end{enumerate}
  369.  
  370. %bigskip
  371. %Huge
  372. section*{Answer Key:}
  373. %bigskip
  374.  
  375. begin{center}
  376. begin{multicols}{6}
  377. showallanswerkeys
  378. end{multicols}
  379. end{center}
  380.  
  381. %bigskip
  382. %Huge
  383. section*{Hint/Explanation of Selected Problems:}
  384. %bigskipbigskip
  385. showallanswers
  386. end{document}
Add Comment
Please, Sign In to add comment