Caption in margin not properly positionned












1















I'm having a peculiar problem: I set up my two-sided document's geometry and captions so that the captions of floats are displayed beside the floats in the margin par. This basically works, but for some reason evenly and unevenly numbered pages show different behaviour.




  • Uneven page example:
    Uneven page example


  • Even page example:
    Even page example



As you can see, for uneven pages the caption is not inside it's supposed margins while the figure is nicely centered and for even pages the situation is reversed.



Here is my MWE (I included all packages that I thought could contribute to this problem):



documentclass[
draft=false,
paper=a4,
paper=portrait,
pagesize=auto,
twoside=true,
fontsize=10pt,
version=last,
parskip=half,
numbers=noenddot,
bibliography=totoc]{scrbook}

usepackage[
includemp,
paper = a4paper,
top = 25.0mm,
bindingoffset = 5.0mm,
bottom = 32.0mm,
footskip = 15.0mm,
inner = 18.5mm,
outer = 16.5mm,
marginparwidth = 45.0mm,
marginparsep = 7.5mm]{geometry}

usepackage{showframe}
usepackage{blindtext}
usepackage[hypcap=true]{caption}
usepackage{floatrow}
usepackage{graphicx}
usepackage{float}

floatsetup[figure]{
facing = yes,
margins = hangoutside,
capposition = beside,
capbesideposition = {top, outside},
floatwidth = textwidth,
capbesidewidth = marginparwidth,
}

captionsetup[capbesidefigure]{
format = plain,
}

begin{document}
%
begin{figure}[h]
begin{center}
includegraphics{example-image-a}
caption{blindtext}
end{center}
end{figure}
newpage
%
begin{figure}[h]
begin{center}
centeringincludegraphics{example-image-a}
caption{blindtext}
end{center}
end{figure}
newpage
%
end{document}


I'm using xelatex, but it's the same with pdflatex.i



I'm thankful for any suggestions how to solve this problem.



Best regards,
Clemens










