Mathematica - How to set default stylesheet - wolfram-mathematica

I want to change my default stylesheet to StandardReport, but all I find when I google this problem is how to set a custom stylesheet as default stylesheet. Can someone please tell me how I set a non-custom stylesheet as default.

This should do it
SetOptions[$FrontEnd, DefaultStyleDefinitions->"Untitled.nb"]

I figured it out (for Windows):
1) Select the stylesheet you want to use as default (under "Format -> Stylesheet") (in my case I choose StandardReport).
2) Press "Format -> Edit Stylesheet". You should now see a line that says "Inheriting base definitions from stylesheet "Report"" ("Report" is different depending on which stylesheet you want to have as default).
3) Save the file as whatever name that pleases you, e.g. I used "Untitled.nb".
4) Place this file under "...\AppData\Roaming\Mathematica\SystemFiles\FrontEnd\StyleSheets".
5) In Mathematica, press "Format -> Option Inspector".
6) Choose "Show option values -> Global Preferences".
7) Search for "DefaultStyleDefinitions" and choose your file (in my case the "Untitled.nb" file).
You've now changed the default stylesheet for Mathematica. :)

Related

How to generate website with menu from an ASCII-Doc file?

I installed AsciiDoctor to generate html5-Websites from my ASCII-Doc files.
So far I did not find an option that generates a file like the one on e.g. http://www.asciidocfx.com/ or http://asciidoctor.org/docs/user-manual/ (i.e. (1) no footer with the date, (2) a menu on the left side and (3) linked headings.)
(How) Do I have to use templates for that?
I am not sure what you mean by "I have installed AsciiDoctor" are you using the Ruby version, the JavaScript version or the JVM Version (Ruby + JRuby)? How are you using Asciidoctor, directly from the command line or integrated in an other build system?
(1) I think (I am not sure about this one) that the footer is created if you have set the parameter docinfo1 to true. See Footer docinfo files.
(2) The menu on the left is called TOC (table of content), you might need add the parameter toc with the value left.
(3) The link on the headers are created when the parameter sectanchors has the value true. See the Anchors section.

Sublime Text 2 loading all shell scripts as plain text [duplicate]

