I'd greatly appreciate having eyeballs other than mine looking at the
attached code. It compiles file both as a python program and using pdflatex
to produce the output. But, ... it prints the table on the second page,
despite there being plenty of room for it on the first page.

  No matter how often I look at the code, I don't see what's pushing the
table to the next page. Probably fresh eyeballs will spot it right away.

Thanks,

Rich

--
Richard B. Shepard, Ph.D.               |  Integrity            Credibility
Applied Ecosystem Services, Inc.        |            Innovation
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
#!/usr/bin/env python

import os, sys, config

preamb = """
  \\documentclass[oneside,english]{article}
  \\usepackage{palatino}
  \\usepackage[T1]{fontenc}
  \\usepackage[latin1]{inputenc}
  \\usepackage[dvips] {geometry}
  
\\geometry{verbose,letterpaper,tmargin=1cm,bmargin=0cm,lmargin=1.5cm,rmargin=9.0cm}
  \\pagestyle{empty}

  \\makeatletter

  \\date{}
  \\setlength\\headsep{0.4cm}
  \\setlength{\\textheight}{20.5cm}
  \\setlength{\\textwidth}{12.0cm}

  \\usepackage{babel}
  \\makeatother
  
  \\begin{document}
  
  """

ending = """\\end{document}"""
  
def econPairs():
  pairData = [("Jobs","Tax base"),
              ("Jobs","Infrastructure"),
              ("Jobs","Schools"),
              ("Jobs","Housing"),
              ("Jobs","Medical care"),
              ("Jobs","Sustainability"),
              ("Jobs","Traffic volume"),
              ("Tax base","Infrastructure"),
              ("Tax base","Schools"),
              ("Tax base","Housing"),
              ("Tax base","Medical care"),
              ("Tax base","Sustainability"),
              ("Tax base","Traffic volume"),
              ("Infrastructure","Schools"),
              ("Infrastructure","Housing"),
              ("Infrastructure","Medical care"),
              ("Infrastructure","Sustainability"),
              ("Infrastructure","Traffic volume"),
              ("Schools","Housing"),
              ("Schools","Medical care"),
              ("Schools","Sustainability"),
              ("Schools","Traffic volume"),
              ("Housing","Medical care"),
              ("Housing","Sustainability"),
              ("Housing","Traffic volume"),
              ("Medical care","Sustainability"),
              ("Medical care","Traffic volume"),
              ("Sustainability","Traffic volume")]

    
  ratingTab = """\\begin{tabular}{cl} \\hline
                 Importance Value & Definition  \\\\ 
                 \\hline
                 1 & Equal importance \\\\
                 3 & Weak importance of one over the other \\\\
                 5 & Strong importance of one over the other \\\\
                 7 & Demonstrated importance of one over the other \\\\
                 9 & Absolute importance of one over the other \\\\
                 2, 4, 6, 8 & Intermediate values between the two adjacent 
definitions \\\\
                \\hline
                \\end{tabular}
            """

  instructPara = """Using the table below, determine your preference for either 
the first
                    item of the pair (on the left), or the second (on the 
right). Use the
                    rating table to determine the strength of your preference, 
then fully
                    fill in the rectangle for that preference strength on the 
same line as
                    the component pairs. If you prefer the second more than the 
first,
                    also completely fill in the last box on the right."""

  title = "Economic Components"

  out = open(r"./reports/omrPairs.tex", 'w')
  out.write(preamb)
  
  out.write('\\hspace{60mm}')
  out.write('\\begin{Large}\\bfseries ')
  out.write(title)
  out.write('\\end{Large}')
  #out.write('\\textnormal{')
  out.write('\n''\n')
  out.write('\\vspace{1cm}')   # space below title to line up first line with 
OMR form
  out.write('\n''\n')
  out.write('\\hspace{43mm}')
  out.write('Fill in the box under \'Economic\' on this line -->')
  out.write('\n''\n')
  out.write('\\vspace{0.5cm}')
  out.write('\n''\n')
  out.write('\\hspace{47mm}')
  out.write('Record your position on the project here -->')
  out.write('\n''\n')
  out.write('\\vspace{1cm}')
  out.write('\n''\n')
  
  for left,right in pairData:
    out.write('\\hspace{45.6mm}')
    out.write(left)
    out.write('\\hspace{\\fill}')
    out.write(right)
    out.write('\n''\n')
    

  out.write('\\vspace{10mm}')
  out.write(instructPara)
  out.write('\n' '\n')
  #out.write('\\vspace{5mm}')
  out.write(ratingTab)

  out.write(ending)
  out.close()

if __name__ == "__main__":
  econPairs()

Reply via email to