Differences between revisions 6 and 38 (spanning 32 versions)
Revision 6 as of 2008-10-27 16:25:10
Size: 1875
Editor: Anderson-Camtasia
Comment:
Revision 38 as of 2013-11-21 16:53:59
Size: 9488
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Using LaTeX on this site =

There are two ways to use LaTeX. Inline: {{{<<latex(\LaTeX)>>}}} which produces: <<latex(\LaTeX)>>

{{{#!latex
Or for extended paragraphs see the code that produced this \LaTeX
\begin{equation}
    e=mc^2
\end{equation}
}}}

For more examples see LatexPreamble and LatexArticle
## page was renamed from UsingLatex
<<TableOfContents>>

= Writing Technical Papers (in LaTeX) =

This section draws heavily from work at my Alma Mater ([[http://cse.unl.edu/~goddard/WritingResources/|UNL]] - specifically Dr. Godddard's Writing Resources site)

== Standard Technical Paper Templates ==

The standard outline presented here, in different forms, is a tool to assist you in writing technical papers (especially in computer science). It is relevant for a wide range of, but not every, type of technical paper. It is certainly appropriate for Master's and Ph.D. theses, for conference and journal papers, and for technical reports. It is also appropriate for proposals, although the speculative nature of a project or thesis proposal requires some adaptation of the form. It is less appropriate for user documentation, but still explicitly represents a number of important issues that must be handled when writing product manuals. These outlines were first created by [[niehaus@eecs.ukans.edu|Douglas Niehaus ]], then modified by [[goddard@cse.unl.edu>|Steve Goddard]] and finally reproduced and edited here by [[scot@southern.edu|Scot Anderson]].

'''Under no circumstances shall you turn in a paper that contains any content from the template. This includes bold questions within the paragraphs''' (this does not apply to section names). Any repreductions of content constitutes plagerism and carries standard consequences from the syllabus.

LaTeX template:
 
   * [[attachment:generic-template.tex|Source]]
   * [[attachment:generic-template.pdf|PDF]]
   * [[attachment:my.bib]]
   * My own [[attachment:Grading_Rubric.pdf|grading rubric]] for project papers (No longer used, but still a good guideline) See: [[http://dra.cs.southern.edu/compwiki/SupplementaryLatexRubric?action=AttachFile&do=view&target=LaTeX+Paper+Dr.+A+Supplementary+Rubric.pdf|LaTeX Supplementary Rubric]]

This simple LatexTemplate, with no content, works specifically with Winedt's gather function.

== LaTeX Tools ==

  * [[http://www.tug.org/texworks/|TeXworks]] - popular, free! Often comes with [[http://miktex.org/|MikTeX]]
  * [[http://www.xm1math.net/texmaker/|Texmaker]] - popular free! Has spell checking integrated.
  * [[http://www.winedt.com/|WinEdt]] - popular shareware! My personal choice.

== Writing Rules ==

Technical writing for sciences varies significantly from what you typically produce in English classes. When you write a technical report for Dr. Anderson, you must use the LaTeX template above and assiduously follow DrAndersonsRulesForWritingPapers.

== Reviewing Technical Papers ==

Many students do not know how to review a technical paper. It is important to learn for (at least) two reasons. First, you may be asked to review a confernce or journal paper. Second, you should always know your audience. Knowing what reviewers are looking for makes it easier to write a paper that they will understand (and like).

  * Prof. John Ousterhout (Berkeley) has a writeup on [[http://www.cs.berkeley.edu/~fox/paper_writing.html#rev|reviewing papers]] (available through Prof. Fox's page).

Line 16: Line 43:
Looking for a template: LatexTemplate

I use wmf2eps which is an excellent program. Here are a few issues to keep in mind:

   1. W
hen using \psfrag, always make sure your excel, visio, ... files use ONE letter substitutions. If you use more than one letter, MS products put them in as individual letters instead of strings (which is what psfrag is looking for).
[[http://ctan.mirrors.hoobly.com/info/svg-inkscape/InkscapePDFLaTeX.pdf|Include inkscape drawings in LaTeX]] is a howto for inkscape - a great option.

If you are using eps files instead of .png/.jpg files (rare now), you may want to use wmf2eps to convert files to eps format. This is especially useful if you are using \psfrag to alter picture text. One issue to keep in mind when using \psfrag, always make sure your excel, visio, ... files use ONE letter substitutions. If you use more than one letter, MS products put them in as individual letters instead of strings (which is what psfrag is looking for).

= Example Constructs for LaTeX =
Line 29: Line 56:
{{{ {{{#!latex
Line 45: Line 72:
          \> \> \> \> $M[i,j] := max(M[i,j],M[i,k]+M[k,j])$ \\           \> \> \> \> $M[i,j] := \max(M[i,j],M[i,k]+M[k,j])$ \\
Line 64: Line 91:

I usually place the text below before the \begin{document} element which allows me to use \progstart and \progend around a tabbing environment:

{{{
%defines the datalog operator :- with correct spacing etc.
\def\lfp{\mathop{\hbox{\it lfp}} }
\def\impl{\mathrel{\hbox{~~:---~~}} }

%defines the program code minipage environment that I used with rules top and bottom
%NOTE: you will need to change the lift value for the \rule command. This is set for 1.5 spacing.
% single spacing: 6pt/6pt and doublespacing: 0pt and 12 point (I believe)
%NOTE: If you use a \tabbing environment immediately after \progstart, (follow progstart by) put \vspace{-18pt}
\def\progstart{\begin{center}\begin{minipage}{0.98\textwidth}\tt\small\noindent\rule[0pt]{\textwidth}{0.4pt} \\}
\def\progend{\rm\rule[6pt]{\textwidth}{0.4pt} \\ \end{minipage}\end{center}}
}}}

'''Relational Algebra symbols'''

{{{
\def\ojoin{\setbox0=\hbox{$\bowtie$}%
  \rule[-.02ex]{.25em}{.4pt}\llap{\rule[\ht0]{.25em}{.4pt}} }
\def\leftouterjoin{\mathbin{\ojoin\mkern-5.8mu\bowtie}}
\def\rightouterjoin{\mathbin{\bowtie\mkern-5.8mu\ojoin}}
\def\fullouterjoin{\mathbin{\ojoin\mkern-5.8mu\bowtie\mkern-5.8mu\ojoin}}

\begin{document}
\[A\leftouterjoin B\]
\[A\rightouterjoin B\]
\[A\fullouterjoin B\]
\end{document}
}}}

== HOW TO FORMAT PSEUDO CODE ==
Make sure you:

 1. specify the input and output parameters
 1. declare and initialize all the variables used.
 1. do not declare or initialize variables you do *not* use.
 1. '''When typesetting, write the name of...'''
    a. functions and procedures in small caps font {\sc Function-Name}
    a. data structures in emphasized font {\em data-structure-name}
    a. constants in courier font {\tt Constant-Name}
 1. For making an assignment, use the form <<latex($a \leftarrow b$)>>
 1. For making a test, use the form <<latex($a = b$)>>
 1. For control constructs, limit yourself to the minimum: while, repeat, for, etc.. Do not use when, unless (they are Lisp'y and not conventional).
 1. Use an algorithm style package, avoid formatting yourself.
 1. Make sure you provide a worst-case complexity estimate in the text.

== HOW TO FORMAT CHARTS ==
 * The labels of the axes of a chart should be centered (vertically and horizontally) and in bold face.
 * Do not use different colors to draw data in charts, but use different line/rectangle patterns. Make sure they print well on black and grey and are clearly distinguishable.
 * Make sure lines are thick enough and do not fade too easily with repeated photocopying of the document.

== HOW TO INCLUDE FIGURES ==
Use the following figure template for one figure:

{{{
\begin{figure}[tbf]
  \centering
  \includegraphics[bb=2.25in 5.2in 6.9in 9.6in,page=1,width=.75\textwidth]{figs/BibleBeliefsDatabaseDiagram.pdf}\\
  \caption{Bible Beliefs Database Diagram}\label{fig:DBDiagram}
\end{figure}
}}}
Use the following template for two or more figures WITH DIFFERENT CAPTIONS:

{{{
  \begin{figure}[ht]
  \begin{minipage}[t]{.45\textwidth}
  \centerline{\psfig{file=<file-directory/file-name>.eps,height=xcm}}
  \caption{\small Some text.}
  \label{fig:xx}
  \end{minipage}
  \hfil
  \begin{minipage}[t]{.45\textwidth}
  \centerline{\psfig{file=<file-directory/file-name>.eps,height=xcm}}
  \caption{\small Some text.}
  \label{fig:xx}
  \end{minipage}
  \end{figure}
}}}
Use the following template for two or more figures WITH THE SAME CAPTION:

{{{
  \begin{figure}[ht]
  \begin{center}
  \begin{tabular}{ccc}
  \psfig{file=<file-directory/file1>.eps,height=5cm} &
  \psfig{file=<file-directory/file2>.eps,height=5cm} &
  \psfig{file=<file-directory/file3>.eps,height=5cm} &
  \end{tabular}
  \end{center}
  \caption{\small Left: xxx. Center: xxx. Right: xxx.}
  \label{fig:xx}
  \end{figure}
}}}
== HOW TO INCLUDE TABLES ==
Use the following figure template for one table:

{{{
  \begin{table}[ht]
  \begin{center}
  \caption{\small Some text.}
  \label{tab:xx}

  \begin{tabular}{ccccccc}\hline
  ......
  \end{tabular}

  \end{center}
  \end{table}
}}}

= Using LaTeX on this site =

There are two ways to use LaTeX. Inline: {{{<<latex(\LaTeX)>>}}} which produces: <<latex(\LaTeX)>>

{{{#!latex
Or for extended paragraphs see the code that produced this \LaTeX
\begin{equation}
    E=mc^2
\end{equation}
}}}

For more examples on including LaTeX in this wiki see LatexPreamble and LatexArticle

Writing Technical Papers (in LaTeX)

This section draws heavily from work at my Alma Mater (UNL - specifically Dr. Godddard's Writing Resources site)

Standard Technical Paper Templates

The standard outline presented here, in different forms, is a tool to assist you in writing technical papers (especially in computer science). It is relevant for a wide range of, but not every, type of technical paper. It is certainly appropriate for Master's and Ph.D. theses, for conference and journal papers, and for technical reports. It is also appropriate for proposals, although the speculative nature of a project or thesis proposal requires some adaptation of the form. It is less appropriate for user documentation, but still explicitly represents a number of important issues that must be handled when writing product manuals. These outlines were first created by Douglas Niehaus, then modified by Steve Goddard and finally reproduced and edited here by Scot Anderson.

Under no circumstances shall you turn in a paper that contains any content from the template. This includes bold questions within the paragraphs (this does not apply to section names). Any repreductions of content constitutes plagerism and carries standard consequences from the syllabus.

LaTeX template:

This simple LatexTemplate, with no content, works specifically with Winedt's gather function.

LaTeX Tools

  • TeXworks - popular, free! Often comes with MikTeX

  • Texmaker - popular free! Has spell checking integrated.

  • WinEdt - popular shareware! My personal choice.

Writing Rules

Technical writing for sciences varies significantly from what you typically produce in English classes. When you write a technical report for Dr. Anderson, you must use the LaTeX template above and assiduously follow DrAndersonsRulesForWritingPapers.

Reviewing Technical Papers

Many students do not know how to review a technical paper. It is important to learn for (at least) two reasons. First, you may be asked to review a confernce or journal paper. Second, you should always know your audience. Knowing what reviewers are looking for makes it easier to write a paper that they will understand (and like).

  • Prof. John Ousterhout (Berkeley) has a writeup on reviewing papers (available through Prof. Fox's page).

Using LaTeX Tips and Tricks

Include inkscape drawings in LaTeX is a howto for inkscape - a great option.

If you are using eps files instead of .png/.jpg files (rare now), you may want to use wmf2eps to convert files to eps format. This is especially useful if you are using \psfrag to alter picture text. One issue to keep in mind when using \psfrag, always make sure your excel, visio, ... files use ONE letter substitutions. If you use more than one letter, MS products put them in as individual letters instead of strings (which is what psfrag is looking for).

Example Constructs for LaTeX

Algorithm Template

Don't forget that

  • \= sets a tab
  • \> uses it

  • \\ ends a line (every line!)

\noindent
\begin{minipage}{4.4in}
\tt
\noindent
\hrulefill
\begin{tabbing}
{\bf  Sat(M,n)} \\
{\bf input:} Matrix $M$ representing a gap-graph over $n+1$ vertices.\\ 
{\bf output:} True or False depending on whether $M$ is satisfiable. \\ 
\\ m := 0 \\ 
{\bf repeat} \= \\
          \> m := m + 1 \\
          \> {\bf for} \= i := 0 to n {\bf do} \\
          \>           \> {\bf for} \= j := 0 to n {\bf do} \\
          \>           \>           \> {\bf for} \= k := 0 to n {\bf do} \\
          \>           \>           \>           \> $M[i,j] := \max(M[i,j],M[i,k]+M[k,j])$ \\
          \>           \>           \> {\bf end-for} \\
          \>           \> {\bf end-for} \\
          \> {\bf end-for} \\
{\bf until}  $m = \log(n+1)$ \\
\\
Flag := True \\
\\
{\bf for} \= i := 0 to n {\bf do} \\
          \> {\bf if} \= $M[i,i] > 0$ {\bf then} \\
          \>          \> Flag := False \\
{\bf end-for} \\
\\
{\bf return}(Flag)
\end{tabbing}
\hrulefill\\
\rm
\end{minipage}

I usually place the text below before the \begin{document} element which allows me to use \progstart and \progend around a tabbing environment:

%defines the datalog operator :- with correct spacing etc.
\def\lfp{\mathop{\hbox{\it lfp}} }
\def\impl{\mathrel{\hbox{~~:---~~}} }

%defines the program code minipage environment that I used with rules top and bottom
%NOTE: you will need to change the lift value for the \rule command. This is set for 1.5 spacing.
%      single spacing: 6pt/6pt and doublespacing: 0pt and 12 point (I believe)
%NOTE: If you use a \tabbing environment immediately after \progstart, (follow progstart by) put \vspace{-18pt}
\def\progstart{\begin{center}\begin{minipage}{0.98\textwidth}\tt\small\noindent\rule[0pt]{\textwidth}{0.4pt} \\}
\def\progend{\rm\rule[6pt]{\textwidth}{0.4pt} \\ \end{minipage}\end{center}}

Relational Algebra symbols

\def\ojoin{\setbox0=\hbox{$\bowtie$}%
  \rule[-.02ex]{.25em}{.4pt}\llap{\rule[\ht0]{.25em}{.4pt}} }
\def\leftouterjoin{\mathbin{\ojoin\mkern-5.8mu\bowtie}}
\def\rightouterjoin{\mathbin{\bowtie\mkern-5.8mu\ojoin}}
\def\fullouterjoin{\mathbin{\ojoin\mkern-5.8mu\bowtie\mkern-5.8mu\ojoin}}

\begin{document}
\[A\leftouterjoin B\]
\[A\rightouterjoin B\]
\[A\fullouterjoin B\]
\end{document}

HOW TO FORMAT PSEUDO CODE

Make sure you:

  1. specify the input and output parameters
  2. declare and initialize all the variables used.
  3. do not declare or initialize variables you do *not* use.
  4. When typesetting, write the name of...

    1. functions and procedures in small caps font {\sc Function-Name}
    2. data structures in emphasized font {\em data-structure-name}
    3. constants in courier font {\tt Constant-Name}
  5. For making an assignment, use the form <<latex($a \leftarrow b$)>>

  6. For making a test, use the form <<latex($a = b$)>>

  7. For control constructs, limit yourself to the minimum: while, repeat, for, etc.. Do not use when, unless (they are Lisp'y and not conventional).
  8. Use an algorithm style package, avoid formatting yourself.
  9. Make sure you provide a worst-case complexity estimate in the text.

HOW TO FORMAT CHARTS

  • The labels of the axes of a chart should be centered (vertically and horizontally) and in bold face.
  • Do not use different colors to draw data in charts, but use different line/rectangle patterns. Make sure they print well on black and grey and are clearly distinguishable.
  • Make sure lines are thick enough and do not fade too easily with repeated photocopying of the document.

HOW TO INCLUDE FIGURES

Use the following figure template for one figure:

\begin{figure}[tbf]
  \centering
  \includegraphics[bb=2.25in 5.2in 6.9in 9.6in,page=1,width=.75\textwidth]{figs/BibleBeliefsDatabaseDiagram.pdf}\\
  \caption{Bible Beliefs Database Diagram}\label{fig:DBDiagram}
\end{figure}

Use the following template for two or more figures WITH DIFFERENT CAPTIONS:

  \begin{figure}[ht]
  \begin{minipage}[t]{.45\textwidth}
  \centerline{\psfig{file=<file-directory/file-name>.eps,height=xcm}}
  \caption{\small Some text.}
  \label{fig:xx}
  \end{minipage}
  \hfil
  \begin{minipage}[t]{.45\textwidth}
  \centerline{\psfig{file=<file-directory/file-name>.eps,height=xcm}}
  \caption{\small Some text.}
  \label{fig:xx}
  \end{minipage}
  \end{figure}

Use the following template for two or more figures WITH THE SAME CAPTION:

  \begin{figure}[ht]
  \begin{center}
  \begin{tabular}{ccc}
  \psfig{file=<file-directory/file1>.eps,height=5cm} &
  \psfig{file=<file-directory/file2>.eps,height=5cm} &
  \psfig{file=<file-directory/file3>.eps,height=5cm} &
  \end{tabular}
  \end{center}
  \caption{\small Left: xxx. Center: xxx. Right: xxx.}
  \label{fig:xx}
  \end{figure}

HOW TO INCLUDE TABLES

Use the following figure template for one table:

  \begin{table}[ht]
  \begin{center}
  \caption{\small Some text.}
  \label{tab:xx}

  \begin{tabular}{ccccccc}\hline
  ......
  \end{tabular}

  \end{center}
  \end{table}

Using LaTeX on this site

There are two ways to use LaTeX. Inline: <<latex(\LaTeX)>> which produces: <<latex(\LaTeX)>>

Or for extended paragraphs see the code that produced this \LaTeX 
\begin{equation}
    E=mc^2
\end{equation}

For more examples on including LaTeX in this wiki see LatexPreamble and LatexArticle

WritingTechnicalPapersInLaTeX (last edited 2024-06-12 16:17:29 by scot)