This question already has an answer here:

One of the most common responses from the experts when a question is first posted is along this line: "Can you show me what you've got by submitting a minimal working example (MWE)?"

That prompts the question of whether a basic "how to" would be helpful.

Edit to address the distinction between @marmot's very valid point regarding content, accompanying by @Werner's thoughts in a similar direction, and the link to that "dissertation" response, and @Troy's and @DavidCarlisle's points addressing the "how to."

The "dissertation" at the linked-to question doesn't say simply, "This is all we need you to do," when it comes to the process of adding the code segment. The more I've studied that, the more obvious it is that this question is magnificently distinct, because "how to" is a mere afterthought included pretty much at the very tail end of that "dissertation." That one addresses "content" of the MWE. Some do have an issue deciding what is "essential;" hence the value in the "dissertation" and @marmot's suggestion that one not focus solely on the "how to."

However, this is not a duplicate of that "dissertation." To be into \LaTeX, at all, is, if not a self-evident moniker of moxy, a suggestion of some level of interest or capability with coding. I don't think the vast majority of OPs have a problem with the notion of "minimal." The "dissertation" addresses "minimal," not "how to." So, my question exits to point out that what we're talking about isn't so much a matter of understanding "minimal" as it is understanding the basic "how to" in getting the contents of one's .tex file into the question.

Where the OP sees the simplicity of the mechanics, of the process, of copy/paste from the .tex file into the question window, whether edited for the needed leading spaces before or after "pasting," I expect there'll be more MWE's submitted originally, and then, when submitted, submitted in the window rather than the comments section, where the OP has just a tad of "how to" guidance in the matter.

No, this question is in no way addressed by the "dissertation" question/answer regarding "content" of the MWE. Please remove the very distracting opening link.

marked as duplicate by Werner, CarLaTeX, Fran, David Carlisle, samcarter Sep 30 at 14:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

migrated from tex.stackexchange.com Sep 28 at 23:37

This question came from our site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

  • @Phelype Oleinik. Good catch. Yes. It may be. The part that I expect the new OPs need, though, is pretty much at the very bottom of that answer. But, I agree, this one and that are similar. I looked and looked and looked; didn't find anything addressing this. That one takes about "reduction," though, rather than "how to" get that minimized .tex file into the question. – Saphar Koshet Sep 28 at 22:57
  • Thanks greatly for your interest in this matter. Please remove the opening link. This "how to" (copy/paste) question / answer is in no way addressed by the "dissertation" question / answer regarding "content." Mention of the link as the "content" portion of the issue, as @marmot did originally, really should suffice. – Saphar Koshet Sep 29 at 9:46
  • 1
    So you're having an issue understanding how to insert code? You can just copy-and-paste code into the text box... or are you interested in the formatting of the code? If that's the case, then it's a duplicate of Is there some trick to writing code snippets?. – Werner Sep 29 at 16:13
  • @Werner Thanks for your time in this. The entire point of this Question/Answer has been totally and completely obfuscated, and I'm presently at a loss to understand why. What I see is a lot of, "Please submit MWE" comments, even where not really necessary, followed by a lot of, "How do I do that?" in the various ways that response arises. What I'm doing is taking the "Help" information out of it's present "Drink from this firehose" approach and turning it into a One-Question, One-Answer matter, per the theme of the forum, generally. No. I'm not the one having the issue. Others are. – Saphar Koshet Sep 30 at 1:56
  • 1
    @SapharKoshet The problem new users have is not, in my experience, the 'technical' business but the conceptual. They want to fix their issue in their document. Conveying that getting a fix is easier with a shortened example is hard to get across, I think for two reasons. First, newer users don't 'get' that 'a LaTeX document' might have content that makes it hard for us to reproduce an issue: 'but I see it, so you must'. Second, they need their file fixing, not some demo one. So explaining how a MWE helps us help them is the key. – Joseph Wright Sep 30 at 9:36
  • @JosephWright Thanks for your thoughts. Yes, and what we're talking about "here" is whether the MWE provided actually addresses their issue. That can't happen until they provide it, and where the "how to" on providing it is a(nother) barrier, a quick "how to" on providing it is what gets started what you're addressing. You're addressing "Step 2." I'm addressing "Step 0" or "Step 1." – Saphar Koshet Sep 30 at 12:18
  • Here's your "duplicate," at least in spirit. tex.meta.stackexchange.com/q/7388/170846 – Saphar Koshet Oct 1 at 22:52

These are the basics.

Basic editing features for TeX LaTeX Stack Exchange

For the text to show up as code, it needs to be indented four spaces.

A fast way to preformat the code is to do a "select all" of the MWE (minimum working example) (i.e., the contents of the .tex file) and then, within that text editor, indent the whole of the file (e.g., shift right, or indent, depending on the editor). Then, with a new "select all," copy the contents of that now once-indented MWE .tex file and paste straight into the input window. The parser for this forum sees the space leader on each row and knows to treat it as code.

If the preview (below the input window) doesn't look right, just delete part or all and try again.

A raised glass not only to the questions but also to the answers!

