I'm trying to get to grips with writing algorithms.
I've managed to write a file that compiles but want to transform it into a file to be included in another project.
What happens: if I use just one file all goes well if I put the same code in another file and input it I get
Code: Select all
(/usr/local/texlive/2009/texmf-dist/tex/latex/base/omscmr.fd) (./algoritmos.tex
! LaTeX Error: Can be used only in preamble.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 \documentclass
[a4paper,portuges]{book}
I attach a version of the code. If you comment and uncomment the input line you'll se what I mean.