share|improve this question





























    1















    I'm having a peculiar problem: I set up my two-sided document's geometry and captions so that the captions of floats are displayed beside the floats in the margin par. This basically works, but for some reason evenly and unevenly numbered pages show different behaviour.




    • Uneven page example:
      Uneven page example


    • Even page example:
      Even page example



    As you can see, for uneven pages the caption is not inside it's supposed margins while the figure is nicely centered and for even pages the situation is reversed.



    Here is my MWE (I included all packages that I thought could contribute to this problem):



    documentclass[
    draft=false,
    paper=a4,
    paper=portrait,
    pagesize=auto,
    twoside=true,
    fontsize=10pt,
    version=last,
    parskip=half,
    numbers=noenddot,
    bibliography=totoc]{scrbook}

    usepackage[
    includemp,
    paper = a4paper,
    top = 25.0mm,
    bindingoffset = 5.0mm,
    bottom = 32.0mm,
    footskip = 15.0mm,
    inner = 18.5mm,
    outer = 16.5mm,
    marginparwidth = 45.0mm,
    marginparsep = 7.5mm]{geometry}

    usepackage{showframe}
    usepackage{blindtext}
    usepackage[hypcap=true]{caption}
    usepackage{floatrow}
    usepackage{graphicx}
    usepackage{float}

    floatsetup[figure]{
    facing = yes,
    margins = hangoutside,
    capposition = beside,
    capbesideposition = {top, outside},
    floatwidth = textwidth,
    capbesidewidth = marginparwidth,
    }

    captionsetup[capbesidefigure]{
    format = plain,
    }

    begin{document}
    %
    begin{figure}[h]
    begin{center}
    includegraphics{example-image-a}
    caption{blindtext}
    end{center}
    end{figure}
    newpage
    %
    begin{figure}[h]
    begin{center}
    centeringincludegraphics{example-image-a}
    caption{blindtext}
    end{center}
    end{figure}
    newpage
    %
    end{document}


    I'm using xelatex, but it's the same with pdflatex.i



    I'm thankful for any suggestions how to solve this problem.



    Best regards,
    Clemens










    share|improve this question



























      1












      1








      1








      I'm having a peculiar problem: I set up my two-sided document's geometry and captions so that the captions of floats are displayed beside the floats in the margin par. This basically works, but for some reason evenly and unevenly numbered pages show different behaviour.




      • Uneven page example:
        Uneven page example


      • Even page example:
        Even page example



      As you can see, for uneven pages the caption is not inside it's supposed margins while the figure is nicely centered and for even pages the situation is reversed.



      Here is my MWE (I included all packages that I thought could contribute to this problem):



      documentclass[
      draft=false,
      paper=a4,
      paper=portrait,
      pagesize=auto,
      twoside=true,
      fontsize=10pt,
      version=last,
      parskip=half,
      numbers=noenddot,
      bibliography=totoc]{scrbook}

      usepackage[
      includemp,
      paper = a4paper,
      top = 25.0mm,
      bindingoffset = 5.0mm,
      bottom = 32.0mm,
      footskip = 15.0mm,
      inner = 18.5mm,
      outer = 16.5mm,
      marginparwidth = 45.0mm,
      marginparsep = 7.5mm]{geometry}

      usepackage{showframe}
      usepackage{blindtext}
      usepackage[hypcap=true]{caption}
      usepackage{floatrow}
      usepackage{graphicx}
      usepackage{float}

      floatsetup[figure]{
      facing = yes,
      margins = hangoutside,
      capposition = beside,
      capbesideposition = {top, outside},
      floatwidth = textwidth,
      capbesidewidth = marginparwidth,
      }

      captionsetup[capbesidefigure]{
      format = plain,
      }

      begin{document}
      %
      begin{figure}[h]
      begin{center}
      includegraphics{example-image-a}
      caption{blindtext}
      end{center}
      end{figure}
      newpage
      %
      begin{figure}[h]
      begin{center}
      centeringincludegraphics{example-image-a}
      caption{blindtext}
      end{center}
      end{figure}
      newpage
      %
      end{document}


      I'm using xelatex, but it's the same with pdflatex.i



      I'm thankful for any suggestions how to solve this problem.



      Best regards,
      Clemens










      share|improve this question
















      I'm having a peculiar problem: I set up my two-sided document's geometry and captions so that the captions of floats are displayed beside the floats in the margin par. This basically works, but for some reason evenly and unevenly numbered pages show different behaviour.




      • Uneven page example:
        Uneven page example


      • Even page example:
        Even page example



      As you can see, for uneven pages the caption is not inside it's supposed margins while the figure is nicely centered and for even pages the situation is reversed.



      Here is my MWE (I included all packages that I thought could contribute to this problem):



      documentclass[
      draft=false,
      paper=a4,
      paper=portrait,
      pagesize=auto,
      twoside=true,
      fontsize=10pt,
      version=last,
      parskip=half,
      numbers=noenddot,
      bibliography=totoc]{scrbook}

      usepackage[
      includemp,
      paper = a4paper,
      top = 25.0mm,
      bindingoffset = 5.0mm,
      bottom = 32.0mm,
      footskip = 15.0mm,
      inner = 18.5mm,
      outer = 16.5mm,
      marginparwidth = 45.0mm,
      marginparsep = 7.5mm]{geometry}

      usepackage{showframe}
      usepackage{blindtext}
      usepackage[hypcap=true]{caption}
      usepackage{floatrow}
      usepackage{graphicx}
      usepackage{float}

      floatsetup[figure]{
      facing = yes,
      margins = hangoutside,
      capposition = beside,
      capbesideposition = {top, outside},
      floatwidth = textwidth,
      capbesidewidth = marginparwidth,
      }

      captionsetup[capbesidefigure]{
      format = plain,
      }

      begin{document}
      %
      begin{figure}[h]
      begin{center}
      includegraphics{example-image-a}
      caption{blindtext}
      end{center}
      end{figure}
      newpage
      %
      begin{figure}[h]
      begin{center}
      centeringincludegraphics{example-image-a}
      caption{blindtext}
      end{center}
      end{figure}
      newpage
      %
      end{document}


      I'm using xelatex, but it's the same with pdflatex.i



      I'm thankful for any suggestions how to solve this problem.



      Best regards,
      Clemens







      captions marginpar






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 11 mins ago









      Hafid Boukhoulda

      2,4571518




      2,4571518










      asked 15 hours ago









      snemsnem

      383




      383






















          1 Answer
          1






          active

          oldest

          votes


















          3














          Looking carefully to the provided images I suspected that the problem may be that the distance separating float and caption is not well adjusted and should be equal to marginparsep.



          A quick search in the floatrow package manual allowed me to discover that this distance can be adapted by means of the capbesidesep.



          To set capbesidesepto be equal to marginparsep the steps are:




          1. defining a new separator that can be named e.g. marginparsep using: DeclareFloatSeparators{marginparsep}{hskipmarginparsep}


          2. adding the key capbesidesep = marginparsep, inside floatsetup[...]{...} command



          !



          documentclass[
          draft=false,
          paper=a4,
          paper=portrait,
          pagesize=auto,
          twoside=true,
          fontsize=10pt,
          version=last,
          parskip=half,
          numbers=noenddot,
          bibliography=totoc]{scrbook}

          usepackage[
          includemp,
          paper = a4paper,
          top = 25.0mm,
          bindingoffset = 5.0mm,
          bottom = 32.0mm,
          footskip = 15.0mm,
          inner = 18.5mm,
          outer = 16.5mm,
          marginparwidth = 45.0mm,
          marginparsep = 7.5mm]{geometry}


          usepackage{showframe,layout}
          usepackage{blindtext}
          usepackage[hypcap=true]{caption}
          usepackage{floatrow}
          usepackage{graphicx}
          usepackage{float}

          DeclareFloatSeparators{marginparsep}{hskipmarginparsep}

          floatsetup[figure]{
          facing = yes,
          margins = hangoutside,
          capposition = beside,
          capbesideposition = {top, outside},
          floatwidth = textwidth,
          capbesidewidth = marginparwidth,
          capbesidesep = marginparsep,
          }

          captionsetup[capbesidefigure]
          {
          format = plain,
          }

          begin{document}

          %
          begin{figure}[h]
          begin{center}
          includegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          begin{figure}[h]
          begin{center}
          centeringincludegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          end{document}


          enter image description hereenter image description here






          share|improve this answer


























          • Thank you! That fixed my problem.

            – snem
            1 hour ago











          • @snem pleaed to know that your problem is solved!

            – Hafid Boukhoulda
            29 mins 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%2f471885%2fcaption-in-margin-not-properly-positionned%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









          3














          Looking carefully to the provided images I suspected that the problem may be that the distance separating float and caption is not well adjusted and should be equal to marginparsep.



          A quick search in the floatrow package manual allowed me to discover that this distance can be adapted by means of the capbesidesep.



          To set capbesidesepto be equal to marginparsep the steps are:




          1. defining a new separator that can be named e.g. marginparsep using: DeclareFloatSeparators{marginparsep}{hskipmarginparsep}


          2. adding the key capbesidesep = marginparsep, inside floatsetup[...]{...} command



          !



          documentclass[
          draft=false,
          paper=a4,
          paper=portrait,
          pagesize=auto,
          twoside=true,
          fontsize=10pt,
          version=last,
          parskip=half,
          numbers=noenddot,
          bibliography=totoc]{scrbook}

          usepackage[
          includemp,
          paper = a4paper,
          top = 25.0mm,
          bindingoffset = 5.0mm,
          bottom = 32.0mm,
          footskip = 15.0mm,
          inner = 18.5mm,
          outer = 16.5mm,
          marginparwidth = 45.0mm,
          marginparsep = 7.5mm]{geometry}


          usepackage{showframe,layout}
          usepackage{blindtext}
          usepackage[hypcap=true]{caption}
          usepackage{floatrow}
          usepackage{graphicx}
          usepackage{float}

          DeclareFloatSeparators{marginparsep}{hskipmarginparsep}

          floatsetup[figure]{
          facing = yes,
          margins = hangoutside,
          capposition = beside,
          capbesideposition = {top, outside},
          floatwidth = textwidth,
          capbesidewidth = marginparwidth,
          capbesidesep = marginparsep,
          }

          captionsetup[capbesidefigure]
          {
          format = plain,
          }

          begin{document}

          %
          begin{figure}[h]
          begin{center}
          includegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          begin{figure}[h]
          begin{center}
          centeringincludegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          end{document}


          enter image description hereenter image description here






          share|improve this answer


























          • Thank you! That fixed my problem.

            – snem
            1 hour ago











          • @snem pleaed to know that your problem is solved!

            – Hafid Boukhoulda
            29 mins ago
















          3














          Looking carefully to the provided images I suspected that the problem may be that the distance separating float and caption is not well adjusted and should be equal to marginparsep.



          A quick search in the floatrow package manual allowed me to discover that this distance can be adapted by means of the capbesidesep.



          To set capbesidesepto be equal to marginparsep the steps are:




          1. defining a new separator that can be named e.g. marginparsep using: DeclareFloatSeparators{marginparsep}{hskipmarginparsep}


          2. adding the key capbesidesep = marginparsep, inside floatsetup[...]{...} command



          !



          documentclass[
          draft=false,
          paper=a4,
          paper=portrait,
          pagesize=auto,
          twoside=true,
          fontsize=10pt,
          version=last,
          parskip=half,
          numbers=noenddot,
          bibliography=totoc]{scrbook}

          usepackage[
          includemp,
          paper = a4paper,
          top = 25.0mm,
          bindingoffset = 5.0mm,
          bottom = 32.0mm,
          footskip = 15.0mm,
          inner = 18.5mm,
          outer = 16.5mm,
          marginparwidth = 45.0mm,
          marginparsep = 7.5mm]{geometry}


          usepackage{showframe,layout}
          usepackage{blindtext}
          usepackage[hypcap=true]{caption}
          usepackage{floatrow}
          usepackage{graphicx}
          usepackage{float}

          DeclareFloatSeparators{marginparsep}{hskipmarginparsep}

          floatsetup[figure]{
          facing = yes,
          margins = hangoutside,
          capposition = beside,
          capbesideposition = {top, outside},
          floatwidth = textwidth,
          capbesidewidth = marginparwidth,
          capbesidesep = marginparsep,
          }

          captionsetup[capbesidefigure]
          {
          format = plain,
          }

          begin{document}

          %
          begin{figure}[h]
          begin{center}
          includegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          begin{figure}[h]
          begin{center}
          centeringincludegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          end{document}


          enter image description hereenter image description here






          share|improve this answer


























          • Thank you! That fixed my problem.

            – snem
            1 hour ago











          • @snem pleaed to know that your problem is solved!

            – Hafid Boukhoulda
            29 mins ago














          3












          3








          3







          Looking carefully to the provided images I suspected that the problem may be that the distance separating float and caption is not well adjusted and should be equal to marginparsep.



          A quick search in the floatrow package manual allowed me to discover that this distance can be adapted by means of the capbesidesep.



          To set capbesidesepto be equal to marginparsep the steps are:




          1. defining a new separator that can be named e.g. marginparsep using: DeclareFloatSeparators{marginparsep}{hskipmarginparsep}


          2. adding the key capbesidesep = marginparsep, inside floatsetup[...]{...} command



          !



          documentclass[
          draft=false,
          paper=a4,
          paper=portrait,
          pagesize=auto,
          twoside=true,
          fontsize=10pt,
          version=last,
          parskip=half,
          numbers=noenddot,
          bibliography=totoc]{scrbook}

          usepackage[
          includemp,
          paper = a4paper,
          top = 25.0mm,
          bindingoffset = 5.0mm,
          bottom = 32.0mm,
          footskip = 15.0mm,
          inner = 18.5mm,
          outer = 16.5mm,
          marginparwidth = 45.0mm,
          marginparsep = 7.5mm]{geometry}


          usepackage{showframe,layout}
          usepackage{blindtext}
          usepackage[hypcap=true]{caption}
          usepackage{floatrow}
          usepackage{graphicx}
          usepackage{float}

          DeclareFloatSeparators{marginparsep}{hskipmarginparsep}

          floatsetup[figure]{
          facing = yes,
          margins = hangoutside,
          capposition = beside,
          capbesideposition = {top, outside},
          floatwidth = textwidth,
          capbesidewidth = marginparwidth,
          capbesidesep = marginparsep,
          }

          captionsetup[capbesidefigure]
          {
          format = plain,
          }

          begin{document}

          %
          begin{figure}[h]
          begin{center}
          includegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          begin{figure}[h]
          begin{center}
          centeringincludegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          end{document}


          enter image description hereenter image description here






          share|improve this answer















          Looking carefully to the provided images I suspected that the problem may be that the distance separating float and caption is not well adjusted and should be equal to marginparsep.



          A quick search in the floatrow package manual allowed me to discover that this distance can be adapted by means of the capbesidesep.



          To set capbesidesepto be equal to marginparsep the steps are:




          1. defining a new separator that can be named e.g. marginparsep using: DeclareFloatSeparators{marginparsep}{hskipmarginparsep}


          2. adding the key capbesidesep = marginparsep, inside floatsetup[...]{...} command



          !



          documentclass[
          draft=false,
          paper=a4,
          paper=portrait,
          pagesize=auto,
          twoside=true,
          fontsize=10pt,
          version=last,
          parskip=half,
          numbers=noenddot,
          bibliography=totoc]{scrbook}

          usepackage[
          includemp,
          paper = a4paper,
          top = 25.0mm,
          bindingoffset = 5.0mm,
          bottom = 32.0mm,
          footskip = 15.0mm,
          inner = 18.5mm,
          outer = 16.5mm,
          marginparwidth = 45.0mm,
          marginparsep = 7.5mm]{geometry}


          usepackage{showframe,layout}
          usepackage{blindtext}
          usepackage[hypcap=true]{caption}
          usepackage{floatrow}
          usepackage{graphicx}
          usepackage{float}

          DeclareFloatSeparators{marginparsep}{hskipmarginparsep}

          floatsetup[figure]{
          facing = yes,
          margins = hangoutside,
          capposition = beside,
          capbesideposition = {top, outside},
          floatwidth = textwidth,
          capbesidewidth = marginparwidth,
          capbesidesep = marginparsep,
          }

          captionsetup[capbesidefigure]
          {
          format = plain,
          }

          begin{document}

          %
          begin{figure}[h]
          begin{center}
          includegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          begin{figure}[h]
          begin{center}
          centeringincludegraphics{example-image-a}
          caption{blindtext}
          end{center}
          end{figure}
          newpage
          %
          end{document}


          enter image description hereenter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 14 hours ago









          Hafid BoukhouldaHafid Boukhoulda

          2,4571518




          2,4571518













          • Thank you! That fixed my problem.

            – snem
            1 hour ago











          • @snem pleaed to know that your problem is solved!

            – Hafid Boukhoulda
            29 mins ago



















          • Thank you! That fixed my problem.

            – snem
            1 hour ago











          • @snem pleaed to know that your problem is solved!

            – Hafid Boukhoulda
            29 mins ago

















          Thank you! That fixed my problem.

          – snem
          1 hour ago





          Thank you! That fixed my problem.

          – snem
          1 hour ago













          @snem pleaed to know that your problem is solved!

          – Hafid Boukhoulda
          29 mins ago





          @snem pleaed to know that your problem is solved!

          – Hafid Boukhoulda
          29 mins 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%2f471885%2fcaption-in-margin-not-properly-positionned%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

          Contact image not getting when fetch all contact list from iPhone by CNContact

          Insert data from modal to MySQL (multiple modal on website)

          count number of partitions of a set with n elements into k subsets