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.

106 lines
3.5 KiB

4 years ago
  1. """
  2. Copyright 2009 Luca Trevisan
  3. Additional contributors: Radu Grigore
  4. LaTeX2WP version 0.6.2
  5. This file is part of LaTeX2WP, a program that converts
  6. a LaTeX document into a format that is ready to be
  7. copied and pasted into WordPress.
  8. You are free to redistribute and/or modify LaTeX2WP under the
  9. terms of the GNU General Public License (GPL), version 3
  10. or (at your option) any later version.
  11. I hope you will find LaTeX2WP useful, but be advised that
  12. it comes WITHOUT ANY WARRANTY; without even the implied warranty
  13. of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GPL for more details.
  15. You should have received a copy of the GNU General Public
  16. License along with LaTeX2WP. If you can't find it,
  17. see <http://www.gnu.org/licenses/>.
  18. """
  19. # Lines starting with #, like this one, are comments
  20. # change to HTML = True to produce standard HTML
  21. HTML = False
  22. # color of LaTeX formulas
  23. textcolor = "000000"
  24. # colors that can be used in the text
  25. colors = { "red" : "ff0000" , "green" : "00ff00" , "blue" : "0000ff" }
  26. # list of colors defined above
  27. colorchoice = ["red","green","blue"]
  28. # counters for theorem-like environments
  29. # assign any counter to any environment. Make sure that
  30. # maxcounter is an upper bound to the any counter being used
  31. maxcounter = 5
  32. T = { "theorem" : 0 , "lemma" : 0 , "proposition" : 0, "definition" : 0,
  33. "corollary" : 0, "remark" : 3 , "example" : 1, "claim" : 4,
  34. "exercise" : 2 }
  35. # list of theorem-like environments defined above
  36. ThmEnvs = ["theorem","definition","lemma","proposition","corollary","claim",
  37. "remark","example","exercise"]
  38. # the way \begin{theorem}, \begin{lemma} etc are translated in HTML
  39. # the string _ThmType_ stands for the type of theorem
  40. # the string _ThmNumb_ is the theorem number
  41. beginthm = "\n<blockquote><b>_ThmType_ _ThmNumb_</b> "
  42. # translation of \begin{theorem}[...]. The string
  43. # _ThmName_ stands for the content betwee the
  44. # square brackets
  45. beginnamedthm = "\n<blockquote><b>_ThmType_ _ThmNumb_ (_ThmName_)</b> "
  46. #translation of \end{theorem}, \end{lemma}, etc.
  47. endthm = "</blockquote>\n<p>\n"
  48. beginproof = "<em>Proof:</em> "
  49. endproof = "$latex \Box&fg=000000$\n\n"
  50. section = "\n<p align=center><b> &mdash; _SecNumb_. _SecName_ &mdash; </b></p>\n\n"
  51. sectionstar = "\n<p align=center><b> &mdash; _SecName_ &mdash; </b></p>\n\n"
  52. subsection = "\n<p align=center><b> &mdash; _SecNumb_._SubSecNumb_. _SecName_ &mdash; </b></p>\n\n"
  53. subsectionstar = "\n<p align=center><b> &mdash; _SecName_ &mdash;</b></p>\n\n"
  54. # Font styles. Feel free to add others. The key *must* contain
  55. # an open curly bracket. The value is the namem of a HTML tag.
  56. fontstyle = {
  57. r'{\em ' : 'em',
  58. r'{\bf ' : 'b',
  59. r'{\it ' : 'i',
  60. r'{\sl ' : 'i',
  61. r'\textit{' : 'i',
  62. r'\textsl{' : 'i',
  63. r'\emph{' : 'em',
  64. r'\textbf{' : 'b',
  65. }
  66. # Macro definitions
  67. # It is a sequence of pairs [string1,string2], and
  68. # latex2wp will replace each occurrence of string1 with an
  69. # occurrence of string2. The substitutions are performed
  70. # in the same order as the pairs appear below.
  71. # Feel free to add your own.
  72. # Note that you have to write \\ instead of \
  73. # and \" instead of "
  74. M = [ ["\\to","\\rightarrow"] ,
  75. ["\\E","\mathop{\\mathbb E}"],
  76. ["\\P","\mathop{\\mathbb P}"],
  77. ["\\N","{\\mathbb N}"],
  78. ["\\Z","{\\mathbb Z}"],
  79. ["\\C","{\\mathbb C}"],
  80. ["\\R","{\\mathbb R}"],
  81. ["\\Q","{\\mathbb Q}"],
  82. ["\\xor","\\oplus"],
  83. ["\\eps","\\epsilon"]
  84. ]