Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coloring "horizontal line" in Mathematica

Is there anyway to have those lines automatically Black in Mathematica ?

enter image description here

enter image description here

like image 451
500 Avatar asked Dec 12 '22 09:12

500


2 Answers

The default style of those lines is defined in the file ContextMenus.tr located in the subdirectory SystemFiles/FrontEnd/TextResources of $InstallationDirectory. If you search for "CellInsertionPoint" in that file then you should find something like

"CellInsertionPoint" -> {
  ....
  Menu["Insert Ho&rizontal Line",
    {
     MenuItem["Thi&n Line", FrontEndExecute[{
       FrontEnd`NotebookWrite[FrontEnd`InputNotebook[], 
        Cell[" ", "Text", 
         ....
         CellFrameColor->RGBColor[0,0,1]], 
       After]
      }]],
     MenuItem["&Medium Line", FrontEndExecute[{
         .....    
         CellFrameColor->RGBColor[0,0,1]], 
       After]
      }]],
     MenuItem["&Thick Line", FrontEndExecute[{   
         .....
         CellFrameColor->RGBColor[0,0,1]], 
       After]
      }]],
  ....
}

To permanently change the default colour of the horizontal lines you could set CellFrameColor of these three MenuItems to whatever colour you want (or you could create extra MenuItems if you want more choice). Note that you need to restart Mathematica for the changes to take effect.

If you don't want to change the original file you can also save a copy of the file to the appropriate subdirectory in either $BaseDirectory or $UserBaseDirectory and edit that.

like image 94
Heike Avatar answered Dec 19 '22 02:12

Heike


Heike has the answer, but in the unlikely case you don't want to mess with those .tr files you could also execute

NotebookPut[
  NotebookGet[
    SelectedNotebook[]] /. {
      Cell[" ", "Text", x___, CellFrameColor -> RGBColor[___], y___] :> 
      Cell[" ", "Text", x, CellFrameColor -> RGBColor[0, 0, 0], y]}, 
  SelectedNotebook[]];

and turn every cell frame (the lines are just cell frames) black.

like image 24
Sjoerd C. de Vries Avatar answered Dec 19 '22 03:12

Sjoerd C. de Vries