SHARE
TWEET

Untitled

a guest Jun 27th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. documentclass{article}
  2. usepackage{amsmath}
  3. usepackage{setspace}
  4. usepackage{etoolbox}
  5. usepackage{lipsum}% just to generate text for the example
  6.  
  7. BeforeBeginEnvironment{equation}{begin{singlespace}}
  8. AfterEndEnvironment{equation}{end{singlespace}noindentignorespaces}
  9. BeforeBeginEnvironment{align}{begin{singlespace}}
  10. AfterEndEnvironment{align}{end{singlespace}noindentignorespaces}
  11.  
  12. doublespacing
  13.  
  14. begin{document}
  15.  
  16. lipsum[2]
  17. begin{equation}
  18. a=b.
  19. end{equation}
  20. lipsum[2]
  21.  
  22. end{document}
  23.      
  24. usepackage[nodisplayskipstretch]{setspace}
  25.      
  26. documentclass{article}
  27. usepackage[nodisplayskipstretch]{setspace}
  28.  
  29. newcommand{namdui}{Nam dui ligula, fringilla a, euismod sodales,
  30. sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero,
  31. pretium at, lobortis vitae, ultricies et, tellus.}  % filler text
  32.  
  33. doublespacing  
  34. begin{document}
  35.  
  36. namdui
  37. begin{equation}
  38. a=b.
  39. end{equation}
  40. namdui
  41. end{document}
  42.      
  43. usepackage{setspace}setdisplayskipstretch{}
  44.      
  45. documentclass[a4paper]{article}  %  For a consistent page count, specify a paper size.
  46. usepackage{setspace}setdisplayskipstretch{}
  47. doublespacing
  48. usepackage{blindtext}  %  Introduces the "Lorem ipsum..." filler text command blindtext
  49. usepackage{pgffor}     %  Introduces the foreach command
  50.  
  51. begin{document}
  52.   foreach n in {1,...,200}{  % repeat 200 times
  53.     begin{equation}
  54.       a=b.
  55.     end{equation}
  56.     blindtext  % "Lorem ipusm..." filler text
  57.   }
  58. end{document}
  59.      
  60. ╔════════════╦════════════════════════════════════════════════════╗
  61. ║ Page count ║ setspace command                                   ║
  62. ╠════════════╬════════════════════════════════════════════════════╣
  63. ║         77 ║ usepackage{setspace}setdisplayskipstretch{}      ║
  64. ║         80 ║ Gonzalo Medina's answer using etoolbox             ║
  65. ║         81 ║ usepackage[nodisplayskipstretch]{setspace}        ║
  66. ║         86 ║ usepackage{setspace}                              ║
  67. ║         93 ║ renewcommand{baselinestretch}{2} % (no setspace) ║
  68. ╚════════════╩════════════════════════════════════════════════════╝
  69.      
  70. newcommand{displayskipstretch}{baselinestretch}
  71. newcommand{setdisplayskipstretch}[1]{renewcommand{displayskipstretch}{#1}}
  72. DeclareOption{nodisplayskipstretch}{setdisplayskipstretch{1.0}}
  73.      
  74. everydisplayexpandafter{%
  75.   theeverydisplay
  76.   abovedisplayskip displayskipstretchabovedisplayskip
  77.   belowdisplayskip displayskipstretchbelowdisplayskip
  78.   abovedisplayshortskip displayskipstretchabovedisplayshortskip
  79.   belowdisplayshortskip displayskipstretchbelowdisplayshortskip
  80. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top