Questions tagged [code-formatting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
0answers
97 views

Post contains a code that is not properly formatted

I am trying to post this question on Mathematica StackExchange but I am getting an error that my code is not properly formatted. I double-checked every line for some time now, but I cannot find an ...
3
votes
1answer
139 views

Post without code supposed to “contain code that is not properly formatted”

I'm trying to post a question but keep getting the error Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button ...
15
votes
1answer
168 views

First-time posts with unformatted code should be automatically caught

tl;dr This is a feature request to enable automatically detecting unformatted code in first-time posts, and show a helpful message to the poster on how to fix it. According to the following meta post,...
3
votes
1answer
104 views

How to input ` in StackExchange [duplicate]

The ` is used to close the code-inline,But how can I input following code?
1
vote
0answers
42 views

Markdown broken [duplicate]

What is wrong with the markdown prettifier here? opts = { "$dollar$" :> "$", "$percent$" :> "%", }; Just to clarify the issue only appears on mathematica.stackexchange like it does ...
7
votes
0answers
146 views

\[DifferentialD] not displayed correctly in Mathematica StackExchange

\[DifferentialD] apparently does not have a Unicode representation, so I had to enter it directly in a reformatting of question 83672. However, I noticed that it is displayed in blue, as if it were ...
4
votes
2answers
101 views

How to place nicely parsed code into an answer

I have seen many answers where there is nicely parsed Mathematica code in the answer. When I attempted to answer a question and pasted in the code, all the spaces and line breaks were removed so it ...
10
votes
2answers
165 views

Backquotes in titles

I'm not sure whether backquotes in titles are supposed to work, or whether they don't currently work, or whether they shouldn't be used. See this question for an example. I know that the math stuff ...
5
votes
1answer
210 views

What to do with brackets in function[]-style references?

Recently I encountered more and more situations where the poster/editor explicitly used function[] instead of function when referencing built-in functions (i.e. Dot[] instead of Dot). What is the ...
10
votes
3answers
698 views

Representation of special symbols in posted code blocks

Since we have decided that pasted code is favorable to pasted images of code, I think there's another issue to resolve: How should the code be pasted? A good examle are Greek letters. A code sprinkled ...
13
votes
2answers
138 views

Should we encourage all users to post code in code-blocks instead of pictures?

On occasion, on SO and here, posters will post there code as pictures and not in code-blocks. As a group, should we encourage or discourage this practice?
20
votes
4answers
1k views

How should I include code samples in posts?

What are best practices for including sections of Mathematica code in posts? Mathematica differs from many programming languages because many of us use it in "REPL" (read-evaluate-print-line) mode, ...
12
votes
2answers
169 views

Can we have code auto-formatting and do we need to tweak what we had on the StackExchange tag?

This question is captured pretty well by its title, but for more background, on the mathematica on StackExchange we have pretty-printing on the code blocks (see here for some more explanation). I ...