You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-commits@maven.apache.org by lt...@apache.org on 2008/03/26 12:32:11 UTC

svn commit: r641263 - in /maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src: main/java/org/apache/maven/doxia/module/latex/ main/resources/org/apache/maven/doxia/module/latex/ test/java/org/apache/maven/doxia/module/latex/

Author: ltheussl
Date: Wed Mar 26 04:32:07 2008
New Revision: 641263

URL: http://svn.apache.org/viewvc?rev=641263&view=rev
Log:
Rewrite of latex sink: avoid re-defining standard latex commands to ease writing a parser. Use package fancyvrb for verbatim environment and hyperref for anchors/links. The sinkCommands are now empty by default, everything is in the preamble which should be made user-customizable.

Modified:
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex
    maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java?rev=641263&r1=641262&r2=641263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java Wed Mar 26 04:32:07 2008
@@ -22,6 +22,8 @@
 import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.sink.AbstractTextSink;
 import org.apache.maven.doxia.util.LineBreaker;
+import org.apache.maven.doxia.util.StructureSinkUtils;
+
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -41,7 +43,7 @@
     /**
      * Flag that indicates if the document to be written is only a fragment.
      *
-     * This implies that <code>\\begin{document}</code>, <code>\\ptitle{..}</code> will not be output.
+     * This implies that <code>\\begin{document}</code>, <code>\\title{..}</code> will not be output.
      */
     private boolean fragmentDocument;
 
@@ -198,7 +200,7 @@
             else
             {
                 titleFlag = false;
-                markup( "\\pmaketitle" + EOL + EOL );
+                markup( "\\maketitle" + EOL + EOL );
             }
         }
     }
