[Tugindia] Using conditionals

Kannan Moudgalya kannan at iitb.ac.in
Sun Sep 14 17:09:08 CEST 2008


Nina Mazumdar wrote:
> On Sat, Sep 13, 2008 at 11:12 PM, Kannan Moudgalya <kannan at iitb.ac.in> wrote:
>   
>> I want to know how to use the conditionals in LaTeX.  For example, if I
>> have the \multicols option on, I want the width of the inserted figures
>> to be \linewidth.  If this option is off, the width should become
>> 0.5\linewidth.
>>     
> Do we need to go for any conditional command? What we need is nothing
> but a new dimension defined which is exactly the column width.
>
> Here is one way of doing it:
>   
Dear Nina,

Thanks for your mail.  The above solution will work if the same length
is to be used in one column and two column formats.  I often have to use 
different sizes, however.  For example, while in two column mode I may 
use 0.75\Columnwidth, I would like to use something larger for one 
column mode, because, the above size is rather small in one column mode. 
  Of course, 0.75\linewidth will become rather large in one column format.

To explain further, to fit the question papers that I set into one page, 
I use the two column format (I tried to send a sample question paper as 
an attachment to this mail, but it did not go through - I am resending 
this mail without the attachment, which I will send separately to your 
personal mail). I keep the questions and answers together, so that I can 
easily maintain them and reuse them, if necessary: an \eatans command 
kills all the answers, \eatquest kills all the questions; if I comment 
out both, questions and answers come in the output.  Because answers 
often involve long expressions, I use the one column format when answers 
have to be compiled.  While setting the question paper, I often choose 
small sizes for the figures, because of the self imposed requirement 
that the questions should fit in one page.  I don't have page 
restrictions while preparing the answers.  At that time, I am more 
concerned about aesthetics.  Typically, I end up using a slightly larger 
size.

To cut the story short, I guess that I cannot escape from using the 
conditionals.  This is a lot more flexible, because, I can use different 
ratios for different figures.

Thanks again.

Kannan



More information about the tugindia mailing list