/samples/sample.tex

http://txt2tags.googlecode.com/ · LaTeX · 228 lines · 163 code · 63 blank · 2 comment · 0 complexity · 716b119494f41ba4e0fa95d1980ad6fb MD5 · raw file

  1. \documentclass{article}
  2. \usepackage{graphicx}
  3. \usepackage{paralist} % needed for compact lists
  4. \usepackage[normalem]{ulem} % needed by strike
  5. \usepackage[urlcolor=blue,colorlinks=true]{hyperref}
  6. \usepackage[utf8]{inputenc} % char encoding
  7. \title{TXT2TAGS SAMPLE}
  8. \author{Aurelio Jargas}
  9. \begin{document}
  10. \date{02/28/2011}
  11. \maketitle
  12. \clearpage
  13. \section*{Introduction}
  14. Welcome to the txt2tags sample file.
  15. Here you have examples and a brief explanation of all
  16. marks.
  17. The first 3 lines of the this file are used as headers,
  18. on the following format:
  19. \begin{verbatim}
  20. line1: document title
  21. line2: author name, email
  22. line3: date, version
  23. \end{verbatim}
  24. Lines with balanced equal signs = around are titles.
  25. \section*{Fonts and Beautifiers}
  26. We have two sets of fonts:
  27. The NORMAL type that can be improved with beautifiers.
  28. The TYPEWRITER type that uses monospaced font for
  29. pre-formatted text.
  30. We will now enter on a subtitle...
  31. \subsection*{Beautifiers}
  32. The text marks for beautifiers are simple, just as you
  33. type on a plain text email message.
  34. We use double *, /, - and \_ to represent \textbf{bold},
  35. \textit{italic}, \sout{strike} and \underline{underline}.
  36. The \textbf{\textit{bold italic}} style is also supported as a
  37. combination.
  38. \subsection*{Pre-Formatted Text}
  39. We can put a code sample or other pre-formatted text:
  40. \begin{verbatim}
  41. here is pre-formatted
  42. //marks// are **not** ``interpreted``
  43. \end{verbatim}
  44. And also, it's easy to put a one line pre-formatted
  45. text:
  46. \begin{verbatim}
  47. prompt$ ls /etc
  48. \end{verbatim}
  49. Or use \texttt{pre-formatted} inside sentences.
  50. \subsection*{More Cosmetics}
  51. Special entities like email (\htmladdnormallink{duh@somewhere.com}{mailto:duh@somewhere.com}) and
  52. URL (\htmladdnormallink{http://www.duh.com}{http://www.duh.com}) are detected automagically,
  53. as long as the horizontal line:
  54. \hrulefill{}
  55. \^{} thin or large v
  56. \clearpage
  57. You can also specify an \htmladdnormallink{explicit link}{http://duh.org}
  58. or an \htmladdnormallink{explicit email}{mailto:duh@somewhere.com} with label.
  59. And remember,
  60. \begin{quotation}
  61. A TAB in front of the line does a quotation.
  62. \begin{quotation}
  63. More TABs, more depth (if allowed).
  64. \end{quotation}
  65. \end{quotation}
  66. Nice.
  67. \section*{Lists}
  68. A list of items is natural, just putting a \textbf{dash} or
  69. a \textbf{plus} at the beginning of the line.
  70. \subsection*{Plain List}
  71. The dash is the default list identifier. For sublists,
  72. just add \textbf{spaces} at the beginning of the line. More
  73. spaces, more sublists.
  74. \begin{compactitem}
  75. \item Earth
  76. \begin{compactitem}
  77. \item America
  78. \begin{compactitem}
  79. \item South America
  80. \begin{compactitem}
  81. \item Brazil
  82. \item How deep can I go?
  83. \end{compactitem}
  84. \end{compactitem}
  85. \item Europe
  86. \begin{compactitem}
  87. \item Lots of countries
  88. \end{compactitem}
  89. \end{compactitem}
  90. \item Mars
  91. \begin{compactitem}
  92. \item Who knows?
  93. \end{compactitem}
  94. \end{compactitem}
  95. The list ends with \textbf{two} consecutive blank lines.
  96. \subsection*{Numbered List}
  97. The same rules as the plain list, just a different
  98. identifier (plus).
  99. \begin{compactenum}
  100. \item one
  101. \item two
  102. \item three
  103. \begin{compactitem}
  104. \item mixed lists!
  105. \item what a mess
  106. \begin{compactenum}
  107. \item counting again
  108. \item ...
  109. \end{compactenum}
  110. \end{compactitem}
  111. \item four
  112. \end{compactenum}
  113. \subsection*{Definition List}
  114. The definition list identifier is a colon, followed by
  115. the term. The term contents is placed on the next line.
  116. \begin{compactdesc}
  117. \item[orange]
  118. a yellow fruit
  119. \item[apple]
  120. a green or red fruit
  121. \item[other fruits]
  122. \begin{compactitem}
  123. \item wee!
  124. \item mixing lists
  125. \begin{compactenum}
  126. \item again!
  127. \item and again!
  128. \end{compactenum}
  129. \end{compactitem}
  130. \end{compactdesc}
  131. \section*{Tables}
  132. Use pipes to compose table rows and cells.
  133. Double pipe at the line beginning starts a heading row.
  134. Natural spaces specify each cell alignment.
  135. \begin{center}\begin{tabular}{|l|c|r|}
  136. \hline \textbf{heading 1} & \textbf{heading 2} & \textbf{heading 3} \\
  137. \hline cell 1.1 & cell 1.2 & cell 1.3 \\
  138. \hline cell 2.1 & cell 2.2 & cell 2.3 \\
  139. \hline \end{tabular}\end{center}
  140. Without the last pipe, no border:
  141. \begin{center}\begin{tabular}{lcr}
  142. \textbf{heading 1} & \textbf{heading 2} & \textbf{heading 3} \\
  143. cell 1.1 & cell 1.2 & cell 1.3 \\
  144. cell 2.1 & cell 2.2 & cell 2.3 \\
  145. \end{tabular}\end{center}
  146. \section*{Special Entities}
  147. Because things were too simple.
  148. \subsection*{Images}
  149. The image mark is as simple as it can be: \texttt{[filename]}.
  150. \includegraphics{img/photo.jpg}
  151. \begin{compactitem}
  152. \item The filename must end in PNG, JPG, GIF, or similar.
  153. \item No spaces inside the brackets!
  154. \end{compactitem}
  155. \subsection*{Other}
  156. The handy \texttt{\%\%date} macro expands to the current date.
  157. So today is 20110602 on the ISO \texttt{YYYYMMDD} format.
  158. You can also specify the date format with the \%? flags,
  159. as \texttt{\%\%date(\%m-\%d-\%Y)} which gives: 06-02-2011.
  160. That's all for now.
  161. \hrulefill{}
  162. \includegraphics{img/t2tpowered.png} (\htmladdnormallink{sample.t2t}{sample.t2t})
  163. % LaTeX2e code generated by txt2tags 2.6.668 (http://txt2tags.org)
  164. % cmdline: txt2tags --no-rc -t tex -i ../../samples/sample.t2t -o sample.tex
  165. \end{document}