From: Petra M. <Pet...@mc...> - 2008-04-17 23:14:51
|
Hi Pablo, > I believe I do have to create a new SectionManager where I could > transfer all the information. The example I gave was a simplified > version of my problem. Actually, I don't have the information I want to > print contained in a .tex file. > > Assume that you have a method that takes an AxPara object and returns a > different AxPara object, while preserving the original one. Then, the > new AxPara object is not linked from any Spec object and then, from any > SectionManager. Could a solution be adding the new AxPara object to the > ZParaList where the original AxPara object is contained so I can follow > the way you suggested? Dealing with transformed specifications or even parts of specifications in the section manager is a bit tricky and I can't give you a nice general answer. The problem with your current approach is that you take the transformed AxPara out of its context. This works fine as long as it does not contain user defined operators. If there are user defined operators in it, the precedence of these operators is needed when the term is printed (brackets may be required in some places). If you don't change anything about the user defined operators, you might copy the operator table (class OpTable) to the new section manager, too (just ask the old section manager for the Key(specName, OpTable.class)). There is a similar problem regarding the latex markup table (class LatexMarkupFunction). This information is used when you try to print funny latex characters (like the one for \fun). In the AST, there is only the Unicode character but when you want to print it in LaTeX you have to define a latex command first (like %%Zinchar \fun U+2192). It is best to reuse existing definitions, that is, use \fun whenever the Unicode character 2192 needs printing. Again, you might just copy the latex markup table into the new section manager, or try to create an empty one to get rid of the warning. The other option is the one you mentioned above but it sounds ugly too. You probably can just add the new AxPara to the ZParaList but then you change the original specification and you might get into trouble later. Is this changed specification still typecheckable, for example? I'd suggest try copying OpTable and LatexMarkupFunction (if it exists) to the new section manager and see how it goes. Cheers, Petra |