|  | 
| def | __init__ (self, name, picture) | 
|  | 
| def | open_latex_code (self) | 
|  | 
| def | close_latex_code (self) | 
|  | 
| def | latex_code (self) | 
|  | 
| def | add_latex_line (self, line) | 
|  | 
| def | makeWriteValue (self, Id, value) | 
|  | 
| def | id_values_dict (self) | 
|  | 
| def | get_Id_value (self, Id, default_value=0) | 
|  | 
| def | get_counter_value (self, counter_name, default_value=0) | 
|  | return the value of the (LaTeX) counter <name> at this point of the LaTeX file.  More... 
 | 
|  | 
| def | get_box_dimension (self, tex_expression, dimension_name, default_value="0pt") | 
|  | 
| def | get_box_size (self, tex_expression, default_value="0pt") | 
|  | 
The auxiliary file serves to make a 'dialog' between LaTeX and phystricks. 
We ask LaTeX to write the box sizes therein.
Each `Picture` has an auxiliary file.
 
      
        
          | def phystricks.src.AuxFile.AuxFile.get_box_size | ( |  | self, | 
        
          |  |  |  | tex_expression, | 
        
          |  |  |  | default_value = "0pt" | 
        
          |  | ) |  |  | 
      
 
return as 2-uple the dimensions of a LaTeX box containing an expression.
INPUT:
- ``tex_expression`` - a valid LaTeX expression.
OUTPUT:
- ``width,height`` - the dimensions of the box in centimeter.
EXAMPLE:
Type the following  in a script :
text = "$A_i=\int_a^bf_i$"
dimx,dimy=pspict.get_box_size(text)
print "The dimensions of the LaTeX text %s is (%s,%s)"%(text,str(dimx),str(dimy))
After having LaTeX-compiled the document containing the pspicture, a second
execution of the script should print :
The dimensions of the LaTeX text $A_i=\int_a^bf_i$ is (1.66653833333,0.46667)
NOTE:
As far as the problem is concerned from a LaTeX point of view, it was discussed here:
http://groups.google.fr/group/fr.comp.text.tex/browse_thread/thread/8431f21588b81530?hl=fr
This functionality creates an intermediate file.
 
 
 
      
        
          | def phystricks.src.AuxFile.AuxFile.get_counter_value | ( |  | self, | 
        
          |  |  |  | counter_name, | 
        
          |  |  |  | default_value = 0 | 
        
          |  | ) |  |  | 
      
 
return the value of the (LaTeX) counter <name> at this point of the LaTeX file. 
Makes LaTeX write the value of the counter in an auxiliary file, then reads the value in that file. (needs several compilations to work)
- Returns
- a float.
If you ask for the page with for example page = pspict.get_counter_value("page") the given page will be the one at which LaTeX thinks the figure lies. Since a figure is a floating object, if you have many of them in a row, the page number could be incorrect.