Centering something that is scaled to fit an empty beamer slide












1














I am trying to fit something in a beamer slide so that it covers the entire frame width, but what I get seems to be offset to the right by hoffset. Here is a MWE:



documentclass{beamer}

usepackage{adjustbox}

% No navigation symbols. %
setbeamertemplate{navigation symbols}{}

begin{document}

begin{frame}[plain]
%
centering
%
begin{adjustbox}{%
max totalsize={paperwidth}%
{dimexprpaperheight-voffsetrelax}}
%
% Something larger than paperwidth, so that scaling is necessary.
adjustbox{width=1.2paperwidth}{Test text.}
%
end{adjustbox}
%
end{frame}

end{document}


The above produces the following:



enter image description here



As can be seen, there is some empty space on the left. Moreover, the contents don't really seem to actually have a width of paperwidth.



What is the right way of achieving this? I would like to avoid playing around with usebackgroundtemplate, as something like Image on full slide in beamer package seems very ad-hoc to me.










share|improve this question





























    1














    I am trying to fit something in a beamer slide so that it covers the entire frame width, but what I get seems to be offset to the right by hoffset. Here is a MWE:



    documentclass{beamer}

    usepackage{adjustbox}

    % No navigation symbols. %
    setbeamertemplate{navigation symbols}{}

    begin{document}

    begin{frame}[plain]
    %
    centering
    %
    begin{adjustbox}{%
    max totalsize={paperwidth}%
    {dimexprpaperheight-voffsetrelax}}
    %
    % Something larger than paperwidth, so that scaling is necessary.
    adjustbox{width=1.2paperwidth}{Test text.}
    %
    end{adjustbox}
    %
    end{frame}

    end{document}


    The above produces the following:



    enter image description here



    As can be seen, there is some empty space on the left. Moreover, the contents don't really seem to actually have a width of paperwidth.



    What is the right way of achieving this? I would like to avoid playing around with usebackgroundtemplate, as something like Image on full slide in beamer package seems very ad-hoc to me.










    share|improve this question



























      1












      1








      1







      I am trying to fit something in a beamer slide so that it covers the entire frame width, but what I get seems to be offset to the right by hoffset. Here is a MWE:



      documentclass{beamer}

      usepackage{adjustbox}

      % No navigation symbols. %
      setbeamertemplate{navigation symbols}{}

      begin{document}

      begin{frame}[plain]
      %
      centering
      %
      begin{adjustbox}{%
      max totalsize={paperwidth}%
      {dimexprpaperheight-voffsetrelax}}
      %
      % Something larger than paperwidth, so that scaling is necessary.
      adjustbox{width=1.2paperwidth}{Test text.}
      %
      end{adjustbox}
      %
      end{frame}

      end{document}


      The above produces the following:



      enter image description here



      As can be seen, there is some empty space on the left. Moreover, the contents don't really seem to actually have a width of paperwidth.



      What is the right way of achieving this? I would like to avoid playing around with usebackgroundtemplate, as something like Image on full slide in beamer package seems very ad-hoc to me.










      share|improve this question















      I am trying to fit something in a beamer slide so that it covers the entire frame width, but what I get seems to be offset to the right by hoffset. Here is a MWE:



      documentclass{beamer}

      usepackage{adjustbox}

      % No navigation symbols. %
      setbeamertemplate{navigation symbols}{}

      begin{document}

      begin{frame}[plain]
      %
      centering
      %
      begin{adjustbox}{%
      max totalsize={paperwidth}%
      {dimexprpaperheight-voffsetrelax}}
      %
      % Something larger than paperwidth, so that scaling is necessary.
      adjustbox{width=1.2paperwidth}{Test text.}
      %
      end{adjustbox}
      %
      end{frame}

      end{document}


      The above produces the following:



      enter image description here



      As can be seen, there is some empty space on the left. Moreover, the contents don't really seem to actually have a width of paperwidth.



      What is the right way of achieving this? I would like to avoid playing around with usebackgroundtemplate, as something like Image on full slide in beamer package seems very ad-hoc to me.







      beamer horizontal-alignment adjustbox scale






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 21 mins ago









      Martin Scharrer

      198k45632814




      198k45632814










      asked Apr 3 at 5:28









      dow

      32316




      32316






















          2 Answers
          2






          active

          oldest

          votes


















          3














          TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with makebox:



          documentclass{beamer}

          usepackage{adjustbox}

          % No navigation symbols. %
          setbeamertemplate{navigation symbols}{}

          begin{document}

          begin{frame}[plain]
          %
          centering
          %
          makebox[textwidth]{%
          begin{adjustbox}{%
          max totalsize={paperwidth}%
          {dimexprpaperheight-voffsetrelax}}%
          %
          % Something larger than paperwidth, so that scaling is necessary.
          adjustbox{width=1.2paperwidth}{Test text.}%
          %
          end{adjustbox}%
          }%
          end{frame}

          end{document}


          enter image description here






          share|improve this answer























          • This is pretty good, but I now get some empty space to the right of the text.
            – dow
            Apr 3 at 6:45










          • @dow there were som missing % to end the line. Now it should work.
            – Skillmon
            Apr 3 at 9:53






          • 1




            You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
            – Martin Scharrer
            Apr 3 at 15:16










          • @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
            – Skillmon
            Apr 3 at 18:39



















          1














          With the current version of adjustbox just add the center key at the very end. There is also no need to use dimexpr anymore. This has been fixed.



          documentclass{beamer}

          usepackage{adjustbox}

          % No navigation symbols. %
          setbeamertemplate{navigation symbols}{}

          begin{document}

          begin{frame}[plain]
          %
          centering
          %
          begin{adjustbox}{%
          max totalsize={paperwidth}{paperheight-voffset}, center}
          %
          % Something larger than paperwidth, so that scaling is necessary.
          adjustbox{width=1.2paperwidth}{Test text.}
          %
          end{adjustbox}
          %
          end{frame}

          end{document}


          enter image description here






          share|improve this answer





















            Your Answer








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

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

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            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%2f424557%2fcentering-something-that-is-scaled-to-fit-an-empty-beamer-slide%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with makebox:



            documentclass{beamer}

            usepackage{adjustbox}

            % No navigation symbols. %
            setbeamertemplate{navigation symbols}{}

            begin{document}

            begin{frame}[plain]
            %
            centering
            %
            makebox[textwidth]{%
            begin{adjustbox}{%
            max totalsize={paperwidth}%
            {dimexprpaperheight-voffsetrelax}}%
            %
            % Something larger than paperwidth, so that scaling is necessary.
            adjustbox{width=1.2paperwidth}{Test text.}%
            %
            end{adjustbox}%
            }%
            end{frame}

            end{document}


            enter image description here






            share|improve this answer























            • This is pretty good, but I now get some empty space to the right of the text.
              – dow
              Apr 3 at 6:45










            • @dow there were som missing % to end the line. Now it should work.
              – Skillmon
              Apr 3 at 9:53






            • 1




              You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
              – Martin Scharrer
              Apr 3 at 15:16










            • @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
              – Skillmon
              Apr 3 at 18:39
















            3














            TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with makebox:



            documentclass{beamer}

            usepackage{adjustbox}

            % No navigation symbols. %
            setbeamertemplate{navigation symbols}{}

            begin{document}

            begin{frame}[plain]
            %
            centering
            %
            makebox[textwidth]{%
            begin{adjustbox}{%
            max totalsize={paperwidth}%
            {dimexprpaperheight-voffsetrelax}}%
            %
            % Something larger than paperwidth, so that scaling is necessary.
            adjustbox{width=1.2paperwidth}{Test text.}%
            %
            end{adjustbox}%
            }%
            end{frame}

            end{document}


            enter image description here






            share|improve this answer























            • This is pretty good, but I now get some empty space to the right of the text.
              – dow
              Apr 3 at 6:45










            • @dow there were som missing % to end the line. Now it should work.
              – Skillmon
              Apr 3 at 9:53






            • 1




              You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
              – Martin Scharrer
              Apr 3 at 15:16










            • @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
              – Skillmon
              Apr 3 at 18:39














            3












            3








            3






            TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with makebox:



            documentclass{beamer}

            usepackage{adjustbox}

            % No navigation symbols. %
            setbeamertemplate{navigation symbols}{}

            begin{document}

            begin{frame}[plain]
            %
            centering
            %
            makebox[textwidth]{%
            begin{adjustbox}{%
            max totalsize={paperwidth}%
            {dimexprpaperheight-voffsetrelax}}%
            %
            % Something larger than paperwidth, so that scaling is necessary.
            adjustbox{width=1.2paperwidth}{Test text.}%
            %
            end{adjustbox}%
            }%
            end{frame}

            end{document}


            enter image description here






            share|improve this answer














            TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with makebox:



            documentclass{beamer}

            usepackage{adjustbox}

            % No navigation symbols. %
            setbeamertemplate{navigation symbols}{}

            begin{document}

            begin{frame}[plain]
            %
            centering
            %
            makebox[textwidth]{%
            begin{adjustbox}{%
            max totalsize={paperwidth}%
            {dimexprpaperheight-voffsetrelax}}%
            %
            % Something larger than paperwidth, so that scaling is necessary.
            adjustbox{width=1.2paperwidth}{Test text.}%
            %
            end{adjustbox}%
            }%
            end{frame}

            end{document}


            enter image description here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 3 at 14:38

























            answered Apr 3 at 6:30









            Skillmon

            21.1k11941




            21.1k11941












            • This is pretty good, but I now get some empty space to the right of the text.
              – dow
              Apr 3 at 6:45










            • @dow there were som missing % to end the line. Now it should work.
              – Skillmon
              Apr 3 at 9:53






            • 1




              You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
              – Martin Scharrer
              Apr 3 at 15:16










            • @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
              – Skillmon
              Apr 3 at 18:39


















            • This is pretty good, but I now get some empty space to the right of the text.
              – dow
              Apr 3 at 6:45










            • @dow there were som missing % to end the line. Now it should work.
              – Skillmon
              Apr 3 at 9:53






            • 1




              You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
              – Martin Scharrer
              Apr 3 at 15:16










            • @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
              – Skillmon
              Apr 3 at 18:39
















            This is pretty good, but I now get some empty space to the right of the text.
            – dow
            Apr 3 at 6:45




            This is pretty good, but I now get some empty space to the right of the text.
            – dow
            Apr 3 at 6:45












            @dow there were som missing % to end the line. Now it should work.
            – Skillmon
            Apr 3 at 9:53




            @dow there were som missing % to end the line. Now it should work.
            – Skillmon
            Apr 3 at 9:53




            1




            1




            You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
            – Martin Scharrer
            Apr 3 at 15:16




            You could shorten this to begin{frame}[plain] begin{adjustbox}{width=1.2paperwidth, max totalsize={paperwidth}{dimexprpaperheight-voffsetrelax}, center} Test text. end{adjustbox} end{frame}.
            – Martin Scharrer
            Apr 3 at 15:16












            @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
            – Skillmon
            Apr 3 at 18:39




            @MartinScharrer the adjustbox{width=1.2paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal).
            – Skillmon
            Apr 3 at 18:39











            1














            With the current version of adjustbox just add the center key at the very end. There is also no need to use dimexpr anymore. This has been fixed.



            documentclass{beamer}

            usepackage{adjustbox}

            % No navigation symbols. %
            setbeamertemplate{navigation symbols}{}

            begin{document}

            begin{frame}[plain]
            %
            centering
            %
            begin{adjustbox}{%
            max totalsize={paperwidth}{paperheight-voffset}, center}
            %
            % Something larger than paperwidth, so that scaling is necessary.
            adjustbox{width=1.2paperwidth}{Test text.}
            %
            end{adjustbox}
            %
            end{frame}

            end{document}


            enter image description here






            share|improve this answer


























              1














              With the current version of adjustbox just add the center key at the very end. There is also no need to use dimexpr anymore. This has been fixed.



              documentclass{beamer}

              usepackage{adjustbox}

              % No navigation symbols. %
              setbeamertemplate{navigation symbols}{}

              begin{document}

              begin{frame}[plain]
              %
              centering
              %
              begin{adjustbox}{%
              max totalsize={paperwidth}{paperheight-voffset}, center}
              %
              % Something larger than paperwidth, so that scaling is necessary.
              adjustbox{width=1.2paperwidth}{Test text.}
              %
              end{adjustbox}
              %
              end{frame}

              end{document}


              enter image description here






              share|improve this answer
























                1












                1








                1






                With the current version of adjustbox just add the center key at the very end. There is also no need to use dimexpr anymore. This has been fixed.



                documentclass{beamer}

                usepackage{adjustbox}

                % No navigation symbols. %
                setbeamertemplate{navigation symbols}{}

                begin{document}

                begin{frame}[plain]
                %
                centering
                %
                begin{adjustbox}{%
                max totalsize={paperwidth}{paperheight-voffset}, center}
                %
                % Something larger than paperwidth, so that scaling is necessary.
                adjustbox{width=1.2paperwidth}{Test text.}
                %
                end{adjustbox}
                %
                end{frame}

                end{document}


                enter image description here






                share|improve this answer












                With the current version of adjustbox just add the center key at the very end. There is also no need to use dimexpr anymore. This has been fixed.



                documentclass{beamer}

                usepackage{adjustbox}

                % No navigation symbols. %
                setbeamertemplate{navigation symbols}{}

                begin{document}

                begin{frame}[plain]
                %
                centering
                %
                begin{adjustbox}{%
                max totalsize={paperwidth}{paperheight-voffset}, center}
                %
                % Something larger than paperwidth, so that scaling is necessary.
                adjustbox{width=1.2paperwidth}{Test text.}
                %
                end{adjustbox}
                %
                end{frame}

                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 23 mins ago









                Martin Scharrer

                198k45632814




                198k45632814






























                    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%2f424557%2fcentering-something-that-is-scaled-to-fit-an-empty-beamer-slide%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

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt