TransWikia.com

How to automatically center the alignment of all output cells?

Mathematica Asked by Amir Gat on December 9, 2020

How can one change the default output alignment from left to center?

2 Answers

You can use $PrePrint to add the option TextAlignment -> Center to all output cells in the current session:

$PrePrint = Style[#, "Output", TextAlignment -> Center] &;

enter image description here

To restore $PrePrint to the default value use

$PrePrint =.

If the notebook contains output cells created before $PrePrint is invoked, you can use

Scan[SetOptions[#, TextAlignment -> Center] &, Cells[CellStyle -> "Output"]]

to change their alignment.

enter image description here

Answered by kglr on December 9, 2020

You can change the stylesheet of the notebook to style all output cells accordingly:

You can find several questions on how to permanently install such stylesheets or how to programmatically change it in the official documentation and on this site, for example here and here.

Answered by Lukas Lang on December 9, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP