0

I am writing my thesis using the memoir class.

I have a main which calls all the needed files.

One of these files is the "summary" which calls two different tex files with respective bibliographies (I need to have the summary in two languages, English and Danish).

The problem is that the second bibliography (danish) doesn't show up (the references are placed perfectly but they cross-reference to the bibliography environment of the English summary).

EDIT: it seems that the danish summary keeps looking at the english bib file. The references are placed only if they have been cited in the english summary and they won't show up otherwise. If the reference key differ between the two bib files (e.g. test1 and test1d in the example below), the reference will not be placed properly.

Attached the MWE

\documentclass[b5paper,10pt,authoryear,longnamesfirst]{memoir}

\begin{filecontents}{englishsummary.bib}
@Article{test1,
  author =   {Test Testesen},
  title =    {Test},
  journal =      {Test journal},
  year =     {2018},
}
@Article{test2,
  author =   {Test T. Test},
  title =    {TestB},
  journal =      {Journal of testing},
  year =     {2018},
}
\end{filecontents}

\begin{filecontents}{danishsummary.bib}

@Article{test1d,
  author =   {Test Testesen},
  title =    {Test},
  journal =      {Test journal},
  year =     {2018},
}
@Article{test2d,
  author =   {Test T. Test},
  title =    {TestB},
  journal =      {Journal of testing},
  year =     {2018},
}
\end{filecontents}

% preamble
\let\newfloat\undefined
\usepackage[capbesideposition={top,center},capposition=top]{floatrow}

\usepackage[scaled=0.75]{beramono}
\usepackage[utf8]{inputenc}
\usepackage[english,danish]{babel}
\usepackage{microtype}

\usepackage{bibunits}
\usepackage[authoryear,sectionbib,longnamesfirst]{natbib}

\setlrmarginsandblock{*}{1.228571in}{0.75} 
\setulmarginsandblock{1in}{*}{1.2}

\nouppercaseheads
\makeoddhead{headings}{\small\scshape\rightmark}{}{\small\thepage} 
\makeevenhead{headings}{\small\thepage}{}{\small\scshape\leftmark}

\linespread{1.1}

\usepackage{cleveref}
% END PREAMBLE

\begin{document}

    \selectlanguage{english}
    \frenchspacing
    \tableofcontents*
    %SUMMARY
    \let\oldbibsection\bibsection
    \let\oldbibsection\bibsection
    \renewcommand\bibsection{\section*{\bibname}}

    % English summary
    \begin{bibunit}[elsarticle-harv]
        \chapter*[Summary]{Summary}
        \addcontentsline{toc}{chapter}{Summary}

        some english text \citep{test1} and \cite{test2}.
        %\clearpage
        \putbib[englishsummary.bib]
    \end{bibunit}
    % END OF English SUMMARY

    % Danish summary
    \begin{bibunit}[elsarticle-harv_danish]
        \chapter*[Danish summary]{Danish summary}
        \addcontentsline{toc}{chapter}{Danish summary}
        \selectlanguage{Danish}
        \frenchspacing
        \setcounter{footnote}{0}
        %DANISH SUMMARY     
        some danish text \citep{test1d} and \cite{test2d}.
        \clearpage
        \putbib[danishsummary.bib]
    \end{bibunit}
        % END OF DANISH SUMMARY
    \selectlanguage{english}
    \frenchspacing
    \let\bibsection\oldbibsection
\end{document}
12
  • Please provide a MWE (from \documentclass through \begin{document} to \end{document}) that shows the error so that we can process it and try to help. For instance you use the memoir class but also the bibunit environment which is not supplied by memoir; where does it come from? Aug 29, 2018 at 18:06
  • @PeterWilson Hi, I added the preamble. Let me know if anything else is needed. The log doesn't return any error as the references appear correctly, the fact that the bibliography environment is missing doesn't seem to be recognized as a problem
    – CAPSLOCK
    Aug 30, 2018 at 8:01
  • Could you please clean this up (a lot), there are many constructions and packages that are completely irrelevant for this question. Also where does the Danish bst file come from? You are imputing stuff we do not have access to, so please help us help you by making something that is minimal and self contained that others can test without having to add a lot of stuff.
    – daleif
    Aug 30, 2018 at 8:56
  • 1
    @daleif I think you just found the problem. If I change the bibtex configuration file to plainnat the danish bibliography environment pops up. Now I need to figure out what's special about the file I was calling
    – CAPSLOCK
    Aug 31, 2018 at 10:11
  • 1
    Now you know why making the single MWE is important, and why it is important to make them self contains and only using stuff others have access to. That process often ends up revealing the issue.
    – daleif
    Aug 31, 2018 at 10:20

1 Answer 1

1

Here is a re-edit of the OPs current MWE (20180831 12:10)

\documentclass[oneside]{memoir}
\usepackage{filecontents}
\begin{filecontents*}{englishsummary.bib}
@Article{test1,
  author =   {Test Testesen},
  title =    {Test english},
  journal =      {Test journal},
  year =     {2018},
}
@Article{test2,
  author =   {Test T. Test},
  title =    {TestB english},
  journal =      {Journal of testing},
  year =     {2018},
}
\end{filecontents*}
\begin{filecontents*}{danishsummary.bib}
@Article{test1d,
  author =   {Test TestesenD},
  title =    {Test danish},
  journal =      {Test journal},
  year =     {2018},
}
@Article{test2d,
  author =   {Test T. TestD},
  title =    {TestB danish},
  journal =      {Journal of testing},
  year =     {2018},
}
\end{filecontents*}

\usepackage[utf8]{inputenc}
\usepackage[danish,english]{babel}

\usepackage{bibunits}
\usepackage[authoryear,sectionbib,longnamesfirst]{natbib}

\begin{document}

    \selectlanguage{english}
    \tableofcontents*


    % English summary
    \begin{bibunit}[plainnat]
        \chapter*[Summary]{Summary}

        some english text \citep{test1} and \cite{test2}.
        %\clearpage
        \putbib[englishsummary]
    \end{bibunit}
    % END OF English SUMMARY

    % Danish summary
    \begin{bibunit}[plainnat]
        \chapter*[Danish summary]{Danish summary}
        \addcontentsline{toc}{chapter}{Danish summary}
        \selectlanguage{Danish}
        \frenchspacing

        some danish text \citep{test1d} and \cite{test2d}.

        \putbib[danishsummary]
    \end{bibunit}
\end{document}

As far as I can see on my system the citations are correct. I added the filecontents package and switched to the starred version of that env, then the two bibfiles will be changed on disk if we alter them in the text file.


Too long for a comment, here is a super small MWE of memoir working with bibunits

Remember to run bibtex on all buX.aux (I use the latexmk tool, it will automatically detect the buX.aux files and run bibtex on them

So what exactly is the problem on your document?

\documentclass[a4paper]{memoir}
\begin{filecontents}{mytest.bib}
@Article{test1,
  author =   {Test Testesen},
  title =    {Test},
  journal =      {Test journal},
  year =     {2018},
}
@Article{test2,
  author =   {Test T. Test},
  title =    {TestB},
  journal =      {Journal of testing},
  year =     {2018},
}
\end{filecontents}


\usepackage[danish,english]{babel}
\usepackage{bibunits}
\usepackage[authoryear,sectionbib,longnamesfirst]{natbib}


\begin{document}

\tableofcontents*


%English summary
\begin{bibunit}[plainnat]
\chapter*[Summary]{Summary}
\addcontentsline{toc}{chapter}{Summary}

some text

\cite{test1}

\putbib[mytest]
\end{bibunit}

% Danish summary
\begin{bibunit}[plainnat]
\chapter*[Danish summary]{Danish summary}
\addcontentsline{toc}{chapter}{Danish summary}
\selectlanguage{danish}
\frenchspacing

some text

\cite{test2}

\putbib[mytest]
\end{bibunit}

\end{document}

You must log in to answer this question.

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