2

What is the balance between test cases and minimalism in a MWE?

I recently wrote a question with a MEW I thought was pretty good. One example, nice and clear what the issue is, but it gave me an answer that doesn't work, so I'm wondering if I wrote it badly.

Reading The top response to it emphasis minimalism a lot, and I think I did a pretty good job there. (I could have removed a couple lines from the example citation, and condensed the usepackage command, but other then that I think it is as to the point as a question about line-breaking can be.)

However, the answer I got doesn't work, despite clearly having been tested, since the author only tested changing the length of the DOI = part of the bibliography.

Now, while I was working on the MWE, I did have a couple of examples in there. But each one takes up a lot of text, and I wanted to try and be a good user of the stackexchange and include as little as possible. Should I include more examples in future?

I included this as the example:

\begin{filecontents}[overwrite]{\jobname.bib}
    @inproceedings{Meshlab,
        booktitle = {Eurographics Italian Chapter Conference},
        editor = {Vittorio Scarano and Rosario De Chiara and Ugo Erra},
        title = {{MeshLab: an Open-Source Mesh Processing Tool}},
        author = {Cignoni, Paolo and Callieri, Marco and Corsini, Massimiliano and Dellepiane, Matteo and Ganovelli, Fabio and Ranzuglia, Guido},
        year = {2008},
        publisher = {The Eurographics Association},
        ISBN = {978-3-905673-68-5},
        DOI = {10.2312/LocalChapterEvents/ItalChap/ItalianChapConf2008/129-136}
    }

For example, I could change the .bib file to read:

\begin{filecontents}[overwrite]{\jobname.bib}
    @inproceedings{Meshlab,
        booktitle = {Eurographics Italian Chapter Conference},
        editor = {Vittorio Scarano and Rosario De Chiara and Ugo Erra},
        title = {{MeshLab: an Open-Source Mesh Processing Tool}},
        author = {Cignoni, Paolo and Callieri, Marco and Corsini, Massimiliano and Dellepiane, Matteo and Ganovelli, Fabio and Ranzuglia, Guido},
        year = {2008},
        publisher = {The Eurographics Association},
        ISBN = {978-3-905673-68-5},
        DOI = {10.2312/LocalChapterEvents/ItalChap/ItalianChapConf2008/129-136}
    }
    @inproceedings{Meshlab2,
        booktitle = {Eurographics Italian Chapter Conference},
        editor = {Vittorio Scarano and Rosario De Chiara and Ugo Erra},
        title = {{MeshLab: an Open-Source Mesh Processing Tool}},
        author = {Cignoni, Paolo and Callieri, Marco and Corsini, Massimiliano and Dellepiane, Matteo and Ganovelli, Fabio and Ranzuglia, Guido},
        year = {2008},
        publisher = {The Eurographics Association},
        ISBN = {978-3-905673-68-5},
        DOI = {10.2312/LocalChapterEvents/ItalChap}
    }
    @inproceedings{Meshlab3,
        booktitle = {Eurographics Italian Chapter Conference},
        editor = {Vittorio Scarano and Rosario De Chiara and Ugo Erra},
        title = {{MeshLab: an Open-Source Mesh Processing Tool}},
        author = {Cignoni, Paolo and Callieri, Marco and Corsini, Massimiliano and Dellepiane, Matteo and Ganovelli, Fabio and Ranzuglia, Guido},
        year = {2008},
        publisher = {The Eurographics Association},
        ISBN = {978-3-905673-68-5},
        DOI =
        {10.2312/LocalChapterEvents/ItalChap/ItalianChapConf2008/ItalianChapConf2008/129-136}
    }
    @Article{ellip,
        author ="Brown, Matthew L. and Van Wieren, Ken and Tailor, Hamel N. and Hartling, David and Jean, Anthony and Merbouh, Nabyl",
        title  ="Three-dimensional printing of ellipsoidal structures using Mercury",
        journal  ="CrystEngComm",
        year  ="2018",
        volume  ="20",
        issue  ="3",
        pages  ="271--274",
        publisher  ="The Royal Society of Chemistry",
        doi  ="10.1039/C7CE01901G",
    }
    @article{ModelHistory,
        author = {Peterson, Quentin R.},
        title = {Some reflections on the use and abuse of molecular models},
        journal = {J.~Chem.~Ed.},
        volume = {47},
        number = {1},
        pages = {24},
        year = {1970},
        doi = {10.1021/ed047p24},
}
\end{filecontents}

That shows off each error I get with the answer (and the three cases the author of the example provided that shows it works), but now the MWE lot longer.

I noted that there is a list of *.bib files you can use that come with TeXLive. So I tried to construct a MWE example using the files from it. biblatex-examples.bib only has two examples with a DOI, neither which show the behaviours I want. I ran a search for DOI on all the *.bib files in my TeXLive2020 folder, and found a few other files I could use, but those tended to need additional code to work (I needed to add a definition of \BibLaTeX in one case, for example), and several of them generate a ton of errors such as warning: undefined macro "Leipzig" in archaeologie-examples.bib, which seems bad for a MWE. So I think that is out.

So, should I have included multiple entries in my *.bib files in future, so that I don't get answers that work with only that entry? Or should I keep my MWEs as minimal as possible to make them easier to read?

| |
  • 2
    This seems an expansion of your immediately previous question, tex.meta.stackexchange.com/q/8684 . I'm leaving a comment there that addresses the content of the question, not a reference to this one. – barbara beeton Oct 17 at 2:44
  • 1
    there are two answers there and neither give changes specific to that doi they both give general changes, \raggedright (which I'm surprised doesn't work always) or a usual penalty balancing trick, which again is general. The actual penalty may need adjusting to handle more tricky cases but I think it is misleading to say the people answering only addressed the specific example not the general issue. I agree with Barbara that this is a duplicate of your other question – David Carlisle Oct 17 at 10:21
  • 1
    @DavidCarlisle I don't consider \raggedright to be a real answer since it turns justification off, which will dramatically change the look of the references section. If I remade the question I would specify that it isn't an option, I thought massive changes to document appearance would be assumed to be outside the scope of the solution. I'm talking about part two which has uses a \hfil as, per their comment, they didn't consider what would happen with a short DOI on a mostly empty line (a very common situation). – Canageek Oct 17 at 16:30
  • sure the answers might be improved but that is not saying they were not written to be general, it's not as if the answer was just inserting a specific break in the example entry. You can just replace hfil by something a bit less stretchy \hspace{0pt plus 2cm} or whatever.And certainly setting bibliographies ragged is very common and with the question as written it is the standard answer. – David Carlisle Oct 17 at 16:45
  • @DavidCarlisle I'll give that a try. I messed around with that answer for half an hour without luck, but given the lack of documentation it was hard to understand what field did what. I wish questions on here would be documented so they'd be more of examples instead of 'copy and paste this and hope it works' – Canageek Oct 19 at 18:04

You must log in to answer this question.

Browse other questions tagged .