Articles I've written for customers on IT issues.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

207 lines
6.8 KiB

4 years ago
  1. \documentclass[12pt]{article}
  2. \usepackage[pdftex,pagebackref,letterpaper=true,colorlinks=true,pdfpagemode=none,urlcolor=blue,linkcolor=blue,citecolor=blue,pdfstartview=FitH]{hyperref}
  3. \usepackage{amsmath,amsfonts}
  4. \usepackage{graphicx}
  5. \usepackage{color}
  6. \setlength{\oddsidemargin}{0pt}
  7. \setlength{\evensidemargin}{0pt}
  8. \setlength{\textwidth}{6.0in}
  9. \setlength{\topmargin}{0in}
  10. \setlength{\textheight}{8.5in}
  11. \setlength{\parindent}{0in}
  12. \setlength{\parskip}{5px}
  13. \input{macrosblog}
  14. \begin{document}
  15. Look at the document source to see how to \sout{strike out} text, how
  16. to \begin{red}use\end{red} \begin{green}different\end{green} \begin{blue}colors\end{blue},
  17. and how to \href{http://www.google.com}{link to URLs with snapshot preview}
  18. and how to \hrefnosnap{http://www.google.com}{link to URLs without snapshot preview}.
  19. There is a command which is ignored by pdflatex and which
  20. defines where to cut the post in the version displayed on the
  21. main page\more
  22. Anything between the conditional declarations {\em ifblog . . . fi}
  23. is ignored by LaTeX and processed by latex2wp. Anything
  24. between {\em iftex . . . fi} is processed by LaTex and ignored
  25. by latex2wp.
  26. \ifblog \begin{green}This green sentence appears only in WordPress \end{green} \fi
  27. \iftex \begin{red}This red sentence appears only in the LaTeX preview \end{red} \fi
  28. This is useful if one, in desperation, wants to put pure HTML commands
  29. in the {\em ifblog . . . fi} scope.
  30. \begin{lemma}[Main] \label{lm:main}
  31. Let $\cal F$ be a total ramification of a compactifier, then
  32. \begin{equation} \label{eq:lemma} \forall g \in {\cal F}. g^2 = \eta \end{equation}
  33. \end{lemma}
  34. The (modifiable) numbering scheme is that lemmas, theorems,
  35. propositions, remarks and corollaries share the same counters,
  36. while exercises and examples have each their own counter.
  37. \begin{theorem} \label{th:ad} The ad\`ele of a number field is never
  38. hyperbolically transfinite.
  39. \end{theorem}
  40. \begin{proof} Left as an exercise. \end{proof}
  41. \begin{exercise} Find a counterexample to Theorem \ref{th:ad}.
  42. \end{exercise}
  43. \begin{exercise}[Advanced] Prove Lemma \ref{lm:main}. \end{exercise}
  44. Note that accented characters are allowed. Unfortunately,
  45. Erd\H os's name cannot be properly typeset in HTML.
  46. (Note that to get the above approximation, you need to type
  47. backslash-H-space-o, rather than backslash-H-{o}. Both are
  48. good in LaTeX, but only the second is recognized by LaTeX2WP.)
  49. One can correctly type the names of H\aa stad, Szemer\'edi,
  50. \v{C}ech, and so on.
  51. It is possible to have numbered equations
  52. \begin{equation} \label{eq:test} \frac 1 {x^2} \ge 0 \end{equation}
  53. and unnumbered equations
  54. $$ t(x) - \frac 12 > x^{\frac 13} $$
  55. Unnumbered equations can be created with the double-dollar sign
  56. command or with the backslash-square bracket command.
  57. \[ f(x) = \int_{-\infty}^{x} \frac 1 {t^2} dt \]
  58. It is possible to refer to equations and
  59. theorems via the {\em ref}, {\em eqref} and {\em label} LaTeX
  60. commands, for example to Equation (\ref{eq:test}),
  61. to Equation \eqref{eq:lemma},
  62. and to Lemma \ref{lm:main} above.
  63. eqnarray* is supported, but not eqnarray:
  64. \begin{eqnarray*}
  65. f(x) & < & x^2 - y^2\\
  66. & = & (x+y) \cdot (x-y)
  67. \end{eqnarray*}
  68. {\em You {\bf can} nest a {\bf bold} text inside an emphasized
  69. text or viceversa.}
  70. The theorem-like environments {\em theorem}, {\em lemma},
  71. {\em proposition}, {\em remark}, {\em corollary}, {\em example}
  72. and {\em exercise} are defined, as is the {\em proof} environment.
  73. The LaTex commands to type \$, \%, and \&\ are supported outside
  74. math mode, and \%\ and \&\ are supported in math mode as well:
  75. \[ 30 \& 10 \% \]
  76. The section symbol \S\ is also supported.
  77. WordPress has trouble if a LaTeX expression containing a $<$
  78. symbol, such as $x^2 < x^2 + 1$ is followed by an expression
  79. containing a $>$ symbol, such as $(x+y)^2 > (x+y)^2 - 3$. This
  80. is fixed by converting the inequality symbols into ``HTML
  81. character codes.'' Always write the symbols $<$ and $>$ in
  82. math mode.
  83. It it is possible to have tabular environments, both with borders
  84. (the border will not be displayed in the LaTeX preview), as in
  85. \begin{btabular}{lr}
  86. blog & quality\\
  87. what's new & excellent\\
  88. in theory & poor
  89. \end{btabular}
  90. and without borders as in
  91. \begin{tabular}{ccc}
  92. $a$ & $\rightarrow$ & $b$\\
  93. $\downarrow$ & & $\uparrow$\\
  94. $c$ & $\rightarrow$ & $d$
  95. \end{tabular}
  96. (The tabular environments will be centered in WordPress, but
  97. not in the LaTeX preview.)
  98. And it is possible to include a picture so that the pdf file produced
  99. with pdflatex imports it from a local image file (which has to be
  100. pdf, gif, jpeg, or png) and the WordPress post imports it from a URL.
  101. \image{width = 400}{http://imgs.xkcd.com/comics/donald_knuth.png}{knuth.png}
  102. The {\em image} command used to generate the above image
  103. has three parameter: a size parameter for either the width or the height,
  104. expressed in pixels (if different from the original resolution, the picture
  105. will be scaled), a URL for the location of the image (this will be used
  106. by WordPress) and a local file name (which will used by pdflatex).
  107. It is possible to have numbered and unnumbered sections and subsections.
  108. References to {\em label} commands which are not in the scope of
  109. a numbered equation or a numbered theorem-like environment
  110. will refer to the section number,
  111. such as a reference to Section \ref{sec} below.
  112. HTML does not have good support for itemized list with
  113. descriptors (what one gets in LaTeX using the {\em itemize} environment
  114. with optional parameters in square brackets after the {\em item} commands).
  115. We can only offer the following rather ugly rendering:
  116. \begin{itemize}
  117. \item [Case a.] Description of case a
  118. \item [Case b.] Description of case b
  119. \end{itemize}
  120. \section*{Examples of Sections}
  121. \subsection*{And Subsections}
  122. \section{A section}
  123. \label{sec}
  124. \subsection{And a subsection}
  125. \section{Changing the style}
  126. The file latex2wpstyle.py contains several definitions that determine
  127. the appearance of the WordPress translation. It should be self-explanatory
  128. to change the way sections, subsections, proofs and theorem-like
  129. environments are typeset, and to change the numbering scheme
  130. for theorem-like environments.
  131. The variable $M$ in latex2wpstyle.py contains a list of pairs of strings.
  132. For every pair, every occurrence of the first string in the document is
  133. replaced by an occurrence of the second before proceeding to the
  134. conversion from LaTeX to WordPress. If you want to use simple macros
  135. (which do not involve parameter-passing) then edit $M$ to add support
  136. for your own LaTeX macros. (You will have to define the macros in
  137. macrosblog.tex as well, otherwise you will not be able to compile
  138. your LaTeX file and preview it.)
  139. Some macros are already defined. For example, backslash-E produces
  140. an expectation symbol:
  141. \[ \E_{x \in X} f(x) := \sum_{x\in X} \P [x] \cdot f(x) \]
  142. Some more macros (see the LaTeX source)
  143. \[ \B, \R , \C, \Z, \N , \Q, \eps \]
  144. \end{document}