Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an interesting situation, I am passing a variable into a LaTeX page via smarty & php. I am generating a PHP Quote form to be used by multiple companies, and what changes is just the logo header and some variables just below the header. I have a variable $outletname and would like to display the following at the top (or even in the header)..

if $outlet1 = star, display logo_star1.png 
if outlet1=jambb, display a different logo... 

and so on and so forth. I'll then just pick these from a directory where GD uploads and names the logos in a certain format...

I'll appreciate your help in this.


@Werner, I currently have about ten images. Logos, Lemme try to make things clearer...

A school has ten departments, each department has a different header for a document whose content and footer are the same. (in other words generate use one layout and content pages but different header logos depending on department that the document is addressed to). So we have:

  1. Engineering with a corresponding Engineering.png logo that goes at the top of the document,
  2. Business Studies that has a Business_Studies.png logo
  3. Computer_Science.png & comp_science.png

and so on and so forth. I can pass a single variable $department to the pdf, i have gotten as far as display the right department on the generated document. I now need to use that variable in a loop to have an image header used that corresponds to the department..

so if ($department="engineering") { display ../images/engineering.png}
elseif ($department=compsci"){display comp_sci.png}... 

Im interested in a LaTeX syntax that can be used to do conditional display of items, in this case images.

share|improve this question

closed as off topic by egreg, Martin Schröder, Kurt, diabonas, Werner Feb 2 '13 at 22:30

Questions on TeX - LaTeX Stack Exchange are expected to relate to TeX, LaTeX or related typesetting systems within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
How many of these logos do (or could) you have? 10s? 100s? 1000s? Is there a correspondence between the name (star and jambb in your example) and the actual image (logo_star1.png). For example, star always has a logo logo_star.png, say. –  Werner Aug 15 '12 at 22:35
2  
From your question, it is hard to understand what you want to know (no question mark :-) . I'd do the conditional stuff in PHP (maybe via a table in a text or csv file or a database) and pass just the filename to LaTeX. –  Stephan Lehmke Aug 16 '12 at 2:45

Browse other questions tagged or ask your own question.