fontspec changes indentation of biblatex bibliography











up vote
3
down vote

favorite












MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{Test}},
year = {2018},
title = {Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.}
}


Adding usepackage{fontspec} decreases the indentation of the biblatex entries in the bibliography, removing it increases it again. Why?



I came across this problem after trying to break a long url in the bibliography of an article. The decreased indentation changes the breakpoint. Furthermore it makes the url overflow by one stubborn character even though I set biburllcpenalty and biburlucpenalty accordingly. Without using fontspec there is no overflow.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
    – Kurt
    3 hours ago

















up vote
3
down vote

favorite












MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{Test}},
year = {2018},
title = {Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.}
}


Adding usepackage{fontspec} decreases the indentation of the biblatex entries in the bibliography, removing it increases it again. Why?



I came across this problem after trying to break a long url in the bibliography of an article. The decreased indentation changes the breakpoint. Furthermore it makes the url overflow by one stubborn character even though I set biburllcpenalty and biburlucpenalty accordingly. Without using fontspec there is no overflow.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
    – Kurt
    3 hours ago















up vote
3
down vote

favorite









up vote
3
down vote

favorite











MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{Test}},
year = {2018},
title = {Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.}
}


Adding usepackage{fontspec} decreases the indentation of the biblatex entries in the bibliography, removing it increases it again. Why?



I came across this problem after trying to break a long url in the bibliography of an article. The decreased indentation changes the breakpoint. Furthermore it makes the url overflow by one stubborn character even though I set biburllcpenalty and biburlucpenalty accordingly. Without using fontspec there is no overflow.










share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











MWE:



test.tex:



% !TeX program = xelatex
documentclass[paper=A4,fontsize=12pt]{scrartcl}
usepackage{fontspec}
usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
addbibresource{resources.bib}
begin{document}
cite{Test.2018}
printbibliography
end{document}


resources.bib:



@misc{Test.2018,
author = {{Test}},
year = {2018},
title = {Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.}
}


Adding usepackage{fontspec} decreases the indentation of the biblatex entries in the bibliography, removing it increases it again. Why?



I came across this problem after trying to break a long url in the bibliography of an article. The decreased indentation changes the breakpoint. Furthermore it makes the url overflow by one stubborn character even though I set biburllcpenalty and biburlucpenalty accordingly. Without using fontspec there is no overflow.







biblatex xetex koma-script fontspec






share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago









gusbrs

6,6142838




6,6142838






New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









Young Un

161




161




New contributor




Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Young Un is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
    – Kurt
    3 hours ago




















  • Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
    – Kurt
    3 hours ago


















Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
– Kurt
3 hours ago






Welcome to TeX.SE! I can confirm this with current MiKTeX 2.9 and Windows 8.1. Which tex distribution and OS do you use? Can you add the bibentrx of the article which shows the issue with the url?
– Kurt
3 hours ago












1 Answer
1






active

oldest

votes

















up vote
2
down vote













Probably someone who knows KOMA-Script better may be able to give a more precise answer. But, as far as I was able to understand, this behavior hangs on how scrartcl class handles parindent which is, in turn, used by biblatex to set the bibliography hanging indent.



biblatex uses the length bibhang on the bibenvironment of the authoryear style. And it is set in biblatex.def with:



setlength{bibhang}{ifnumequal{parindent}{0}{1em}{parindent}}


Which will set bibhang to parindent but default bibhang to 1em if parindent is 0 for some reason, which is not the case here (that is parindent is not 0, so bibhang actually receives parindent).



Now if we build the document below with XeLaTeX:



documentclass[paper=A4,fontsize=12pt]{scrartcl}

typeout{theparindent}

begin{document}

theparindent

end{document}


The PDF will print "12.0pt", but we will find "20.0pt" in the log.



This means that, for some reason, parindent is 20pt in the preamble, and 12pt in the document. biblatex sets bibhang in the preamble, thus, in the absence of other intervening packages, takes the value of 20pt.



Now, if we add fontspec to the document:



documentclass[paper=A4,fontsize=12pt]{scrartcl}

usepackage{fontspec}

typeout{theparindent}

begin{document}

theparindent

end{document}


We will find "12pt" in both the document and the log. So, if biblatex is called after fontspec, it will receive now the value of 12pt.



This doesn't really mean that fontspec is responsible for this setting on it's own. As far as I grasp, it is more likely bringing some KOMA hook anticipating the setting which would otherwise come "at begin document". For example, if we substitute the call to fontspec with KOMA's recalctypearea, we get the same result: 12pt in both the document and the log.



documentclass[paper=A4,fontsize=12pt]{scrartcl}

recalctypearea

typeout{theparindent}

begin{document}

theparindent

end{document}


This explains why, in scrartcl class, if you load biblatex after fontspec you get different bibhangs. But I cannot really explain why parindent works the way it does in scrartcl.



Still, as you probably want fontspec anyway in your document, this discussion is more of a curiosity. You woudn't want to remove fontspec just because, by sheer chance (yes, a change in bibhang may trigger an overfull hbox in you url) it allows for a better line break in a single bib entry. So you'll have to look for some other form to break your entry's url (there are several answers in this site on this subject).






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
    });


    }
    });






    Young Un is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f466036%2ffontspec-changes-indentation-of-biblatex-bibliography%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
    2
    down vote













    Probably someone who knows KOMA-Script better may be able to give a more precise answer. But, as far as I was able to understand, this behavior hangs on how scrartcl class handles parindent which is, in turn, used by biblatex to set the bibliography hanging indent.



    biblatex uses the length bibhang on the bibenvironment of the authoryear style. And it is set in biblatex.def with:



    setlength{bibhang}{ifnumequal{parindent}{0}{1em}{parindent}}


    Which will set bibhang to parindent but default bibhang to 1em if parindent is 0 for some reason, which is not the case here (that is parindent is not 0, so bibhang actually receives parindent).



    Now if we build the document below with XeLaTeX:



    documentclass[paper=A4,fontsize=12pt]{scrartcl}

    typeout{theparindent}

    begin{document}

    theparindent

    end{document}


    The PDF will print "12.0pt", but we will find "20.0pt" in the log.



    This means that, for some reason, parindent is 20pt in the preamble, and 12pt in the document. biblatex sets bibhang in the preamble, thus, in the absence of other intervening packages, takes the value of 20pt.



    Now, if we add fontspec to the document:



    documentclass[paper=A4,fontsize=12pt]{scrartcl}

    usepackage{fontspec}

    typeout{theparindent}

    begin{document}

    theparindent

    end{document}


    We will find "12pt" in both the document and the log. So, if biblatex is called after fontspec, it will receive now the value of 12pt.



    This doesn't really mean that fontspec is responsible for this setting on it's own. As far as I grasp, it is more likely bringing some KOMA hook anticipating the setting which would otherwise come "at begin document". For example, if we substitute the call to fontspec with KOMA's recalctypearea, we get the same result: 12pt in both the document and the log.



    documentclass[paper=A4,fontsize=12pt]{scrartcl}

    recalctypearea

    typeout{theparindent}

    begin{document}

    theparindent

    end{document}


    This explains why, in scrartcl class, if you load biblatex after fontspec you get different bibhangs. But I cannot really explain why parindent works the way it does in scrartcl.



    Still, as you probably want fontspec anyway in your document, this discussion is more of a curiosity. You woudn't want to remove fontspec just because, by sheer chance (yes, a change in bibhang may trigger an overfull hbox in you url) it allows for a better line break in a single bib entry. So you'll have to look for some other form to break your entry's url (there are several answers in this site on this subject).






    share|improve this answer



























      up vote
      2
      down vote













      Probably someone who knows KOMA-Script better may be able to give a more precise answer. But, as far as I was able to understand, this behavior hangs on how scrartcl class handles parindent which is, in turn, used by biblatex to set the bibliography hanging indent.



      biblatex uses the length bibhang on the bibenvironment of the authoryear style. And it is set in biblatex.def with:



      setlength{bibhang}{ifnumequal{parindent}{0}{1em}{parindent}}


      Which will set bibhang to parindent but default bibhang to 1em if parindent is 0 for some reason, which is not the case here (that is parindent is not 0, so bibhang actually receives parindent).



      Now if we build the document below with XeLaTeX:



      documentclass[paper=A4,fontsize=12pt]{scrartcl}

      typeout{theparindent}

      begin{document}

      theparindent

      end{document}


      The PDF will print "12.0pt", but we will find "20.0pt" in the log.



      This means that, for some reason, parindent is 20pt in the preamble, and 12pt in the document. biblatex sets bibhang in the preamble, thus, in the absence of other intervening packages, takes the value of 20pt.



      Now, if we add fontspec to the document:



      documentclass[paper=A4,fontsize=12pt]{scrartcl}

      usepackage{fontspec}

      typeout{theparindent}

      begin{document}

      theparindent

      end{document}


      We will find "12pt" in both the document and the log. So, if biblatex is called after fontspec, it will receive now the value of 12pt.



      This doesn't really mean that fontspec is responsible for this setting on it's own. As far as I grasp, it is more likely bringing some KOMA hook anticipating the setting which would otherwise come "at begin document". For example, if we substitute the call to fontspec with KOMA's recalctypearea, we get the same result: 12pt in both the document and the log.



      documentclass[paper=A4,fontsize=12pt]{scrartcl}

      recalctypearea

      typeout{theparindent}

      begin{document}

      theparindent

      end{document}


      This explains why, in scrartcl class, if you load biblatex after fontspec you get different bibhangs. But I cannot really explain why parindent works the way it does in scrartcl.



      Still, as you probably want fontspec anyway in your document, this discussion is more of a curiosity. You woudn't want to remove fontspec just because, by sheer chance (yes, a change in bibhang may trigger an overfull hbox in you url) it allows for a better line break in a single bib entry. So you'll have to look for some other form to break your entry's url (there are several answers in this site on this subject).






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        Probably someone who knows KOMA-Script better may be able to give a more precise answer. But, as far as I was able to understand, this behavior hangs on how scrartcl class handles parindent which is, in turn, used by biblatex to set the bibliography hanging indent.



        biblatex uses the length bibhang on the bibenvironment of the authoryear style. And it is set in biblatex.def with:



        setlength{bibhang}{ifnumequal{parindent}{0}{1em}{parindent}}


        Which will set bibhang to parindent but default bibhang to 1em if parindent is 0 for some reason, which is not the case here (that is parindent is not 0, so bibhang actually receives parindent).



        Now if we build the document below with XeLaTeX:



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        The PDF will print "12.0pt", but we will find "20.0pt" in the log.



        This means that, for some reason, parindent is 20pt in the preamble, and 12pt in the document. biblatex sets bibhang in the preamble, thus, in the absence of other intervening packages, takes the value of 20pt.



        Now, if we add fontspec to the document:



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        usepackage{fontspec}

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        We will find "12pt" in both the document and the log. So, if biblatex is called after fontspec, it will receive now the value of 12pt.



        This doesn't really mean that fontspec is responsible for this setting on it's own. As far as I grasp, it is more likely bringing some KOMA hook anticipating the setting which would otherwise come "at begin document". For example, if we substitute the call to fontspec with KOMA's recalctypearea, we get the same result: 12pt in both the document and the log.



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        recalctypearea

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        This explains why, in scrartcl class, if you load biblatex after fontspec you get different bibhangs. But I cannot really explain why parindent works the way it does in scrartcl.



        Still, as you probably want fontspec anyway in your document, this discussion is more of a curiosity. You woudn't want to remove fontspec just because, by sheer chance (yes, a change in bibhang may trigger an overfull hbox in you url) it allows for a better line break in a single bib entry. So you'll have to look for some other form to break your entry's url (there are several answers in this site on this subject).






        share|improve this answer














        Probably someone who knows KOMA-Script better may be able to give a more precise answer. But, as far as I was able to understand, this behavior hangs on how scrartcl class handles parindent which is, in turn, used by biblatex to set the bibliography hanging indent.



        biblatex uses the length bibhang on the bibenvironment of the authoryear style. And it is set in biblatex.def with:



        setlength{bibhang}{ifnumequal{parindent}{0}{1em}{parindent}}


        Which will set bibhang to parindent but default bibhang to 1em if parindent is 0 for some reason, which is not the case here (that is parindent is not 0, so bibhang actually receives parindent).



        Now if we build the document below with XeLaTeX:



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        The PDF will print "12.0pt", but we will find "20.0pt" in the log.



        This means that, for some reason, parindent is 20pt in the preamble, and 12pt in the document. biblatex sets bibhang in the preamble, thus, in the absence of other intervening packages, takes the value of 20pt.



        Now, if we add fontspec to the document:



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        usepackage{fontspec}

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        We will find "12pt" in both the document and the log. So, if biblatex is called after fontspec, it will receive now the value of 12pt.



        This doesn't really mean that fontspec is responsible for this setting on it's own. As far as I grasp, it is more likely bringing some KOMA hook anticipating the setting which would otherwise come "at begin document". For example, if we substitute the call to fontspec with KOMA's recalctypearea, we get the same result: 12pt in both the document and the log.



        documentclass[paper=A4,fontsize=12pt]{scrartcl}

        recalctypearea

        typeout{theparindent}

        begin{document}

        theparindent

        end{document}


        This explains why, in scrartcl class, if you load biblatex after fontspec you get different bibhangs. But I cannot really explain why parindent works the way it does in scrartcl.



        Still, as you probably want fontspec anyway in your document, this discussion is more of a curiosity. You woudn't want to remove fontspec just because, by sheer chance (yes, a change in bibhang may trigger an overfull hbox in you url) it allows for a better line break in a single bib entry. So you'll have to look for some other form to break your entry's url (there are several answers in this site on this subject).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 hours ago

























        answered 3 hours ago









        gusbrs

        6,6142838




        6,6142838






















            Young Un is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Young Un is a new contributor. Be nice, and check out our Code of Conduct.













            Young Un is a new contributor. Be nice, and check out our Code of Conduct.












            Young Un is a new contributor. Be nice, and check out our Code of Conduct.
















            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%2f466036%2ffontspec-changes-indentation-of-biblatex-bibliography%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

            Costa Masnaga

            Fotorealismo

            Sidney Franklin