Message Boards Message Boards

2
|
7143 Views
|
2 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Any Chance of Improving Code Display in Community Posts?

Posted 9 years ago

It can sometimes be cumbersome to decipher code that appears differently than it does in a Mathematica notebook. For example,

(-1)^k/Sqrt[1.5^k] Sin[(-1)^k Sqrt[1.5^k] t]

as compared to

enter image description here

Any chance that we will be able to post and view code on community posts exactly as it appears in Mathematica?

POSTED BY: Bryan Lettner
2 Replies

I guess why the former is preferred over the latter is because the former is copy-pasteable, while the latter is not. You can however add formulas in TeX:

(-1)^k/Sqrt[1.5^k] Sin[(-1)^k Sqrt[1.5^k] t] // TeXForm

and pasting that between dollar signs here:

$\frac{(-1)^k \sin \left((-1)^k \sqrt{1.5^k} t\right)}{\sqrt{1.5^k}}$

EDIT: strange I didn't see the above post! Now it appeared!

POSTED BY: Sander Huisman

The Community code formating is a good balance between displaying code and being able to copy-paste it without errors into Mathematica or Wolfram Cloud notebook. For most of the cases Community code formating here does a good job. For the cases when more math-like formating is needed we recommend also (in-addition) using an image, as you did yourself. Or you can use MathJax and TeXForm and symbol $:

TeXForm[(-1)^k/Sqrt[1.5^k] Sin[(-1)^k Sqrt[1.5^k] t]]

\frac{(-1)^k \sin \left((-1)^k \sqrt{1.5^k} t\right)}{\sqrt{1.5^k}}

so using the above TeX between $ you get:

$$\frac{(-1)^k \sin \left((-1)^k \sqrt{1.5^k} t\right)}{\sqrt{1.5^k}}$$

More detailed information is in the tutorial that is linked from the top of main page:

READ FIRST: How to post and use Wolfram Community

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract