1

I would like to reduce the space when several examples follow each other. My examples are all quite long (several lines) and I provide a free translation (no gloss).

[Edit] This is an attempt of a minimal working example:

   \documentclass{book}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{setspace}
    \newcounter{ex}
    \usepackage{enumitem}
    \usepackage{gb4e}
    \noautomath
    \makeatletter
    \apptocmd{\@exe}{\singlespacing}{}{}
    \makeatother

    \begin{document}

... François Bayrou: 

 \begin{exe}
            \ex \begin{otherlanguage*}{french}\textsc{Lucien Degauchy (UMP)} [majority]: C’est Bayrou qui a écrit ce discours ! (FR 2006.12.12) \end{otherlanguage*} \\
            \begin{small} \emph{\textsc{Lucien Degauchy (UMP)} [majority]: Bayrou has written this speech!} \end{small}
        \end{exe}

It is thus widely acknowledged... \\

... the corpus: 

\begin{exe}
    \exr{ex:wrote}
    {\textsc{Mr. David Cameron (Tories)} [majority]: \textbf{The right hon. Gentleman} clearly wrote his questions before coming to the House and listening to my statement. (UK 2011.12.12)}
    \end{exe}

    \begin{exe}
        \ex \textsc{Sir Edward Leigh (Tories)} [majority]: We are all being a bit unfair on the Labour party. After all, 40 years ago it was the Labour party that gave us a referendum and, to be fair to the Liberals, they promised one in the last Parliament, although I do not understand why they have gone wobbly on trusting \textbf{the people}. Perhaps it is because \textbf{the people} may give the wrong answer. (UK 2015.03.23)
    \end{exe}

    \begin{exe}
        \ex \textsc{Mr. David Cameron (Tories)} [majority]: The problem is, though, that \textbf{the people who have lent the money to Greece} want their money back, and they believe that Greece should carry out a series of reforms before they give it any more money. (UK 2015.03.23)
    \end{exe}

    \end{document}

There are more packages but they should be irrelevant to the question. [End of the edited part]

In the preamble I am using:

\usepackage{gb4e}
\noautomath 

and

\makeatletter
\apptocmd{\@exe}{\singlespacing}{}{}
\makeatother

so that the examples are single spaced.

I am using https://www.latextemplates.com/template/masters-doctoral-thesis.

When I mention only one example, it looks the way I want:

Example 1

This is the code corresponding to example 8:

\begin{exe}
        \ex \begin{otherlanguage*}{french}\textsc{Lucien Degauchy (UMP)} [majority]: C’est Bayrou qui a écrit ce discours ! (FR 2006.12.12) \end{otherlanguage*} \\
        \begin{small} \emph{\textsc{Lucien Degauchy (UMP)} [majority]: Bayrou has written this speech!} \end{small}
    \end{exe}

But I have several examples as a list, it does not and there is too much space between the examples:

Example 2

This is the code corresponding to example 5, 34, and 35:

\begin{exe}
    \exr{ex:wrote}
    {\textsc{Mr. David Cameron (Tories)} [majority]: \textbf{The right hon. Gentleman} clearly wrote his questions before coming to the House and listening to my statement. (UK 2011.12.12)}
    \end{exe}

    \begin{exe}
        \ex \textsc{Sir Edward Leigh (Tories)} [majority]: We are all being a bit unfair on the Labour party. After all, 40 years ago it was the Labour party that gave us a referendum and, to be fair to the Liberals, they promised one in the last Parliament, although I do not understand why they have gone wobbly on trusting \textbf{the people}. Perhaps it is because \textbf{the people} may give the wrong answer. (UK 2015.03.23)
    \end{exe}

    \begin{exe}
        \ex \textsc{Mr. David Cameron (Tories)} [majority]: The problem is, though, that \textbf{the people who have lent the money to Greece} want their money back, and they believe that Greece should carry out a series of reforms before they give it any more money. (UK 2015.03.23)
    \end{exe}

A possible solution is to add \begin{singlespace*} and \end{singlespace*} for each example, but then there is not enough space between the example and the following text.

Another solution is to have \begin{exe} only once and then \end{exe} at the end of the list, but then there is barely any space between the examples and it is very uncomfortable to read.

