Case protection with emphasis in biblatexHow to write “ä” and other umlauts and accented letters in...

Icon at Subject-line scrlttr2

Eww, those bytes are gross

Taking an academic pseudonym?

Allow console draw poker game to output more hands

Writing dialogues for characters whose first language is not English

Modern Algebraic Geometry and Analytic Number Theory

How much light is too much?

Crack the bank account's password!

Renting a 2CV in France

Co-worker sabotaging/undoing my work (software development)

Why are samba client and NFS client used differently?

How vim overwrites readonly mode?

Is there any danger of my neighbor having my wife's signature?

How can I handle players killing my NPC outside of combat?

How to politely refuse in-office gym instructor for steroids and protein

What is an efficient way to digitize a family photo collection?

To be or not to be - Optional arguments inside definition of macro

Does it take energy to move something in a circle?

Minimum Viable Product for RTS game?

What does からか mean?

Where does documentation like business and software requirement spec docs fit in an agile project?

How to not let the Identify spell spoil everything?

How long has this character been impersonating a Starfleet Officer?

Single-row INSERT...SELECT much slower than separate SELECT



Case protection with emphasis in biblatex


How to write “ä” and other umlauts and accented letters in bibliography?What is the proper casing to use when storing titles in the bibliography database?German APA reference: origyear field is incomplete (needs reprinttitle)Adapting an existing biblatex style in order to imitate Springer's author-year reference list rules for authorsHow to get BibLaTeX-chicago use title case capitalization?Some fields don't show up or are missing formatting in the bibliography even though I have entries for themCiting (author, journalabbr., year) neededBiblatex-apa : Replace author name by dash in case of multiple works by same authorFormatting issue with DeclareBibliographyDriver in my Custom Biblatex Style basedWhat is the proper casing to use when storing titles in the bibliography database?In bibliographies, how to present each work by an author after the first as a subindented paragraph with hanging indentation?custom citation format based on custom tag in .bib-file













5















Following the question
What is the proper casing to use when storing titles in the bibliography database? I am storing titles in Title Case in the .bib file and {Protecting} proper nouns etc. I had been using biblatex-chicago so far where I didn't run into any problems, as Chicago mandates Title Case anyways.



But now I am running into trouble with biblatex-apa – APA prefers sentence casing – with quotation marks and emphasis. Since mkbibquote{} and mkbibemph{} already case-protect what's inside, enclosing them in an extra set of braces {mkbibquote{}} un-case-protects them. But then, I'm having a number of problems.



Consider this MWE:



% !TEX TS-program = xelatexmk
documentclass{article}

usepackage{polyglossia}
setdefaultlanguage[variant=american]{english}
usepackage{csquotes}
usepackage[style=apa]{biblatex}

usepackage{filecontents}
begin{filecontents}{bib.bib}

@book{Author2000,
Title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
Author = {Author, Anton},
Date = {1990},
}
@book{Author2000a,
Title = {{mkbibquote{But if the Title starts in Quotes}} It Turns into All Caps},
Author = {Author, Anton},
Date = {2000},
}
@book{Author2000b,
Title = {A Discussion of the Book {mkbibemph{{My} New Book}}: It Should Keep the First Word Capitalized},
Author = {Author, Anton},
Date = {2010},
}
@book{Author2000c,
Title = {{mkbibemph{And if the Title starts with Emphasis}} It also Turns into All Caps and Doesn't Apply the Emphasis},
Author = {Author, Anton},
Date = {2001},
}
@book{Author2000d,
Title = {And If {mkbibquote{an Acronym {{{AAEE}}} is Included}}, How to Preserve it?},
Author = {Author, Anton},
Date = {2011},
}

end{filecontents}
addbibresource{bib.bib}

begin{document}
autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
printbibliography % print the bibliography
end{document}


It gives this output:



enter image description here



There are numerous problems. If mkbibquote or mkbibemph are issued at the beginning of the string, then it turns the entire string into ALL CAPS. Also I have no idea how to protect specific words within a string that is already enclosed by mkbibquote or mkbibemph.










share|improve this question



























    5















    Following the question
    What is the proper casing to use when storing titles in the bibliography database? I am storing titles in Title Case in the .bib file and {Protecting} proper nouns etc. I had been using biblatex-chicago so far where I didn't run into any problems, as Chicago mandates Title Case anyways.



    But now I am running into trouble with biblatex-apa – APA prefers sentence casing – with quotation marks and emphasis. Since mkbibquote{} and mkbibemph{} already case-protect what's inside, enclosing them in an extra set of braces {mkbibquote{}} un-case-protects them. But then, I'm having a number of problems.



    Consider this MWE:



    % !TEX TS-program = xelatexmk
    documentclass{article}

    usepackage{polyglossia}
    setdefaultlanguage[variant=american]{english}
    usepackage{csquotes}
    usepackage[style=apa]{biblatex}

    usepackage{filecontents}
    begin{filecontents}{bib.bib}

    @book{Author2000,
    Title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
    Author = {Author, Anton},
    Date = {1990},
    }
    @book{Author2000a,
    Title = {{mkbibquote{But if the Title starts in Quotes}} It Turns into All Caps},
    Author = {Author, Anton},
    Date = {2000},
    }
    @book{Author2000b,
    Title = {A Discussion of the Book {mkbibemph{{My} New Book}}: It Should Keep the First Word Capitalized},
    Author = {Author, Anton},
    Date = {2010},
    }
    @book{Author2000c,
    Title = {{mkbibemph{And if the Title starts with Emphasis}} It also Turns into All Caps and Doesn't Apply the Emphasis},
    Author = {Author, Anton},
    Date = {2001},
    }
    @book{Author2000d,
    Title = {And If {mkbibquote{an Acronym {{{AAEE}}} is Included}}, How to Preserve it?},
    Author = {Author, Anton},
    Date = {2011},
    }

    end{filecontents}
    addbibresource{bib.bib}

    begin{document}
    autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
    printbibliography % print the bibliography
    end{document}


    It gives this output:



    enter image description here



    There are numerous problems. If mkbibquote or mkbibemph are issued at the beginning of the string, then it turns the entire string into ALL CAPS. Also I have no idea how to protect specific words within a string that is already enclosed by mkbibquote or mkbibemph.










    share|improve this question

























      5












      5








      5








      Following the question
      What is the proper casing to use when storing titles in the bibliography database? I am storing titles in Title Case in the .bib file and {Protecting} proper nouns etc. I had been using biblatex-chicago so far where I didn't run into any problems, as Chicago mandates Title Case anyways.



      But now I am running into trouble with biblatex-apa – APA prefers sentence casing – with quotation marks and emphasis. Since mkbibquote{} and mkbibemph{} already case-protect what's inside, enclosing them in an extra set of braces {mkbibquote{}} un-case-protects them. But then, I'm having a number of problems.



      Consider this MWE:



      % !TEX TS-program = xelatexmk
      documentclass{article}

      usepackage{polyglossia}
      setdefaultlanguage[variant=american]{english}
      usepackage{csquotes}
      usepackage[style=apa]{biblatex}

      usepackage{filecontents}
      begin{filecontents}{bib.bib}

      @book{Author2000,
      Title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
      Author = {Author, Anton},
      Date = {1990},
      }
      @book{Author2000a,
      Title = {{mkbibquote{But if the Title starts in Quotes}} It Turns into All Caps},
      Author = {Author, Anton},
      Date = {2000},
      }
      @book{Author2000b,
      Title = {A Discussion of the Book {mkbibemph{{My} New Book}}: It Should Keep the First Word Capitalized},
      Author = {Author, Anton},
      Date = {2010},
      }
      @book{Author2000c,
      Title = {{mkbibemph{And if the Title starts with Emphasis}} It also Turns into All Caps and Doesn't Apply the Emphasis},
      Author = {Author, Anton},
      Date = {2001},
      }
      @book{Author2000d,
      Title = {And If {mkbibquote{an Acronym {{{AAEE}}} is Included}}, How to Preserve it?},
      Author = {Author, Anton},
      Date = {2011},
      }

      end{filecontents}
      addbibresource{bib.bib}

      begin{document}
      autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
      printbibliography % print the bibliography
      end{document}


      It gives this output:



      enter image description here



      There are numerous problems. If mkbibquote or mkbibemph are issued at the beginning of the string, then it turns the entire string into ALL CAPS. Also I have no idea how to protect specific words within a string that is already enclosed by mkbibquote or mkbibemph.










      share|improve this question














      Following the question
      What is the proper casing to use when storing titles in the bibliography database? I am storing titles in Title Case in the .bib file and {Protecting} proper nouns etc. I had been using biblatex-chicago so far where I didn't run into any problems, as Chicago mandates Title Case anyways.



      But now I am running into trouble with biblatex-apa – APA prefers sentence casing – with quotation marks and emphasis. Since mkbibquote{} and mkbibemph{} already case-protect what's inside, enclosing them in an extra set of braces {mkbibquote{}} un-case-protects them. But then, I'm having a number of problems.



      Consider this MWE:



      % !TEX TS-program = xelatexmk
      documentclass{article}

      usepackage{polyglossia}
      setdefaultlanguage[variant=american]{english}
      usepackage{csquotes}
      usepackage[style=apa]{biblatex}

      usepackage{filecontents}
      begin{filecontents}{bib.bib}

      @book{Author2000,
      Title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
      Author = {Author, Anton},
      Date = {1990},
      }
      @book{Author2000a,
      Title = {{mkbibquote{But if the Title starts in Quotes}} It Turns into All Caps},
      Author = {Author, Anton},
      Date = {2000},
      }
      @book{Author2000b,
      Title = {A Discussion of the Book {mkbibemph{{My} New Book}}: It Should Keep the First Word Capitalized},
      Author = {Author, Anton},
      Date = {2010},
      }
      @book{Author2000c,
      Title = {{mkbibemph{And if the Title starts with Emphasis}} It also Turns into All Caps and Doesn't Apply the Emphasis},
      Author = {Author, Anton},
      Date = {2001},
      }
      @book{Author2000d,
      Title = {And If {mkbibquote{an Acronym {{{AAEE}}} is Included}}, How to Preserve it?},
      Author = {Author, Anton},
      Date = {2011},
      }

      end{filecontents}
      addbibresource{bib.bib}

      begin{document}
      autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
      printbibliography % print the bibliography
      end{document}


      It gives this output:



      enter image description here



      There are numerous problems. If mkbibquote or mkbibemph are issued at the beginning of the string, then it turns the entire string into ALL CAPS. Also I have no idea how to protect specific words within a string that is already enclosed by mkbibquote or mkbibemph.







      biblatex apa-style






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 6 hours ago









      janjan

      9781418




      9781418






















          1 Answer
          1






          active

          oldest

          votes


















          7














          The sentence casing function for biblatex is implemented in LaTeX. BibTeX's sentence casing, on the other hand, is implemented in BibTeX directly. That means that there are some subtle and not so subtle differences between the two. In particular biblatex's sentence case function will try to expand macros if possible.



          The major issue here is that curly braces are overloaded with meaning: For LaTeX they serve as argument delimiters or apply grouping; for BibTeX they protect strings from case change and mark up LaTeX macros for non-ASCII characters such as ä -> {"a} (cf. How to write “ä” and other umlauts and accented letters in bibliography?). The different meanings clash from time to time, in those cases workaround are needed to resolve the issue.



          See also the recent https://github.com/plk/biblatex/issues/871 and linked issues as well as the doc additions https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334 and https://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86.



          For the use cases you show in the MWE I can offer the following workaround. The idea is to get around using braces by using delimited arguments (a sort of foo <argument>endfoo syntax). Delimited arguments come with their own issues when they are nested, but they work well enough in the MWE.



          documentclass{article} 
          usepackage[american]{babel}
          usepackage{csquotes}
          usepackage[style=apa]{biblatex}

          protecteddefhorriblemkbibquote#1endhorriblemkbibquote{mkbibquote{#1}}
          letendhorriblemkbibquoterelax
          protecteddefhorriblemkbibemph#1endhorriblemkbibemph{mkbibemph{#1}}
          letendhorriblemkbibemphrelax

          usepackage{filecontents}
          begin{filecontents}{jobname.bib}
          @book{Author2000,
          title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
          author = {Author, Anton},
          date = {1990},
          }
          @book{Author2000a,
          title = {horriblemkbibquote {But} if the Title starts in Quotesendhorriblemkbibquote{} It Turns into All Caps},
          author = {Author, Anton},
          date = {2000},
          }
          @book{Author2000b,
          title = {A Discussion of the Book horriblemkbibemph{My} New Bookendhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
          author = {Author, Anton},
          date = {2010},
          }
          @book{Author2000c,
          title = {horriblemkbibemph {And} if the Title starts with Emphasisendhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
          author = {Author, Anton},
          date = {2001},
          }
          @book{Author2000d,
          title = {And If horriblemkbibquote an Acronym {AAEE} is Includedendhorriblemkbibquote{}, How to Preserve it?},
          author = {Author, Anton},
          date = {2011},
          }

          end{filecontents}
          addbibresource{jobname.bib}


          begin{document}
          autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
          printbibliography % print the bibliography
          end{document}


          Author, A. (1990). This is a title with something in “quotes that should be downcased”.//Author, A. (2000). “But if the title starts in quotes” it turns into all caps.//Author, A. (2001). And if the title starts with emphasis it also turns into all caps and doesn’t apply the emphasis.//Author, A. (2010). A discussion of the book My new book: It should keep the first word capitalized.//Author, A. (2011). And if “an acronym AAEE is included”, how to preserve it?



          In the long run the desirable solution seems to me to implement a new case changing function that uses a different markup to specify the protected strings, so that curly braces don't clash with it any more.



          FWIW BibTeX's case change function has similar issues. It doesn't capitalise words at the beginning of the string, so it does not suffer from the ALL-CAPS issue, but the other two protect-within-unprotect issues are also present.






          share|improve this answer





















          • 2





            +1: horriblemkbibquote:)

            – Dr. Manuel Kuehner
            5 hours ago











          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',
          autoActivateHeartbeat: false,
          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%2f476546%2fcase-protection-with-emphasis-in-biblatex%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









          7














          The sentence casing function for biblatex is implemented in LaTeX. BibTeX's sentence casing, on the other hand, is implemented in BibTeX directly. That means that there are some subtle and not so subtle differences between the two. In particular biblatex's sentence case function will try to expand macros if possible.



          The major issue here is that curly braces are overloaded with meaning: For LaTeX they serve as argument delimiters or apply grouping; for BibTeX they protect strings from case change and mark up LaTeX macros for non-ASCII characters such as ä -> {"a} (cf. How to write “ä” and other umlauts and accented letters in bibliography?). The different meanings clash from time to time, in those cases workaround are needed to resolve the issue.



          See also the recent https://github.com/plk/biblatex/issues/871 and linked issues as well as the doc additions https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334 and https://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86.



          For the use cases you show in the MWE I can offer the following workaround. The idea is to get around using braces by using delimited arguments (a sort of foo <argument>endfoo syntax). Delimited arguments come with their own issues when they are nested, but they work well enough in the MWE.



          documentclass{article} 
          usepackage[american]{babel}
          usepackage{csquotes}
          usepackage[style=apa]{biblatex}

          protecteddefhorriblemkbibquote#1endhorriblemkbibquote{mkbibquote{#1}}
          letendhorriblemkbibquoterelax
          protecteddefhorriblemkbibemph#1endhorriblemkbibemph{mkbibemph{#1}}
          letendhorriblemkbibemphrelax

          usepackage{filecontents}
          begin{filecontents}{jobname.bib}
          @book{Author2000,
          title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
          author = {Author, Anton},
          date = {1990},
          }
          @book{Author2000a,
          title = {horriblemkbibquote {But} if the Title starts in Quotesendhorriblemkbibquote{} It Turns into All Caps},
          author = {Author, Anton},
          date = {2000},
          }
          @book{Author2000b,
          title = {A Discussion of the Book horriblemkbibemph{My} New Bookendhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
          author = {Author, Anton},
          date = {2010},
          }
          @book{Author2000c,
          title = {horriblemkbibemph {And} if the Title starts with Emphasisendhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
          author = {Author, Anton},
          date = {2001},
          }
          @book{Author2000d,
          title = {And If horriblemkbibquote an Acronym {AAEE} is Includedendhorriblemkbibquote{}, How to Preserve it?},
          author = {Author, Anton},
          date = {2011},
          }

          end{filecontents}
          addbibresource{jobname.bib}


          begin{document}
          autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
          printbibliography % print the bibliography
          end{document}


          Author, A. (1990). This is a title with something in “quotes that should be downcased”.//Author, A. (2000). “But if the title starts in quotes” it turns into all caps.//Author, A. (2001). And if the title starts with emphasis it also turns into all caps and doesn’t apply the emphasis.//Author, A. (2010). A discussion of the book My new book: It should keep the first word capitalized.//Author, A. (2011). And if “an acronym AAEE is included”, how to preserve it?



          In the long run the desirable solution seems to me to implement a new case changing function that uses a different markup to specify the protected strings, so that curly braces don't clash with it any more.



          FWIW BibTeX's case change function has similar issues. It doesn't capitalise words at the beginning of the string, so it does not suffer from the ALL-CAPS issue, but the other two protect-within-unprotect issues are also present.






          share|improve this answer





















          • 2





            +1: horriblemkbibquote:)

            – Dr. Manuel Kuehner
            5 hours ago
















          7














          The sentence casing function for biblatex is implemented in LaTeX. BibTeX's sentence casing, on the other hand, is implemented in BibTeX directly. That means that there are some subtle and not so subtle differences between the two. In particular biblatex's sentence case function will try to expand macros if possible.



          The major issue here is that curly braces are overloaded with meaning: For LaTeX they serve as argument delimiters or apply grouping; for BibTeX they protect strings from case change and mark up LaTeX macros for non-ASCII characters such as ä -> {"a} (cf. How to write “ä” and other umlauts and accented letters in bibliography?). The different meanings clash from time to time, in those cases workaround are needed to resolve the issue.



          See also the recent https://github.com/plk/biblatex/issues/871 and linked issues as well as the doc additions https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334 and https://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86.



          For the use cases you show in the MWE I can offer the following workaround. The idea is to get around using braces by using delimited arguments (a sort of foo <argument>endfoo syntax). Delimited arguments come with their own issues when they are nested, but they work well enough in the MWE.



          documentclass{article} 
          usepackage[american]{babel}
          usepackage{csquotes}
          usepackage[style=apa]{biblatex}

          protecteddefhorriblemkbibquote#1endhorriblemkbibquote{mkbibquote{#1}}
          letendhorriblemkbibquoterelax
          protecteddefhorriblemkbibemph#1endhorriblemkbibemph{mkbibemph{#1}}
          letendhorriblemkbibemphrelax

          usepackage{filecontents}
          begin{filecontents}{jobname.bib}
          @book{Author2000,
          title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
          author = {Author, Anton},
          date = {1990},
          }
          @book{Author2000a,
          title = {horriblemkbibquote {But} if the Title starts in Quotesendhorriblemkbibquote{} It Turns into All Caps},
          author = {Author, Anton},
          date = {2000},
          }
          @book{Author2000b,
          title = {A Discussion of the Book horriblemkbibemph{My} New Bookendhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
          author = {Author, Anton},
          date = {2010},
          }
          @book{Author2000c,
          title = {horriblemkbibemph {And} if the Title starts with Emphasisendhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
          author = {Author, Anton},
          date = {2001},
          }
          @book{Author2000d,
          title = {And If horriblemkbibquote an Acronym {AAEE} is Includedendhorriblemkbibquote{}, How to Preserve it?},
          author = {Author, Anton},
          date = {2011},
          }

          end{filecontents}
          addbibresource{jobname.bib}


          begin{document}
          autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
          printbibliography % print the bibliography
          end{document}


          Author, A. (1990). This is a title with something in “quotes that should be downcased”.//Author, A. (2000). “But if the title starts in quotes” it turns into all caps.//Author, A. (2001). And if the title starts with emphasis it also turns into all caps and doesn’t apply the emphasis.//Author, A. (2010). A discussion of the book My new book: It should keep the first word capitalized.//Author, A. (2011). And if “an acronym AAEE is included”, how to preserve it?



          In the long run the desirable solution seems to me to implement a new case changing function that uses a different markup to specify the protected strings, so that curly braces don't clash with it any more.



          FWIW BibTeX's case change function has similar issues. It doesn't capitalise words at the beginning of the string, so it does not suffer from the ALL-CAPS issue, but the other two protect-within-unprotect issues are also present.






          share|improve this answer





















          • 2





            +1: horriblemkbibquote:)

            – Dr. Manuel Kuehner
            5 hours ago














          7












          7








          7







          The sentence casing function for biblatex is implemented in LaTeX. BibTeX's sentence casing, on the other hand, is implemented in BibTeX directly. That means that there are some subtle and not so subtle differences between the two. In particular biblatex's sentence case function will try to expand macros if possible.



          The major issue here is that curly braces are overloaded with meaning: For LaTeX they serve as argument delimiters or apply grouping; for BibTeX they protect strings from case change and mark up LaTeX macros for non-ASCII characters such as ä -> {"a} (cf. How to write “ä” and other umlauts and accented letters in bibliography?). The different meanings clash from time to time, in those cases workaround are needed to resolve the issue.



          See also the recent https://github.com/plk/biblatex/issues/871 and linked issues as well as the doc additions https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334 and https://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86.



          For the use cases you show in the MWE I can offer the following workaround. The idea is to get around using braces by using delimited arguments (a sort of foo <argument>endfoo syntax). Delimited arguments come with their own issues when they are nested, but they work well enough in the MWE.



          documentclass{article} 
          usepackage[american]{babel}
          usepackage{csquotes}
          usepackage[style=apa]{biblatex}

          protecteddefhorriblemkbibquote#1endhorriblemkbibquote{mkbibquote{#1}}
          letendhorriblemkbibquoterelax
          protecteddefhorriblemkbibemph#1endhorriblemkbibemph{mkbibemph{#1}}
          letendhorriblemkbibemphrelax

          usepackage{filecontents}
          begin{filecontents}{jobname.bib}
          @book{Author2000,
          title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
          author = {Author, Anton},
          date = {1990},
          }
          @book{Author2000a,
          title = {horriblemkbibquote {But} if the Title starts in Quotesendhorriblemkbibquote{} It Turns into All Caps},
          author = {Author, Anton},
          date = {2000},
          }
          @book{Author2000b,
          title = {A Discussion of the Book horriblemkbibemph{My} New Bookendhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
          author = {Author, Anton},
          date = {2010},
          }
          @book{Author2000c,
          title = {horriblemkbibemph {And} if the Title starts with Emphasisendhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
          author = {Author, Anton},
          date = {2001},
          }
          @book{Author2000d,
          title = {And If horriblemkbibquote an Acronym {AAEE} is Includedendhorriblemkbibquote{}, How to Preserve it?},
          author = {Author, Anton},
          date = {2011},
          }

          end{filecontents}
          addbibresource{jobname.bib}


          begin{document}
          autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
          printbibliography % print the bibliography
          end{document}


          Author, A. (1990). This is a title with something in “quotes that should be downcased”.//Author, A. (2000). “But if the title starts in quotes” it turns into all caps.//Author, A. (2001). And if the title starts with emphasis it also turns into all caps and doesn’t apply the emphasis.//Author, A. (2010). A discussion of the book My new book: It should keep the first word capitalized.//Author, A. (2011). And if “an acronym AAEE is included”, how to preserve it?



          In the long run the desirable solution seems to me to implement a new case changing function that uses a different markup to specify the protected strings, so that curly braces don't clash with it any more.



          FWIW BibTeX's case change function has similar issues. It doesn't capitalise words at the beginning of the string, so it does not suffer from the ALL-CAPS issue, but the other two protect-within-unprotect issues are also present.






          share|improve this answer















          The sentence casing function for biblatex is implemented in LaTeX. BibTeX's sentence casing, on the other hand, is implemented in BibTeX directly. That means that there are some subtle and not so subtle differences between the two. In particular biblatex's sentence case function will try to expand macros if possible.



          The major issue here is that curly braces are overloaded with meaning: For LaTeX they serve as argument delimiters or apply grouping; for BibTeX they protect strings from case change and mark up LaTeX macros for non-ASCII characters such as ä -> {"a} (cf. How to write “ä” and other umlauts and accented letters in bibliography?). The different meanings clash from time to time, in those cases workaround are needed to resolve the issue.



          See also the recent https://github.com/plk/biblatex/issues/871 and linked issues as well as the doc additions https://github.com/plk/biblatex/commit/863fea969a9f1d37d7f944265cb276cf18293334 and https://github.com/plk/biblatex/commit/a291e72a6c8ba2b896eb3f53ada6cc938c2cfa86.



          For the use cases you show in the MWE I can offer the following workaround. The idea is to get around using braces by using delimited arguments (a sort of foo <argument>endfoo syntax). Delimited arguments come with their own issues when they are nested, but they work well enough in the MWE.



          documentclass{article} 
          usepackage[american]{babel}
          usepackage{csquotes}
          usepackage[style=apa]{biblatex}

          protecteddefhorriblemkbibquote#1endhorriblemkbibquote{mkbibquote{#1}}
          letendhorriblemkbibquoterelax
          protecteddefhorriblemkbibemph#1endhorriblemkbibemph{mkbibemph{#1}}
          letendhorriblemkbibemphrelax

          usepackage{filecontents}
          begin{filecontents}{jobname.bib}
          @book{Author2000,
          title = {This is a Title with Something in {mkbibquote{Quotes that Should Be Downcased}}},
          author = {Author, Anton},
          date = {1990},
          }
          @book{Author2000a,
          title = {horriblemkbibquote {But} if the Title starts in Quotesendhorriblemkbibquote{} It Turns into All Caps},
          author = {Author, Anton},
          date = {2000},
          }
          @book{Author2000b,
          title = {A Discussion of the Book horriblemkbibemph{My} New Bookendhorriblemkbibemph{}: It Should Keep the First Word Capitalized},
          author = {Author, Anton},
          date = {2010},
          }
          @book{Author2000c,
          title = {horriblemkbibemph {And} if the Title starts with Emphasisendhorriblemkbibemph{} It also Turns into All Caps and Doesn't Apply the Emphasis},
          author = {Author, Anton},
          date = {2001},
          }
          @book{Author2000d,
          title = {And If horriblemkbibquote an Acronym {AAEE} is Includedendhorriblemkbibquote{}, How to Preserve it?},
          author = {Author, Anton},
          date = {2011},
          }

          end{filecontents}
          addbibresource{jobname.bib}


          begin{document}
          autocites{Author2000,Author2000a,Author2000b,Author2000c,Author2000d}
          printbibliography % print the bibliography
          end{document}


          Author, A. (1990). This is a title with something in “quotes that should be downcased”.//Author, A. (2000). “But if the title starts in quotes” it turns into all caps.//Author, A. (2001). And if the title starts with emphasis it also turns into all caps and doesn’t apply the emphasis.//Author, A. (2010). A discussion of the book My new book: It should keep the first word capitalized.//Author, A. (2011). And if “an acronym AAEE is included”, how to preserve it?



          In the long run the desirable solution seems to me to implement a new case changing function that uses a different markup to specify the protected strings, so that curly braces don't clash with it any more.



          FWIW BibTeX's case change function has similar issues. It doesn't capitalise words at the beginning of the string, so it does not suffer from the ALL-CAPS issue, but the other two protect-within-unprotect issues are also present.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 5 hours ago









          moewemoewe

          91.9k10115347




          91.9k10115347








          • 2





            +1: horriblemkbibquote:)

            – Dr. Manuel Kuehner
            5 hours ago














          • 2





            +1: horriblemkbibquote:)

            – Dr. Manuel Kuehner
            5 hours ago








          2




          2





          +1: horriblemkbibquote:)

          – Dr. Manuel Kuehner
          5 hours ago





          +1: horriblemkbibquote:)

          – Dr. Manuel Kuehner
          5 hours ago


















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476546%2fcase-protection-with-emphasis-in-biblatex%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

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...