[Tugindia] Using conditionals

Kannan Moudgalya kannan at iitb.ac.in
Sun Sep 14 12:49:03 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:
>   
Nina,

Thanks for your mail.  The above solution will work if the same length 
(as a proportion of the column width) is to be used in one column and 
two column format.  In case the figure size is chosen not from aesthetic 
point of view, but some other optimality condition (e.g. document should 
fit in one page) one may want to change the size - conditionals will be 
useful then. 

To explain further, the question papers that I set typically fit into 
one page, if I use the two column format - I have attached one such 
paper.   I keep the questions and answers together, so that I can easily 
maintain them and reuse them, if necessary: a \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.  I may lose some aesthetics while preparing the questions, 
because of the requirement that the question paper should fit in one 
page.  I don't have page restrictions while preparing the answers.  At 
that time, I will be more concerned about aesthetics.  In other words, I 
may want to use different scaling factors for different figures.

To cut the story short, I still need a solution that makes use of 
conditionals.  If I have this facility, for each figure, I will define 
the length for the two column mode and another for the single column format.

Thanks again.

Kannan


More information about the tugindia mailing list