When using mylatexformat background image is not shown











up vote
2
down vote

favorite












In order to optimize the generation of thousands of PDF documents, I'm struggling with mylatexformat that will include the main packages.



To structure our work, I've put all the common packages in a file that should be precompiled, and all our client related definitions in another file (in a second step I will also try to precompile some packages and definitions for each client).



But the generated PDF output doesn't include the letterhead background. The PDF also shows a page number whereas I've defined that no page number should be visible. When I'm not working with mylatexformat, this Hello World ! example is working correctly.



penarch-common-precompiled.tex



defencodingdefault{OT1}normalfont
everyjobexpandafter{theeveryjobdefencodingdefault{TU}normalfont}


documentclass{article}


usepackage{parskip} % vertical space between paragraphs
usepackage{xcolor} % foreground (text, rules, etc.) and background colour management
usepackage{soul} % hyphenatable letterspacing, underlining, overstriking, highlighting
usepackage{geometry} % customize page layout
usepackage{enumitem} % enumerate, itemize and description lists
usepackage{hyperref} % hypertext links
usepackage{qrcode} % generate QR codes
usepackage{fancyhdr} % headers and footers
usepackage{graphicx} % support for graphics
usepackage{tabularx} % tables with adjustable width columns
usepackage{scalerel} % vertically scaling and stretching objects
usepackage{amssymb} % symbols found in the AMS symbol font msam and msbm
usepackage{multicol} % define a multicols environment which typesets text in multiple columns
usepackage{pst-barcode} % printing of barcodes, including qr codes
usepackage{scrextend} % required to left indent address block
usepackage{marvosym} % includes euro symbol
usepackage{colortbl} % background color for row, columns or individual cells in a table
usepackage[absolute]{textpos} % absolute positioning of text on the page
usepackage{tikz} % package for creating graphics
usepackage{setspace} % set spacing between lines
usepackage{wallpaper} % use pdf as background image (letterhead)

title{Sections and Chapters}
hypersetup{colorlinks=true,linkcolor=blue} % define the layout of hyperlinks
newcommand{hlc}[2][yellow]{
{sethlcolor{#1} hl{#2}}
} % define a new command to highlight in another color
newcommand{dole}[1]{%
begin{tikzpicture}[remember picture,overlay]
node[anchor=east,xshift=0mm,yshift=-1.2mm]{#1};
end{tikzpicture}
} % make a font to is aligned 1.2mm beneath the normal line

newcolumntype{C}[1]{>{centeringarraybackslash}m{#1}} % define a new column type for a fixed-width centered-aligned column - middle vertical alignment
newcolumntype{R}[1]{>{raggedleftarraybackslash}m{#1}} % define a new column type for a fixed-width right-aligned column - middle vertical alignment
newcolumntype{L}[1]{>{raggedrightarraybackslash}m{#1}} % define a new column type for a fixed-width left-aligned column - middle vertical alignment
newcolumntype{F}[1]{>{raggedrightarraybackslash}p{#1}} % define a new column type for a fixed-width left-aligned column - top vertical alignment

setlength{TPHorizModule}{10mm} % 1 generic horizontal unit is equivalent to 10mm for a textblock
setlength{TPVertModule}{10mm} % 1 generic vertical unit is equivalent to 10mm for a textblock
textblockorigin{0mm}{0mm} % top left corner set as origin for a textblock

endofdump


penarch-client.tex



usepackage{fontspec}                       % support for OpenType fonts

geometry{
a4paper,
left=30mm,
right=25mm,
headheight=115pt,
top=4.5cm,
headsep=0cm,
bottom=3.5cm,
footskip=95pt
}

pagenumbering{gobble} % sets page numbering off

linespread{0.8} % change the line spacing for entire document
setmainfont[Path=./fonts/,
BoldItalicFont=CALIBRIZ.TTF,
BoldFont =CALIBRIB.TTF,
ItalicFont =CALIBRII.TTF]{CALIBRI.TTF} % set main font to Calibri

ULCornerWallPaper{1}{letterhead.pdf}


hello-world.tex



%&penarch-common-precompiled
input{penarch-client}
input{penarch-hyphenation-dutch}

begin{document}


Hello World !


end{document}


My shell script



xelatex -ini -jobname="penarch-common-precompiled" "&xelatex" mylatexformat.ltx penarch-common-precompiled.tex
xelatex hello-world.tex









share|improve this question


























    up vote
    2
    down vote

    favorite












    In order to optimize the generation of thousands of PDF documents, I'm struggling with mylatexformat that will include the main packages.



    To structure our work, I've put all the common packages in a file that should be precompiled, and all our client related definitions in another file (in a second step I will also try to precompile some packages and definitions for each client).



    But the generated PDF output doesn't include the letterhead background. The PDF also shows a page number whereas I've defined that no page number should be visible. When I'm not working with mylatexformat, this Hello World ! example is working correctly.



    penarch-common-precompiled.tex



    defencodingdefault{OT1}normalfont
    everyjobexpandafter{theeveryjobdefencodingdefault{TU}normalfont}


    documentclass{article}


    usepackage{parskip} % vertical space between paragraphs
    usepackage{xcolor} % foreground (text, rules, etc.) and background colour management
    usepackage{soul} % hyphenatable letterspacing, underlining, overstriking, highlighting
    usepackage{geometry} % customize page layout
    usepackage{enumitem} % enumerate, itemize and description lists
    usepackage{hyperref} % hypertext links
    usepackage{qrcode} % generate QR codes
    usepackage{fancyhdr} % headers and footers
    usepackage{graphicx} % support for graphics
    usepackage{tabularx} % tables with adjustable width columns
    usepackage{scalerel} % vertically scaling and stretching objects
    usepackage{amssymb} % symbols found in the AMS symbol font msam and msbm
    usepackage{multicol} % define a multicols environment which typesets text in multiple columns
    usepackage{pst-barcode} % printing of barcodes, including qr codes
    usepackage{scrextend} % required to left indent address block
    usepackage{marvosym} % includes euro symbol
    usepackage{colortbl} % background color for row, columns or individual cells in a table
    usepackage[absolute]{textpos} % absolute positioning of text on the page
    usepackage{tikz} % package for creating graphics
    usepackage{setspace} % set spacing between lines
    usepackage{wallpaper} % use pdf as background image (letterhead)

    title{Sections and Chapters}
    hypersetup{colorlinks=true,linkcolor=blue} % define the layout of hyperlinks
    newcommand{hlc}[2][yellow]{
    {sethlcolor{#1} hl{#2}}
    } % define a new command to highlight in another color
    newcommand{dole}[1]{%
    begin{tikzpicture}[remember picture,overlay]
    node[anchor=east,xshift=0mm,yshift=-1.2mm]{#1};
    end{tikzpicture}
    } % make a font to is aligned 1.2mm beneath the normal line

    newcolumntype{C}[1]{>{centeringarraybackslash}m{#1}} % define a new column type for a fixed-width centered-aligned column - middle vertical alignment
    newcolumntype{R}[1]{>{raggedleftarraybackslash}m{#1}} % define a new column type for a fixed-width right-aligned column - middle vertical alignment
    newcolumntype{L}[1]{>{raggedrightarraybackslash}m{#1}} % define a new column type for a fixed-width left-aligned column - middle vertical alignment
    newcolumntype{F}[1]{>{raggedrightarraybackslash}p{#1}} % define a new column type for a fixed-width left-aligned column - top vertical alignment

    setlength{TPHorizModule}{10mm} % 1 generic horizontal unit is equivalent to 10mm for a textblock
    setlength{TPVertModule}{10mm} % 1 generic vertical unit is equivalent to 10mm for a textblock
    textblockorigin{0mm}{0mm} % top left corner set as origin for a textblock

    endofdump


    penarch-client.tex



    usepackage{fontspec}                       % support for OpenType fonts

    geometry{
    a4paper,
    left=30mm,
    right=25mm,
    headheight=115pt,
    top=4.5cm,
    headsep=0cm,
    bottom=3.5cm,
    footskip=95pt
    }

    pagenumbering{gobble} % sets page numbering off

    linespread{0.8} % change the line spacing for entire document
    setmainfont[Path=./fonts/,
    BoldItalicFont=CALIBRIZ.TTF,
    BoldFont =CALIBRIB.TTF,
    ItalicFont =CALIBRII.TTF]{CALIBRI.TTF} % set main font to Calibri

    ULCornerWallPaper{1}{letterhead.pdf}


    hello-world.tex



    %&penarch-common-precompiled
    input{penarch-client}
    input{penarch-hyphenation-dutch}

    begin{document}


    Hello World !


    end{document}


    My shell script



    xelatex -ini -jobname="penarch-common-precompiled" "&xelatex" mylatexformat.ltx penarch-common-precompiled.tex
    xelatex hello-world.tex









    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      In order to optimize the generation of thousands of PDF documents, I'm struggling with mylatexformat that will include the main packages.



      To structure our work, I've put all the common packages in a file that should be precompiled, and all our client related definitions in another file (in a second step I will also try to precompile some packages and definitions for each client).



      But the generated PDF output doesn't include the letterhead background. The PDF also shows a page number whereas I've defined that no page number should be visible. When I'm not working with mylatexformat, this Hello World ! example is working correctly.



      penarch-common-precompiled.tex



      defencodingdefault{OT1}normalfont
      everyjobexpandafter{theeveryjobdefencodingdefault{TU}normalfont}


      documentclass{article}


      usepackage{parskip} % vertical space between paragraphs
      usepackage{xcolor} % foreground (text, rules, etc.) and background colour management
      usepackage{soul} % hyphenatable letterspacing, underlining, overstriking, highlighting
      usepackage{geometry} % customize page layout
      usepackage{enumitem} % enumerate, itemize and description lists
      usepackage{hyperref} % hypertext links
      usepackage{qrcode} % generate QR codes
      usepackage{fancyhdr} % headers and footers
      usepackage{graphicx} % support for graphics
      usepackage{tabularx} % tables with adjustable width columns
      usepackage{scalerel} % vertically scaling and stretching objects
      usepackage{amssymb} % symbols found in the AMS symbol font msam and msbm
      usepackage{multicol} % define a multicols environment which typesets text in multiple columns
      usepackage{pst-barcode} % printing of barcodes, including qr codes
      usepackage{scrextend} % required to left indent address block
      usepackage{marvosym} % includes euro symbol
      usepackage{colortbl} % background color for row, columns or individual cells in a table
      usepackage[absolute]{textpos} % absolute positioning of text on the page
      usepackage{tikz} % package for creating graphics
      usepackage{setspace} % set spacing between lines
      usepackage{wallpaper} % use pdf as background image (letterhead)

      title{Sections and Chapters}
      hypersetup{colorlinks=true,linkcolor=blue} % define the layout of hyperlinks
      newcommand{hlc}[2][yellow]{
      {sethlcolor{#1} hl{#2}}
      } % define a new command to highlight in another color
      newcommand{dole}[1]{%
      begin{tikzpicture}[remember picture,overlay]
      node[anchor=east,xshift=0mm,yshift=-1.2mm]{#1};
      end{tikzpicture}
      } % make a font to is aligned 1.2mm beneath the normal line

      newcolumntype{C}[1]{>{centeringarraybackslash}m{#1}} % define a new column type for a fixed-width centered-aligned column - middle vertical alignment
      newcolumntype{R}[1]{>{raggedleftarraybackslash}m{#1}} % define a new column type for a fixed-width right-aligned column - middle vertical alignment
      newcolumntype{L}[1]{>{raggedrightarraybackslash}m{#1}} % define a new column type for a fixed-width left-aligned column - middle vertical alignment
      newcolumntype{F}[1]{>{raggedrightarraybackslash}p{#1}} % define a new column type for a fixed-width left-aligned column - top vertical alignment

      setlength{TPHorizModule}{10mm} % 1 generic horizontal unit is equivalent to 10mm for a textblock
      setlength{TPVertModule}{10mm} % 1 generic vertical unit is equivalent to 10mm for a textblock
      textblockorigin{0mm}{0mm} % top left corner set as origin for a textblock

      endofdump


      penarch-client.tex



      usepackage{fontspec}                       % support for OpenType fonts

      geometry{
      a4paper,
      left=30mm,
      right=25mm,
      headheight=115pt,
      top=4.5cm,
      headsep=0cm,
      bottom=3.5cm,
      footskip=95pt
      }

      pagenumbering{gobble} % sets page numbering off

      linespread{0.8} % change the line spacing for entire document
      setmainfont[Path=./fonts/,
      BoldItalicFont=CALIBRIZ.TTF,
      BoldFont =CALIBRIB.TTF,
      ItalicFont =CALIBRII.TTF]{CALIBRI.TTF} % set main font to Calibri

      ULCornerWallPaper{1}{letterhead.pdf}


      hello-world.tex



      %&penarch-common-precompiled
      input{penarch-client}
      input{penarch-hyphenation-dutch}

      begin{document}


      Hello World !


      end{document}


      My shell script



      xelatex -ini -jobname="penarch-common-precompiled" "&xelatex" mylatexformat.ltx penarch-common-precompiled.tex
      xelatex hello-world.tex









      share|improve this question













      In order to optimize the generation of thousands of PDF documents, I'm struggling with mylatexformat that will include the main packages.



      To structure our work, I've put all the common packages in a file that should be precompiled, and all our client related definitions in another file (in a second step I will also try to precompile some packages and definitions for each client).



      But the generated PDF output doesn't include the letterhead background. The PDF also shows a page number whereas I've defined that no page number should be visible. When I'm not working with mylatexformat, this Hello World ! example is working correctly.



      penarch-common-precompiled.tex



      defencodingdefault{OT1}normalfont
      everyjobexpandafter{theeveryjobdefencodingdefault{TU}normalfont}


      documentclass{article}


      usepackage{parskip} % vertical space between paragraphs
      usepackage{xcolor} % foreground (text, rules, etc.) and background colour management
      usepackage{soul} % hyphenatable letterspacing, underlining, overstriking, highlighting
      usepackage{geometry} % customize page layout
      usepackage{enumitem} % enumerate, itemize and description lists
      usepackage{hyperref} % hypertext links
      usepackage{qrcode} % generate QR codes
      usepackage{fancyhdr} % headers and footers
      usepackage{graphicx} % support for graphics
      usepackage{tabularx} % tables with adjustable width columns
      usepackage{scalerel} % vertically scaling and stretching objects
      usepackage{amssymb} % symbols found in the AMS symbol font msam and msbm
      usepackage{multicol} % define a multicols environment which typesets text in multiple columns
      usepackage{pst-barcode} % printing of barcodes, including qr codes
      usepackage{scrextend} % required to left indent address block
      usepackage{marvosym} % includes euro symbol
      usepackage{colortbl} % background color for row, columns or individual cells in a table
      usepackage[absolute]{textpos} % absolute positioning of text on the page
      usepackage{tikz} % package for creating graphics
      usepackage{setspace} % set spacing between lines
      usepackage{wallpaper} % use pdf as background image (letterhead)

      title{Sections and Chapters}
      hypersetup{colorlinks=true,linkcolor=blue} % define the layout of hyperlinks
      newcommand{hlc}[2][yellow]{
      {sethlcolor{#1} hl{#2}}
      } % define a new command to highlight in another color
      newcommand{dole}[1]{%
      begin{tikzpicture}[remember picture,overlay]
      node[anchor=east,xshift=0mm,yshift=-1.2mm]{#1};
      end{tikzpicture}
      } % make a font to is aligned 1.2mm beneath the normal line

      newcolumntype{C}[1]{>{centeringarraybackslash}m{#1}} % define a new column type for a fixed-width centered-aligned column - middle vertical alignment
      newcolumntype{R}[1]{>{raggedleftarraybackslash}m{#1}} % define a new column type for a fixed-width right-aligned column - middle vertical alignment
      newcolumntype{L}[1]{>{raggedrightarraybackslash}m{#1}} % define a new column type for a fixed-width left-aligned column - middle vertical alignment
      newcolumntype{F}[1]{>{raggedrightarraybackslash}p{#1}} % define a new column type for a fixed-width left-aligned column - top vertical alignment

      setlength{TPHorizModule}{10mm} % 1 generic horizontal unit is equivalent to 10mm for a textblock
      setlength{TPVertModule}{10mm} % 1 generic vertical unit is equivalent to 10mm for a textblock
      textblockorigin{0mm}{0mm} % top left corner set as origin for a textblock

      endofdump


      penarch-client.tex



      usepackage{fontspec}                       % support for OpenType fonts

      geometry{
      a4paper,
      left=30mm,
      right=25mm,
      headheight=115pt,
      top=4.5cm,
      headsep=0cm,
      bottom=3.5cm,
      footskip=95pt
      }

      pagenumbering{gobble} % sets page numbering off

      linespread{0.8} % change the line spacing for entire document
      setmainfont[Path=./fonts/,
      BoldItalicFont=CALIBRIZ.TTF,
      BoldFont =CALIBRIB.TTF,
      ItalicFont =CALIBRII.TTF]{CALIBRI.TTF} % set main font to Calibri

      ULCornerWallPaper{1}{letterhead.pdf}


      hello-world.tex



      %&penarch-common-precompiled
      input{penarch-client}
      input{penarch-hyphenation-dutch}

      begin{document}


      Hello World !


      end{document}


      My shell script



      xelatex -ini -jobname="penarch-common-precompiled" "&xelatex" mylatexformat.ltx penarch-common-precompiled.tex
      xelatex hello-world.tex






      format-files






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 7 at 9:13









      user3048741

      434




      434






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          You must add endofdump. Without it mylatexformat will ignore everything in the preamble until begin{document}:



          endofdump
          input{penarch-client}
          input{penarch-hyphenation-dutch}

          begin{document}


          Hello World !


          end{document}





          share|improve this answer





















            Your Answer








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

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

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


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463654%2fwhen-using-mylatexformat-background-image-is-not-shown%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
            4
            down vote



            accepted










            You must add endofdump. Without it mylatexformat will ignore everything in the preamble until begin{document}:



            endofdump
            input{penarch-client}
            input{penarch-hyphenation-dutch}

            begin{document}


            Hello World !


            end{document}





            share|improve this answer

























              up vote
              4
              down vote



              accepted










              You must add endofdump. Without it mylatexformat will ignore everything in the preamble until begin{document}:



              endofdump
              input{penarch-client}
              input{penarch-hyphenation-dutch}

              begin{document}


              Hello World !


              end{document}





              share|improve this answer























                up vote
                4
                down vote



                accepted







                up vote
                4
                down vote



                accepted






                You must add endofdump. Without it mylatexformat will ignore everything in the preamble until begin{document}:



                endofdump
                input{penarch-client}
                input{penarch-hyphenation-dutch}

                begin{document}


                Hello World !


                end{document}





                share|improve this answer












                You must add endofdump. Without it mylatexformat will ignore everything in the preamble until begin{document}:



                endofdump
                input{penarch-client}
                input{penarch-hyphenation-dutch}

                begin{document}


                Hello World !


                end{document}






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 7 at 11:58









                Ulrike Fischer

                184k7289666




                184k7289666






























                    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%2f463654%2fwhen-using-mylatexformat-background-image-is-not-shown%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

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    How to change which sound is reproduced for terminal bell?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents