footnotesize in output stream generates unexpected “Undefined control sequence”












2















I am writing styled text to an external file (using the newfile package). I can successfully style the text with many attributes, e.g., largemdseriesitshape. But, very puzzling to me, when I style the text with footnotesize, I get an unexpected "Undefined control sequence" error, and I can't tell why it is arising:



(/compile/output.nameofstream
! Undefined control sequence.
l.1 ... {10}{12}selectfont abovedisplayskip 10p
@ plus2p@ minus5p@ abov...


The following MWE compiles fine and generates appropriately styled text both in the external file and in the output. The external file contains:



relax fontsize {14.4}{18}selectfont mdseries itshape Text to be styled


But when I uncomment out renewcommand{styleForText}{footnotesize}, I get the above error message and the external file contains:



relax fontsize {10}{12}selectfont abovedisplayskip 10p@ plus2p@ minus5p@ abovedisplayshortskip z@ plus3p@ belowdisplayshortskip 6p@ plus3p@ minus3p@ def leftmargin leftmargini parsep 5p@ plus2.5p@ minusp@ topsep 10p@ plus4p@ minus6p@ itemsep 5p@ plus2.5p@ minusp@ {leftmargin leftmargini topsep 6p@ plus2p@ minus2p@ parsep 3p@ plus2p@ minusp@ itemsep parsep }belowdisplayskip abovedisplayskip Text to be styled


I never expected that footnotesize would result in such different behavior than large. What's going on?



documentclass[12pt]{article}
usepackage{newfile}
newcommand{streamName}{nameofstream}
newcommand{sendStyledTextToStream}[1]{%
addtostream{streamName}{styleForText#1}%
}
newcommand{printStream}{%
closeoutputstream{streamName}%
input{jobname.streamName}%
}
newcommand{styleForText}{largemdseriesitshape}
%renewcommand{styleForText}{footnotesize}
begin{document}
newoutputstream{streamName}
openoutputfile{jobname.streamName}{streamName}
sendStyledTextToStream{Text to be styled}
printStream
end{document}









share|improve this question


















  • 2





    Try with protectfootnotesize.

    – GuM
    Nov 10 '18 at 18:23













  • That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

    – Jim Ratliff
    Nov 10 '18 at 18:25






  • 2





    It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

    – GuM
    Nov 10 '18 at 18:36











  • If you turn this into an answer, I will accept it.

    – Jim Ratliff
    Nov 10 '18 at 18:37
















2















I am writing styled text to an external file (using the newfile package). I can successfully style the text with many attributes, e.g., largemdseriesitshape. But, very puzzling to me, when I style the text with footnotesize, I get an unexpected "Undefined control sequence" error, and I can't tell why it is arising:



(/compile/output.nameofstream
! Undefined control sequence.
l.1 ... {10}{12}selectfont abovedisplayskip 10p
@ plus2p@ minus5p@ abov...


The following MWE compiles fine and generates appropriately styled text both in the external file and in the output. The external file contains:



relax fontsize {14.4}{18}selectfont mdseries itshape Text to be styled


But when I uncomment out renewcommand{styleForText}{footnotesize}, I get the above error message and the external file contains:



relax fontsize {10}{12}selectfont abovedisplayskip 10p@ plus2p@ minus5p@ abovedisplayshortskip z@ plus3p@ belowdisplayshortskip 6p@ plus3p@ minus3p@ def leftmargin leftmargini parsep 5p@ plus2.5p@ minusp@ topsep 10p@ plus4p@ minus6p@ itemsep 5p@ plus2.5p@ minusp@ {leftmargin leftmargini topsep 6p@ plus2p@ minus2p@ parsep 3p@ plus2p@ minusp@ itemsep parsep }belowdisplayskip abovedisplayskip Text to be styled


I never expected that footnotesize would result in such different behavior than large. What's going on?



documentclass[12pt]{article}
usepackage{newfile}
newcommand{streamName}{nameofstream}
newcommand{sendStyledTextToStream}[1]{%
addtostream{streamName}{styleForText#1}%
}
newcommand{printStream}{%
closeoutputstream{streamName}%
input{jobname.streamName}%
}
newcommand{styleForText}{largemdseriesitshape}
%renewcommand{styleForText}{footnotesize}
begin{document}
newoutputstream{streamName}
openoutputfile{jobname.streamName}{streamName}
sendStyledTextToStream{Text to be styled}
printStream
end{document}









share|improve this question


















  • 2





    Try with protectfootnotesize.

    – GuM
    Nov 10 '18 at 18:23













  • That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

    – Jim Ratliff
    Nov 10 '18 at 18:25






  • 2





    It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

    – GuM
    Nov 10 '18 at 18:36











  • If you turn this into an answer, I will accept it.

    – Jim Ratliff
    Nov 10 '18 at 18:37














2












2








2








I am writing styled text to an external file (using the newfile package). I can successfully style the text with many attributes, e.g., largemdseriesitshape. But, very puzzling to me, when I style the text with footnotesize, I get an unexpected "Undefined control sequence" error, and I can't tell why it is arising:



(/compile/output.nameofstream
! Undefined control sequence.
l.1 ... {10}{12}selectfont abovedisplayskip 10p
@ plus2p@ minus5p@ abov...


The following MWE compiles fine and generates appropriately styled text both in the external file and in the output. The external file contains:



relax fontsize {14.4}{18}selectfont mdseries itshape Text to be styled


But when I uncomment out renewcommand{styleForText}{footnotesize}, I get the above error message and the external file contains:



relax fontsize {10}{12}selectfont abovedisplayskip 10p@ plus2p@ minus5p@ abovedisplayshortskip z@ plus3p@ belowdisplayshortskip 6p@ plus3p@ minus3p@ def leftmargin leftmargini parsep 5p@ plus2.5p@ minusp@ topsep 10p@ plus4p@ minus6p@ itemsep 5p@ plus2.5p@ minusp@ {leftmargin leftmargini topsep 6p@ plus2p@ minus2p@ parsep 3p@ plus2p@ minusp@ itemsep parsep }belowdisplayskip abovedisplayskip Text to be styled


I never expected that footnotesize would result in such different behavior than large. What's going on?



documentclass[12pt]{article}
usepackage{newfile}
newcommand{streamName}{nameofstream}
newcommand{sendStyledTextToStream}[1]{%
addtostream{streamName}{styleForText#1}%
}
newcommand{printStream}{%
closeoutputstream{streamName}%
input{jobname.streamName}%
}
newcommand{styleForText}{largemdseriesitshape}
%renewcommand{styleForText}{footnotesize}
begin{document}
newoutputstream{streamName}
openoutputfile{jobname.streamName}{streamName}
sendStyledTextToStream{Text to be styled}
printStream
end{document}









share|improve this question














I am writing styled text to an external file (using the newfile package). I can successfully style the text with many attributes, e.g., largemdseriesitshape. But, very puzzling to me, when I style the text with footnotesize, I get an unexpected "Undefined control sequence" error, and I can't tell why it is arising:



(/compile/output.nameofstream
! Undefined control sequence.
l.1 ... {10}{12}selectfont abovedisplayskip 10p
@ plus2p@ minus5p@ abov...


The following MWE compiles fine and generates appropriately styled text both in the external file and in the output. The external file contains:



relax fontsize {14.4}{18}selectfont mdseries itshape Text to be styled


But when I uncomment out renewcommand{styleForText}{footnotesize}, I get the above error message and the external file contains:



relax fontsize {10}{12}selectfont abovedisplayskip 10p@ plus2p@ minus5p@ abovedisplayshortskip z@ plus3p@ belowdisplayshortskip 6p@ plus3p@ minus3p@ def leftmargin leftmargini parsep 5p@ plus2.5p@ minusp@ topsep 10p@ plus4p@ minus6p@ itemsep 5p@ plus2.5p@ minusp@ {leftmargin leftmargini topsep 6p@ plus2p@ minus2p@ parsep 3p@ plus2p@ minusp@ itemsep parsep }belowdisplayskip abovedisplayskip Text to be styled


I never expected that footnotesize would result in such different behavior than large. What's going on?



documentclass[12pt]{article}
usepackage{newfile}
newcommand{streamName}{nameofstream}
newcommand{sendStyledTextToStream}[1]{%
addtostream{streamName}{styleForText#1}%
}
newcommand{printStream}{%
closeoutputstream{streamName}%
input{jobname.streamName}%
}
newcommand{styleForText}{largemdseriesitshape}
%renewcommand{styleForText}{footnotesize}
begin{document}
newoutputstream{streamName}
openoutputfile{jobname.streamName}{streamName}
sendStyledTextToStream{Text to be styled}
printStream
end{document}






fontsize external-files






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 '18 at 18:10









Jim RatliffJim Ratliff

4971411




4971411








  • 2





    Try with protectfootnotesize.

    – GuM
    Nov 10 '18 at 18:23













  • That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

    – Jim Ratliff
    Nov 10 '18 at 18:25






  • 2





    It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

    – GuM
    Nov 10 '18 at 18:36











  • If you turn this into an answer, I will accept it.

    – Jim Ratliff
    Nov 10 '18 at 18:37














  • 2





    Try with protectfootnotesize.

    – GuM
    Nov 10 '18 at 18:23













  • That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

    – Jim Ratliff
    Nov 10 '18 at 18:25






  • 2





    It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

    – GuM
    Nov 10 '18 at 18:36











  • If you turn this into an answer, I will accept it.

    – Jim Ratliff
    Nov 10 '18 at 18:37








2




2





Try with protectfootnotesize.

– GuM
Nov 10 '18 at 18:23







Try with protectfootnotesize.

– GuM
Nov 10 '18 at 18:23















That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

– Jim Ratliff
Nov 10 '18 at 18:25





That does seem to work. Why is that necessary for footnotesize when it's not required here for large?

– Jim Ratliff
Nov 10 '18 at 18:25




2




2





It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

– GuM
Nov 10 '18 at 18:36





It’s best to protect the large declaration too; it doesn’t exhibit the same problem, in this particular situation, just because its expansion doesn’t happen to contain “internal” commands using the @ character, contrary to footnotesize. On the other hand, you might have uncovered a bug: several years ago, the commands for changing the font style (e.g., itshape, mdseries…) were made robust so that they no longer required to be protected; but apparently, they forgot to apply a similar change to the commands that change the font size!

– GuM
Nov 10 '18 at 18:36













If you turn this into an answer, I will accept it.

– Jim Ratliff
Nov 10 '18 at 18:37





If you turn this into an answer, I will accept it.

– Jim Ratliff
Nov 10 '18 at 18:37










1 Answer
1






active

oldest

votes


















0














I'm answering my own question in order to bring closure. A commenter (@GuM) answered it in a comment, but never converted it into an answer.



His solution: Use protectfootnotesize.



He gave the further explanation:




It’s best to protect the large declaration too; it doesn’t exhibit
the same problem, in this particular situation, just because its
expansion doesn’t happen to contain “internal” commands using the @
character, contrary to footnotesize. On the other hand, you might
have uncovered a bug: several years ago, the commands for changing the
font style (e.g., itshape, mdseries…) were made robust so that they
no longer required to be protected; but apparently, they forgot to
apply a similar change to the commands that change the font size!







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',
    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%2f459355%2ffootnotesize-in-output-stream-generates-unexpected-undefined-control-sequence%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









    0














    I'm answering my own question in order to bring closure. A commenter (@GuM) answered it in a comment, but never converted it into an answer.



    His solution: Use protectfootnotesize.



    He gave the further explanation:




    It’s best to protect the large declaration too; it doesn’t exhibit
    the same problem, in this particular situation, just because its
    expansion doesn’t happen to contain “internal” commands using the @
    character, contrary to footnotesize. On the other hand, you might
    have uncovered a bug: several years ago, the commands for changing the
    font style (e.g., itshape, mdseries…) were made robust so that they
    no longer required to be protected; but apparently, they forgot to
    apply a similar change to the commands that change the font size!







    share|improve this answer




























      0














      I'm answering my own question in order to bring closure. A commenter (@GuM) answered it in a comment, but never converted it into an answer.



      His solution: Use protectfootnotesize.



      He gave the further explanation:




      It’s best to protect the large declaration too; it doesn’t exhibit
      the same problem, in this particular situation, just because its
      expansion doesn’t happen to contain “internal” commands using the @
      character, contrary to footnotesize. On the other hand, you might
      have uncovered a bug: several years ago, the commands for changing the
      font style (e.g., itshape, mdseries…) were made robust so that they
      no longer required to be protected; but apparently, they forgot to
      apply a similar change to the commands that change the font size!







      share|improve this answer


























        0












        0








        0







        I'm answering my own question in order to bring closure. A commenter (@GuM) answered it in a comment, but never converted it into an answer.



        His solution: Use protectfootnotesize.



        He gave the further explanation:




        It’s best to protect the large declaration too; it doesn’t exhibit
        the same problem, in this particular situation, just because its
        expansion doesn’t happen to contain “internal” commands using the @
        character, contrary to footnotesize. On the other hand, you might
        have uncovered a bug: several years ago, the commands for changing the
        font style (e.g., itshape, mdseries…) were made robust so that they
        no longer required to be protected; but apparently, they forgot to
        apply a similar change to the commands that change the font size!







        share|improve this answer













        I'm answering my own question in order to bring closure. A commenter (@GuM) answered it in a comment, but never converted it into an answer.



        His solution: Use protectfootnotesize.



        He gave the further explanation:




        It’s best to protect the large declaration too; it doesn’t exhibit
        the same problem, in this particular situation, just because its
        expansion doesn’t happen to contain “internal” commands using the @
        character, contrary to footnotesize. On the other hand, you might
        have uncovered a bug: several years ago, the commands for changing the
        font style (e.g., itshape, mdseries…) were made robust so that they
        no longer required to be protected; but apparently, they forgot to
        apply a similar change to the commands that change the font size!








        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 11 mins ago









        Jim RatliffJim Ratliff

        4971411




        4971411






























            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%2f459355%2ffootnotesize-in-output-stream-generates-unexpected-undefined-control-sequence%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

            Lallio

            Futebolista

            Jornalista