I'd like Sublime 2 editor to treat *.sbt files (to highlight syntax) as Scala language, same as *.scala, but I can't find where to set this up. Do you happen to know?
In Sublime Text (confirmed in both v2.x and v3.x) there is a menu command:
View -> Syntax -> Open all with current extension as ...
I've found the answer (by further examining the Sublime 2 config files structure):
I was to open
~/.config/sublime-text-2/Packages/Scala/Scala.tmLanguage
And edit it to add sbt (the extension of files I want to be opened as Scala code files) to the array after the fileTypes key:
<dict>
<key>bundleUUID</key>
<string>452017E8-0065-49EF-AB9D-7849B27D9367</string>
<key>fileTypes</key>
<array>
<string>scala</string>
<string>sbt</string>
<array>
...
PS: May there be a better way, something like a right place to put my customizations (insted of modifying packages themselves), I'd still like to know.
I put my customized changes in the User package:
*nix: ~/.config/sublime-text-2/Packages/User/Scala.tmLanguage
*Windows: %APPDATA%\Sublime Text 2\Packages\User\Scala.tmLanguage
Which also means it's in JSON format:
{
"extensions":
[
"sbt"
]
}
This is the same place the
View -> Syntax -> Open all with current extension as ...
menu item adds it (creating the file if it doesn't exist).
For ST3
$language = "language u wish"
If exists, open ~/.config/sublime-text-3/Packages/User/*$language*.sublime-settings
else just create it.
And set
{
"extensions":
[
"*yourextension*"
]
}
This way allows you to enable syntax for composite extensions (e.g. sql.mustache, js.php, etc ... )
There's an excellent plugin called ApplySyntax (previously DetectSyntax) that provides certain other niceties for file-syntax matching. allows regex expressions etc.
There is a quick method to set the syntax:
Ctrl+Shift+P,then type in the input box
ss + (which type you want set)
eg: ss html +Enter
and ss means "set syntax"
it is really quicker than check in the menu's checkbox.
I know this topic is old now, but let me state a new approach, some people might find this easy to understand and do.
Open Sublime Text(make sure you have Package Control installed and ready in your Sublime Text):
Ctrl+Shift+P(or Cmd+Shift+P for MacOS guys)
Type "PRV"(Package Resource Viewer), select the one ending with :Open Resource
Type "SCALA"/"scala" and press Enter
Type Scala.sublime-syntax and press Enter and press Esc to close the
open list
Now in Scala.sublime-syntax goto the section file_extensions: and add your file extension sbt(like - sbt) in the end of that section
Save and close the file and restart Sublime Text, you'll now have
Scala syntax highlighting for your custom .sbt extension. Same steps can be done with any file type like XML, PHP, HTML, JS etc.
Pretty easy to follow, right ?

How do you set the default file extension for a syntax in Sublime Text 3?

I'm not asking about associating a syntax with a file extension, but about associating a file extension with a syntax. That is, setting the file extension suggested in the save file dialog after you create a new file, then set the syntax, then hit save.
You can change the extension in the save dialog, but it would be better not to have to do that every time.
For saving plain text files with a .txt extension by default, you can achieve this with a small plugin:
import sublime
import sublime_plugin
class DefaultPlainTextExtensionEventListener(sublime_plugin.EventListener):
def update_default_extension(self, view, syntax):
if syntax == 'Packages/Text/Plain text.tmLanguage':
view.settings().set('default_extension', 'txt')
elif view.settings().get('default_extension', None) == 'txt':
view.settings().erase('default_extension')
def on_new_async(self, view):
self.update_default_extension(view, view.settings().get('syntax'))
def on_post_text_command(self, view, command_name, args):
if command_name == 'set_file_type':
self.update_default_extension(view, args['syntax'])
elif command_name in ('paste', 'paste_and_indent'):
self.update_default_extension(view, view.settings().get('syntax'))
Note that we can't use the on_pre_save event because the file dialog has already been shown to the user by the point this is triggered, and the file name chosen.
The idea is that, when a new tab is created or the syntax is changed to Plain Text, it will set the default_extension setting to txt. If the syntax changes to something else, it will remove the default_extension.
For changing the default file extension for a syntax, it requires changing the .sublime-syntax file to re-order the file extensions set, so that the default one is first in the list.
(Using the default_extension referenced earlier is unreliable.)
So, for Markdown, you could do the following to change the default from .mdown to .md:
Install PackageResourceViewer if it is not already installed
Open the Command Palette
Type PRV: O
Select PackageResourceViewer: Open Resource
Select Markdown
Select Markdown.sublime-syntax
Find where it says:
file_extensions:
- mdown
- markdown
- markdn
- md
Change it so that md is at the top:
file_extensions:
- md
- mdown
- markdown
- markdn
Save the file
Then, when you create a new tab, set the syntax to Markdown and save it, it will default to the .md file extension.
Note that you could try to create an issue/PR at the relevant GitHub repo, if you believe that changing the default could benefit others too and want to see the repo maintainer's reaction.
Are you also trying to set, say, .txt. as the default file extension for when saving plaintext documents? I've looked around and as far as I've seen it's not currently possible to do so. Sadly the default Plain Text content type appears to be the only one that DOESN'T default to its specific .txt extension even though it exists in the Save as type dropdown in the Save As window:
I've seen the AdvancedNewFile plugin recommended as a way to work around this but I don't have any personal experience with it.

Forced line break after option name

Default product options view place the option name on a line, forces a line break, and then displays options beneath.
Anyone know where/which changes need to be made to remove the line break so that the option choice displays next to the option name?
I'm using Magento 1.6.2 Community. Thanks!
You can achieve this with just css, just put a float left on the label and inputbox.
The easiest way to find out where a template file is located in magento is to turn on template path hints
See How do I turn on template path hints
Also you may want to use 'chrome inspect element' or 'firebug for firefox' to see if you can restyle it using css.

How to customise file type to syntax associations in Sublime Text?

I'd like Sublime 2 editor to treat *.sbt files (to highlight syntax) as Scala language, same as *.scala, but I can't find where to set this up. Do you happen to know?
In Sublime Text (confirmed in both v2.x and v3.x) there is a menu command:
View -> Syntax -> Open all with current extension as ...
I've found the answer (by further examining the Sublime 2 config files structure):
I was to open
~/.config/sublime-text-2/Packages/Scala/Scala.tmLanguage
And edit it to add sbt (the extension of files I want to be opened as Scala code files) to the array after the fileTypes key:
<dict>
<key>bundleUUID</key>
<string>452017E8-0065-49EF-AB9D-7849B27D9367</string>
<key>fileTypes</key>
<array>
<string>scala</string>
<string>sbt</string>
<array>
...
PS: May there be a better way, something like a right place to put my customizations (insted of modifying packages themselves), I'd still like to know.
I put my customized changes in the User package:
*nix: ~/.config/sublime-text-2/Packages/User/Scala.tmLanguage
*Windows: %APPDATA%\Sublime Text 2\Packages\User\Scala.tmLanguage
Which also means it's in JSON format:
{
"extensions":
[
"sbt"
]
}
This is the same place the
View -> Syntax -> Open all with current extension as ...
menu item adds it (creating the file if it doesn't exist).
For ST3
$language = "language u wish"
If exists, open ~/.config/sublime-text-3/Packages/User/*$language*.sublime-settings
else just create it.
And set
{
"extensions":
[
"*yourextension*"
]
}
This way allows you to enable syntax for composite extensions (e.g. sql.mustache, js.php, etc ... )
There's an excellent plugin called ApplySyntax (previously DetectSyntax) that provides certain other niceties for file-syntax matching. allows regex expressions etc.
There is a quick method to set the syntax:
Ctrl+Shift+P,then type in the input box
ss + (which type you want set)
eg: ss html +Enter
and ss means "set syntax"
it is really quicker than check in the menu's checkbox.
I know this topic is old now, but let me state a new approach, some people might find this easy to understand and do.
Open Sublime Text(make sure you have Package Control installed and ready in your Sublime Text):
Ctrl+Shift+P(or Cmd+Shift+P for MacOS guys)
Type "PRV"(Package Resource Viewer), select the one ending with :Open Resource
Type "SCALA"/"scala" and press Enter
Type Scala.sublime-syntax and press Enter and press Esc to close the
open list
Now in Scala.sublime-syntax goto the section file_extensions: and add your file extension sbt(like - sbt) in the end of that section
Save and close the file and restart Sublime Text, you'll now have
Scala syntax highlighting for your custom .sbt extension. Same steps can be done with any file type like XML, PHP, HTML, JS etc.
Pretty easy to follow, right ?

Resources