Document ClassesMaking a macro long -- after the fact

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
hendrick
Posts: 8
Joined: Mon Sep 07, 2009 3:58 pm

Making a macro long -- after the fact

Post by hendrick »

I would like to be able to change a non-\long macro into a \long macro. Here is a toy example of what I am looking to do:

Code: Select all

\def\xxx#1{{\em #1}}
\makeitlong\xxx
\xxx{This is a test\par in two paragraphs.}
(What's missing, of course, is a "\makeitlong" command.)

If you're curious, my actual situation involves using a package (namely, datatool.sty) that defines some commands as ordinary macros when when I need them to be \long macros. Of course I can create a modified version of datatool.sty (called, say, longdata.sty), but I want to share this with others without taking the responsibility of maintaining such a complicated package! I'd rather just \RequirePackage{datatool} and then change the specific commands I need, if that is possible.

Any ideas? Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Post Reply