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 jv...@apache.org on 2007/03/17 15:46:30 UTC

svn commit: r519330 - in /maven/doxia/trunk/doxia-modules/doxia-module-latex: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/doxia/ src/main/java/org/apache/m...

Author: jvanzyl
Date: Sat Mar 17 07:46:28 2007
New Revision: 519330

URL: http://svn.apache.org/viewvc?view=rev&rev=519330
Log:
o separate module for latex

Added:
    maven/doxia/trunk/doxia-modules/doxia-module-latex/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml   (with props)
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java   (with props)
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/
    maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java   (with props)

Added: maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml
URL: http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml?view=auto&rev=519330
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml Sat Mar 17 07:46:28 2007
@@ -0,0 +1,21 @@
+<?xml version="1.0"?><project>
+  <parent>
+    <artifactId>doxia-modules</artifactId>
+    <groupId>org.apache.maven.doxia</groupId>
+    <version>1.0-alpha-9-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.doxia</groupId>
+  <artifactId>doxia-module-latex</artifactId>
+  <name>doxia-module-latex</name>
+  <version>1.0-SNAPSHOT</version>
+  <url>http://maven.apache.org</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/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/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java?view=auto&rev=519330
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java Sat Mar 17 07:46:28 2007
@@ -0,0 +1,822 @@
+package org.apache.maven.doxia.module.latex;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.doxia.module.apt.AptParser;
+import org.apache.maven.doxia.sink.SinkAdapter;
+import org.apache.maven.doxia.util.LineBreaker;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.StringUtils;
+
+import java.io.Writer;
+import java.io.IOException;
+import java.io.InputStream;
+
+public class LatexSink
+    extends SinkAdapter
+{
+    private static final String EOL = System.getProperty( "line.separator" );
+
+    /**
+     * 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.
+     */
+    private boolean fragmentDocument;
+
+    private boolean ignoreText;
+
+    private LineBreaker out;
+
+    private String sinkCommands;
+
+    private String preamble;
+
+    private boolean titleFlag;
+
+    private int numberedListNesting;
+
+    private boolean verbatimFlag;
+
+    private boolean boxFlag;
+
+    private boolean figureFlag;
+
+    private boolean tableFlag;
+
+    private boolean gridFlag;
+
+    private int[] cellJustif;
+
+    private int cellCount;
+
+    private boolean isTitle;
+
+    private String title;
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public LatexSink( Writer out )
+        throws IOException
+    {
+        this( out, IOUtil.toString( getDefaultSinkCommands() ), IOUtil.toString( getDefaultPreamble() ) );
+    }
+
+    public LatexSink( Writer out, String sinkCommands, String preamble )
+    {
+        this.out = new LineBreaker( out );
+        this.sinkCommands = sinkCommands;
+        this.preamble = preamble;
+    }
+
+    public LatexSink( Writer out, String sinkCommands, String preamble, boolean fragmentDocument )
+    {
+        this.out = new LineBreaker( out );
+        this.sinkCommands = sinkCommands;
+        this.preamble = preamble;
+        this.fragmentDocument = fragmentDocument;
+    }
+
+    // ----------------------------------------------------------------------
+    // Overridables
+    // ----------------------------------------------------------------------
+
+    protected String getDocumentStart()
+    {
+        return "\\documentclass[a4paper]{article}";
+    }
+
+    protected String getDocumentBegin()
+    {
+        return "\\begin{document}";
+    }
+
+    protected String getDocumentEnd()
+    {
+        return "\\end{document}" + EOL;
+    }
+
+    // ----------------------------------------------------------------------
+    // Sink Implementation
+    // ----------------------------------------------------------------------
+
+    public void head()
+    {
+        titleFlag = false;
+        numberedListNesting = 0;
+        verbatimFlag = false;
+        boxFlag = false;
+        figureFlag = false;
+        tableFlag = false;
+        gridFlag = false;
+        cellJustif = null;
+        cellCount = 0;
+
+        if ( !fragmentDocument )
+        {
+            markup( sinkCommands );
+
+            markup( preamble );
+
+            markup( getDocumentStart() );
+
+            markup( getDocumentBegin() );
+        }
+    }
+
+    public void body()
+    {
+        if ( titleFlag )
+        {
+            if ( fragmentDocument  )
+            {
+                markup( "\\psection" );
+            }
+            else
+            {
+                titleFlag = false;
+                markup( "\\pmaketitle" + EOL + EOL );
+            }
+        }
+    }
+
+    public void body_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( getDocumentEnd() );
+        }
+
+        out.flush();
+    }
+
+    // ----------------------------------------------------------------------
+    // Section Title 1
+    // ----------------------------------------------------------------------
+
+    public void sectionTitle1()
+    {
+        isTitle = true;
+    }
+
+    public void sectionTitle1_()
+    {
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( "\\psectioni{" + title + "}" );
+
+            title = null;
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Section Title 2
+    // ----------------------------------------------------------------------
+
+    public void sectionTitle2()
+    {
+        isTitle = true;
+    }
+
+    public void sectionTitle2_()
+    {
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( "\\psectionii{" + title + "}" );
+
+            title = null;
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Section Title 3
+    // ----------------------------------------------------------------------
+
+    public void sectionTitle3()
+    {
+        isTitle = true;
+    }
+
+    public void sectionTitle3_()
+    {
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( "\\psectioniii{" + title + "}" );
+
+            title = null;
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Section Title 4
+    // ----------------------------------------------------------------------
+
+    public void sectionTitle4()
+    {
+        isTitle = true;
+    }
+
+    public void sectionTitle4_()
+    {
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( "\\psectioniv{" + title + "}" );
+
+            title = null;
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Section Title 5
+    // ----------------------------------------------------------------------
+
+    public void sectionTitle5()
+    {
+        isTitle = true;
+    }
+
+    public void sectionTitle5_()
+    {
+        isTitle = false;
+
+        if ( StringUtils.isNotEmpty( title ) )
+        {
+            markup( "\\psectionv{" + title + "}" );
+
+            title = null;
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public void list()
+    {
+        markup( "\\begin{plist}" + EOL + EOL );
+    }
+
+    public void list_()
+    {
+        markup( "\\end{plist}" + EOL + EOL );
+    }
+
+    public void listItem()
+    {
+        markup( "\\item{} " );
+    }
+
+    public void numberedList( int numbering )
+    {
+        ++numberedListNesting;
+
+        String counter;
+        switch ( numberedListNesting )
+        {
+            case 1:
+                counter = "enumi";
+                break;
+            case 2:
+                counter = "enumii";
+                break;
+            case 3:
+                counter = "enumiii";
+                break;
+            case 4:
+            default:
+                counter = "enumiv";
+        }
+
+        String style;
+        switch ( numbering )
+        {
+            case NUMBERING_UPPER_ALPHA:
+                style = "Alph";
+                break;
+            case NUMBERING_LOWER_ALPHA:
+                style = "alph";
+                break;
+            case NUMBERING_UPPER_ROMAN:
+                style = "Roman";
+                break;
+            case NUMBERING_LOWER_ROMAN:
+                style = "roman";
+                break;
+            case NUMBERING_DECIMAL:
+            default:
+                style = "arabic";
+        }
+
+        markup( "\\begin{pnumberedlist}" + EOL );
+        markup( "\\renewcommand{\\the" + counter + "}{\\" + style + "{" + counter + "}}" + EOL + EOL );
+    }
+
+    public void numberedList_()
+    {
+        markup( "\\end{pnumberedlist}" + EOL + EOL );
+        --numberedListNesting;
+    }
+
+    public void numberedListItem()
+    {
+        markup( "\\item{} " );
+    }
+
+    public void definitionList()
+    {
+        markup( "\\begin{pdefinitionlist}" + EOL + EOL );
+    }
+
+    public void definitionList_()
+    {
+        markup( "\\end{pdefinitionlist}" + EOL + EOL );
+    }
+
+    public void figure()
+    {
+        figureFlag = true;
+        markup( "\\begin{pfigure}" + EOL );
+    }
+
+    public void figure_()
+    {
+        markup( "\\end{pfigure}" + EOL + EOL );
+        figureFlag = false;
+    }
+
+    public void table()
+    {
+        tableFlag = true;
+        markup( "\\begin{ptable}" + EOL );
+    }
+
+    public void table_()
+    {
+        markup( "\\end{ptable}" + EOL + EOL );
+        tableFlag = false;
+    }
+
+    public void tableRows( int[] justification, boolean grid )
+
+    {
+        StringBuffer justif = new StringBuffer();
+        for ( int i = 0; i < justification.length; ++i )
+        {
+            if ( grid )
+            {
+                justif.append( '|' );
+            }
+            switch ( justification[i] )
+            {
+                case AptParser.JUSTIFY_CENTER:
+                    justif.append( 'c' );
+                    break;
+                case AptParser.JUSTIFY_LEFT:
+                    justif.append( 'l' );
+                    break;
+                case AptParser.JUSTIFY_RIGHT:
+                    justif.append( 'r' );
+                    break;
+            }
+        }
+        if ( grid )
+        {
+            justif.append( '|' );
+        }
+
+        markup( "\\begin{ptablerows}{" + justif.toString() + "}" + EOL );
+        if ( grid )
+        {
+            markup( "\\hline" + EOL );
+        }
+        gridFlag = grid;
+        cellJustif = justification;
+    }
+
+    public void tableRows_()
+    {
+        markup( "\\end{ptablerows}" + EOL );
+        gridFlag = false;
+        cellJustif = null;
+    }
+
+    public void tableRow()
+    {
+        cellCount = 0;
+    }
+
+    public void tableRow_()
+    {
+        markup( "\\\\" + EOL );
+        if ( gridFlag )
+        {
+            markup( "\\hline" + EOL );
+        }
+        cellCount = 0;
+    }
+
+    public void title()
+    {
+        if ( !fragmentDocument )
+        {
+            titleFlag = true;
+            markup( "\\ptitle{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    public void title_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
+    public void author()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "\\pauthor{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    public void author_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
+    public void date()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "\\pdate{" );
+        }
+        else
+        {
+            ignoreText = true;
+        }
+    }
+
+    public void date_()
+    {
+        if ( !fragmentDocument )
+        {
+            markup( "}" + EOL );
+        }
+        else
+        {
+            ignoreText = false;
+        }
+    }
+
+    public void sectionTitle_()
+    {
+        markup( "}" + EOL + EOL );
+    }
+
+    public void paragraph_()
+    {
+        markup( EOL + EOL );
+    }
+
+    public void verbatim( boolean boxed )
+    {
+        if ( boxed )
+        {
+            markup( "\\begin{pverbatimbox}" + EOL );
+        }
+        else
+        {
+            markup( "\\begin{pverbatim}" + EOL );
+        }
+        markup( "\\begin{verbatim}" + EOL );
+
+        verbatimFlag = true;
+        boxFlag = boxed;
+    }
+
+    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;
+    }
+
+    public void definedTerm()
+    {
+        markup( "\\item[\\mbox{" );
+    }
+
+    public void definedTerm_()
+    {
+        markup( "}] " );
+    }
+
+    public void figureCaption()
+    {
+        markup( "\\pfigurecaption{" );
+    }
+
+    public void figureCaption_()
+    {
+        markup( "}" + EOL );
+    }
+
+    public void tableCell()
+    {
+        if ( cellCount > 0 )
+        {
+            markup( " &" + EOL );
+        }
+
+        char justif;
+        switch ( cellJustif[cellCount] )
+        {
+            case AptParser.JUSTIFY_LEFT:
+                justif = 'l';
+                break;
+            case AptParser.JUSTIFY_RIGHT:
+                justif = 'r';
+                break;
+            case AptParser.JUSTIFY_CENTER:
+            default:
+                justif = 'c';
+                break;
+        }
+        markup( "\\begin{pcell}{" + justif + "}" );
+    }
+
+    public void tableCell_()
+    {
+        markup( "\\end{pcell}" );
+        ++cellCount;
+    }
+
+    public void tableCaption()
+    {
+        markup( "\\ptablecaption{" );
+    }
+
+    public void tableCaption_()
+    {
+        markup( "}" + EOL );
+    }
+
+    public void figureGraphics( String name )
+    {
+        markup( "\\pfiguregraphics{" + name + "}" + EOL );
+    }
+
+    public void horizontalRule()
+    {
+        markup( "\\phorizontalrule" + EOL + EOL );
+    }
+
+    public void pageBreak()
+    {
+        markup( "\\newpage" + EOL + EOL );
+    }
+
+    public void anchor( String name )
+    {
+        markup( "\\panchor{" );
+    }
+
+    public void anchor_()
+    {
+        markup( "}" );
+    }
+
+    public void link( String name )
+    {
+        markup( "\\plink{" );
+    }
+
+    public void link_()
+    {
+        markup( "}" );
+    }
+
+    public void italic()
+    {
+        markup( "\\pitalic{" );
+    }
+
+    public void italic_()
+    {
+        markup( "}" );
+    }
+
+    public void bold()
+    {
+        markup( "\\pbold{" );
+    }
+
+    public void bold_()
+    {
+        markup( "}" );
+    }
+
+    public void monospaced()
+    {
+        markup( "\\pmonospaced{" );
+    }
+
+    public void monospaced_()
+    {
+        markup( "}" );
+    }
+
+    public void lineBreak()
+    {
+        markup( ( figureFlag || tableFlag || titleFlag ) ? "\\\\" + EOL : "\\newline" + EOL );
+    }
+
+    public void nonBreakingSpace()
+    {
+        markup( "~" );
+    }
+
+    public void text( String text )
+    {
+        if ( ignoreText )
+        {
+            return;
+        }
+        if ( isTitle )
+        {
+            title = text;
+        }
+        else if ( verbatimFlag )
+        {
+            verbatimContent( text );
+        }
+        else
+        {
+            content( text );
+        }
+    }
+
+    // -----------------------------------------------------------------------
+
+    protected void markup( String text )
+    {
+        if ( text != null )
+        {
+            out.write( text, /*preserveSpace*/ true );
+        }
+    }
+
+    protected void content( String text )
+    {
+        out.write( escaped( text ), /*preserveSpace*/ false );
+    }
+
+    protected void verbatimContent( String text )
+    {
+        out.write( text, /*preserveSpace*/ true );
+    }
+
+    // -----------------------------------------------------------------------
+
+    protected static String escaped( String text )
+    {
+        int length = text.length();
+        StringBuffer buffer = new StringBuffer( length );
+
+        for ( int i = 0; i < length; ++i )
+        {
+            char c = text.charAt( i );
+            switch ( c )
+            {
+                case '-':
+                case '<':
+                case '>':
+                    buffer.append( "\\symbol{" ).append( (int) c ).append( "}" );
+                    break;
+                case '~':
+                    buffer.append( "\\textasciitilde " );
+                    break;
+                case '^':
+                    buffer.append( "\\textasciicircum " );
+                    break;
+                case '|':
+                    buffer.append( "\\textbar " );
+                    break;
+                case '\\':
+                    buffer.append( "\\textbackslash " );
+                    break;
+                case '$':
+                    buffer.append( "\\$" );
+                    break;
+                case '&':
+                    buffer.append( "\\&" );
+                    break;
+                case '%':
+                    buffer.append( "\\%" );
+                    break;
+                case '#':
+                    buffer.append( "\\#" );
+                    break;
+                case '{':
+                    buffer.append( "\\{" );
+                    break;
+                case '}':
+                    buffer.append( "\\}" );
+                    break;
+                case '_':
+                    buffer.append( "\\_" );
+                    break;
+                default:
+                    buffer.append( c );
+            }
+        }
+
+        return buffer.toString();
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public void flush()
+    {
+        out.flush();
+    }
+
+    public void close()
+    {
+        out.close();
+    }
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    public static InputStream getDefaultSinkCommands()
+        throws IOException
+    {
+        return LatexSink.class.getResource( "default_sink_commands.tex" ).openStream();
+    }
+
+    public static InputStream getDefaultPreamble()
+        throws IOException
+    {
+        return LatexSink.class.getResource( "default_preamble.tex" ).openStream();
+    }
+}

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/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/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex?view=auto&rev=519330
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_preamble.tex Sat Mar 17 07:46:28 2007
@@ -0,0 +1,13 @@
+\usepackage{a4wide}
+\usepackage{color}
+\usepackage{graphics}
+\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}

Added: maven/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/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex?view=auto&rev=519330
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-latex/src/main/resources/org/apache/maven/doxia/module/latex/default_sink_commands.tex Sat Mar 17 07:46:28 2007
@@ -0,0 +1,36 @@
+\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}}

Added: maven/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/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java?view=auto&rev=519330
==============================================================================
--- maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java (added)
+++ maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java Sat Mar 17 07:46:28 2007
@@ -0,0 +1,43 @@
+package org.apache.maven.doxia.module.latex;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.doxia.module.latex.LatexSink;
+import org.apache.maven.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.AbstractSinkTestCase;
+
+/**
+ * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
+ * @version $Id:LatexSinkTest.java 348605 2005-11-24 12:02:44 +1100 (Thu, 24 Nov 2005) brett $
+ */
+public class LatexSinkTest
+    extends AbstractSinkTestCase
+{
+    protected String outputExtension()
+    {
+        return "tex";
+    }
+
+    protected Sink createSink()
+        throws Exception
+    {
+        return new LatexSink( getTestWriter() );
+    }
+}

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/doxia/trunk/doxia-modules/doxia-module-latex/src/test/java/org/apache/maven/doxia/module/latex/LatexSinkTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"