1

I do have a section name with a pretty long name but which could "nicely" fit on one line. I was wondering, therefore, how I could avoid the line to break, perhaps using some space compression and/or line overflow.


\documentclass[12pt,article,oneside]{memoir}
\usepackage[margin=1in]{geometry}
\begin{document}
\mainmatter
\section{Convolutional artificial neural networks --- ConvNets}
\end{document}

enter image description here

Basically, I'd like to have a one-line title (I don't like how it looks like, and gaining an extra line would be also quite helpful).

4
  • 1
    Please provide a minimal working example so that one can better assist you.
    – azetina
    Nov 11, 2013 at 19:43
  • Done. I thought my question was clear also without a working example (I'm just asking how to squeeze a multi line on one line).
    – Atcold
    Nov 11, 2013 at 20:30
  • That title doesn't fit on one line, so the only solution is to shorten it or use a smaller font. The memoir class has facilities for doing the latter: see \setsecheadstyle and similar macros.
    – Dan
    Nov 12, 2013 at 7:17
  • Could you explain where would you put \setsecheadstyle, please?
    – Atcold
    Nov 13, 2013 at 18:10

1 Answer 1

3

If you really want this you could just stick the title in an \mbox:

\documentclass[12pt,article,oneside]{memoir}
\usepackage[margin=1in]{geometry}
\begin{document}
\mainmatter
\section{\mbox{Convolutional artificial neural networks --- ConvNets}}
\end{document}
3
  • Great! This did the overflow thing. Do you suggest also some space compression, or it would look bad?
    – Atcold
    Nov 13, 2013 at 18:12
  • @Atcold It would probably look even worse than \mbox, I think. For that matter, the only way of doing that that I can think of just now would be to use \scalebox or \resizebox from the graphicx package to squeeze the text. There may of course be better ways. Nov 13, 2013 at 18:36
  • @TorbjørnT. Thanks for the \mbox trick. This elegantly solves the issue provided the resulting title is marginally outside the text-area.
    – theOne
    Sep 1, 2016 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.