Remove pagebreaks before bibliography

3,974 views
Skip to first unread message

r

unread,
Sep 23, 2010, 4:39:28 PM9/23/10
to LaTeX Users Group
Readers,

A main bibliography is successfully applied. A second bibliography is
applied as an appendix:

...
\usepackage{multibib}
\newcites{di}{~}
...
\appendix
...
\input{file1}

File1 contains:

\chapter{heading}
Some introductory text
\nocitedi{*}
\bibliographydi{bibliographyown}
\bibliographystyledi{plainnat}

The second bibliography is produced as requested except that there is
a pagebreak between "some introductory text" and the bibliography,
i.e.:

Appendix ...

heading

Some...

\pagebreak

bibliography entries.

Is it possible to remove the pagebreak please?

late...@conference.jabber.org

Peter Flynn

unread,
Sep 23, 2010, 6:20:13 PM9/23/10
to latexus...@googlegroups.com
On Thu, Sep 23, 2010 at 9:39 PM, r <inp...@gmail.com> wrote:
Readers,

A main bibliography is successfully applied. A second bibliography is applied as an appendix:
[...]
File1 contains:

\chapter{heading}
       Some introductory text
       \nocitedi{*}
       \bibliographydi{bibliographyown}
       \bibliographystyledi{plainnat}

The second bibliography is produced as requested except that there is a pagebreak between "some introductory text" and the bibliography,

That is correct. The \bibliography<s> commands in multibib just use the standard thebibliography environment. You don't say what document class you are using, but the default book and report classes define \thebibliography to include \chapter*{bibname} which will start a new page (the default article class uses \section*{\refname} which does not).

The simplest fix is to copy the definition of \thebibliography from whatever class file you are using into your own document (or private style file) and change the definition to use \section* instead. This is better style anyway: bibliographies are not chapters, and should not rank at the same level. For example assuming book.cls you would need:

\makeatletter
\renewenvironment{thebibliography}[1]
     {\section*{\bibname}%
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother

The only changes are to change \newenvironment into \renewenvironment, and change \chapter to \section.

If you are using some other document class that you have not told us about, use the same principle of copy-and-modify.

///Peter

r

unread,
Sep 24, 2010, 4:52:24 AM9/24/10
to LaTeX Users Group


On 23 Sep, 23:20, Peter Flynn <anglebrac...@gmail.com> wrote:
> On Thu, Sep 23, 2010 at 9:39 PM, r <inp...@gmail.com> wrote:
> > Readers,
>
> > A main bibliography is successfully applied. A second bibliography is
> > applied as an appendix:
>
> [...]
>
> > File1 contains:
>
> > \chapter{heading}
> >        Some introductory text
> >        \nocitedi{*}
> >        \bibliographydi{bibliographyown}
>
>        \bibliographystyledi{plainnat}
>
>
>
> > The second bibliography is produced as requested except that there is a
> > pagebreak between "some introductory text" and the bibliography,
>
> That is correct. The \bibliography<s> commands in multibib just use the
> standard *thebibliography* environment. You don't say what document class
> you are using, but the default book and report classes define
> \thebibliography to include \chapter*{bibname} which will start a new page
> (the default article class uses \section*{\refname} which does not).
>
The book class is being used.

> The simplest fix is to copy the definition of \thebibliography from whatever
> class file you are using into your own document (or private style file) and
> change the definition to use \section* instead. This is better style anyway:
> bibliographies are not chapters, and should not rank at the same level. For
> example assuming book.cls you would need:
>
> \makeatletter
> \*re*newenvironment{thebibliography}[1]
>      {\*section**{\bibname}%
>       \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
>       \list{\@biblabel{\@arabic\c@enumiv}}%
>            {\settowidth\labelwidth{\@biblabel{#1}}%
>             \leftmargin\labelwidth
>             \advance\leftmargin\labelsep
>             \@openbib@code
>             \usecounter{enumiv}%
>             \let\p@enumiv\@empty
>             \renewcommand\theenumiv{\@arabic\c@enumiv}}%
>       \sloppy
>       \clubpenalty4000
>       \@clubpenalty \clubpenalty
>       \widowpenalty4000%
>       \sfcode`\.\@m}
>      {\def\@noitemerr
>        {\@latex@warning{Empty `thebibliography' environment}}%
>       \endlist}
> \makeatother
>
I copied the commands above into the preamble section of the root
document; thank you. The effect of this answer is to produce the
bibliography as a sub-section of a preceding appendix, which is not
wanted. The requirement is for this secondary bibliography to appear
as a chapter in the table of contents and also as a page style to
resemble the appearance of preceding appendices.

Peter Flynn

unread,
Sep 24, 2010, 7:12:28 AM9/24/10
to latexus...@googlegroups.com
On Fri, Sep 24, 2010 at 9:52 AM, r <inp...@gmail.com> wrote:
[...]

I copied the commands above into the preamble section of the root
document; thank you. The effect of this answer is to produce the
bibliography as a sub-section of a preceding appendix, which is not
wanted. The requirement is for this secondary bibliography to appear
as a chapter in the table of contents and also as a page style to
resemble the appearance of preceding appendices.

There is a conflict here. Your code showed the bibliography as coming after the appendix heading amd indented so that it implied it was subsidiary to the appendix:


\chapter{heading}
    Some introductory text
    \nocitedi{*}
    \bibliographydi{bibliographyown}

That is, the bibliography is a child of the appendix. This is normal: multiple bibliographies would not normally be at chapter level.

Now you are saying you want the bibliography to be a chapter-level in the ToC, but you want it to look like an Appendix...but in your example above it was subsidiary to the appendix heading. You can't have it both ways; and having a chapter-style heading appear in mid-page would look very odd.

You can make the ToC entry look like a chapter-level just by adding
\addcontentsline{toc}{chapter}{title text}
but to make a chapter layout appear in mid-page with no page-break would mean creating a private version of the \chapter command omitting the page-break code, which might look like this
\newcommand\fakechapter{\@afterindentfalse\secdef\@chapter\@schapter}
(untested as I'm away from base right now) and using \fakechapter in the redeinition of thebibliography.

///Peter



r

unread,
Sep 24, 2010, 7:49:23 AM9/24/10
to LaTeX Users Group


On 24 Sep, 12:12, Peter Flynn <anglebrac...@gmail.com> wrote:
> On Fri, Sep 24, 2010 at 9:52 AM, r <inp...@gmail.com> wrote:
>
> [...]
>
> > I copied the commands above into the preamble section of the root
> > document; thank you. The effect of this answer is to produce the
> > bibliography as a sub-section of a preceding appendix, which is not
> > wanted. The requirement is for this secondary bibliography to appear
> > as a chapter in the table of contents and also as a page style to
> > resemble the appearance of preceding appendices.
>
> There is a conflict here. Your code showed the bibliography as coming after
> the appendix heading amd indented so that it implied it was subsidiary to
> the appendix:
>
To clarify further, the root document contains:

...
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plainnat}
\bibliography{bibliography}
\appendix
...

> \chapter{heading}
>     Some introductory text
>     \nocitedi{*}
>     \bibliographydi{bibliographyown}
>
> That is, the bibliography is a child of the appendix. This is normal:
> multiple bibliographies would not normally be at chapter level.
>
I want the secondary bibliography to appear as a chapter level, as
achieved with the main bibliography. Other appendices are formatted to
appear in the table of contents as a chapter level entry.

> Now you are saying you want the bibliography to be a chapter-level in the
> ToC, but you want it to look like an Appendix...but in your example above it
> was subsidiary to the appendix heading. You can't have it both ways; and
> having a chapter-style heading appear in mid-page would look very odd.
>
> You can make the ToC entry look like a chapter-level just by adding
> \addcontentsline{toc}{chapter}{*title text*}
> but to make a chapter layout appear in mid-page with no page-break would
> mean creating a private version of the \chapter command omitting the
> page-break code, which might look like this
> \newcommand\fakechapter{\@afterindentfalse\secdef\@chapter\@schapter}
> (untested as I'm away from base right now) and using \fakechapter in the
> redeinition of thebibliography.
>
So the preamble previously provided would become:

\makeatletter
\renewenvironment{thebibliography}[1]
\newcommand\fakechapter{\@afterindentfalse\secdef\@chapter\@schapter}
\makeatother

Peter Flynn

unread,
Sep 24, 2010, 8:22:15 AM9/24/10
to latexus...@googlegroups.com
On Fri, Sep 24, 2010 at 12:49 PM, r <inp...@gmail.com> wrote:
To clarify further, the root document contains:

...
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{plainnat}
\bibliography{bibliography}
\appendix
...

> \chapter{heading}
>     Some introductory text
>     \nocitedi{*}
>     \bibliographydi{bibliographyown}
>
> That is, the bibliography is a child of the appendix. This is normal:
> multiple bibliographies would not normally be at chapter level.
>
I want the secondary bibliography to appear as a chapter level, as
achieved with the main bibliography. Other appendices are formatted to
appear in the table of contents as a chapter level entry.


But that means the appendix headings and the bibliography headings will look the same (apart from the letter-value of the appendix). This will look very strange, but certainly possible.
 
So the preamble previously provided would become:

\makeatletter
\renewenvironment{thebibliography}[1]
\newcommand\fakechapter{\@afterindentfalse\secdef\@chapter\@schapter}
\makeatother

No, not at all. The renewed thebibliography will be as I suggested, but instead of using \section, use the \fakechapter I suggested. This will make it appear as a chapter style, but without the pagebreak, as you requested.

///Peter

r

unread,
Sep 24, 2010, 9:22:51 AM9/24/10
to LaTeX Users Group


On 24 Sep, 13:22, Peter Flynn <anglebrac...@gmail.com> wrote:
> On Fri, Sep 24, 2010 at 12:49 PM, r <inp...@gmail.com> wrote:
> > To clarify further, the root document contains:
>
> > ...
> > \addcontentsline{toc}{chapter}{Bibliography}
> > \bibliographystyle{plainnat}
> > \bibliography{bibliography}
> > \appendix
> > ...
>
> > > \chapter{heading}
> > >     Some introductory text
> > >     \nocitedi{*}
> > >     \bibliographydi{bibliographyown}
>
> > > That is, the bibliography is a child of the appendix. This is normal:
> > > multiple bibliographies would not normally be at chapter level.
>
> > I want the secondary bibliography to appear as a chapter level, as
> > achieved with the main bibliography. Other appendices are formatted to
> > appear in the table of contents as a chapter level entry.
>
> But that means the appendix headings and the bibliography headings will look
> the same (apart from the letter-value of the appendix). This will look very
> strange, but certainly possible.
>
Not to me! The table of contents looks satisfyingly consistent.

> > So the preamble previously provided would become:
>
> > \makeatletter
> > \renewenvironment{thebibliography}[1]
> > \newcommand\fakechapter{\@afterindentfalse\secdef\@chapter\@schapter}
> > \makeatother
>
> No, not at all. The renewed thebibliography will be as I suggested, but
> instead of using \section, use the \fakechapter I suggested. This will make
> it appear as a chapter style, but without the pagebreak, as you requested.
>
Implemented successfully, thank you.
Reply all
Reply to author
Forward
0 new messages