Memoir class - bibliography environment reference to wrong bibunit











up vote
0
down vote

favorite












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
letnewfloatundefined
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}{smallscshaperightmark}{}{smallthepage}
makeevenhead{headings}{smallthepage}{}{smallscshapeleftmark}

linespread{1.1}

usepackage{cleveref}
% END PREAMBLE

begin{document}

selectlanguage{english}
frenchspacing
tableofcontents*
%SUMMARY
letoldbibsectionbibsection
letoldbibsectionbibsection
renewcommandbibsection{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
letbibsectionoldbibsection
end{document}









share|improve this question
























  • 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?
    – Peter Wilson
    Aug 29 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
    – Gio
    Aug 30 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 at 8:56










  • Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
    – daleif
    Aug 31 at 9:43






  • 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
    – Gio
    Aug 31 at 10:11















up vote
0
down vote

favorite












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
letnewfloatundefined
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}{smallscshaperightmark}{}{smallthepage}
makeevenhead{headings}{smallthepage}{}{smallscshapeleftmark}

linespread{1.1}

usepackage{cleveref}
% END PREAMBLE

begin{document}

selectlanguage{english}
frenchspacing
tableofcontents*
%SUMMARY
letoldbibsectionbibsection
letoldbibsectionbibsection
renewcommandbibsection{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
letbibsectionoldbibsection
end{document}









share|improve this question
























  • 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?
    – Peter Wilson
    Aug 29 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
    – Gio
    Aug 30 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 at 8:56










  • Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
    – daleif
    Aug 31 at 9:43






  • 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
    – Gio
    Aug 31 at 10:11













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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
letnewfloatundefined
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}{smallscshaperightmark}{}{smallthepage}
makeevenhead{headings}{smallthepage}{}{smallscshapeleftmark}

linespread{1.1}

usepackage{cleveref}
% END PREAMBLE

begin{document}

selectlanguage{english}
frenchspacing
tableofcontents*
%SUMMARY
letoldbibsectionbibsection
letoldbibsectionbibsection
renewcommandbibsection{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
letbibsectionoldbibsection
end{document}









share|improve this question















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
letnewfloatundefined
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}{smallscshaperightmark}{}{smallthepage}
makeevenhead{headings}{smallthepage}{}{smallscshapeleftmark}

linespread{1.1}

usepackage{cleveref}
% END PREAMBLE

begin{document}

selectlanguage{english}
frenchspacing
tableofcontents*
%SUMMARY
letoldbibsectionbibsection
letoldbibsectionbibsection
renewcommandbibsection{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
letbibsectionoldbibsection
end{document}






bibliographies memoir bibunits






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 31 at 10:13

























asked Aug 29 at 16:14









Gio

12




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?
    – Peter Wilson
    Aug 29 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
    – Gio
    Aug 30 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 at 8:56










  • Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
    – daleif
    Aug 31 at 9:43






  • 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
    – Gio
    Aug 31 at 10:11


















  • 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?
    – Peter Wilson
    Aug 29 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
    – Gio
    Aug 30 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 at 8:56










  • Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
    – daleif
    Aug 31 at 9:43






  • 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
    – Gio
    Aug 31 at 10:11
















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?
– Peter Wilson
Aug 29 at 18:06




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?
– Peter Wilson
Aug 29 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
– Gio
Aug 30 at 8:01






@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
– Gio
Aug 30 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 at 8:56




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 at 8:56












Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
– daleif
Aug 31 at 9:43




Woul;d you please still make this into a single example instead of several sniplets. There is no need for the rest of us to replicate your folder structure. As you can see from my example below, there is no issues in making a single MWE.
– daleif
Aug 31 at 9:43




1




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
– Gio
Aug 31 at 10:11




@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
– Gio
Aug 31 at 10:11










1 Answer
1






active

oldest

votes

















up vote
0
down vote













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}





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448364%2fmemoir-class-bibliography-environment-reference-to-wrong-bibunit%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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}





    share|improve this answer



























      up vote
      0
      down vote













      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}





      share|improve this answer

























        up vote
        0
        down vote










        up vote
        0
        down vote









        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}





        share|improve this answer














        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}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Aug 31 at 10:10

























        answered Aug 30 at 9:30









        daleif

        31.8k252113




        31.8k252113






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448364%2fmemoir-class-bibliography-environment-reference-to-wrong-bibunit%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents