Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newcommand {mainv} {parnoindenthspace*{0pt}ignorespaces}
- main {This text is written using command main}
- mainv {This text is written using command mainv}
- newcommand {main} {parnoindenthspace*{0pt}ignorespaces}
- documentclass{article}
- newcommandmain{parnoindenthspace*{0pt}ignorespaces}
- newcommandmainV{vspace{-10pt}main}
- begin{document}
- main Some text
- main Some text
- main Some text
- mainV some other, overlapping text
- end{document}
- % My standard header for TeX.SX answers:
- documentclass[a4paper]{article} % To avoid confusion, let us explicitly
- % declare the paper format.
- usepackage[T1]{fontenc} % Not always necessary, but recommended.
- % End of standard header. What follows pertains to the problem at hand.
- makeatletter
- newcommand*vspacebeforeline[1]{%
- ifvmode % if in vertical mode, act as "vspace{#1}"
- vskip #1
- vskip z@skip
- else
- @bsphack
- vadjust pre {%
- @restorepar
- vskip #1
- vskip z@skip
- }%
- @esphack
- fi
- }
- makeatother
- begin{document}
- Here is some nonsensical text, written for the sole purpose of filling up at
- least one line. Well, after all I~think that two lines would be even better.
- And now, we use our new command exactly herevspacebeforeline{18pt plus 6pt
- minus 6pt}, followed by a few other words to end the test.
- vspacebeforeline{3pt}
- It can be used in vertical mode, too.
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement