phystricks
Public Member Functions | Public Attributes | Private Attributes | List of all members
phystricks.src.AuxFile.AuxFile Class Reference
Inheritance diagram for phystricks.src.AuxFile.AuxFile:
Inheritance graph
[legend]
Collaboration diagram for phystricks.src.AuxFile.AuxFile:
Collaboration graph
[legend]

Public Member Functions

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")
 

Public Attributes

 name
 
 picture
 
 newwriteName
 
 interWriteFile
 
 already_used_interId
 
 already_warned_CompileYourLaTeXFile
 
 interId_to_tex_expression
 

Private Attributes

 _latex_line_list
 

Detailed Description

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.

Constructor & Destructor Documentation

def phystricks.src.AuxFile.AuxFile.__init__ (   self,
  name,
  picture 
)

Member Function Documentation

def phystricks.src.AuxFile.AuxFile.add_latex_line (   self,
  line 
)
def phystricks.src.AuxFile.AuxFile.close_latex_code (   self)
def phystricks.src.AuxFile.AuxFile.get_box_dimension (   self,
  tex_expression,
  dimension_name,
  default_value = "0pt" 
)
Return the dimension of the LaTeX box corresponding to the LaTeX
expression `tex_expression`.

dimension_name is a valid LaTeX macro that can be applied to
a LaTeX expression and that return a number. Like
widthof, depthof, heightof, totalheightof
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.

def phystricks.src.AuxFile.AuxFile.get_Id_value (   self,
  Id,
  default_value = 0 
)
def phystricks.src.AuxFile.AuxFile.id_values_dict (   self)
Build the dictionary of stored values in the auxiliary file and rewrite that file.
def phystricks.src.AuxFile.AuxFile.latex_code (   self)
def phystricks.src.AuxFile.AuxFile.makeWriteValue (   self,
  Id,
  value 
)
def phystricks.src.AuxFile.AuxFile.open_latex_code (   self)

Member Data Documentation

phystricks.src.AuxFile.AuxFile._latex_line_list
private
phystricks.src.AuxFile.AuxFile.already_used_interId
phystricks.src.AuxFile.AuxFile.already_warned_CompileYourLaTeXFile
phystricks.src.AuxFile.AuxFile.interId_to_tex_expression
phystricks.src.AuxFile.AuxFile.interWriteFile
phystricks.src.AuxFile.AuxFile.name
phystricks.src.AuxFile.AuxFile.newwriteName
phystricks.src.AuxFile.AuxFile.picture

The documentation for this class was generated from the following file: