Hot answers tagged

184

This answer focuses more on minimalizing the code, rather than finding the source of the problem, as the top-voted answer does. It is intended to be concise and hands-on, but digestible rather than exhaustive. Suggestions for improvement welcome! Here are some strategies for reducing your code, which will help you get better and faster answers, since it ...


52

Just to make an example, look at europecv stack exceeding which cannot be answered in the current form, as \documentclass{europecv} \usepackage[T1]{fontenc} \usepackage[magyar]{babel} \begin{document} x \end{document} gives no error whatsoever. In the .../tex/latex subtree of TeX Live there are currently 2066 directories, which correspond to more than ...


30

It's not really an answer, but my thoughts are too long for a comment. :) First of all, I'd like to thank you for all the effort you've put into moderncv and the time spent in helping people here. :) I really share your worries on some MWE lacking the minimal component. Indeed we have quite a bunch of such examples in our community. I once stumbled upon ...


27

There’s a new package on CTAN called mwe, providing some features for creating MWEs. This is the announcement text: mwe provides several files useful to create a minimal working examples (MWEs). A mwe package is provided which loads a small set of often used packages for MWEs. In addition several different images are provided which will be ...


27

Firstly, the aim is that Questions and Answers on this site are as widely applicable as possible. The extra packages that you load, may not be needed at all by another user. For example, you may be writing you document in Czech, but loading babel with the czech option is not the cause of the problem you are having, and the answer given will thus help a ...


27

Another very important thing to note is language, as in written language. LaTeX uses easy-readable commands in plain english, this is great but not my point. Here at TeX.SX are people of many many nations helping each other. Describing a problem in words can be very hard in a different language, espeacially when a special nomentclature is in use. I have ...


25

A MWEB is a MWE (Minimal Working Example) which include a bibliography file (.bib). MWEB stands for "Minimal Working Example with Bibliography". The bibliography file contains your bibliographical references. If your question is about Bibtex/Biber/Natbib/Biblatex/..., this file may contain valuable information useful to answer it. You should use the ...


25

Apart from the security reason raised by Wang Ki Wun, there are other reasons that Overleaf links should not be accepted as replacements for MWEs. (Some of these you mention in your question, but they bear repeating here.) First, one of the main goals of the whole network is to be a set of self-contained questions and answers. So in the same way that a link-...


24

Some remarks about the "global scope" in the question: Yes LaTeX (not TeX) needs quite some global code. You can't compile hello world It gives the error ! LaTeX Error: Missing \begin{document}. And adding only a document environment doesn't work either \begin{document} hello world \end{document} gives the error ! LaTeX Error: The font size ...


21

The basic principle is exactly the same whether you use LaTeX (I've just been asked to write a minimal example, what is that?) or LyX: create a document that contains the least amount of content possible, while still demonstrating the problem at hand. For example, if you have a problem with a table, you can probably remove all the text in the document, ...


21

Don't put links to overleaf in public forum, even read-only links will show your email address to everybody Example: link from this answer https://tex.stackexchange.com/a/506205/195169 click on share and see the mail (I removed name, but you probably recognise that this is your mail)


20

This is a bad idea, for a few reasons. First, despite the fact that people like to demand MWEs, it's not really the case that every question demands one. Yes, they are important in lots of cases, but there are plenty of good questions which don't need them at all. Second, plain TeX users or ConTeXt users would never be able to ask questions without an ...


19

Another reason why minimal examples are often required (meaning "necessary to solve the problem" not "mandated by the site") is that errors in TeX are notoriously cryptic and the line number at which an error arises may be very far away from the actual source of the error. So, for example, someone gets an error and the posts the fragment of code that the log ...


18

The effort to produce a minimal working example, in my case, almost always results in a solution and prevents me from posting a question on the site. Not that we want to discourage questions, but there is a lot you can do to debug a problem before you ask for help, and the MWE encourages that.


17

This has been answered in comments really but For (1) for images traditionally you could use \usepackage[demo]{graphicx} or simply replace the \includegraphics{...} by \rule{3cm}{1cm} in either case, getting a black rectangle, but most modern installations now include the examples from mwe so you can use \includegraphics{example-image} to get an image ...


15

My selfish reason why I require a MWE and why I tend not to answer questions wihout a MWE: I'm lazy. When the question contains a MWE, I can simply copy-paste it, do what is necessary, test it quickly and post an answer. Without a MWE, I have to create one, which is something I'm not willing to do for the original poster. It is their questions and my amount ...


15

The first thing to remember here is that the site exists to help people use TeX. In the end, provided that happens other factors (such as stats) are not so important. At the same time, of course, we want to make it as easy as possible for people to find the information they want. In the StackExchange model for a site, the idea is that good questions should ...


14

Because in TeX, unlike other programming languages, the entire document to reproduce the problem is hardly ever longer than 30 lines long. And typing that much shouldn't be seen as a burden to get an answer from the community that is known to be very fast to respond already. And most of the times, you find out the problem yourself while creating the minimal ...


14

The answer to the title of the question is yes and I think there is no discussion about it. But... I would add a non-selfish reason too. Writing a MWE from scratch sucks. Big time. We enjoy fixing the problems here but not creating the problem AND solving it. We are doing it for the fun of it (at least myself), and the OP benefits from it, meeting a ...


14

The easiest solution I've found involves using the pdfpages package: Compile the MWE into a pdf. pdfpages allows "Several logical pages [to] be arranged onto each sheet of paper", like so: \documentclass{article} \usepackage{nopageno} \usepackage{pdfpages} \begin{document} \includepdf[nup=4x4,pages={1-16},frame=true]{<filename>.pdf} \end{document} ...


11

A good minimal example is one which shows that someone really used his/her brain and invested some time and effort to make a clear and concise question. You don't need a template to realize that an \input is problematic - you only need to really think about "what helps others to understand my question" and "what could hinder them". There are some elements ...


10

Unless you discover a bug along the lines of: "when I put someonr in a section heading, the computer expolodes", it should always be possible to reproduce the bug. If the problem is in TeX's word-breaking algorithm, then as long as the word to break is not strictly confidentail, you can replace everything else on the line by a properly sized \rule{10em}{1ex}...


9

The following resources are a good place to start: http://www.minimalbeispiel.de/mini-en.html http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl In general, just make an example that demonstrates the error but doesn't contain any code unrelated to the error. Unfortunately, it's hard to provide an MWE for the things you mentioned, since it's really ...


9

I think you should paste the contents of the pdf_tex file into your question. Then all the necessary info will be in the question itself, which is better than relying on external sites, in my opinion. Note also that if you upload a PDF as an image to the post, it will be converted to PNG, I don't think the original PDF is saved.


7

I somewhat disagree with Alan Munn. It is true that not every questions needs a MWE, but the majority does. Think of your email program; if you mention »attached« in the text the program asks you whether you have forgotten something. The same could be done here; if the MWE is missing, ask the user whether he maybe want to add it for clarification. I agree ...


5

I feel like adding my answer to this question, even though I am not very active in the community, and (more importantly) even though my own MWEs were perhaps not the best ones could have hope for. The latter is, indeed, partly my fault, and partly because the problems I was dealing with were far beyond my own understanding of TeX, and despite trying, I ...


5

There are several non-TeX.SX resources out there that explain the process of creating MWEs https://texfaq.org/FAQ-minxampl (English) http://www.minimalbeispiel.de/ (German and English) https://texwelt.de/wissen/fragen/569/was-ist-ein-vollstandiges-minimalbeispiel-oder-kurz-vm-und-wie-erstelle-ich-dieses (German, could be shortened to https://texwelt.de/...


4

To second Torbjørn: It is strongly preferred to include content of your TeX file into your question. But in almost all cases you should reduce the code to the absolutely necessary parts. This is called a minimal working example or short MWE. We have an own meta question here (see I've just been asked to write a minimal example, what is that?), and you ...


4

A good MWE is some compilable, "to-the-point" code that clearly isolates the problem and contains no superfluous clutter and only a limited amount of jargon from the particular area.


4

Have a look at: What is a minimal working example? on minimalbeispiel.de How to make a “minimum example” in the UK TeX FAQ or the question on this meta site: I've just been asked to write a minimal example, what is that? and for the second question: Editing help right at the beginning.


Only top voted, non community-wiki answers of a minimum length are eligible