Show different bibtex field when writing in different languages











up vote
0
down vote

favorite












I write in English as well as Chinese. When I cite Chinese work in English paper, I want to include both the English transcription/translation and original Chinese characters. But when I cite Chinese work in Chinese paper, I don't need to include the transcription. Is there a possible and convenient way to switch from these two circumstances, provided I make only one bibtex record for each reference, instead of two (Chinese version .bib and English version)?



I use Biblatex + TeXlive2018 + Win10



Example



When I write in English, I want output be like this:
enter image description here



When I write in Chinese, I want the same two references be like this:
enter image description here



(Biblatex-Chicago style is used)



That is to say:



English reference in English/Chinese writing --> remains English



Chinese reference in English writing --> shows both English and Chinese fields



Chinese reference in Chinese writing --> shows Chinese fields only










share|improve this question






















  • At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
    – moewe
    Dec 3 at 21:39















up vote
0
down vote

favorite












I write in English as well as Chinese. When I cite Chinese work in English paper, I want to include both the English transcription/translation and original Chinese characters. But when I cite Chinese work in Chinese paper, I don't need to include the transcription. Is there a possible and convenient way to switch from these two circumstances, provided I make only one bibtex record for each reference, instead of two (Chinese version .bib and English version)?



I use Biblatex + TeXlive2018 + Win10



Example



When I write in English, I want output be like this:
enter image description here



When I write in Chinese, I want the same two references be like this:
enter image description here



(Biblatex-Chicago style is used)



That is to say:



English reference in English/Chinese writing --> remains English



Chinese reference in English writing --> shows both English and Chinese fields



Chinese reference in Chinese writing --> shows Chinese fields only










share|improve this question






















  • At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
    – moewe
    Dec 3 at 21:39













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I write in English as well as Chinese. When I cite Chinese work in English paper, I want to include both the English transcription/translation and original Chinese characters. But when I cite Chinese work in Chinese paper, I don't need to include the transcription. Is there a possible and convenient way to switch from these two circumstances, provided I make only one bibtex record for each reference, instead of two (Chinese version .bib and English version)?



I use Biblatex + TeXlive2018 + Win10



Example



When I write in English, I want output be like this:
enter image description here



When I write in Chinese, I want the same two references be like this:
enter image description here



(Biblatex-Chicago style is used)



That is to say:



English reference in English/Chinese writing --> remains English



Chinese reference in English writing --> shows both English and Chinese fields



Chinese reference in Chinese writing --> shows Chinese fields only










share|improve this question













I write in English as well as Chinese. When I cite Chinese work in English paper, I want to include both the English transcription/translation and original Chinese characters. But when I cite Chinese work in Chinese paper, I don't need to include the transcription. Is there a possible and convenient way to switch from these two circumstances, provided I make only one bibtex record for each reference, instead of two (Chinese version .bib and English version)?



I use Biblatex + TeXlive2018 + Win10



Example



When I write in English, I want output be like this:
enter image description here



When I write in Chinese, I want the same two references be like this:
enter image description here



(Biblatex-Chicago style is used)



That is to say:



English reference in English/Chinese writing --> remains English



Chinese reference in English writing --> shows both English and Chinese fields



Chinese reference in Chinese writing --> shows Chinese fields only







biblatex bibtex chinese






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 3 at 21:30









Lucius Zhao

183




183












  • At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
    – moewe
    Dec 3 at 21:39


















  • At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
    – moewe
    Dec 3 at 21:39
















At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
– moewe
Dec 3 at 21:39




At the moment that is not really possible without serious manual modifications to the style. A few years ago, there was an idea to implement a multiscript version of biblatex that would make these things easier (github.com/plk/biblatex/tree/ms, github.com/plk/biblatex/issues/416), but unfortunately development for that feature has stalled in recent years.
– moewe
Dec 3 at 21:39










1 Answer
1






active

oldest

votes

















up vote
3
down vote













This is a proof of concept of a limited alternative which, I'm sure, it won't take long before someone finds an unfixable flaw. But I submit it as an idea. As it stands, it only works for literal fields (I'm using title here as example) and I'm not sure if this could be extended for names and lists. It will very likely generate some problems with biblatex's formatting directives. It is also a fragile setting, as we need to place some macros directly in the bibentry field of interest.



documentclass{article}

usepackage{filecontents}
begin{filecontents}{jobname.bib}
@book{book1,
author = {Author},
title = {caseenglish{Title}casebrazilian{Título}},
date = {2000},
location = {Location},
publisher = {Publisher},
addendum = {An entry in Brazilian Portuguese, for which we want both titles
when the language is English and Portuguese title when the langage is
brazilian},
}

@book{book2,
author = {Author},
title = {English title},
date = {2004},
location = {Location},
publisher = {Publisher},
addendum = {An entry in English, which should always be in English},
}

end{filecontents}

usepackage{iflang}
usepackage[brazilian,english]{babel}
usepackage{csquotes}
usepackage[style=authoryear]{biblatex}

addbibresource{jobname.bib}

newcommand*{caseenglish}[1]{#1}
newcommand*{casebrazilian}[1]{#1}

AtBeginBibliography{%
IfLanguageName{english}{%
renewcommand*{casebrazilian}[1]{ #1}%
}{}%
IfLanguageName{brazilian}{%
renewcommand*{caseenglish}[1]{}%
}{}%
}

begin{document}

nocite{*}

printbibliography

selectlanguage{brazilian}

printbibliography

end{document}


enter image description here






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%2f463050%2fshow-different-bibtex-field-when-writing-in-different-languages%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
    3
    down vote













    This is a proof of concept of a limited alternative which, I'm sure, it won't take long before someone finds an unfixable flaw. But I submit it as an idea. As it stands, it only works for literal fields (I'm using title here as example) and I'm not sure if this could be extended for names and lists. It will very likely generate some problems with biblatex's formatting directives. It is also a fragile setting, as we need to place some macros directly in the bibentry field of interest.



    documentclass{article}

    usepackage{filecontents}
    begin{filecontents}{jobname.bib}
    @book{book1,
    author = {Author},
    title = {caseenglish{Title}casebrazilian{Título}},
    date = {2000},
    location = {Location},
    publisher = {Publisher},
    addendum = {An entry in Brazilian Portuguese, for which we want both titles
    when the language is English and Portuguese title when the langage is
    brazilian},
    }

    @book{book2,
    author = {Author},
    title = {English title},
    date = {2004},
    location = {Location},
    publisher = {Publisher},
    addendum = {An entry in English, which should always be in English},
    }

    end{filecontents}

    usepackage{iflang}
    usepackage[brazilian,english]{babel}
    usepackage{csquotes}
    usepackage[style=authoryear]{biblatex}

    addbibresource{jobname.bib}

    newcommand*{caseenglish}[1]{#1}
    newcommand*{casebrazilian}[1]{#1}

    AtBeginBibliography{%
    IfLanguageName{english}{%
    renewcommand*{casebrazilian}[1]{ #1}%
    }{}%
    IfLanguageName{brazilian}{%
    renewcommand*{caseenglish}[1]{}%
    }{}%
    }

    begin{document}

    nocite{*}

    printbibliography

    selectlanguage{brazilian}

    printbibliography

    end{document}


    enter image description here






    share|improve this answer

























      up vote
      3
      down vote













      This is a proof of concept of a limited alternative which, I'm sure, it won't take long before someone finds an unfixable flaw. But I submit it as an idea. As it stands, it only works for literal fields (I'm using title here as example) and I'm not sure if this could be extended for names and lists. It will very likely generate some problems with biblatex's formatting directives. It is also a fragile setting, as we need to place some macros directly in the bibentry field of interest.



      documentclass{article}

      usepackage{filecontents}
      begin{filecontents}{jobname.bib}
      @book{book1,
      author = {Author},
      title = {caseenglish{Title}casebrazilian{Título}},
      date = {2000},
      location = {Location},
      publisher = {Publisher},
      addendum = {An entry in Brazilian Portuguese, for which we want both titles
      when the language is English and Portuguese title when the langage is
      brazilian},
      }

      @book{book2,
      author = {Author},
      title = {English title},
      date = {2004},
      location = {Location},
      publisher = {Publisher},
      addendum = {An entry in English, which should always be in English},
      }

      end{filecontents}

      usepackage{iflang}
      usepackage[brazilian,english]{babel}
      usepackage{csquotes}
      usepackage[style=authoryear]{biblatex}

      addbibresource{jobname.bib}

      newcommand*{caseenglish}[1]{#1}
      newcommand*{casebrazilian}[1]{#1}

      AtBeginBibliography{%
      IfLanguageName{english}{%
      renewcommand*{casebrazilian}[1]{ #1}%
      }{}%
      IfLanguageName{brazilian}{%
      renewcommand*{caseenglish}[1]{}%
      }{}%
      }

      begin{document}

      nocite{*}

      printbibliography

      selectlanguage{brazilian}

      printbibliography

      end{document}


      enter image description here






      share|improve this answer























        up vote
        3
        down vote










        up vote
        3
        down vote









        This is a proof of concept of a limited alternative which, I'm sure, it won't take long before someone finds an unfixable flaw. But I submit it as an idea. As it stands, it only works for literal fields (I'm using title here as example) and I'm not sure if this could be extended for names and lists. It will very likely generate some problems with biblatex's formatting directives. It is also a fragile setting, as we need to place some macros directly in the bibentry field of interest.



        documentclass{article}

        usepackage{filecontents}
        begin{filecontents}{jobname.bib}
        @book{book1,
        author = {Author},
        title = {caseenglish{Title}casebrazilian{Título}},
        date = {2000},
        location = {Location},
        publisher = {Publisher},
        addendum = {An entry in Brazilian Portuguese, for which we want both titles
        when the language is English and Portuguese title when the langage is
        brazilian},
        }

        @book{book2,
        author = {Author},
        title = {English title},
        date = {2004},
        location = {Location},
        publisher = {Publisher},
        addendum = {An entry in English, which should always be in English},
        }

        end{filecontents}

        usepackage{iflang}
        usepackage[brazilian,english]{babel}
        usepackage{csquotes}
        usepackage[style=authoryear]{biblatex}

        addbibresource{jobname.bib}

        newcommand*{caseenglish}[1]{#1}
        newcommand*{casebrazilian}[1]{#1}

        AtBeginBibliography{%
        IfLanguageName{english}{%
        renewcommand*{casebrazilian}[1]{ #1}%
        }{}%
        IfLanguageName{brazilian}{%
        renewcommand*{caseenglish}[1]{}%
        }{}%
        }

        begin{document}

        nocite{*}

        printbibliography

        selectlanguage{brazilian}

        printbibliography

        end{document}


        enter image description here






        share|improve this answer












        This is a proof of concept of a limited alternative which, I'm sure, it won't take long before someone finds an unfixable flaw. But I submit it as an idea. As it stands, it only works for literal fields (I'm using title here as example) and I'm not sure if this could be extended for names and lists. It will very likely generate some problems with biblatex's formatting directives. It is also a fragile setting, as we need to place some macros directly in the bibentry field of interest.



        documentclass{article}

        usepackage{filecontents}
        begin{filecontents}{jobname.bib}
        @book{book1,
        author = {Author},
        title = {caseenglish{Title}casebrazilian{Título}},
        date = {2000},
        location = {Location},
        publisher = {Publisher},
        addendum = {An entry in Brazilian Portuguese, for which we want both titles
        when the language is English and Portuguese title when the langage is
        brazilian},
        }

        @book{book2,
        author = {Author},
        title = {English title},
        date = {2004},
        location = {Location},
        publisher = {Publisher},
        addendum = {An entry in English, which should always be in English},
        }

        end{filecontents}

        usepackage{iflang}
        usepackage[brazilian,english]{babel}
        usepackage{csquotes}
        usepackage[style=authoryear]{biblatex}

        addbibresource{jobname.bib}

        newcommand*{caseenglish}[1]{#1}
        newcommand*{casebrazilian}[1]{#1}

        AtBeginBibliography{%
        IfLanguageName{english}{%
        renewcommand*{casebrazilian}[1]{ #1}%
        }{}%
        IfLanguageName{brazilian}{%
        renewcommand*{caseenglish}[1]{}%
        }{}%
        }

        begin{document}

        nocite{*}

        printbibliography

        selectlanguage{brazilian}

        printbibliography

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 3 at 23:53









        gusbrs

        6,4942838




        6,4942838






























            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%2f463050%2fshow-different-bibtex-field-when-writing-in-different-languages%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

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

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