# Editing Minimal Working Examples (MWEs) - the W part

I am wondering about a question which is closely related to the question with almost identical title: Editing Minimal Working Examples (MWEs), in which the focus was on the minimizing part. More precisely, the discussion was whether or not it is OK to kick out unrelated things such as unnecessary packages.

I am mainly wondering about the "working" part. Specifically,

Is it OK to make a non-working MWE working?

Obviously, I am not thinking about questions of the type "why does that code not work?". Rather, I am wondering whether it is OK to add the document preamble and cure obvious mistakes like a missing semicolon at the end of a TikZ path, say.

I can see reasons why one might consider making the code compilable: more users may play with it because the threshold is lower, and hence a btter answer may emerge.

On the other hand, there are good reasons not to do it. In the worst case, one may introduce errors. Or one may just upset others by loading packages that are not essential and so on.

Clearly, this is only a very partial list of pros and cons, and the purpose of this question is to inquire the opinion of the community on this. (I plan not to accept an answer, rather votes should give an impression how the majority feels, and I really would like to collect all pros and cons.)

I'd leave the code as it was posted by the OP.

If you add \documentclass{article} and then you find out that the OP is using \documentclass{beamer}, for example, the answer could differ.

Tricky question! In most cases I agree with @CarLaTeX's answer and would leave it to the OP. However I also see the good intention to give other users working code as some starting point for working on an answer.

As a compromise maybe one could use a strategy I already saw a couple of times on the main site: Leave the code from the questions as it is and add the working code at the end of the post clearly marked as edit by user @xyz.

This could be used in cases where the preamble etc. is simply missing.

# Example:

This is the original question

    with code fragments


which are not compilable

Edit by @xyz to include a working example

\documentclass{article}

\begin{document}

code fragment

\end{document}


• i'd go along with this answer if the document class has been identified by the op in a comment and the context makes sense. but without that information, it becomes a different question, which really doesn't help. – barbara beeton Jun 24 '18 at 16:39
• I think this adds further to the "just do it for me" mentality. And while I understand people who like to answer those questions (which tend to be drawing related), I'm not sure we should get people used to having their questions improved in this way. – Alan Munn Jun 25 '18 at 15:44

In almost all cases I just leave a comment suggesting that the OP fixes the example however sometimes I edit the question.

For edits I think it's important to distinguish why the example isn't working/complete.

1. The posted example was never tested and has typos that suggest it wasn't used to generate the output or error described.

Here, for new users I may just add the missing preamble and \end{document} and leave a comment that the example has been completed to help people test answers.