[OS X TeX] creating a "smart macro"

C.H.E. eliot001 at umn.edu
Thu Apr 23 04:31:09 CEST 2009


I have done this for classes using the formlett package. Export your excel
file as comma-delimited (CSV) and (either by adding them before export or by
find/replace after) make sure that your delimiters mach what you declare
them to be. I use:

 \usepackage{formlett} \delimiters{,}{~}{!}

Your nametag or whatever text, if any, goes within a \beginletter ...
\endletter environment. Within that you can call, for instance, column 1
from the exported data just by typing \paras[1]. 

The data goes after the \endletter but before \end{document}. If you're just
exporting first names from excel, it would look like this:

\moreletter Jane!
\moreletter Owen!

etc. But you can input arbitrarily long data lines like \moreletter
Jane,Smith,Arkansas,Honors,12! whether or not you use that data, which is
convenient for just popping in exported excel.

Put in an \eject command a before \endletter to automatically create a new
page for of the 109 \moreletter lines you're inputting.


>> I need to create a number of name tags for a class. The idea is to  
>> create a list of the students' names and have a macro that will  
>> fetch the first name, then reexecute using the second name and so on.
>> This is the layout I created. Can anybody give me a hint how to  
>> make a smart macro out of this that will work its way through a  
>> list of 109 students and create a pdf in which every single page  
>> looks like the output of the code below while replacing \1stname  
>> and \lastname with the names in the list?

-- 
View this message in context: http://n2.nabble.com/creating-a-%22smart-macro%22-tp2675065p2680664.html
Sent from the MacOSX-TeX mailing list archive at Nabble.com.




More information about the macostex-archives mailing list