Re:Exporting PRINT results from Mathematica to other applications
- To: mathgroup at smc.vnet.net
- Subject: [mg18871] Re:[mg18859] Exporting PRINT results from Mathematica to other applications
- From: hanssen at zeiss.de
- Date: Sun, 25 Jul 1999 03:30:08 -0400
- Sender: owner-wri-mathgroup at wolfram.com
P.J. Hinton writes: > > In article <7n68sa$gua at smc.vnet.net>, hanssen at zeiss.de writes: > >> recently, there was a thread "Exporting results from Mathematica to >> other applications" in this group, e.g. mg17737, mg17672. >> We learned from it, first to convert output cells to OutputForm using >> the ConvertTo command. Later one has to select and use >> Edit>Copy as>Text. >> >> If one does this with cells generated with Print, which also contain >> formatted numbers (e.g. generated with one or the other option of >> PaddedForm or 100*Round[#/100]& etc), the well formatted numbers are >> sometimes extended with insignificant digits and the proper formatting >> is gone. I have not yet found out, when exactly this happens, at >> least it is highly undesireable. >> >> Any idea, how to avoid around this (it happens in Matheamtica 3.0.1.1x, >> what about Mathematica 4)? > > > I suspect that the problem you are encountering is a ramification of > using StandardForm as your default output format type. You can force > plain text to be used in Print and other kernel output cells by clicking > on the front end menu command sequence > > Cell -> Default Output Format Type -> InputForm > > or by evaluating an appropriate SetOptions[] command. > > sets option on a global level > > SetOptions[$FrontEnd, > CommonDefaultFormatTypes -> {"Output" -> OutputForm}] > > sets option on an individual notebook level > > SetOptions[EvaluationNotebook[], > CommonDefaultFormatTypes -> {"Output" -> OutputForm}] > > If you wish to retain StandardForm for output, you could write an > override function for Print[] that does something similar to the > OutputForm. > > Unprotect[Print] > > Remove[Print] > > System`Print[expr___] := > CellPrint[ > Cell[TextData[StringJoin[Map[ToString[#, OutputForm] &, {expr}] ]], > "Print"]] > > Protect[Print] > Hi, Paul, Manipulating Cell -> Default Output Format Type -> InputForm has the disadvantage, that strings appear in quotation marks. BTW, setting it to anything but StandardForm has the side effect, that the order of printing and plotting is disturbed: all subsequent Print's go to one cell and Plots below that. Your second hint, automaticly to convert all print output to String and join them all together, works fine. Is there any objection against putting your override function for Print to ...AddOns\Autoload\Init.m ? Thanks for your response and kind regards Dipl.-Math. Adalbert Hanszen