What kind of Input and Output Code Styles are acceptable in SE?
These days I've heard about some comments (suggestions) about formatting. Some are my apparent error usages, and some are acceptable in my present point of view, but may receive criticism.
I am new in formatting, and I think new visitors would also confront formatting problems. I still remember my first several posts downvoted and closed.(So I feel happy when see some other's closed posts.) My philosophy is writing in Notebook and copy that to SE directly with good form. Also need work by hand but should as little as possible.
Let me say my confusion by examples.
1.About Input
This is the look in Notebook, with Input and Output tags.
In[22]:= sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
I've seen someone's posts with such tags, and I that's not a good job to remove the tags to evaluate when one copied and pasted code into Notebook.
I'd like to use tags/signposts. Tags/Signposts are conceived to use in such cases.
How to combine
Input[11]
andInput[12]
to get the result.
Multiple output results are pictures which do not follow the input but in the end of the post being a total image. This is one previous example. mathematica.stackexchange.com/a/26932/6648
style 1:
(*In[22]:=*) sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
style 2:
(*In[22]:=*) sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
But I'd like this: The problem is if we should edit the second line of the code, should type 16 spaces, though I do it by program. So if acceptable, I'll use it.
style 3:
(*In[22]:=*)
sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
Problem with style 2, new lines should only type 4 spaces as much as the first line. But maybe it is not with a good look of (*In[22]:=*)
in one separate line.
style 4:
(*Input ==> 1*) sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
style 5:
(*Input ==< 1*) sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
style 6:
(==========================================================================>Input 1*)
sample1 = "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
2. About output
Some are same to that about input. There is some problems/confusions with the usage of blockquotes. The appearance in meta are not the same to that of main site(I like yellow background).
with (* *)
we can copy directly the two input codes (with outputs between them) into Notebook, maybe with blockquotes, we can also use one code extractor
to import to Notebook too.
But rm-rf seems disagree with the usage of blockquotes in output.
And I see Mr.Wizard and someone else do not use the (* *)
in output, but just use blockquotes with codeblock for output.
style 1:
(*Output==> 1 "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";*)
style 2:
(*Output==> 1*) "[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss";
style 3:
(*"[AA]AB[AA]BB[AA]B[AA]\
CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"*);
style 4:
(*"[AA]AB[AA]BB[AA]B[AA]\ CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss"*);
style 5:
(* "[AA]AB[AA]BB[AA]B[AA]\ CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss" *);
style 6:
(* Output==> "[AA]AB[AA]BB[AA]B[AA]\ CCCsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss" *);
I'll edit if necessary to add more kinds of styles and questions.
Links of my posts with some problems. Some are hidden in the revision history. Sometimes when I use one seems acceptable formatting, and still will be edited by others with another formatting, then I doubted my older usage of some acceptable formatting(not those obvious errors.)
Replace with position and order number
StringReplace except some pattern
https://mathematica.stackexchange.com/a/26932/6648
https://mathematica.stackexchange.com/a/27084/6648
InputForm
without any cell labels commented or not (we don't care if you're now atIn[973]
) and output commented out, to allow for easy copying. Some add an additional quote block if it's important to highlight it, but ignore it otherwise. You might find occasional differences here and there, but that is not a reason to try and use every arcane style in your posts one-by-one to see what sticks. If you haven't noticed already, there have been a few unhappy grumblings re: your style experiments...Table
).