Thank you Davide, the unionTable macro and PGML example really helped.
I have a few questions regarding the side by side placement of text and images with the columns.
1.) How can I include a caption or credit on column 2 for the image?
My experimentation to produce a caption base on previous examples did not succeed.
2.) The columns work great and returned some control back to the "tex_size=>" specifier. When not working with the columns (under the unionTable macro) the "tex_size=>" specifier had no affect on changing the size of the display. The image display seemed to be defaulting to a full size regardless of the number used in the "tex_size=>" specifier. And yes I triple checked the dimensions of the image file.
Here is an example of the image code I used (without a column display):
>>[@ image("Dragonfly_BryonRoberts.png", width=>727, height=>620, tex_size=>100) @]* Bryon_Roberts_Copy_Right_2007.
3.) Just some observations: I noticed that there is no height dimension requested for images within a column? Also parameters need their brackets removed or they will display in the text column, correct?
Without columns: [`R = [$R]`]
Inside columns: [`R = $R`]
Thank you for all the help!
My code is below if this helps with question 1.
Tim
DOCUMENT();
loadMacros(
"PGstandard.pl",
"PGML.pl",
"MathObjects.pl",
"unionTables.pl",
"PGcourse.pl"
);
loadMacros("PGML.pl","unionTables.pl");
# Webwork Workshop 2015 for Payer, Homework 1, Practice:
# Exercises for Survival and Renewal applications: pg460, #34
Context("Numeric")->flags->set(
tolerance => 1.0,
tolType => 'absolute',
);
Context()->variables->add(t=>"Real");
$po = Real(random(1000, 9000,1000));
$R =Real(random(8, 40,1));
$T =Real(random(5, 14,1));
$ex =Real(random(0.01, 0.15,0.01));
$a =Real(random(5, 14,1));
$c =Real(random(5, 14,1));
$cb =Real(random(5, 14,1));
$g =Formula("($a/($cb))");
$g1 =Formula("exp(-$ex*$T)*($po+($R/$ex)*(exp($ex*$T)-1))");
$g2 =floor($g1);
$column1 = PGML::Format(<<END_PGML);
During the summer months a dragonfly population at the Musky marsh follows a survival and renewal equation with an initial population of [`P_0 = $po`] dragonflies, a renewal rate of [`R = $R`] , and a survival function of [``S(t) = e^{-$ex t}``] at time [`t`] in weeks. Find the population of dragonflies at [`T = $T`] weeks.
*Note!* Round your decimal answer down to the number of complete dragonflies.
[______________________]{$g2}
END_PGML
$column2 =image("Dragonfly_BryonRoberts.png", width=>756, tex_size=>800);
TEXT(ColumnTable($column1,$column2));
ENDDOCUMENT();