P.S. See also Similar question at meta

  • 5
    You can indent the code from within TeX.SE itself, with the {} button. – Troy Sep 28 at 22:53
  • 2
    You may want to add that an MWE is much more than just properly indented code. See this discussion for details. – marmot Sep 29 at 0:54
  • @marmot That's a good point. What you're talking about is the content, and content definitely matters. I think content is the main focus of the related question asking basically, "What constitutes a good MWE?" What I'm addressing is the mechanics of simply getting "something" (good, bad, indifferent) out of the OP's .tex file and into the question. Yes. Content definitely matters, but time after time, code segments end up in these comment sections until someone comes along and edits them into question itself. So, the main focus here is on the mechanics of "how to" add code to the question. – Saphar Koshet Sep 29 at 1:06
  • 2
    Well, all I am suggesting is that you mention that "an MWE is much more than just properly indented code". This does not mean that you should repeat the discussion under the link, but I'd like to argue that a link to the discussion might be worthwhile. – marmot Sep 29 at 1:08
  • This answer is making adding code seem far more complicated that it is, there is no need to edit in an external editor, just highlight it and use the {} button or simpler, type control-k. I think you should delete this answer as it's confusing for new users. Note the first paragraph of the help page that you link to already explains about control-k. – David Carlisle Sep 29 at 6:56
  • @DavidCarlisle. Or, if you would, add your experiences and observations as an answer. The objective here is to provide a quick-access, easy to read, i.e., "short," "how to." That one linked to at the top is the "confusing" answer. Marmot's point, clearly based on experience, is that while doing the copy/paste, consideration of content matters. My point is that those new to posting need simply to know which buttons to press to accomplish the objective of providing an MWE. You (and Tony) have an "improved" answer to this very basic "how to" question. Many will likely benefit by it. – Saphar Koshet Sep 29 at 9:11
  • 1
    But there is nothing here that isn't in the first few lines of the general stack exchange help page that you link to, and rest of the text in the answer is misleading at best, so there is really no answer needed other than highlight the markup help link. – David Carlisle Sep 29 at 10:05
  • @DavidCarlisle :) :) Hence the opening link to it, which, if known about and/or read by the OPs originally, would likely obviate the need for this question, and for the common requests for MWEs in the first place. I agree with you; it's all there. That by itself isn't "working." I provided an alternative to what's already there. You don't like the proposed alternative, which is great. At least your observations are responsive to the question, hence the request for an answer. If you'd like, instead, simply to support the use of the link I've already provided, that'll work, too. – Saphar Koshet Sep 29 at 10:10
  • @SapharKoshet there is a link to the markdown help page in every text box where you can post questions and answer on the site. – David Carlisle Sep 29 at 10:21
  • @DavidCarlisle Yes, and I'm satisfied that you and I may be getting closer to being on the same page, here. What you're saying is, "It's already out there," and what I'm saying is, "Yes, so why don't we point that out, somehow, and encourage the reading of it?" People asking questions aren't necessarily interested in "overhead" of the whole of the "help" info. The specific question is, "Can you provide an MWE?" and the obvious implied response is, "How do I do that?" Seeing that specific item in its own answer, by itself, though, does save time. – Saphar Koshet Sep 29 at 10:31
  • @DavidCarlisle Here's another way to look at this. "We" necessitate "one question" per thread in the Q&A, but the "help" info is multiple questions all at once. Where the "one question" is "How do I get you what you're asking of me?" which is a code segment, not all the rest of what's addressed in the wonderful help info, having that "one answer" "right there" has tremendous value. – Saphar Koshet Sep 29 at 10:33
  • 5
    my main objection is not about it being duplicate or not, simply that the answer here is unhelpful. I have posted 9000 answers to the main site and never needed to indent the code in an external editor – David Carlisle Sep 29 at 10:52
  • @DavidCarlisle Those familiar with how this website works will have your experience. Those who have "never done this before" benefit from knowing that they don't have to "know the website" in order to submit code. And, again, rather than this multi-part commentary, you could have Answered, as Troy did, or, if Troy had answered, you could have voted his answer "up." What you're saying is that "experience" brings perspective. The new OPs don't have that yet. And, since they don't have points enough to participate, I'm at a total loss to prove my point to you. – Saphar Koshet Sep 30 at 2:04
  • @SapharKoshet: We, like many sites on this network, have a high bounce rate of new users asking questions (with or without registering), reaping the rewards of an answer (in comment or as a legit answer) and never acknowledging it through upvoting, accepting or comment. That's just the nature of an open, online environment. So there are many people who lack "perspective" (as you call it). We also have many new users who just dump code into their posts without formatting it. Those who follow the post quickly correct that through an edit. I don't see code formatting as a problem here... – Werner Sep 30 at 6:43
  • 2
    @SapharKoshet I did not say experience brings perspective. you are missing the points of the comments. We are not objecting to giving new users help. The problem is that the suggested help here is bad it makes posting code far more complicated than it is, you never need to copy it to an external editor and then (by some process that you can not explain without knowing which editor they use) indenting by four spaces. If the question and answer were giving useful help, then the question could probably have stood, but the question only seems to have been posted to post this answer. – David Carlisle Sep 30 at 11:42

Not the answer you're looking for? Browse other questions tagged .