I've had a hard time incorporating my C++ code into a document which was formatted using the AMS book template.

% Beginning of chapter.tex
%  This is a sample file for use with AMS-LaTeX.  It provides an example
%  of how to set up a file for a book to be typeset with AMS-LaTeX.
%  This is the driver file.  Separate chapters should be included at
%  the end of this file.
%  Follow the guidelines in the file chapter.template.


    frame=tb, % draw a frame at the top and bottom of the code block
    tabsize=4, % tab space width
    showstringspaces=false, % don't mark spaces in strings
    numbers=left, % display line numbers on the left
    commentstyle=\color{green}, % comment color
    keywordstyle=\color{blue}, % keyword color
    stringstyle=\color{red} % string color

%\includeonly{preface, chap1, array, biblio,index}





%    Absolute value notation


%    Blank box placeholder for figures (to avoid requiring any
%    particular graphics capabilities for printing this document).
%    Set fboxsep to 0 so that the actual size of the box will match the
%    given measurements more closely.

\title{My LaTeX Experiment}

%    Address of record for the research reported here
%\address{Department of Mathematics, Louisiana State University, Baton Rouge, Louisiana 70803}
%    Current address
%\curraddr{Department of Mathematics and Statistics, Case Western Reserve University, Cleveland, Ohio 43403}
%    \thanks will become a 1st page footnote.
%\thanks{The first author was supported in part by NSF Grant \#000000.}

%    Information for second author
%\author{Author Two}
%\address{Mathematical Research Section, School of Mathematical Sciences,
%Australian National University, Canberra ACT 2601, Australia}

\date{July 2, 1991}
\subjclass[2010]{Primary 54C40, 14E20;\\Secondary 46E25, 20C20}
\keywords{\texttt{amsbook}, AMS-\LaTeX}

This document is a sample prepared to illustrate the use of the
American Mathematical Society's \LaTeX{} document class
\texttt{amsbook} and publication-specific variants of that class.







It gave me the errors. Can any one share some working code with me?

Thank you very much for your time.

  • 2
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem.
    – jub0bs
    Jan 31, 2016 at 20:51
  • 3
    If I complete that example by adding \begin{document}\end{document} then it runs through latex without error, so any error you get is in code you haven't shown and gives an error message that you have not shown. That makes it hard to help. Jan 31, 2016 at 21:00
  • @Jubos. Thanks, I added the complete code of the driver file. The source files can be downloaded here ams.org/publications/authors/books/monopackages
    – Newbie
    Feb 1, 2016 at 1:33
  • @DavidCarlisle It gave me errors like "Overfull \hbox...". Any hints?
    – Newbie
    Feb 2, 2016 at 21:43
  • 4
    I'm voting to close this question as off-topic because the question was referred to ams tech-support, where failure to provide sufficient information made it impossible to answer May 8, 2016 at 18:48


Browse other questions tagged or ask your own question.