[Tex/LaTex] biblatex prints an unwanted star (*)

biblatexbibtex

I am using biblatex in an article document class which has been turned into a
resume manually. The \section and \subsection have been redefined. Now If I use
bibtex or biblatex, I get an unwanted star (*) on the left of References.

A similar problem has been reported here:
The bibliography prints a * (star) on the first line.

The solution given there works only for bibtex. Can someone suggest a solution
for biblatex?

Putting the (journal and conference) publication list in the resume is not easy.

Here is a minimum working example.

Here is a minimum working example (MWE).

    \documentclass[10pt]{article}
\usepackage{hyperref}


% Redefine section
\renewcommand{\section}[2]%
        {\pagebreak[2]\vspace{1.3\baselineskip}%
         \phantomsection\addcontentsline{toc}{section}{#1}%
         \hspace{0in}%
         \marginpar{
         \raggedright \scshape #1}#2}


% Redefine subsection
\renewcommand{\subsection}[2]%
        {\pagebreak[2]\vspace{1.3\baselineskip}%
         \phantomsection\addcontentsline{toc}{section}{#1}%
         \hspace{0in}%
         \marginpar{
         \raggedright \scshape #1}#2}

%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}

\begin{filecontents}{\jobname.bib}
@article{paper1,
  author = {John G. Smith},
  year = {2004},
  title = {This is journal paper 1},
}
@article{papere2,
  author = {John G. Smith},
  year = {2006},
  title = {This is journal paper 2},
}
@conference{C03,
  author = {John G. Smith},
  year = {2003},
  title = {This is conference paper 1},
}
\end{filecontents}



\begin{document}


\section{Publications}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}

\end{document}

To run this example, save it as mwe.tex and type:

  • pdflatex mwe.tex
  • bibtex mwe1-blx.aux
  • bibtex mwe2-blx.aux
  • pdflatex mwe.tex
  • pdflatex mwe.tex

The output shows section Publication on right. In the original file it's placed
on left (I turned it into a MWE and that's what happened). Nevertheless you can see two stars on the right. These are printed by biblatex, probably because \section* has not been redefined.

The template for latex is same as this template. The problem with this template is that, it does not offer a proper solution for the list of publications. I wanted to use biblatex to be able to list journal and conference papers in two sections, and enumerate them, separately.

Best Answer

It is easy enough to mimic the page design of the linked-to sample_CV.tex without all the complicated hoops it jumps through. All it takes is geometry and titlesec. (I would also use enumitem to fiddle with my various list environments, but that is beside the point here.) What matters in this case is setting the margins to the width you like, and making sure there's enough room for your sectional titles. In order to keep these settings obvious and easy to change, I'd use the following:

\newlength\lmargwidth% <-- will set the width left of section headings
\newlength\sectionlen% <-- will set the space reserved for the section headings
\setlength{\lmargwidth}{1in}
\setlength{\sectionlen}{1in}                        

The advantage of setting lengths this way is that if you decide you want to use the same lengths elsewhere, you can just plug in a, say, \sectionlen. Then, if you want to make changes to its length (say to 2in), one change will propagate to all the 'right' places in the document.

The only other addition to this file is the \printmyname command, which basically just is a 'stretchable' macro to mimic the way the name is set in sample_CV.tex. Personally, I'd probably do something different to set off my name in my CV. (Not that this person's set up is overly flashy...)

\documentclass[10pt]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{paper1,
  author = {John G. Smith},
  year = {2004},
  title = {This is journal paper 1},
}
@article{papere2,
  author = {John G. Smith},
  year = {2006},
  title = {This is journal paper 2},
}
@conference{C03,
  author = {John G. Smith},
  year = {2003},
  title = {This is conference paper 1},
}
\end{filecontents}

\usepackage[T1]{fontenc}
% These two lengths set the left margin and the space reserved on the
% left for the sectional titles, which are, by design *not* part of
% the text block.  If you need to invade that space for a special
% section, you just need to decrease the left margin by a
% '-\sectionlen' (e.g., \hspace*{-\sectionlen})
\newlength\lmargwidth
\newlength\sectionlen
\setlength{\lmargwidth}{1.0in}%
\setlength{\sectionlen}{1.0in}%

\usepackage[paper=letterpaper,
            %includefoot, % Uncomment to put page number above margin
          lmargin={\dimexpr\lmargwidth +\sectionlen\relax}, % <-- changed
            rmargin=1in,
            vmargin=1in,
            nomarginpar,
%            showframe, % <-- for debugging...
            ]{geometry}

\usepackage{lipsum}

% Set up \section and \subsection format
\usepackage[nobottomtitles]{titlesec}
\setcounter{secnumdepth}{0}% <-- don't number sections or subsections
\titleformat{\section}[leftmargin]
   {\normalfont\scshape\filright}
   {\thesection}
   {0.5em}
   {}
\titlespacing*{\section}% <-- remove the * if you want indentation on the first line
  {\sectionlen}{1.5ex plus .1ex minus .2ex}{0pc}

\titleformat{\subsection}[leftmargin]
   {\normalfont\scshape\filright}
   {\thesubsection}
   {0.5em}
   {}
\titlespacing*{\subsection}% <-- * == no indentation for 1st line
  {\sectionlen}{1.5ex plus .1ex minus .2ex}{0pc}

%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}

% Load hyperref after most packages...
\usepackage{hyperref}


% Format name: bold and 'large'
\newcommand{\nameformat}[1]{%
  \textbf{\large #1}}
% Set and print name over a horizontal rule...
\newcommand{\printmyname}[1]{%
  \begingroup
  \parindent 0pt
  \hspace*{-\sectionlen}%
  \makebox[0pt][l]{\nameformat{#1}}\par
  \hspace*{-\sectionlen}%
%  \hrulefill% <-- normal line
  \rule{\dimexpr\textwidth + \sectionlen\relax}{2mm}% <-- 2mm thick line
  \endgroup}

\begin{document}

\printmyname{Some Gal with a Really Long Name}


\section{First}
\lipsum[1]

\begin{itemize}
\item one
\item two
\item three
\end{itemize}

\subsection{Second}
\lipsum[1-3]

\section*{First Starred}
\lipsum[2]

\subsection*{Second Starred}
\lipsum[2]

\section{Publications}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}

\end{document}

Original answer. (Designed to put section titles flush to the right-hand margin.)

I think you can achieve the same effect, more or less with a very simple use of titlesec:

\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\titleformat{\section}[block]
   {\hfill\scshape}
   {\thesection}
   {0.5em}
   {}[]

\titleformat{\subsection}[block]
   {\hfill\scshape}
   {\thesubsection}
   {0.5em}
   {}[]

The full example, then, would be the following:

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{paper1,
  author = {John G. Smith},
  year = {2004},
  title = {This is journal paper 1},
}
@article{papere2,
  author = {John G. Smith},
  year = {2006},
  title = {This is journal paper 2},
}
@conference{C03,
  author = {John G. Smith},
  year = {2003},
  title = {This is conference paper 1},
}
\end{filecontents}


\usepackage{lipsum}   % <-- used to help see the textblock
\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\titleformat{\section}[block]
   {\hfill\scshape}
   {\thesection}
   {0.5em}
   {}[]

\titleformat{\subsection}[block]
   {\hfill\scshape}
   {\thesubsection}
   {0.5em}
   {}[]

% another titlesec option would be 'rightmargin' instead of 'block': but this puts the heading *in* the margin...

%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}


\usepackage{hyperref}% load after most packages...

\begin{document}

\section{First}

\lipsum[1]

\subsection{Second}

\lipsum[1]

\section*{First Starred}
\subsection*{Second Starred}

\lipsum[1]

\section{Publications}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}

\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}

\end{document}