Guest User

Untitled

a guest
Nov 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. % Minimum working example of a bug in 'memoir.cls':
  2. % 'marginpar{<short comment>}' breaks 'sidebar{<multipage comments>}'
  3. % The bug is that the order of the lines in the sidebar is jumbled.
  4.  
  5. documentclass[9pt,A4]{memoir}
  6.  
  7. % --- header of the log file -----------------------------------------
  8. % This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017)
  9. % (preloaded format=pdflatex) restricted write18 enabled.
  10. % entering extended mode
  11. % (./memoir_bug_in_sidebar.tex
  12. % LaTeX2e <2017-04-15>
  13. % Babel <3.15> and hyphenation patterns for 84 language(s) loaded.
  14. % (/usr/local/texlive/2017/texmf-dist/tex/latex/memoir/memoir.cls
  15. % Document Class: memoir 2016/05/16 v3.7f configurable
  16. % book, report, article document class
  17. % --------------------------------------------------------------------
  18. % Note: no very evident errors are reported in log file ...
  19.  
  20. % load packages
  21. RequirePackage{xcolor}
  22. RequirePackage{ragged2e}
  23. RequirePackage{calc}
  24. RequirePackage{lipsum}
  25.  
  26. % --- begin memoir/sidebar/marginpar adjustments -------------
  27. % note: details of these appearance-options seemingly are
  28. % immaterial to the sidebar{...} wrap-bug
  29.  
  30. % set and check the page dimensions
  31. % preparing for marginparwidth = 11em
  32. % sidebarwidth = 14em
  33. normalfont%
  34. setlrmarginsandblock{11em+1em+2cm}{14em+1em+2cm}{*}
  35. checkandfixthelayout
  36.  
  37. % adjust the marginpar parameters
  38. marginparmargin{inner}
  39. setmarginnotes% {<hsep>}{<width>}{<push>}
  40. {1em}% specify <hsep> => marginparsep
  41. {spinemargin-1em-2cm}% specify <width> => marginparwidth
  42. {onelineskip}% specify <push> => marginparpush
  43.  
  44. % adjust the sidebar parameters
  45. sidebarmargin{outer}
  46. setsidebars% {<hsep>}{<width>}{<vsep>}{<topsep>}{<font>}{<height>}
  47. {1em}% specify <hsep>
  48. {foremargin-1em-2cm}% specify <width> => sidebarwidth
  49. {onelineskip}% specify <vsep> => sidebarvsep
  50. {0pt}% specify <topsep> => sidebartopsep
  51. {sffamilyfootnotesize% specify the <font> parameters
  52. % BUG: the following 'color{...}' bleeds into the body
  53. color{blue}}% (optionally including a color)
  54. {textheight}% specify <height> => sidebarheight
  55. DeclareRobustCommand{sidebarform}{justifying}
  56. % --- end memoir/sidebar/marginpar adjustments -------------
  57.  
  58. begin{document}
  59. textbf{This is the first paragraph of a
  60. multipage memoir-class document.}
  61.  
  62. lipsum[2]%
  63. marginpar{
  64. Marginal comments like this one,
  65. when they comes textsc{before}
  66. a multipage sidebar,
  67. textsc{do not} induce a wrap-error.
  68. }
  69.  
  70. lipsum[3]%
  71. sidebar{strictpagecheck%
  72. textbf{TEST: this sidebar paragraph should
  73. appear on page 1, at the top of the fore-margin.}
  74. par
  75. lipsum[2-11]
  76. par
  77. textbf{TEST: this sidebar paragraph should
  78. appear as the bottom-most fore-margin
  79. paragraph, as the final paragraph
  80. (namely the 12th paragraph)
  81. of a multipage sidebar.}
  82. }%
  83.  
  84. lipsum[4]%
  85. marginpar{strictpagecheck%
  86. textsc{Alas}dots marginal
  87. comments like this one,
  88. that are specified textsc{after}
  89. a multipage sidebar,
  90. textsc{do} induce a wrap-error.
  91. }
  92.  
  93. lipsum[5-8]%
  94.  
  95. lipsum[9]%
  96. marginpar{strictpagecheck%
  97. textsc{Alas}dots this marginal
  98. comment too, appearing
  99. on the second page of
  100. a multipage sidebar,
  101. induces a wrap-error.
  102. }
  103.  
  104. lipsum[10-19]
  105.  
  106. textbf{This is the final body-text
  107. paragraph (namely the 20th paragraph)
  108. of a multipage document.}
  109.  
  110. end{document}
  111. endininput
Add Comment
Please, Sign In to add comment