1、documentclassicmmcmusepackageurl % For formatting URLs and other web or% file references.usepackagemflogo % Provides the METAFONT logo; you% wont need it for your report.usepackagegraphicx % For importing graphics.usepackagenatbib% Sample ICM/MCM Contest Submission% Based on sample senior thesis doc
2、ument% Last modified by Jeremy Rouse% Summer 2000% and on the LaTeX Hints document% created by C.M. Connelly % Copyright 2002-2012% -% Local Command and Environment Definitions% If you have any local command or environment definitions, put them% here or in a separate style file that you load with us
3、epackage.% newtheorem declarationsnewtheoremTheo1TheoremnewtheoremTheo2TheoremsectionnewtheoremLemmaTheo2Lemma% Each of the above defines a new theorem environment.% Multiple theorems can be done in the same environment.% Theo2s number is defined by the subsection its in.% Theo3 uses the same number
4、ing counter and numbering system as% Theo2 (thats the meaning of Theo2).% You probably wont want any of the following commands, which are% here to allow various the names of commands, make examples typeset% properly, and so on. You can, of course, use them as examples for% your own user-defined comm
5、ands.newcommandbslashsymbol134%backslashnewcommandbsltextttbslashnewcommandcom1bsltexttt#1xspacenewcommandfile1texttt#1xspacenewcommandpdftexPDFtexnewcommandpdflatexPDFlatexnewcommandacronym1textsc#1xspacenewcommandkey1textsfemph#1xspacenewcommandclass1textsf#1xspacenewcommandpackage1textsf#1xspacen
6、ewcommandenv1texttt#1xspacenewcommandprog1texttt#1xspacenewcommandcommand1textttbsl#1xspacenewcommandctttextttcomp.text.texxspacenewcommandtexTeXxspacenewcommandlatexLaTeXxspace% Note that the xspace command comes from the xspace package. It% allows you type a command that inserts text without havin
7、g to% worry about how you end that command.% Without xspace, you would need to end a command with a backslash% followed by a space or with an empty set of braces if you followed% the command with a space. For example,% foo is a very important algorithm.% might produce% The foobarbaz algorithmis a ve
8、ry important algorithm.% whereas with the xspace command, the same code would produce% The foobarbaz algorithm is a very important algorithm.% If you need to butt a command that produces text against a letter% of some sort - say, to pluralize it - you need to tell TeX% where your command name ends s
9、o that it expands the correct% macro. So you might do% bars are very busy creatures.% TeX has an amazingly good hyphenation algorithm, but sometimes it% gets confused and needs some help.% For words that only occur once or twice, you can insert hints% directly into your text, as in% our data-base sy
10、stem is one of the most complex ever devised% For words that you use a lot, and that seem to keep ending up at% the end of a line, however, inserting the hints each time gets to% be a drag. You can use the hyphenation command to globally tell% TeX where to hyphenate words it cant figure out on its o
11、wn.hyphenationwhite-space% End Local Command and Environment Definitions% -% -% Title Blocktitlelatex Hints for ICM/MCM Contest Reports% Which contest are you taking part in? (Just one!)contestICM/MCM% The question you answered. (Again, just the one.)questionReport Sample% Your Contest Team Control
12、Numberteam21247% A normal document would specify the authors name (and possibly% their affiliation or other information) in an author command.% Because the ICM/MCM Contest rules specify that the names of the% team members, their advisor, and their institution should not% appear anywhere in the repor
13、t, do *not* define an author command.% Defining the date command is optional. If you leave it blank,% your document will include the date that the file is typeset, in% the form Month dd, yyyy.% date% End Title Block% -begindocument% -% SummarybeginsummaryThis document is meant to give you a quick in
14、troduction to TeX andLaTeX. It covers a lot of material, but still barely manages toscratch the surface. It should provide you with some inspirationand, I hope, with some useful code you can copy, modify, and use inyour report.You should use the fileblank-template.tex file as a basis foryour report
15、rather than this file. Be sure to change its name tosomething sensible (maybe your team control number), and to set thevalues of the comtitle, comquestion, and comteam commandsto appropriate values.Good luck!hfill- Claireendsummary% End Summary% -% -% Print Title Block, Contents, et al.maketitletabl
16、eofcontents% Uncomment the following lines if you have figures or tables in% your report:listoffigureslistoftables% End Print Title Block, Contents, et al.% -sectionIntroduction: What Is latex?%labelsec:introductionlatex is a tool that allows you to concentrate on your writing whiletaking advantage
17、of the tex typesetting system to producehigh-quality typeset documents.latexs benefits includebeginenumerateitem Standardized document classesitem Structural frameworks for organizing documentsitem Automatic numbering and cross-referencing of structural elementsitem Floating figures and tablesitem H
18、igh-level programming interface for accessing texstypesetting capabilitiesitem Access to latex extensions through loading packagesendenumeratesectionStructured Writing%labelsec:structured-writingLike HTML,footnoteHyperText Markup Language latex is a markuplanguage rather than a acronymWysiwygfootnot
19、eWhat You See IsWhat You Get. system. You write plain text files that use specialkeycommands and keyenvironments that govern the appearance andfunction of parts of your text in your final typeset document.subsectionDocument Classes%labelsec:document-classesThe general appearance of your document is
20、determined by your choiceof keydocument class. Document classes also load latex packagesto provide additional functionality.latex provides a number of basic classes, including classarticle,classletter, classreport, and classbook. There are also alarge number of other document classes available, incl
21、udingclassamsart and classamsbook, created by the AmericanMathematical Society and providing some additional mathematicallyuseful structures and commands; classfoils, classprosper, andclassseminar, which allow you to create slides forpresentations; the math departments classthesis class, forformatti
22、ng senior theses; and many journal- or company-specificclasses that format your document to match the house style of aparticular periodical or publisher.subsectionPackages%labelsec:packages%labelsec:ctanlatex packages, or keystyle files, define additional commands andenvironments, or change the way
23、that previously defined commands andenvironments work. By loading packages, you can change the fonts usedin your document, write your document in a non-English language with anon-acronymAscii font encoding, include graphics, format programlistings, add custom headers and footers to your document, an
24、d muchmore.A typical tex installation includes hundreds of style files, andhundreds more are available from the Comprehensive tex ArchiveNetwork (CTAN), at urlhttp:/www.ctan.org/.subsectionStructural Commands%labelsec:structural-commandsbegintablecenteringbegintabularlltopruleCommand optional comman
25、dusepackagecommands, which load in additional latex packages (seeSectionrefsec:packages); and other setup commands, such asuser-defined commands and environments, counter settings, and soforth.I generally also include the commands defining the title, author, anddate in my preambles, but other people
26、 include them just aftercommandbeginverb+document+, before the commandmaketitlecommand, which creates the title block of your document.subsubsectionMath Environments%labelsec:math-environmentsOne of the major hallmarks of tex is its ability to typesetmathematical equations.The two primary ways of do
27、ing so are with the use of keyinline andkeydisplay math environments. These environments are used sooften that there are shorthands provided for typing them. Inline mathenvironments, such as $a2 + b2 = c2$, can be typed asbeginquotebeginverbatimbeginmatha2 + b2 = c2endmathendverbatimendquoteorbeginq
28、uotebeginverbatim$a2 + b2 = c2$.endverbatimendquoteDisplay math environments set your equation apart from your runningtext. Theyre generally used for more complicated expressions, suchasf(x) = int left( fracx2 + x31 right)dxwhich can be typed asbeginquotebeginverbatimbegindisplaymathf(x) = int left(
29、 fracx2 + x31 right)dxenddisplaymathendverbatimendquoteorbeginquotebeginverbatimf(x) = int left( fracx2 + x31 right)dxendverbatimendquoteGenerally, youll want to use the verb+$+ %$ frac2alpha+1-12alpha , a geq frac3a2, where $alpha$ is the greatest power of 2 that divides $a$, $phi(a)$is the number
30、of integers less than $a$ and relatively primeto $a$, and $sigma(a)$ is the sum of the divisors of $a$ (including$1$ and $a$).Typeset a piecewise function using the envcases environment (fromthe packageamsmath package) as follows: |x| =begincasesx, -x, envalignat, which allows you to specify the spa
31、cing;and more. See citeamsmath-doc, citegratzer-mil, citelamport,or citekopka-daly-guide for more information about thealternatives.In Equationsrefeq:eqnarray-refeq:eqnarray-last, the $=$ signshave been aligned using the enveqnarray environment.begineqnarray3%labeleq:eqnarrayx4 + frac1x4 if at thebo
32、ttom, the caption will appear beneath its contents. Captions areusually set at the bottom of a float, but if a particular publisher orjournal prefers the captions on top, you can accommodate them.Captions should generally be written as brief, complete sentences,ending with a period. They should eith
33、er be capitalized as normalsentences or use headline capitaliztion-capitalized as you would thetitle of a document or a section. SobeginquoteProduction Statistics from Soviet Russia, 1977-1987.endquoteorbeginquoteProduction statistics from Soviet Russia, 1977-1987.endquoterather thanbeginquoteproduc
34、tion statistics from Soviet Russia, 1977-1987endquoteWhichever style you choose, be consistent!Avoid explaining the whole float in the caption. Do your explanationin the text that refers to the float.The comcaption command takes an optional argument, which is typedinside brackets (verb| |). This arg
35、ument is used in the list oftables or list of figures in place of your actual caption.subsubsectionFragile Commands and Moving Arguments%labelsec:fragile-commandsBoth arguments to the comcaption command are emphmovingarguments (because TeX can move them). Some commands areemphfragile, that is, they
36、produce output that can cause problemsif the typeset text is moved somewhere other than the place that TeXoriginally thought it would be typeset.To prevent fragile commands from being expanded too early andcausing problems, you can use the comprotect command just beforethe command you want to keep u
37、nexpanded.subsubsectionLabels%labelsec:labeling-floatsThe comlabel command for a float is generally typed immediatelyafter the comcaption command.subsectionFigureslabelsec:including-graphicsGraphic images are included in your document in a envfigureenvironment. The state-of-the-art method requires y
38、ou to load thepackagegraphics or packagegraphicx package. Both packagesprovide the same functionality, but take arguments in a slightlydifferent format.footnoteThe packagegraphicx package definescommands that take their arguments in key-value pairs, and isthe one that most people use; the packagegra
39、phics package isoften loaded by document classes to avoid forcing the key-valueargument form on people who dont want to use them. Moreinformation about the packagegraphics and packagegraphicxpackages is available in its manual, textttgrfguidecitecarlisle-grfguide, which is included in DVI, PostScrip
40、t, orPDF format with most TeX systems and accessible by typingtexttttexdoc grfguide at a shell prompt.Modern TeX systems use PDF as their default output format, andexpects that your included graphics will be in PDF format (forvector images) or PNG or JPEG format (for bitmaps). Note thatwhenever poss
41、ible you should try to save graphics in the vectorPDF format, because they can be rescaled to any size withoutlosing detail and can be rendered clearly both on screen and onpaper.emphEncapsulated PostScript or emphEPS is an older formatused by the old LaTeX to DVI to PostScript toolchain. EPS filesa
42、re special PostScript files that define their bounding box,may include a bitmap representation for use in previewers, and arerestricted from using some PostScript operators.EPS files are generally created with a vector graphics applicationsuch as Adobe Illustrator, Dia, OmniGraffle, or Visio. They c
43、an alsobe created from TeX files using the texttt-E flag withprogdvips or from TeX code using an application such asLaTeXiT.With the development of PDFTeX, which is now the default TeXengine, generating Portable Document Format files has become mucheasier. PDFTeX requires that your graphics are also
44、 PDF files(or PNGs, if theyre bitmaps). SeeSectionrefsec:pdftex-graphics for some hints.Both formats use the same command, however: comincludegraphics.The following code produces the graphic inFigurereffig:a-graphic:beginverbatimbeginfigurebegincenterscalebox.50includegraphicsshapesendcentercaptionS
45、ome shapesSome shapes.%labelfig:a-graphicendfigureendverbatimbeginfigurebegincenterscalebox.50includegraphicsshapesendcentercaptionSome shapesSome shapes.%labelfig:a-graphicendfigureNotice that we didnt specify the extension in the filenameargument to the comincludegraphics command. By dropping theextension, we can typeset this document with PDFLaTeX or withthe older toolchain (provided that we have graphics in theappropriate formats) by changing the commands that we run. Thecomincludegraphics package searches for the graphic formatssupported by the particular engine you