4

I'm using a class based off the scrartcl class. I need to include a bibliography entry in a section, but it displays it as having a * for the section title. If I use the command

\section*{hello} 

in the document it displays as

*
___
hello

and similarly

\section{Publications}
\nocite{ref1}
\bibliographystyle{test}
\bibliography{myreflist}

displays as

PUBLICATIONS
--
*
___
[1] Ref1 etc,

I've used the

\renewcommand{\refname}{} 

command to remove the title "References" from the bibliography, but this asterisk is annoying. Does anyone know if the bibliography command uses the \section* command anywhere, and how one might change/remove it?

Minimal working example:

\documentclass{tccv}

\section{Publications}
\nocite{ref1}
\bibliographystyle{test}
\bibliography{References}
\end{document}
  • The command \thebibliography issues a \section*{\refname}. The first command is automatically called within \bibliography{...} – user31729 Jan 17 '15 at 15:26
  • And I forgot: Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jan 17 '15 at 15:27
  • Thank you, I solved it by redefining \thebibliography in the preamble to not use the \section*{} command. – Ashiataka Jan 17 '15 at 15:45
  • bibliography=totocnumbered as global option. – Johannes_B Jan 17 '15 at 15:49
  • 1
    @Ashiataka: What the hell is tccv class? Did you not mean scrartcl? – user31729 Jan 17 '15 at 15:52
5

This does not solve the deficiencies of the class file, but:

\documentclass[bibliography=totocnumbered]{tccv}
\begin{document}
\nocite{companion}
\section{Publications}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}

Use the proper documented interface to get a numbered (i.e. non starred) bibliography.

Or to make it completely obvius:

\listfiles
\documentclass[bibliography=totocnumbered]{tccv}
\renewcommand{\refname}{Publications}
\begin{document}
\nocite{companion}
\bibliographystyle{plain}
\bibliography{biblatex-examples}
\end{document}

1enter image description here

4

Yes, thebibliography does issue \section* under the tccv document class. In fact, tccv redefines \section to suit its own needs without taking into account that \section could be used in a starred form:

% Overrides the \section command to capitalize every
% word for cosmetic purposes and draws a rule under it.
\let\old@section\section
\renewcommand\section[2][]{%
  \old@section[#1]{\ucwords{#2}}%
  \newdimen\raising%
  \raising=\dimexpr-0.7\baselineskip\relax%
  \vskip\raising\hrule height 0.4pt\vskip-\raising}

You can correct this in two ways by adding the following to your document preamble:

  1. Add dummy starred functionality to \section:

    \makeatletter
    \let\tccvsection\section
    \renewcommand{\section}{\@ifstar\tccvsection\tccvsection}
    \makeatother
    
  2. Patch \bib@heading using etoolbox:

    \usepackage{etoolbox}
    \makeatletter
    % \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
    \patchcmd{\bib@heading}{\section*}{\section}{}{}
    \makeatother
    

Here's a minimal example using the former option:

enter image description here

\documentclass{tccv}
\makeatletter
\let\tccvsection\section
\renewcommand{\section}{\@ifstar\tccvsection\tccvsection}
\makeatother

\begin{document}

\section{Publications}

\begin{thebibliography}{x}
  \bibitem{abc} Some bibliography item
\end{thebibliography}

\end{document}

Now you should be able to change the bibliography heading to suit your needs using an appropriate

\renewcommnd{\refname}{<your new bibliography heading>}

if you wish.

  • The two headings are clearly wrong. – egreg Jan 17 '15 at 16:34
  • @egreg: Clearly. The OP shows the use of what sections should look like \section{Publications} and then how it's set in the bibliography. I kept the input as-is. – Werner Jan 17 '15 at 16:35
  • Note that the OP says to have tried doing \renewcommand{\refname}{} to suppress the heading. – egreg Jan 17 '15 at 16:37
1

It is certainly an error in the tccv class redefining \section so that it doesn't honor a * after it.

You solve the issue by defining \bib@heading to do nothing.

\documentclass{tccv}
\makeatletter
\renewcommand{\bib@heading}{}
\makeatother

\begin{document}

\section{Publications}
\nocite{Knuth:ct-a}
\bibliographystyle{plain}
\bibliography{texbook1}

\end{document}

enter image description here

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.