9

In traditional typesetting for books, there are often little figures called vignettes that serve as a separation between sections or subsections.

One could always include the graphics as in a figure/vector, draw it with tikz-pgf or even work a font, but I am wondering if there is any package that provides good integration with (hopefully pretty) vignettes.

If not, a good collection and instructions to put them automatically at the end of a section will be much appreciated.

Edit: Summary of answers: there is no package or way to doing that automatically, at least not touching only the preamble. The best way is to create a macro to insert the ornament and calling it wherever is needed.

  • 5
    @Victor Check out this post tex.stackexchange.com/questions/10941/free-ornaments-font – Yiannis Lazarides Mar 2 '11 at 20:28
  • @Yiannis: Good link! I used it too at the same time in my answer. – Stefan Kottwitz Mar 2 '11 at 20:35
  • @Yiannis Thank you very much for the link, there is not an automatic way but it seems not very difficult to integrate manually :) Still, there is a "good" way of automatically add a piece of text (in that case the figure) to the end of a section? – Víctor Pimentel Mar 2 '11 at 20:55
  • @Victor it would be very difficult if not impossible! Only way I could think of it, is to have it typeset as en environment. If you are willing to type begin{mysection}...\end{mysection} is possible. But I think it will be more typing in the end. – Yiannis Lazarides Mar 2 '11 at 21:24
  • @Victor see my post. – Yiannis Lazarides Mar 2 '11 at 21:48
8
  • Thank you for the information, still, the solution of those questions you link relays on putting the same code (or a macro you define) over and over exactly in the places you want. As I asked Yiannis, do you know a way of adding that code automatically to the end of all sections? Hopefully, without having to define a new environment to use instead of \section. – Víctor Pimentel Mar 2 '11 at 20:59
5

These are called ornaments. You can define an environment and use them automatically as follows:

\documentclass[12pt]{article}
\usepackage{fourier}
\usepackage{lipsum}

\begin{document}
\newenvironment{Section}[1]
{\section{#1}}
{\vspace{12pt}\centering ------- \decofourleft\decofourright ------- \par}

\begin{Section}{Test}
\lipsum[1]
\end{Section}

\end{document}
5

After looking to Jiannis and Stefan answers I just decided that the best option is to do it manually with some macros. I post my "solution" to help others:

% Nice ending for sections and subsections

\newcommand*\myhrulefill{%
   \leavevmode\leaders\hrule depth-2pt height 2.4pt\hfill\kern0pt}

\newcommand\niceending[1]{%
  \begin{center}%
    \LARGE \myhrulefill \hspace{0.2cm} #1 \hspace{0.2cm} \myhrulefill%
  \end{center}}

\newcommand*\nicesectionending{\niceending{\aldineright\aldineleft}}
\newcommand*\nicesubsectionending{\niceending{\aldinesmall}}

After this is defined, I just use \nicesectionending or \nicesubsectionending wherever I want. It is not as good as done automatically but as Yiannis said, it will be more typing and very easy to mess up the code.

1

Because the end of one section is the beginning of another, you can sort-of automate the vignettes by defining the section as beginning with the vignette if the section is section 2 or greater,

\ifnum\value{section}<2\else\nicesectionending\fi

which leaves the final ornament, which could be done manually, or with an empty section \section*{}.

Sections with ornaments

One way to redefine the section format is with titlesec.

\usepackage{titlesec}

    \titleformat{\section}[display] {\normalfont\ifnum\value{section}<2\else\nicesectionending\vskip3em\fi\large\bfseries}{\S \thesection}{0pt}{}

MWE

    \documentclass[12pt]{article}

\usepackage{lipsum}
\usepackage{fourier}%adforn}

\newcommand*\myhrulefill{%
   \leavevmode\leaders\hrule depth-2pt height 2.4pt\hfill\kern0pt}

\newcommand\niceending[1]{%
  \begin{center}%
    \LARGE \myhrulefill \hspace{0.2cm} #1 \hspace{0.2cm} \myhrulefill%
  \end{center}}

\newcommand*\nicesectionending{\niceending{\aldineright\aldineleft}}
\newcommand*\nicesubsectionending{\niceending{\aldinesmall}}


    \usepackage{titlesec}

    \titleformat{\section}[display] {\normalfont\ifnum\value{section}<2\else\nicesectionending\vskip3em\fi\large\bfseries}{\S \thesection}{0pt}{}

\newcommand\sampletext{Etiam euismod. Fusce facilisis lacinia dui. Suspendisse potenti. In mi erat, cursus
id, nonummy sed, ullamcorper eget, sapien. Praesent pretium, magna in
eleifend egestas, pede pede pretium lorem, quis consectetuer tortor sapien facilisis
magna. Mauris quis magna varius nulla scelerisque imperdiet.}%from lipsum[12]
\begin{document}    
    \section{First Example}
\sampletext
    \section{Second Example}
\sampletext
\section{Third Test}    
\sampletext
\section{Test}
\sampletext
\section{Test}
\sampletext
\section*{}
%\nicesectionending

    \end{document}

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.