1\documentclass[11pt]{report}
2
3\newif\iflatextortf  %all \newif constructs ignored; defaults to False
4% manually set flag -- not required
5\latextortffalse  %ignored by latex2rtf
6%\latextortftrue  %also ignored by latex2rtf
7
8\usepackage[pdftex]{graphicx}
9
10\iflatextortf
11\else
12  \usepackage{dcolumn}
13  \newcolumntype{d}[1]{D{.}{.}{#1}}
14  \usepackage{sidecap}
15\fi
16
17\begin{document}
18
19\section{If-else}
20
21\iflatextortf
22  This is the true clause!  There should be no false clause.
23\else
24  This is the false clause!  Something is wrong if this appears in the RTF translation.
25  This should appear in the \LaTeX{} version.
26\fi
27
28\section{If only}
29
30\iflatextortf
31  This is the true clause, with no else clause. It should not appear in the \LaTeX{} version.
32\fi
33
34\section{Blank if, non-blank else}
35
36\iflatextortf
37	%blank
38\else
39  This is the false clause!
40  This should appear in the \LaTeX{} version.
41\fi
42
43%
44% The remainder of these tests do not work with latex2trf r614
45%
46
47%\section{Nesting in the table environment}
48
49%Table~\ref{tab:one} should have aligned numbers in \LaTeX{} and normal columns in RTF (not possible in RTF).
50
51%\begin{table}[h]
52%\begin{center}
53%\caption{Random population densities of some countries}
54%\iflatextortf
55%  \begin{tabular}{lccc} % standard column definitions
56%\else
57%  \begin{tabular}{ld{2}d{2}d{2}} % dcolumn column definitions
58%\fi
59%\hline
60%Name & \multicolumn{1}{c}{Population} & \multicolumn{1}{c}{Area} & \multicolumn{1}{c}{Density} \\
61%\hline
62%Canada           &  32,268,240 & 9,970,610    &      3.2   \\
63%Denmark          &   5,430,590 &    43,094    &    126     \\
64%Germany          &  82,689,210 &   357,022    &    232     \\
65%Greenland        &      56,916 & 2,175,600    &      0.026 \\
66%Pitcairn Islands &          67 &         5    &     13.4   \\
67%Monaco           &      35,253 &         1.49 & 23,660     \\
68%United States    & 298,212,900 & 9,629,091    &     31     \\
69%Vatican City     &         821 &         0.44 &  1,866     \\
70%\hline
71%\multicolumn{4}{r}{\footnotesize{Source: \textit{Wikipedia: List of countries by population density}}}
72%\end{tabular}
73%\label{tab:one}
74%\end{center}
75%\end{table}
76
77%\section{Using the SCfigure environment}
78
79%Figure~\ref{fig:one} should have a caption on the right in \LaTeX{} normal caption in RTF.
80
81%\iflatextortf
82%  \begin{figure}
83%\else
84%  \begin{SCfigure}
85%\fi
86%\includegraphics[height=18cm,width=5cm]{fig_tex}
87%\caption{A stretched figure which goes from the bottom of the page, to top.}
88%\label{fig:one}
89%\iflatextortf
90%  \end{figure}
91%\else
92%  \end{SCfigure}
93%\fi
94
95\end{document}
96
97