MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Named Formats? (followup question)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65884] Re: [mg65862] Re: Named Formats? (followup question)
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Thu, 20 Apr 2006 05:15:22 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com
  • Sender: owner-wri-mathgroup at wolfram.com

On Thu, 20 Apr 2006 09:58:23 +0400, Maxim wrote:
>
>
> -----Original Message-----
> From: John Fultz <jfultz at wolfram.com>
To: mathgroup at smc.vnet.net
> To: <m.r at inbox.ru>, <mathgroup at smc.vnet.net>
> Date: Wed, 19 Apr 2006 11:17:58 -0500
> Subject: [mg65884] Re: [mg65862] Re: Named Formats? (followup question)
>
>>
>> On Wed, 19 Apr 2006 04:54:17 -0400 (EDT), Maxim wrote:
>>> On Mon, 17 Apr 2006 07:38:36 +0000 (UTC), Paul Abbott
>>>
>>> <paul at physics.uwa.edu.au> wrote:
>>>
>>>> In article <e1surj$cjf$1 at smc.vnet.net>, AES <siegman at stanford.edu>
>>>> wrote:
>>>>
>>>>> I like to work in Mathematica with screen magnification 125% or
>>>>> 150%,
>>>>> cells wrapped to window width, then convert to 100%
>>>>> magnification,
>>>>> cells
>>>>> wrapped to page width, and Show Page Breaks turned on for
>>>>> printing to
>>>>> paper -- or maybe other options for print to PDF.
>>>>>
>>>>> Is there any kind of "named format" capability, akin to Style
>>>>> Sheets,
>>>>> that would enable one to switch between these options in one
>>>>> click
>>>>> (or
>>>>> maybe by executing one notebook cell?), instead of having to
>>>>> execute
>>>>> a
>>>>> multi-step sequence of menu commands?
>>>>>
>>>> Called Environments, they are part of the StyleSheet functionality.
>>>>
>>>> For the "Working" style set
>>>>
>>>> Magnification->1.5,
>>>> PageWidth->WindowWidth,
>>>>
>>>> and for the "Printout" style set (the default)
>>>>
>>>> PageWidth->PaperWidth,
>>>>
>>>> Using the "ShowPageBreaks" Front End Token you can Show Page
>>>> Breaks:
>>>>
>>>> FrontEndExecute[{FrontEndToken[
>>>> FrontEnd`EvaluationNotebook[], "ShowPageBreaks"]}]
>>>>
>>>> Note that this is a toggle -- executing it if page breaks are
>>>> showing
>>>> turns it off.
>>>>
>>>> However, there does not seem to be a Front End Token for switching
>>>>
>>>> Format | Screen Style Environment | Working
>>>>
>>>> to
>>>>
>>>> Format | Screen Style Environment | Printout
>>>>
>>>> Cheers,
>>>> Paul
>>>>
>>>
>>> For some reason the first command works but the second one doesn't:
>>>
>>> FrontEndTokenExecute[
>>> "Format", "ScreenStyleEnvironment", "Presentation"]
>>>
>>> FrontEndTokenExecute[SelectedNotebook[],
>>> "Format", "ScreenStyleEnvironment", "Presentation"]
>>>
>>> Maxim Rytin
>>> m.r at inbox.ru
>>>
>> SelectedNotebook[] doesn't always point to the notebook you might
>> expect on
>> non-Windows platforms -- partly due to FE bugs, and partly due to
>> operating
>> system limitations.
>>
>> But, most of the time, when you're thinking SelectedNotebook[], you
>> really
>> mean InputNotebook[], which is the notebook that all keystrokes go to
>> (SelectedNotebook[] may refer to a palette, which can be selected but
>> can
>> never receive input).
>>
>> Alternatively, you could also have used EvaluationNotebook[], which is
>> the
>> notebook that the current evaluation is running in.
>>
>> Sincerely,
>>
>> John Fultz
>> jfultz at wolfram.com
>> User Interface Group
>> Wolfram Research, Inc.
>>
>>
> Yes, but on my system (Windows XP) it doesn't work regardless of which
> notebook I specify as the first argument...
>
> Maxim Rytin
> m.r at inbox.ru

Sorry...the SelectedNotebook[] issue is a common enough question that I 
overlooked the real issue.

The "Format" argument is meaningless.  Your first command "works" because 
of an accident of how argument-handling is done...the "Format" string was, 
in fact, incidental.  The front end token you're trying to access is 
"ScreenStyleEnvironment", and its value is "Presentation".  These are the 
only two values you care about.  So, what you want is, e.g.,

FrontEndTokenExecute[
  InputNotebook[], "ScreenStyleEnvironment", "Presentation"]

Of course, the more common idiom for doing this would be SetOptions...

SetOptions[InputNotebook[], ScreenStyleEnvironment->"Presentation"]

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.



  • Prev by Date: warning messages with Nintegrate and FindMinmum
  • Next by Date: Re: mathematica programming
  • Previous by thread: Re: Re: Named Formats? (followup question)
  • Next by thread: calculating contradicts plotting