Thanks for TorbjørnT. from Tex forum for these methods.
Sometimes I needed to define some text and put it in 2 different places.
If the text has no verbatim in it, this method can be used
\documentclass{article}% \begin{document} \newcommand\mytext{ text with some with no verbatim more text here } \mytext \renewcommand\mytext{ more text with here more text here also....... } \mytext \end{document}
But if the text has verbatim in it, the above does not work. Use this method
\documentclass{article}% \usepackage{filecontents} \begin{document} \begin{filecontents*}{somefile.txt} Text with \verb|Initialization| verbatim it. This would now be put in text file, then read again \end{filecontents*} \input{somefile.txt} \end{document}