Is there a way to get rid of the unused space on the left of the package editor?
What is it's purpose if I configured Mathematica to not show In
and Out
names? (Using Mathematica 10.1).
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityQuick fix for a specific file:
Ok, let's open new package File -> New -> Package
.
It was second on my list of Notebooks[]
. So:
package = Notebooks[][[2]]
This is a notebook as any other, it just has different stylesheet ("Package.nb"
) and we can modify it as any other:
SetOptions[ package, {
StyleDefinitions -> Notebook[{
Cell[StyleData[StyleDefinitions -> "Package.nb"]],
Cell[StyleData["Code"], CellMargins -> {{0, 0}, {0, 0}}]
}],
ShowCellLabel -> False,
ShowGroupOpener -> False}
]
(notice that we are styling "Code" cell as this is the default one)
General approach to modifying built in stylesheets
This was set just for that .m file. If you want to set it globally edit the Package.nb
stylesheet.
It is not so easy, you need privileges to work in $InstallationDirectory
, system packages are not Editable
and you risk breaking base files.
Here is a way to go to avoid those problems: copy stylesheet to the $UserBaseDirectory
, enable editing and do whatever you need:
CopyFile @@ ( FileNameJoin[
{#, "SystemFiles", "FrontEnd", "StyleSheets", "Package.nb"}
] & /@ {
$InstallationDirectory, $UserBaseDirectory
})
SetOptions[NotebookOpen @ %, {Editable -> True, Saveable -> True}]
In
and Out
are still available, you just can't see which cells they are referring to.
$\endgroup$
CellMargins
:) $\endgroup$