Code Listings for Latex

I wrote an article a few days back about writing a research paper. That became too long and I had to cut it short. However, it turns out that in as much as it had plenty of advice, many of the things were missed. One of those things is about various kinds of codes for Latex. Here I am posting code listings for various kinds of functions in Latex.

The pseudo-code for NUAV is shown in Algorithm~\ref{alg:algo-1}.
\caption{NUAV testbed}
\STATE $NET \gets nnsetup(architecture)$
\STATE $numweights \gets nnnumweights(NET)$
\STATE $Population \gets initPop$
\STATE $NET \gets nnassignweights(NET, offspringPop(i))$
\STATE $inputData \gets getFlightData$
\STATE $outputData \gets FeedForward(inputData)$
\STATE $sendFlightData(outputData)$
\STATE $Individual(i) \gets evaluateInd()$
\STATE $parents \gets tournamentSelection$
\STATE $childPop \gets geneticOperators(parents)$
\STATE $NET \gets nnassignweights(NET, childPop(j))$
\STATE $inputData \gets getFlightData$
\STATE $outputData \gets FeedForward(inputData)$
\STATE $sendFlightData(outputData)$
\STATE $Individual(i) \gets evaluateInd()$
\STATE $Population \gets replacement(parentPop, childPop)$

You can create tables using the tabular environment. Never create a table in a different software and then save it as a figure of some sort. Always create tables using the standard fashion prescribed for latex. Here is an example snippet.

\begin{tabular}{ c c c }
cell1 & cell2 & cell3 \
cell4 & cell5 & cell6 \
cell7 & cell8 & cell9

Here is a complete tutorial for this.

Tables – ShareLaTeX, Online LaTeX Editor

A comprehensive LaTeX guide with easy to understand examples and how-tos.


Photo by martingreffe

If you found an error, highlight it and press Shift + Enter or click here to inform us.

CC BY-NC-ND 4.0 Code Listings for Latex by Psyops Prime is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Leave a Reply