2

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.

5
  • 2
    Please add a minimal working example (MWE) that illustrates your problem. – Guido Mar 13 '14 at 20:21
  • 2
    \section and/or \subsection have most likely been badly redefined and is/are the culprit. It is hard to answer the question until a real minimal file is posted here, however, because many unwise or downright wrong redefinitions of these commands are possible. – jon Mar 13 '14 at 20:31
  • 1
    The problem is in the redefinition of your sectioning commands, which should not be done this way. The same effect can be achieved without "breaking" these commands -- which now can't be used the so-called starred (i.e., \section* and \subsection*) form. – jon Mar 13 '14 at 21:49
  • not sure how to achieve the same effect for \section (so that it works with my document and produces the same output) in a different way without running into this problem. – eli Mar 13 '14 at 22:09
  • I added a new answer, which I hope is closer to what you were looking for. – jon Mar 14 '14 at 2:46
3

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}
4
  • Thanks jon. If you notice, in my example the headers "Journals" and "Conferences" are properly placed on left (although Publication is printed on right). When I run your example as given, the * are gone but those two headers now are placed on right. In fact, when I use your solution in my complete resume, all sections are placed on right (which is not the case with previous redefinition of \section --- except for the MWE above). – eli Mar 13 '14 at 22:57
  • The original resume template can be found here too: astro.puc.cl/~tpuzia/PUC/PUCHD-Application_files/sample_CV.tex. The problem with this template is that, as mentioned, it interferes with bibtex and biblatex, since \section and \subsection have been redefined. – eli Mar 13 '14 at 23:19
  • Thanks again. Almost there, 1) the name and the line below that are not within page left and right margins, that the rest of the text obeys. Would be better to make the line bold (I should be able to figure this out myself) 2) various sections are not aligned with each other, i.e., they have different left margines 3) when section title is broken to two or more lines, words are right-aligned, not left-aligned – eli Mar 14 '14 at 7:07
  • @eli -- OK, changed. Regarding (1), I did not change it, really: this is by design (if sections are to be in the margin, then they should not be in the textblock). But see the comments for how easily adjustable the 'leftmargin' (\lmargwidth) and 'section width' (\sectionlen) are. Just change to suit your needs. (2) Section titles are all now 'flush left' to \sectionlen. (3) This is connected to (2), and should be fine. I also changed the \printmyname command to use the same \sectionlen so longer names start where section titles start regardless of the length of the name. – jon Mar 14 '14 at 16:46

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.