Using pdflatex, I would like to set an A4 article. I believed (from  answer) that it did not matter whether I use  \documentclass[a4paper]{article}    or   \documentclass{article} \usepackage[a4paper]{geometry}   But when I compile the two, I get different page margins. So I am now confused which is the "correct" way to use A4 paper. Is it maybe that one option only changes the paper format from letter to A4 but maintains the page margins, while the other adapts the margins to the new format? (Just a guess...)  MWE:  \documentclass{article} \usepackage[a4paper]{geometry} %\documentclass[a4paper]{article} as the alternative \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Aliquet risus feugiat in ante metus dictum. Auctor urna nunc id cursus metus aliquam. Malesuada proin libero nunc consequat interdum varius sit amet mattis. Quis ipsum suspendisse ultrices gravida dictum fusce ut placerat orci. Pellentesque habitant morbi tristique senectus et netus et. Quam viverra orci sagittis eu volutpat odio. Tellus id interdum velit laoreet id donec ultrices. Ut lectus arcu bibendum at. In aliquam sem fringilla ut. Tristique senectus et netus et malesuada. Semper eget duis at tellus at. Tincidunt lobortis feugiat vivamus at. Volutpat commodo sed egestas egestas fringilla. Lorem mollis aliquam ut porttitor. Vitae auctor eu augue ut lectus. \end{document}
122743
I have seen a similar question at  and the selected answer there implies that there is no difference in whether we use \documentclass[a4paper]{article} or if we use \usepackage[a4paper]{geometry}.  But my observations contradict the selected answer there.  Here is my code in file foo.tex:  \documentclass[a4paper]{article} \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec lobortis justo. Praesent ut scelerisque risus, sit amet mollis erat. Fusce at lacus at libero consequat consectetur.  Proin at vehicula ligula. Vivamus quis ligula id lacus aliquet ultricies. Vivamus tristique, velit vestibulum tincidunt fermentum, lacus sem euismod risus, ut volutpat augue dolor vitae est. Proin odio nunc, sollicitudin quis nisi a, sodales efficitur quam. Phasellus ex velit, porttitor vestibulum consectetur eu, maximus et nisi.  Nulla pharetra augue ex, quis scelerisque sem iaculis id. Aliquam in tincidunt quam. Praesent ac laoreet elit. Aenean varius ullamcorper dolor ac finibus. Proin est sapien, tempor nec mollis ut, ultricies et ante. Maecenas hendrerit velit non augue rutrum, mollis pharetra nisl auctor. Ut nisl mauris, porta ut nisi ut, elementum tristique nibh.  \end{document}   Here is another one in file bar.tex. The only thing that is different here is the usage of \usepackage[a4paper]{geometry} instead of \documentclass[a4paper]{article}.  \documentclass{article} \usepackage[a4paper]{geometry} \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec lobortis justo. Praesent ut scelerisque risus, sit amet mollis erat. Fusce at lacus at libero consequat consectetur.  Proin at vehicula ligula. Vivamus quis ligula id lacus aliquet ultricies. Vivamus tristique, velit vestibulum tincidunt fermentum, lacus sem euismod risus, ut volutpat augue dolor vitae est. Proin odio nunc, sollicitudin quis nisi a, sodales efficitur quam. Phasellus ex velit, porttitor vestibulum consectetur eu, maximus et nisi.  Nulla pharetra augue ex, quis scelerisque sem iaculis id. Aliquam in tincidunt quam. Praesent ac laoreet elit. Aenean varius ullamcorper dolor ac finibus. Proin est sapien, tempor nec mollis ut, ultricies et ante. Maecenas hendrerit velit non augue rutrum, mollis pharetra nisl auctor. Ut nisl mauris, porta ut nisi ut, elementum tristique nibh. \end{document}   But the output from both files are different. Here is a side by side comparison with foo.pdf on left and bar.pdf on right.         I have three questions:   Why are the two outputs different? Looks like it is due to different margins. Am I right? Do these outputs contradict the selected answer at  ? Is there a best practice regarding where a4paper should be declared?
58166
I'm trying to create a document that has different margins on even and odd pages. This is what I've tried:  \documentclass[a4paper,12pt]{article} \usepackage[slovene]{babel} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsfonts,amsmath,amssymb,amsthm} \usepackage[all,cmtip]{xy} \usepackage{graphicx} \usepackage{resizegather}  \hfuzz=2pt  \oddsidemargin=51pt \evensidemargin=11pt   This would give me precisely the margins I want, but for some reason, \oddsidemargin and \evensidemargin are not independent. When I set one of them, the other is fixed. After reading some answers here, I tried setting changing the first line to  \documentclass[a4paper,12pt,twoside]{article}   but this completely messes with my layout and I get a bunch of "underfull \vbox"'s. (Although the left and right margins then behave as expected.) So, my question is as follows:     How do I make \oddsidemargin and \evensidemargin behave independently without introducing any other (undesired) behaviour?
60154
Consider the Code below:  \documentclass[%     paper=A4,     twoside=true,     fontsize=12pt,     titlepage=true,     listof=totoc,     bibliography=totoc,     listof=flat,     open=right,     cleardoublepage=empty,     headsepline=true,     footsepline=false,     captions=tableheading,     numbers=noendperiod,     parskip=half-,     headings=normal]{scrbook} \usepackage[a4paper]{geometry} \geometry{     includehead=true,     hmarginratio=1:2,     vmarginratio=3:5,     textwidth=170mm,     textheight=230mm,     headheight=20pt,     footskip=15mm,     bindingoffset=6mm} \usepackage{showframe} \usepackage{blindtext} \usepackage[tocindentauto]{tocstyle} \usetocstyle{KOMAlike} \begin{document} \frontmatter \tableofcontents \cleardoublepage \mainmatter \blinddocument\blindtext \pagenumbering{Roman} \setcounter{page}{20} \appendix \blinddocument \end{document}   The roman pagenumbers in the table of contents are too wide. How to fix this?
68980
recognize this simple example:  \documentclass[]{article} \usepackage[paperwidth=612.0pt, paperheight=792.0pt]{geometry}  \begin{document} Hello World \end{document}   I compiled it with pdflatex. Additionally I wrote this small Java-Programm (using the iText library):  PdfReader reader = new PdfReader("example.pdf"); Rectangle psize = reader.getPageSize(1); System.out.println(psize.getHeight()); System.out.println(psize.getWidth());   The result:  Height: 789.041 Width: 609.714   Why is the paperwidth and paperheight different to the tex?
20062
I'm trying to make a document that has a very small font throughout, I tried this:  \documentclass[0.5mm, a4paper]{article} \documentclass[7pt, a4paper]{article}   But it doesn't seem that they allow me to go anything below 10pt.  This hack make it work, but not for the section headers:  \fontsize{4mm}{5mm}\selectfont   Does anyone know any better ways to do this?
29589
I'm writing my thesis and I'd like to insert A3 pages within my A4 document. Is it possible to place figures with captions (as normal) on those A3?  I'm able to include full PDF pages which are A3 by \includepdf, however that way I can't have captions.  I get this error:  ! Package caption Error: No float type ! Package caption Error\caprion outside float
78854
Can anyone tell me the difference between those two commands?  Edit: Thanks for the answers, but I didn't get the clue yet. Here's an example:  test.tex  \documentclass[a4paper,oneside]{mytestclass} ...   mytestclass.cls  \NeedsTeXFormat{LaTeX2e}  \ProvidesClass{testclass}[2011/01/30 v0.1 testclass] \LoadClass{book}   or  \NeedsTeXFormat{LaTeX2e}  \ProvidesClass{testclass}[2011/01/30 v0.1 testclass] \LoadClassWithOptions{book}   In both examples the options a4paper and oneside are passed to book. So, I don't see any difference in the result.
8303
I'm using \documentclass[10pt, a4paper]{article} in my TeX file. It all works fine, except, the lower bound of each page is cut off. So some text is either cut off, or at least the text reaches the very end of the page.  Has anyone experienced the same issue?  Here is an minimal working example:  \documentclass[10pt, a4paper]{article}  \usepackage[utf8]{inputenc} \usepackage{ngerman} \usepackage[cm]{fullpage}  \setlength{\headheight}{12.4pt} \setlength{\headsep}{1.5\headheight}  \begin{document}  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f  \section{a}  asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f asdlkjf sakfj saoekfsalk lksa jfsakfsaoel jfsaoelkfj saoeflksad jfoelksaf sadfoelkjsa f   \end{document}
2706
I'm generating a PDF document with pdflatex (more precisely, latexmk invoked from TexMaker 3.4. My LaTeX install is TeXLive 20120719). I can read the document fine in Okular and Gmail's attachment preview, but a colleague that runs Acrobat Reader on Windows reports: "There was a problem reading this document (131)".  EDIT: The error disappears when using \usepackage[demo]{graphicx}, which puts black boxes instead of the real images. They are all PDFs, PNGs and JPGs. Instead of using demo, I added the code for a \demoincludegraphics command, which makes the file work in Reader when using it to replace the logo in the headers, as shown below. But enabling it (using \includegraphics instead of \demoincludegraphics) and removing everything else also works in Reader! There is some strange global interaction that makes the file appear broken to Reader when enabling all the graphics...  My code compiles fine, reason why I only attach the preamble and a simple text for a Minimal Working Example:  \documentclass[12pt,lettersize,twoside]{article}  \usepackage[utf8]{inputenc} \usepackage[spanish,es-tabla]{babel}   \usepackage[fixlanguage]{babelbib} \usepackage{amssymb,amsmath} \usepackage{graphicx}    \usepackage{array}    \usepackage{caption} \usepackage{subfig} \usepackage{rotating} \usepackage{booktabs} \usepackage{multirow} \usepackage{calc} \usepackage{stfloats} \usepackage{fixltx2e} \usepackage{url} \usepackage[colorlinks=true,linkcolor=blue,citecolor=red]{hyperref} \usepackage[all]{hypcap}  % Margins \usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry}  % Make header show up in the first page \makeatletter \renewcommand\maketitle{\par \begingroup     \renewcommand\thefootnote{\@fnsymbol\c@footnote}%     \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%     \long\def\@makefntext##1{\parindent 1em\noindent             \hb@xt@1.8em{%                 \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%     \if@twocolumn     \ifnum \col@number=\@ne         \@maketitle     \else         \twocolumn[\@maketitle]%     \fi     \else     \newpage     \global\@topnum\z@   % Prevents figures from going at top of page.     \@maketitle     \fi     \thispagestyle{fancy}\@thanks % was {empty} \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\maketitle\relax \global\let\@maketitle\relax \global\let\@thanks\@empty \global\let\@author\@empty \global\let\@date\@empty \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax } \makeatother  % Remove date field in title; Remove preceding vertical space \makeatletter \renewcommand{\@maketitle}{ \vspace{-3cm} \begin{center}% {\LARGE \@title}\\ \vspace{2mm}% {\@author} \end{center}% \par} \makeatother \makeatletter  % Demo includegraphic boxes \newcommand{\demoincludegraphics}[2][]{%   \setlength{\fboxsep}{-\fboxrule}% Remove frame separator/gap   \framebox{\rule{0pt}{100pt}\rule{150pt}{0pt}}% Framed box of 150pt x 100pt }  % Headers Config  \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \renewcommand{\headrulewidth}{0.4pt} \setlength{\headheight}{2.2cm}  \addtolength{\textheight}{-1.62cm} \fancyhead[LO,RE]{\demoincludegraphics[height=1.6cm]{logo-slogan}} \fancyhead[LE,RO]{}  % Footers Config \fancyfoot{} \renewcommand{\footrulewidth}{0pt} \fancyfoot[C]{\thepage}  % Notas al pie etiquetadas por simbolos   \renewcommand{\thefootnote}{\fnsymbol{footnote}}  \title{Doc Title} \author{My name}  \begin{document}  \maketitle  This is a test. It includes graphics and other floats.   \end{document}   EDIT: I found a workaround: Processing the generated pdf file through Ghostscript, as follows:   gs -dSAFER -dBATCH -dNOPAUSE  -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf   where input.pdf is the file generated by pdfLaTeX, and output.pdf the one that will be readable by Adobe Reader and the rest of the PDF readers.
62432
I am trying to automate the solution proposed by egreg to  by hooking into \begin{document} and \end{document}.  So, egreg's solution works fine:  \documentclass{article} \def\MinimumPaperHeight{12cm} \usepackage{geometry} \geometry{paperwidth=\MinimumPaperHeight,paperheight=\maxdimen,margin=1cm} \usepackage{lipsum}  \begin{document} \setbox0=\vbox{ \lipsum[1-6] } \dimen0=\dp0 \pdfpageheight=\dimexpr\ht0+2cm\relax \ifdim\pdfpageheight&lt;\MinimumPaperHeight \pdfpageheight=\MinimumPaperHeight \fi \unvbox0\kern-\dimen0 \end{document}   But can't seem to get this to work:  \documentclass{article} \def\MinimumPaperHeight{12cm} \usepackage{geometry} \geometry{paperwidth=\MinimumPaperHeight,paperheight=\maxdimen,margin=1cm} \usepackage{lipsum} \usepackage{environ}  \NewEnviron{MyBox}{     \setbox0=\vbox{\BODY}% }{%     \dimen0=\dp0%     \pdfpageheight=\dimexpr\ht0+2cm\relax%     \ifdim\pdfpageheight&lt;\MinimumPaperHeight \pdfpageheight=\MinimumPaperHeight \fi%     \unvbox0\kern-\dimen0% }  \AtBeginDocument{\begin{MyBox}} \AtEndDocument{\end{MyBox}}  \begin{document} \lipsum[1-6] \end{document}   Hooking into \AtBeginDocument is per this solution on .
95267
Is it possible to have different margins for printing from those shown on screen? I'm writing my thesis and for the paper version I would like a larger inner margin to allow space for the binding, but when viewed on screen I'd like the text to be centred (so left margin = right margin).  Here's a MWE (with margins for printing and binding):  \documentclass[twoside,a4paper,12pt]{book} \usepackage[bottom=3cm,top=3cm,outer=3cm,inner=4cm]{geometry}  \begin{document}  \include{Chapter1} \include{Chapter2}  \end{document}   So for printing I would like  \usepackage[bottom=3cm,top=3cm,outer=3cm,inner=4cm]{geometry}   but for on-screen viewing I would like  \usepackage[bottom=3cm,top=3cm,outer=3.5cm,inner=3.5cm]{geometry}   Obviously I could just make two different pdf files, one for printing and one for on-screen viewing, but I think it would be pretty cool if this could be done with just one file (much like the ocgcolorlinks option for the hyperref package disables colours for printing).
98899
My document should be letterpaper and my attachments should be a4paper. I had high hopes for the \newgeometry command from the geometry package, but the documentation says      \newgeometry is almost similar to   \geometry except that \newgeometry   disables all the options specified in   the preamble and skips the   papersize-related options: landscape,   portrait and paper size options (such   as papersize, paper=a4paper and so   forth).   Any help is appreciated!
86830
I'm using the documentclass article with the option twoside in order to customize the header and the footer for even and odd pages with the fancyhdr package. The compilation works, but the problem is that the output panel gives me the following badbox:  Underfull \vbox (badness 10000) has occurred while \output is active   I think the problem is due to the use of the geometry package, but I don't know how to solve it. What does it mean and how can I get rid of it? This is my preamble:  \documentclass[10pt,twoside]{article} \usepackage[papersize={120mm,195mm},top=2.7cm,bottom=2.7cm,right=1.3cm,left=1.3cm]{geometry}%left1.6 \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[polutonikogreek,italian,english]{babel} \usepackage[italian]{varioref} \usepackage{fancyhdr}  \pagestyle{fancy} \fancyhf{} \fancyhead[CO]{Titolo} \fancyhead[CE]{Autore} \cfoot{\thepage} \renewcommand{\headrulewidth}{0pt}
42768
I just started to learn LaTeX after seeing some amazing examples of scientific articles produced using it; I was also told that, unlike some other other text programs, LaTeX automatically produces articles respecting some publication standards. Well, after playing around with it for a while, I have to say my PDFs are anything but pretty, particularly when compared to those examples I mentioned before! My margins are really too large, my font size seem to be too small, my default paper is not A4 (and even when I set it manually to A4, the top margin then take an even more ridiculous amount of space). After reading a bit, I obviously found out how to control these elements, but the whole point for me to start learning LaTeX was not to fool around with such things. So here is (are) my question(s): am I doing something wrong? Is all this a matter of configuration? Or am I being delusional and my output PDFs actually ARE all in the expected standards? (I am using MiKTeX, and I tried three editors so far: TeXworks, LyX and WinEdt8)  Here are some examples I found on the internet of what I am talking about. The first seems to me as a simple article without any extra layout commands. Notice the size of the margins, fonts, etc. This is how my PDFs look like.   Now compare that previous PDF with this one here:  Unfortunately this one is written in two column format but I couldn't find another example online with just one column. Note how everything is balanced, how the margins are small, how the font is smaller as well, etc.  As a final note, I just would like to say that I really don't mind learning LaTex and that I am not expecting to produce amazing documents from day one; I just think that, in case my problems here are really sound, then I might have came to LaTeX with the wrong set of mind.  Thanks a lot!
94070
I am a relative (La)TeX newbie! I want to split an A4 scanned image across two pages! Is there a  package to achieve this or is it possible to do this manually so that to be able to define the exact  splitting point?
80197
I am working on a book right now and the margin notes are not appearing on the left-side pages.  I tried using mparhack but it made no difference.  Is my geometry, fancy style or another package messing up the normal layout?  I am using pdflatex to render.  Here is a minimal test case:  \documentclass[twoside,10pt]{book} \usepackage[margin=9mm,paperwidth=107.95mm,paperheight=174.63mm,bottom=18mm]{geometry} %\usepackage[cam,a4,center,pdftex]{crop} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage{fancyhdr} \usepackage{lipsum} \pagestyle{fancy} \fancyhead{} \fancyfoot[C]{\thepage} \renewcommand{\headrulewidth}{0pt} \fontsize{10.5}{13}\selectfont \usepackage[sc,medium]{titlesec} \usepackage{tocloft} \addtocontents{toc}{%             \protect\renewcommand{\protect\cftchapleader}{%-- switch it on here                     \protect\cftdotfill{\protect\cftdotsep}}} \addtocontents{toc}{\protect\thispagestyle{empty}} \renewcommand{\cfttoctitlefont}{\hfill\scshape} \renewcommand\cftaftertoctitle{\hfill\null\\\null\hfill\scshape{Page}} \renewcommand{\cftchapfont}{\normalsize\scshape} \renewcommand{\cftchappagefont}{\normalsize\scshape} \setlength{\emergencystretch}{3em} \title{Heroic Real Estate Otter of the 21st Century} \date{} \begin{document} \frenchspacing \chapter*{Thread 0} \addcontentsline{toc}{chapter}{Thread 0} \pagestyle{fancy} \hspace{0pt}\marginpar[$\omega$]{$\omega$}\lipsum[4-6]  NEXT\hspace{0pt}\marginpar[$\psi$]{$\psi$}\lipsum[10]  \end{document}
65855
If I want to shuffle the question to prepare four different questions papers having same questions but with the different question numbers, what should I do?       \documentclass[12pt,a4paper]{exam}     \usepackage{amsmath,amsthm,amsfonts,amssymb,dsfont}     \setlength\parindent{0pt}         %usage \choice{ }{ }{ }{ }         %(A)(B)(C)(D)         \newcommand{\fourch}[4]{         \par                 \begin{tabular}{*{4}{@{}p{0.23\textwidth}}}                 (a)~#1 &amp; (b)~#2 &amp; (c)~#3 &amp; (d)~#4                 \end{tabular}         }          %(A)(B)         %(C)(D)         \newcommand{\twoch}[4]{                  \begin{tabular}{*{2}{@{}p{0.46\textwidth}}}                 (a)~#1 &amp; (b)~#2                 \end{tabular}         \par                 \begin{tabular}{*{2}{@{}p{0.46\textwidth}}}                 (c)~#3 &amp; (d)~#4                 \end{tabular}         }          %(A)         %(B)         %(C)         %(D)         \newcommand{\onech}[4]{         \par               (a)~#1 \par (b)~#2 \par (c)~#3 \par (d)~#4         }          \newlength\widthcha         \newlength\widthchb         \newlength\widthchc         \newlength\widthchd         \newlength\widthch         \newlength\tabmaxwidth          \setlength\tabmaxwidth{0.96\textwidth}         \newlength\fourthtabwidth         \setlength\fourthtabwidth{0.25\textwidth}         \newlength\halftabwidth         \setlength\halftabwidth{0.5\textwidth}        \newcommand{\choice}[4]{%       \settowidth\widthcha{AM.#1}\setlength{\widthch}{\widthcha}%       \settowidth\widthchb{BM.#2}%       \ifdim\widthch&lt;\widthchb\relax\setlength{\widthch}{\widthchb}\fi%       \settowidth\widthchb{CM.#3}%       \ifdim\widthch&lt;\widthchb\relax\setlength{\widthch}{\widthchb}\fi%       \settowidth\widthchb{DM.#4}%       \ifdim\widthch&lt;\widthchb\relax\setlength{\widthch}{\widthchb}\fi%       \ifdim\widthch&lt;\fourthtabwidth         \fourch{#1}{#2}{#3}{#4}       \else\ifdim\widthch&lt;\halftabwidth         \ifdim\widthch&gt;\fourthtabwidth           \twoch{#1}{#2}{#3}{#4}         \else           \onech{#1}{#2}{#3}{#4}         \fi       \fi\fi     }     \begin{document}      \begin{questions}     \question If $a = 3 + i$ and $z = 2 - 3i$ then the points on the Argand diagram     representing az, 3az and - az are     \choice{Vertices of a right angled triangle}{ Vertices of an equilateral      triangle}{Vertices of an isosceles triangle}{Collinear}     \question If z represents a complex number then $\arg (z) + \arg\left(\bar z\right)$ is      \choice{$\dfrac{\pi}{4}$}{$\dfrac{\pi}{2}$}{0}{$\dfrac{\pi}{6}$}     \question If the amplitude of a complex number is $\dfrac{\pi}{2}$ then the number is     \choice{ purely imaginary}{purely real}{0}{neither real nor imaginary}     \question The value of $i + i^{22} + i^{23} + i^{24} + i^{25}$ is     \choice{i}{-i}{1}{-1}     \question The volume generated by      rotating the triangle with vertices at     (0, 0), (3, 0) and (3, 3) about x-axis is     \choice{$18\pi$}{$2\pi$}{$36\pi$}{$9\pi$}\end{questions}     \end{document}      \end{document}   That is I need to mark the question paper given above as Code&nbsp;A. And I need to print another question paper which marked as Code&nbsp;B and in this question paper the first question Code&nbsp;A should be in question number 5 (say) and similarly others also should have different positions...