@@ -216,6 +218,97 @@
         flush();
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public void title()
+    {
+        if ( !fragmentDocument )
+        {
+            titleFlag = true;
+            markup( "\\title{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void title_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void author()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "\\author{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void author_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void date()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "\\date{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void date_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
     // ----------------------------------------------------------------------
     // Section Title 1
     // ----------------------------------------------------------------------
@@ -237,7 +330,7 @@
 
         if ( StringUtils.isNotEmpty( title ) )
         {
-            markup( "\\psectioni{" + title + "}" + EOL );
+            markup( "\\section{" + title + "}" + EOL );
 
             title = null;
         }
@@ -264,7 +357,7 @@
 
         if ( StringUtils.isNotEmpty( title ) )
         {
-            markup( "\\psectionii{" + title + "}" + EOL );
+            markup( "\\subsection{" + title + "}" + EOL );
 
             title = null;
         }
@@ -291,7 +384,7 @@
 
         if ( StringUtils.isNotEmpty( title ) )
         {
-            markup( "\\psectioniii{" + title + "}" + EOL );
+            markup( "\\subsubsection{" + title + "}" + EOL );
 
             title = null;
         }
@@ -318,7 +411,7 @@
 
         if ( StringUtils.isNotEmpty( title ) )
         {
-            markup( "\\psectioniv{" + title + "}" + EOL );
+            markup( "\\paragraph{" + title + "}" + EOL );
 
             title = null;
         }
@@ -345,14 +438,14 @@
 
         if ( StringUtils.isNotEmpty( title ) )
         {
-            markup( "\\psectionv{" + title + "}" + EOL );
+            markup( "\\subparagraph{" + title + "}" + EOL );
 
             title = null;
         }
     }
 
     // ----------------------------------------------------------------------
-    //
+    // List
     // ----------------------------------------------------------------------
 
     /**
@@ -360,7 +453,7 @@
      */
     public void list()
     {
-        markup( "\\begin{plist}" + EOL + EOL );
+        markup( "\\begin{itemize}" + EOL + EOL );
     }
 
     /**
@@ -368,7 +461,7 @@
      */
     public void list_()
     {
-        markup( "\\end{plist}" + EOL + EOL );
+        markup( "\\end{itemize}" + EOL + EOL );
     }
 
     /**
@@ -376,7 +469,7 @@
      */
     public void listItem()
     {
-        markup( "\\item{} " );
+        markup( "\\item " );
     }
 
     /**
@@ -423,7 +516,7 @@
                 style = "arabic";
         }
 
-        markup( "\\begin{pnumberedlist}" + EOL );
+        markup( "\\begin{enumerate}" + EOL );
         markup( "\\renewcommand{\\the" + counter + "}{\\" + style + "{" + counter + "}}" + EOL + EOL );
     }
 
@@ -432,7 +525,7 @@
      */
     public void numberedList_()
     {
-        markup( "\\end{pnumberedlist}" + EOL + EOL );
+        markup( "\\end{enumerate}" + EOL + EOL );
         --numberedListNesting;
     }
 
@@ -441,7 +534,7 @@
      */
     public void numberedListItem()
     {
-        markup( "\\item{} " );
+        markup( "\\item " );
     }
 
     /**
@@ -449,7 +542,7 @@
      */
     public void definitionList()
     {
-        markup( "\\begin{pdefinitionlist}" + EOL + EOL );
+        markup( "\\begin{description}" + EOL + EOL );
     }
 
     /**
@@ -457,16 +550,36 @@
      */
     public void definitionList_()
     {
-        markup( "\\end{pdefinitionlist}" + EOL + EOL );
+        markup( "\\end{description}" + EOL + EOL );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void definedTerm()
+    {
+        markup( "\\item[\\mbox{" );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void definedTerm_()
+    {
+        markup( "}] " );
     }
 
+    // ----------------------------------------------------------------------
+    // Figure
+    // ----------------------------------------------------------------------
+
     /**
      * {@inheritDoc}
      */
     public void figure()
     {
         figureFlag = true;
-        markup( "\\begin{pfigure}" + EOL );
+        markup( "\\begin{figure}[htb]" + EOL );
     }
 
     /**
@@ -474,17 +587,54 @@
      */
     public void figure_()
     {
-        markup( "\\end{pfigure}" + EOL + EOL );
+        markup( "\\end{figure}" + EOL + EOL );
         figureFlag = false;
     }
 
     /**
      * {@inheritDoc}
      */
+    public void figureGraphics( String name )
+    {
+        String src = name;
+
+        if ( !src.endsWith( ".eps" ) )
+        {
+            getLog().warn( "[latex-sink] Found non-eps figure graphics!" );
+        }
+
+        markup( "\\begin{center}" + EOL );
+        markup( "\\includegraphics{" + src + "}" + EOL );
+        markup( "\\end{center}" + EOL );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void figureCaption()
+    {
+        markup( "\\caption{" );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void figureCaption_()
+    {
+        markup( "}" + EOL );
+    }
+
+    // ----------------------------------------------------------------------
+    // Table
+    // ----------------------------------------------------------------------
+
+    /**
+     * {@inheritDoc}
+     */
     public void table()
     {
         tableFlag = true;
-        markup( "\\begin{ptable}" + EOL );
+        markup( "\\begin{table}[htp]" + EOL );
     }
 
     /**
@@ -492,7 +642,7 @@
      */
     public void table_()
     {
-        markup( "\\end{ptable}" + EOL + EOL );
+        markup( "\\end{table}" + EOL + EOL );
         tableFlag = false;
     }
 
@@ -527,7 +677,8 @@
             justif.append( '|' );
         }
 
-        markup( "\\begin{ptablerows}{" + justif.toString() + "}" + EOL );
+        markup( "\\begin{center}" + EOL );
+        markup( "\\begin{tabular}{" + justif.toString() + "}" + EOL );
         if ( grid )
         {
             markup( "\\hline" + EOL );
@@ -541,7 +692,9 @@
      */
     public void tableRows_()
     {
-        markup( "\\end{ptablerows}" + EOL );
+        markup( "\\end{tabular}" + EOL );
+        markup( "\\end{center}" + EOL );
+
         gridFlag = false;
         cellJustif = null;
     }
@@ -571,184 +724,6 @@
     /**
      * {@inheritDoc}
      */
-    public void title()
-    {
-        if ( !fragmentDocument )
-        {
-            titleFlag = true;
-            markup( "\\ptitle{" );
-        }
-        else
-        {
-            ignoreText = true;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void title_()
-    {
-        if ( !fragmentDocument )
-        {
-            markup( "}" + EOL );
-        }
-        else
-        {
-            ignoreText = false;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void author()
-    {
-        if ( !fragmentDocument )
-        {
-            markup( "\\pauthor{" );
-        }
-        else
-        {
-            ignoreText = true;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void author_()
-    {
-        if ( !fragmentDocument )
-        {
-            markup( "}" + EOL );
-        }
-        else
-        {
-            ignoreText = false;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void date()
-    {
-        if ( !fragmentDocument )
-        {
-            markup( "\\pdate{" );
-        }
-        else
-        {
-            ignoreText = true;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void date_()
-    {
-        if ( !fragmentDocument )
-        {
-            markup( "}" + EOL );
-        }
-        else
-        {
-            ignoreText = false;
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void sectionTitle_()
-    {
-        // TODO: closing bracket?
-        markup( "}" + EOL + EOL );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void paragraph_()
-    {
-        markup( EOL + EOL );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void verbatim( boolean boxed )
-    {
-        if ( boxed )
-        {
-            markup( "\\begin{pverbatimbox}" + EOL );
-        }
-        else
-        {
-            markup( "\\begin{pverbatim}" + EOL );
-        }
-        markup( "\\begin{verbatim}" + EOL );
-
-        verbatimFlag = true;
-        boxFlag = boxed;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void verbatim_()
-    {
-        markup( EOL + "\\end{verbatim}" + EOL );
-        if ( boxFlag )
-        {
-            markup( "\\end{pverbatimbox}" + EOL + EOL );
-        }
-        else
-        {
-            markup( "\\end{pverbatim}" + EOL + EOL );
-        }
-
-        verbatimFlag = false;
-        boxFlag = false;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void definedTerm()
-    {
-        markup( "\\item[\\mbox{" );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void definedTerm_()
-    {
-        markup( "}] " );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void figureCaption()
-    {
-        markup( "\\pfigurecaption{" );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void figureCaption_()
-    {
-        markup( "}" + EOL );
-    }
-
-    /**
-     * {@inheritDoc}
-     */
     public void tableCell()
     {
         tableCell( false );
@@ -808,7 +783,7 @@
                 justif = 'c';
                 break;
         }
-        markup( "\\begin{pcell}{" + justif + "}" );
+        markup( "\\begin{tabular}[t]{" + justif + "}" );
     }
 
     /**
@@ -818,7 +793,7 @@
      */
     private void tableCell_( boolean header )
     {
-        markup( "\\end{pcell}" );
+        markup( "\\end{tabular}" );
         ++cellCount;
     }
 
@@ -827,7 +802,7 @@
      */
     public void tableCaption()
     {
-        markup( "\\ptablecaption{" );
+        markup( "\\caption{" );
     }
 
     /**
@@ -841,9 +816,41 @@
     /**
      * {@inheritDoc}
      */
-    public void figureGraphics( String name )
+    public void paragraph_()
+    {
+        markup( EOL + EOL );
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void verbatim( boolean boxed )
+    {
+        markup( EOL + "\\begin{small}" + EOL );
+
+        if ( boxed )
+        {
+            markup( "\\begin{Verbatim}[frame=single]" + EOL );
+        }
+        else
+        {
+            markup( "\\begin{Verbatim}" + EOL );
+        }
+
+        verbatimFlag = true;
+        boxFlag = boxed;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void verbatim_()
     {
-        markup( "\\pfiguregraphics{" + name + "}" + EOL );
+        markup( EOL + "\\end{Verbatim}" + EOL );
+        markup( "\\end{small}" + EOL + EOL );
+
+        verbatimFlag = false;
+        boxFlag = false;
     }
 
     /**
@@ -851,7 +858,7 @@
      */
     public void horizontalRule()
     {
-        markup( "\\phorizontalrule" + EOL + EOL );
+        markup( "\\begin{center}\\rule[0.5ex]{\\linewidth}{1pt}\\end{center}" + EOL + EOL );
     }
 
     /**
@@ -867,7 +874,7 @@
      */
     public void anchor( String name )
     {
-        markup( "\\panchor{" );
+        markup( "\\hypertarget{" + name + "}{" );
     }
 
     /**
@@ -883,7 +890,15 @@
      */
     public void link( String name )
     {
-        markup( "\\plink{" );
+        // TODO: use \\url for simple links
+        if ( StructureSinkUtils.isExternalLink( name ) )
+        {
+            markup( "\\href{" + name + "}{" );
+        }
+        else
+        {
+            markup( "\\hyperlink{" + name + "}{" );
+        }
     }
 
     /**
@@ -899,7 +914,7 @@
      */
     public void italic()
     {
-        markup( "\\pitalic{" );
+        markup( "\\textit{" );
     }
 
     /**
@@ -915,7 +930,7 @@
      */
     public void bold()
     {
-        markup( "\\pbold{" );
+        markup( "\\textbf{" );
     }
 
     /**
@@ -931,7 +946,7 @@
      */
     public void monospaced()
     {
-        markup( "\\pmonospaced{" );
+        markup( "\\texttt{\\small " );
     }
 
     /**
@@ -947,7 +962,7 @@
      */
     public void lineBreak()
     {
-        markup( ( figureFlag || tableFlag || titleFlag ) ? "\\\\" + EOL : "\\newline" + EOL );
+        markup( ( figureFlag || tableFlag || titleFlag || verbatimFlag ) ? EOL : "\\newline" + EOL );
     }
 
     /**

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex?rev=641263&r1=641262&r2=641263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex Wed Mar 26 04:32:07 2008
@@ -1,14 +1,14 @@
-\usepackage{a4wide}
-\usepackage{color}
-\usepackage{graphics}
+% required (do not remove!):
+\usepackage{graphics} % for images
+\usepackage{fancyvrb} % for verbatim
+\usepackage[colorlinks=true,urlcolor=blue,linkcolor=green]{hyperref} % for links and anchors
+
+% optional:
 \usepackage{times}
 \usepackage[latin1]{inputenc}
-%%\usepackage[T1]{fontenc}
+
 \pagestyle{plain}
-\definecolor{plinkcolor}{rgb}{0,0,0.54}
-\definecolor{panchorcolor}{rgb}{0.54,0,0}
-\newlength{\pparskipamount}
-\setlength{\pparskipamount}{1ex}
+
 \setlength{\parindent}{0pt}
-\setlength{\parskip}{\pparskipamount}
+\setlength{\parskip}{1ex}
 

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex?rev=641263&r1=641262&r2=641263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex Wed Mar 26 04:32:07 2008
@@ -1,37 +0,0 @@
-\newcommand{\ptitle}[1]{\title{#1}}
-\newcommand{\pauthor}[1]{\author{#1}}
-\newcommand{\pdate}[1]{\date{#1}}
-\newcommand{\pmaketitle}{\maketitle}
-\newcommand{\psectioni}[1]{\section{#1}}
-\newcommand{\psectionii}[1]{\subsection{#1}}
-\newcommand{\psectioniii}[1]{\subsubsection{#1}}
-\newcommand{\psectioniv}[1]{\paragraph{#1}}
-\newcommand{\psectionv}[1]{\subparagraph{#1}}
-\newenvironment{plist}{\begin{itemize}}{\end{itemize}}
-\newenvironment{pnumberedlist}{\begin{enumerate}}{\end{enumerate}}
-\newcommand{\pdef}[1]{\textbf{#1}\hfill}
-\newenvironment{pdefinitionlist}
-{\begin{list}{}{\settowidth{\labelwidth}{\textbf{999.}}
-                \setlength{\leftmargin}{\labelwidth}
-                \addtolength{\leftmargin}{\labelsep}
-                \renewcommand{\makelabel}{\pdef}}} {\end{list}}
-\newenvironment{pfigure}{\begin{center}}{\end{center}}
-\newcommand{\pfiguregraphics}[1]{\includegraphics{#1.eps}}
-\newcommand{\pfigurecaption}[1]{\\ \vspace{\pparskipamount}
-                                \textit{#1}}
-\newenvironment{ptable}{\begin{center}}{\end{center}}
-\newenvironment{ptablerows}[1]{\begin{tabular}{#1}}{\end{tabular}}
-\newenvironment{pcell}[1]{\begin{tabular}[t]{#1}}{\end{tabular}}
-\newcommand{\ptablecaption}[1]{\\ \vspace{\pparskipamount}
-                               \textit{#1}}
-\newenvironment{pverbatim}{\begin{small}}{\end{small}} \newsavebox{\pbox}
-\newenvironment{pverbatimbox} {\begin{lrbox}{\pbox}\begin{minipage}{\linewidth}\begin{small}}
-{\end{small}\end{minipage}\end{lrbox}\fbox{\usebox{\pbox}}}
-\newcommand{\phorizontalrule}{\begin{center}
-                              \rule[0.5ex]{\linewidth}{1pt}
-                              \end{center}}
-\newcommand{\panchor}[1]{\textcolor{panchorcolor}{#1}}
-\newcommand{\plink}[1]{\textcolor{plinkcolor}{#1}} \newcommand{\pitalic}[1]{\textit{#1}}
-\newcommand{\pbold}[1]{\textbf{#1}}
-\newcommand{\pmonospaced}[1]{\texttt{\small #1}}
-

Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java?rev=641263&r1=641262&r2=641263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java Wed Mar 26 04:32:07 2008
@@ -46,19 +46,19 @@
     /** {@inheritDoc} */
     protected String getTitleBlock( String title )
     {
-        return "\\ptitle{" + LatexSink.escaped( title ) + "}" + EOL;
+        return "\\title{" + LatexSink.escaped( title ) + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getAuthorBlock( String author )
     {
-        return "\\pauthor{" + LatexSink.escaped( author ) + "}" + EOL;
+        return "\\author{" + LatexSink.escaped( author ) + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getDateBlock( String date )
     {
-        return "\\pdate{" + LatexSink.escaped( date ) + "}" + EOL;
+        return "\\date{" + LatexSink.escaped( date ) + "}" + EOL;
     }
 
     /** {@inheritDoc} */
@@ -79,73 +79,72 @@
     /** {@inheritDoc} */
     protected String getSectionTitleBlock( String title )
     {
-        // TODO: closing bracket?
-        return title + "}" + EOL + EOL;
+        return title;
     }
 
     /** {@inheritDoc} */
     protected String getSection1Block( String title )
     {
-        return "\\psectioni{" + title + "}" + EOL;
+        return "\\section{" + title + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection2Block( String title )
     {
-        return "\\psectionii{" + title + "}" + EOL;
+        return "\\subsection{" + title + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        return "\\psectioniii{" + title + "}" + EOL;
+        return "\\subsubsection{" + title + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        return "\\psectioniv{" + title + "}" + EOL;
+        return "\\paragraph{" + title + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        return "\\psectionv{" + title + "}" + EOL;
+        return "\\subparagraph{" + title + "}" + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getListBlock( String item )
     {
-        return "\\begin{plist}" + EOL + EOL + "\\item{} " + LatexSink.escaped( item ) + "\\end{plist}" + EOL + EOL;
+        return "\\begin{itemize}" + EOL + EOL + "\\item " + LatexSink.escaped( item ) + "\\end{itemize}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getNumberedListBlock( String item )
     {
-        return "\\begin{pnumberedlist}" + EOL + "\\renewcommand{\\theenumi}{\\roman{enumi}}" + EOL + EOL + "\\item{} "
-            + LatexSink.escaped( item ) + "\\end{pnumberedlist}" + EOL + EOL;
+        return "\\begin{enumerate}" + EOL + "\\renewcommand{\\theenumi}{\\roman{enumi}}" + EOL + EOL + "\\item "
+            + LatexSink.escaped( item ) + "\\end{enumerate}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getDefinitionListBlock( String definum, String definition )
     {
-        return "\\begin{pdefinitionlist}" + EOL + EOL + "\\item[\\mbox{" + definum + "}] " + definition + "\\end{pdefinitionlist}" + EOL + EOL;
+        return "\\begin{description}" + EOL + EOL + "\\item[\\mbox{" + definum + "}] " + definition + "\\end{description}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getFigureBlock( String source, String caption )
     {
-        return "\\begin{pfigure}" + EOL + "\\pfiguregraphics{" + source + "}" + EOL + "\\pfigurecaption{"
-            + LatexSink.escaped( caption ) + "}" + EOL + "\\end{pfigure}" + EOL + EOL;
+        return "\\begin{figure}[htb]" + EOL + "\\begin{center}" + EOL + "\\includegraphics{" + source + "}" + EOL
+            + "\\end{center}" + EOL + "\\caption{Figure\\_caption}" + EOL + "\\end{figure}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getTableBlock( String cell, String caption )
     {
-        // TODO: something's wrong
-        return "\\begin{ptable}" + EOL + "\\begin{ptablerows}{c}" + EOL + "\\begin{pcell}{c}cell\\end{pcell}\\\\"
-            + EOL + "\\end{ptablerows}" + EOL + "\\ptablecaption{" + LatexSink.escaped( caption ) + "}"
-            + EOL + "\\end{ptable}" + EOL + EOL;
+        
+        return "\\begin{table}[htp]" + EOL + "\\begin{center}" + EOL + "\\begin{tabular}{c}" + EOL
+            + "\\begin{tabular}[t]{c}cell\\end{tabular}\\\\" + EOL + "\\end{tabular}" + EOL
+            + "\\end{center}" + EOL + "\\caption{Table\\_caption}" + EOL + "\\end{table}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
@@ -157,13 +156,14 @@
     /** {@inheritDoc} */
     protected String getVerbatimBlock( String text )
     {
-        return "\\begin{pverbatimbox}" + EOL + "\\begin{verbatim}" + EOL + text + EOL + "\\end{verbatim}" + EOL + "\\end{pverbatimbox}" + EOL + EOL;
+        return EOL + "\\begin{small}" + EOL + "\\begin{Verbatim}[frame=single]" + EOL + text + EOL
+            + "\\end{Verbatim}" + EOL + "\\end{small}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getHorizontalRuleBlock()
     {
-        return "\\phorizontalrule" + EOL + EOL;
+        return "\\begin{center}\\rule[0.5ex]{\\linewidth}{1pt}\\end{center}" + EOL + EOL;
     }
 
     /** {@inheritDoc} */
@@ -175,31 +175,31 @@
     /** {@inheritDoc} */
     protected String getAnchorBlock( String anchor )
     {
-        return "\\panchor{" + anchor + "}";
+        return "\\hypertarget{" + anchor + "}{" + anchor + "}";
     }
 
     /** {@inheritDoc} */
     protected String getLinkBlock( String link, String text )
     {
-        return "\\plink{" + text + "}";
+        return "\\hyperlink{" + link + "}{" + text + "}";
     }
 
     /** {@inheritDoc} */
     protected String getItalicBlock( String text )
     {
-        return "\\pitalic{" + text + "}";
+        return "\\textit{" + text + "}";
     }
 
     /** {@inheritDoc} */
     protected String getBoldBlock( String text )
     {
-        return "\\pbold{" + text + "}";
+        return "\\textbf{" + text + "}";
     }
 
     /** {@inheritDoc} */
     protected String getMonospacedBlock( String text )
     {
-        return "\\pmonospaced{" + text + "}";
+        return "\\texttt{\\small " + text + "}";
     }
 
     /** {@inheritDoc} */