13.11.2015 Views

my Latex and Tex4ht cheat sheet

my Latex cheat sheet - 12000.org

my Latex cheat sheet - 12000.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.29 How to define text block to use in more than one place?<br />

Thanks for TorbjørnT. from Tex forum for these methods.<br />

Sometimes I needed to define some text <strong>and</strong> put it in 2 different places.<br />

If the text has no verbatim in it, this method can be used<br />

\documentclass{article}%<br />

\begin{document}<br />

\newcomm<strong>and</strong>\<strong>my</strong>text{<br />

text with some with no verbatim<br />

more text here<br />

}<br />

\<strong>my</strong>text<br />

\renewcomm<strong>and</strong>\<strong>my</strong>text{<br />

more text with here<br />

more text here also.......<br />

}<br />

\<strong>my</strong>text<br />

\end{document}<br />

But if the text has verbatim in it, the above does not work. Use this method<br />

\documentclass{article}%<br />

\usepackage{filecontents}<br />

\begin{document}<br />

\begin{filecontents*}{somefile.txt}<br />

Text with \verb|Initialization| verbatim it.<br />

This would now be put in text file, then read again<br />

\end{filecontents*}<br />

\input{somefile.txt}<br />

\end{document}<br />

2.30 adjusting text, parskip, parindent<br />

From http://www.<strong>and</strong>y-roberts.net/writing/latex/tables<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!