I am thankful for any help!

  • Welcome to TeX.SX! Is it too late to tell you to run away from MastersDoctoralThesis as fast as you can? While the template has gotten better, it still can not be considered the pinnacle of TeX programming and the issue is complicated by the fact that many slightly different versions of the template float around out there. – moewe Sep 06 '18 at 14:52
  • Unrelated to your real issue, but you probably want The right hon.\ Gentleman instead of The right hon. Gentleman to avoid the . after hon. being treated as the full stop ending a sentence. See https://tex.stackexchange.com/q/2229/35864 – moewe Sep 06 '18 at 14:54
  • Thank you for your suggestion! Unfortunately, yes, it's really too late, I'm now almost submitting my thesis. I'll know for next time... – BerlinLinguist Sep 06 '18 at 14:54
  • Still useful, thank you! There is indeed too much space between "hon." and "Gentleman". I'll correct it. – BerlinLinguist Sep 06 '18 at 14:57
  • Ah, blast. Good luck with your thesis. I'll have a look later, I have to go now. Yyou can make it easier for people to help you if you manage to compile the snippets of code into one document starting with \documentclass with a preamble and \begin{document}...\end{document}, that can be copied, pasted and run without further ado, a so called minimal working example: https://tex.meta.stackexchange.com/q/228/35864. Then people can start immediately and don't have to rebuild what you already have. – moewe Sep 06 '18 at 14:58
  • Thank you! I have edited the initial post, I hope this works as a minimal working example. – BerlinLinguist Sep 06 '18 at 15:10
  • I might be missing something, but would it be possible to put several \exs into on exe environment? In that case the spacing will be better because ending exe and starting it anew adds (in this case unwanted) space. – moewe Sep 06 '18 at 15:24
  • The code is better, but it is still not an MWE (minimal working example). It fails on the minimal (it loads many packages that are not required - though I must admit it can be hard to figure out what is required, especially if you are in a hurry, though you should definitely try to minimise the code when you ask questions here - it makes them much easier to answer). But more importantly it also fails on the working front: The idea is that you show one block of code that contains everything we need to know. At the moment I can kind of figure out what you want if I reassemble the bits ... – moewe Sep 06 '18 at 15:28
  • Yes, it is. This is what I refer to at the end when I say: "Another solution is to have \begin{exe} only once and then \end{exe} at the end of the list, but then there is barely any space between the examples and it is very uncomfortable to read." I will try again but it was rather unsatisfactory until now... – BerlinLinguist Sep 06 '18 at 15:28
  • ... a MWE could look like https://gist.github.com/moewew/c3778b0d588050f8f5e0abbe00118c74 – moewe Sep 06 '18 at 15:28
  • Oh sorry, I've been trying to provide a MWE at the same time, I think it looks about the same as yours? I'm still learning, thank you for your understanding :) – BerlinLinguist Sep 06 '18 at 15:36
  • Your example is certainly working (which is the important bit), but it is not entirely minimal (compare with my link above). biblatex is not really needed here and neither is amsmath ... But it should definitely be good enough, I'm working on a suggestion. – moewe Sep 06 '18 at 15:38
  • It's hard for me to know how minimal it should be since I'm always afraid to cut some packages that might have something to do with the problem. I'll provide ab better MWE based on your suggestion. Thank you! – BerlinLinguist Sep 06 '18 at 15:39
  • I know it takes some experience to get this right and as I say the important bit is that your code shows the problem. If you know what each package does that also helps a lot, because you can be fairly confident that a bibliography package like biblatex is not the problem here. Usually you can just remove a package and see if something changes in your MWE, if nothing relevant changes, the package is probably not relevant for the example. – moewe Sep 06 '18 at 15:43

1 Answers1

3

If you have several \exes in a row, you should place them in the same exe environment. That avoids excessive space between the \exes caused by ending and beginning a new exe environment.

If you feel that the space between two example items is too narrow in that case, you can increase it by modifying the value \itemsep when you also set the \singlespacing for \@exe.

In the example below we set the space between two items to double its normal space in exe, which I think looks OK, but you can choose any value you like.

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french,british]{babel}
\usepackage{libertine}
\usepackage{setspace}
\usepackage{etoolbox}
\usepackage{gb4e}
\noautomath
\makeatletter
\apptocmd{\@exe}{%
  \singlespacing
  \setlength{\itemsep}{2\itemsep}%
}{}{}
\makeatother

\newcommand*{\person}[1]{\textsc{#1}}
\newcommand*{\important}[1]{\textbf{#1}}

\begin{document}

\begin{exe}
  \exr{ex:wrote} \person{Mr.\ David Cameron (Tories)} [majority]:
    \important{The right hon.\ Gentleman} clearly wrote his questions before
    coming to the House and listening to my statement. (UK 2011.12.12)

  \ex \person{Sir Edward Leigh (Tories)} [majority]:
    We are all being a bit unfair on the Labour party. After all, 40 years ago
    it was the Labour party that gave us a referendum and, to be fair to the
    Liberals, they promised one in the last Parliament, although I do not
    understand why they have gone wobbly on trusting \important{the people}.
    Perhaps it is because \textbf{the people} may give the wrong answer.
    (UK 2015.03.23)

  \ex \person{Mr.\ David Cameron (Tories)} [majority]:
  The problem is, though, that \important{the people who have lent the money to
  Greece} want their money back, and they believe that Greece should carry out
  a series of reforms before they give it any more money. (UK 2015.03.23)
\end{exe}
Neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur,
adipisci velit
\begin{exe}
  \ex
    \begin{otherlanguage*}{french}
      \person{Lucien Degauchy (UMP)} [majority]:
      C’est Bayrou qui a écrit ce discours ! (FR 2006.12.12)
    \end{otherlanguage*} \\
    {\small \emph{\person{Lucien Degauchy (UMP)} [majority]: Bayrou has written this speech!}}
\end{exe}
\end{document}

The picture shows the first three examples separated with a small space. Then two lines of normal text separated by a bit of space from the examples.

moewe
  • 175,683
  • This is exactly what I wanted! I'm SO happy!! I had the intuition that putting all the examples in the same exe environment would help, but I had no idea how to modify the value \itemsep. Thank you so much! – BerlinLinguist Sep 06 '18 at 15:58
  • @BerlinLinguist Glad I could help. Have a look at the edited answer. I defined more semantic macros (\person and \important - the latter is probably not a good name, but I could not exactly figure out what you were highlighting). I also corrected the borderline incorrect usage of \begin{small} blah \end{small}, {\small blah} is more idiomatic: https://tex.stackexchange.com/q/7312/35864 – moewe Sep 06 '18 at 16:05
  • Yes, I've just discovered the new commands! So useful! What a pity the thesis is already written... Thank you for correcting my use of small font, I'll use it the way you suggested from now on ({\small blah}). – BerlinLinguist Sep 06 '18 at 16:09