2

Background - I'm modifying a fairly well documented LaTex CV to build my own. All works well, till I tried to add publications using the multibib package (using this answer in Tex.SE). When I incorporate that, I get a series of asterisks in the margin that I don't know how to remove. I've whittled down the code to the following MWE - however, I have no clue how to debug it further. Any help would be greatly appreciated!

\documentclass[10pt]{article}

\usepackage{multibib}
\newcites{journal,conference}{Journal Articles, Refereed Conference Publications}

\usepackage{color,hyperref}

%%% SECTION HEADINGS

% The section headings. Flush left in small caps down pseudo-margin.
%
% Usage: \section{section name}
\renewcommand{\section}[1]{\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}

\begin{document}

\section{Publications}

\bibliographystylejournal{plain}
\nocitejournal{*}
\bibliographyjournal{journal}

\bibliographystyleconference{plain}
\nociteconference{*}
\bibliographyconference{conference}

\end{document}

content for journal.bib

@article{entry2,
    author = {Author name},
    journal = {Some Journal},
    title = {Title},
    year = {2013},
}

content for conference.bib

@inproceedings{entry1,
    author = {Author name},
    address = {address},
    booktitle = {Some conference},
    title = {Title},
    year = {2013},
}

Here's what the generated output looks like: Generated output

I want to remove the offending stars in the margin. I understand from the way the section command has been redefined, its treating the entries output by multibib as some sort of list. But how to make it not happen, is not something I can decipher.

1
  • You get into trouble with the starred section \section*{} macro, which seems to be used by \multibib for some reason.
    – user31729
    Commented Nov 9, 2014 at 7:26

1 Answer 1

4

\multibib uses \section* commands (hidden in \thebibliography), but a redefinition of \section{} without providing the starred version is wrong (in general!), so this must be cured in the way that \section*{} is still available, by pushing it back to use the old definition, using the \let macro.

If \section*{} is not available, the \section*{} will just print an asterisk symbol * at the corresponding place.

However, redefining \section will break other sections of the document body. In my point of view, the \renewcommand{section} should, if at all, only occur within the \thebibliography group.

Additional note: In \newcites{...} there should be no space between after the comma, as this is taken literally as the \bibname and it will appear accordingly.

The long version using \@ifnextchar etc.

\documentclass[10pt]{article}

\usepackage{multibib}
\newcites{journal,conference}{Journal Articles,Refereed Conference Publications}

\usepackage{color,hyperref}

%%% SECTION HEADINGS

% The section headings. Flush left in small caps down pseudo-margin.
%
% Usage: \section{section name}

\makeatletter
\let\LaTeXStandardSection\section

\newcommand{\starredsection}[1]{%
\LaTeXStandardSection*{#1}%
}

\newcommand{\unstarredsection@@noopt}[1]{%
\unstarredsection@@opt[#1]{#1}%
}%

\newcommand{\unstarredsection@@opt}[2][]{%
\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}%

\newcommand{\unstarredsection}{%
\@ifnextchar[{\unstarredsection@@opt}{\unstarredsection@@noopt}%
}%

\renewcommand{\section}{%
\@ifstar{\starredsection}{\unstarredsection}%
}%

\makeatother

\begin{document}

\section{Publications}

\bibliographystylejournal{plain}
\nocitejournal{*}
\bibliographyjournal{journal}

\bibliographystyleconference{plain}
\nociteconference{*}
\bibliographyconference{conference}

\end{document}

The short version, using \xapptocmd

\documentclass[10pt]{article}
\usepackage{xpatch}%

\usepackage{multibib}
\newcites{journal,conference}{Journal Articles,Refereed Conference Publications}


\let\LaTeXStandardSection\section

\xpatchcmd{\thebibliography}{\section*}{\LaTeXStandardSection*}{}{}

\usepackage{color,hyperref}

%%% SECTION HEADINGS

% The section headings. Flush left in small caps down pseudo-margin.
%
% Usage: \section{section name}

% This not a very good style --> it will break the text sections!

\renewcommand{\section}[1]{%
\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}%



\begin{document}

\section{Publications}

\bibliographystylejournal{plain}
\nocitejournal{*}
\bibliographyjournal{journal}

\bibliographystyleconference{plain}
\nociteconference{*}
\bibliographyconference{conference}

\end{document}

enter image description here

2
  • Used the long version, works precisely as predicted! On a separate note, apart from reading the TeX manual, what resources have you used to wrap your head around TeX programming? It seems so very different from the mainstream programming languages, I have great difficulty even reading it!
    – TCSGrad
    Commented Nov 9, 2014 at 21:00
  • @TCSGrad: Well, I learned a lot of things here at TeX.SX and after some time, it's possible to read the (La)TeX sources and to provide solutions then.
    – user31729
    Commented Nov 9, 2014 at 21:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .