Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. newcommand {mainv} {parnoindenthspace*{0pt}ignorespaces}
  2.  
  3. main {This text is written using command main}
  4. mainv {This text is written using command mainv}
  5.  
  6. newcommand {main} {parnoindenthspace*{0pt}ignorespaces}
  7.  
  8. documentclass{article}
  9.  
  10. newcommandmain{parnoindenthspace*{0pt}ignorespaces}
  11. newcommandmainV{vspace{-10pt}main}
  12.  
  13. begin{document}
  14.  
  15. main Some text
  16. main Some text
  17. main Some text
  18. mainV some other, overlapping text
  19. end{document}
  20.  
  21. % My standard header for TeX.SX answers:
  22. documentclass[a4paper]{article} % To avoid confusion, let us explicitly
  23. % declare the paper format.
  24.  
  25. usepackage[T1]{fontenc} % Not always necessary, but recommended.
  26. % End of standard header. What follows pertains to the problem at hand.
  27.  
  28. makeatletter
  29.  
  30. newcommand*vspacebeforeline[1]{%
  31. ifvmode % if in vertical mode, act as "vspace{#1}"
  32. vskip #1
  33. vskip z@skip
  34. else
  35. @bsphack
  36. vadjust pre {%
  37. @restorepar
  38. vskip #1
  39. vskip z@skip
  40. }%
  41. @esphack
  42. fi
  43. }
  44.  
  45. makeatother
  46.  
  47.  
  48.  
  49.  
  50. begin{document}
  51.  
  52. Here is some nonsensical text, written for the sole purpose of filling up at
  53. least one line. Well, after all I~think that two lines would be even better.
  54. And now, we use our new command exactly herevspacebeforeline{18pt plus 6pt
  55. minus 6pt}, followed by a few other words to end the test.
  56.  
  57. vspacebeforeline{3pt}
  58.  
  59. It can be used in vertical mode, too.
  60.  
  61. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement