Hot answers tagged

123

As Schweinebacke has noted, there are two kind of differences: a) differences in availability of commands and environments b) differences in the default settings. Only the latter may be changed easily using options and commands. Differences with regard to available commands and environments: book and report feature the \chapter sectioning command, while ...


68

If you used scrartcl instead of article, the command \subtitle would immediately work as expected. scrartcl belongs to the KOMA-Script classes which are extended replacements of the LaTeX standard classes. I strongly recommend KOMA-Script. For reasons have a look at: Most useful additions in KOMA-Script Your document is considerably large. An ...


49

To supplement Stefan's answer, the core LaTeX article class does not have a \subtitle macro. You can therefore either do something like \title{Title \\ Subtitle} or consider the titlepage environment. Other document classes, notably KOMA-Script, do have a separate \subtitle macro available.


34

If you make a LaTeX document without using many packages and without altering other defaults, then the style of the document is largely determined by two factors: the default font designed by Donald Knuth, and the default layout of the standard document classes designed by Leslie Lamport. The Font The default font is Computer Modern, designed by Donald ...


31

The minimal class has already empty page style, so no page number is printed. There's no page number needed for a standalone graphic. minimal doesn't define macros. There's less than in article which could disturb. However, usually I would use minimal just for testing or for showing a minimal working example. Though for just displaying a graphic it might ...


27

The article class recognises the titlepage option, which forces the \maketitle command to create a separate page. \documentclass[titlepage]{article} \author{A.\,N.~Other} \title{Some things I did} \begin{document} \maketitle Some text \end{document}


25

The listings package allows you to change the margins (see section 4.10 of the documentation.) \lstset{numbers=right, numberstyle=\tiny, breaklines=true, backgroundcolor=\color{light-gray}, numbersep=5pt, xleftmargin=.25in, xrightmargin=.25in} Adjust as ...


20

As @Marco mentioned in his comment, "every documentclass" provides the titlepage environment - you won't find it as part of latex.ltx. However, it is probably best to view these macros and environments as they are defined in the class files: article.cls, book.cls and report.cls. However, some discussion may also be warranted. When looking at the titlepage ...


19

that is all, what minimal defines: \renewcommand\normalsize{\fontsize{10pt}{12pt}\selectfont} \setlength{\textwidth}{6.5in} \setlength{\textheight}{8in} \pagenumbering{arabic} % but no page numbers are printed because: \pagestyle{empty} % this is actually already in the kernel


17

There is not much choice: There is no place for (DPPH) on the first line. If (DPPH) is put on the second line, the inter word spaces are too much for a pleasant result. In this case, package microtype helps (pdfTeX), because it adds more flexibility by allowing the letters to shrink or stretch a little. This helps to reduce the large inter word spaces in ...


17

Maybe with the spy library: \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning,arrows,spy} \tikzstyle{arr} = [draw, -latex'] \begin{document} \begin{frame} % premier transparent \frametitle{Figure (1)} \scalebox{.3}{ \begin{tikzpicture}[spy using outlines={circle, magnification=3, size=20cm, connect spies}] \node ...


16

In LaTeX there is no unique style -- we've got collection of macros based on the LaTeX core (which itself uses the primitives of TeX, originally developed by D.E. Knuth in the late 70s/early 80s -- Mr. Knuth also provided the cm fonts) About 1985 Leslie Lamport developed LaTeX as macro package based on the not very easy usage of Knuth's TeX language (My ...


16

I believe the titling package does what you want. From documentation: The package inhibits the normal automatic cancellation of titling commands after \maketitle. This means that you can have multiple instances of the same, or perhaps different, titles in one document. Hooks are provided so that additional titling elements can be defined ...


16

If you are loading the package natbib, then \renewcommand{\bibsection}{} after \usepackage[<options>]{natbib} will get rid of the section automatically provided (and also of the blank space you'd get by only redefining \refname or \bibname).


15

You could split every report into two files: a main file holding only the preamble and an \input as document body, and a second file holding all the actual content. Then you are able to \input or \include all the content files in another main file for the book. % Main file of one report, e.g. `report01.tex` \documentclass{report} \title{...} ...


13

Using the minimal class instead of article introduces errors and does not remove them. There is nothing in article which can add to your problems. However there are many things missing in minimal which packages and the user normally awaits! I once used it for a table related MWS (minimum working solution :-) ) which first didn't worked. It took me 15 minutes ...


13

This is a bit of a non-answer, but the underlying point may be useful. As far as I am able, I don't choose a class to use. The majority of my documents are articles intended for publication in a journal. When I start writing the article, I don't usually have a particular journal in mind. But when I submit the article, I often find that the journal I do ...


13

Here's a solution using the appendix package (adding the title package option) and a redefinition of \thetable and \thefigure: \documentclass{article} \usepackage[titletoc,toc,title]{appendix} \begin{document} \tableofcontents \section{Dolor sit amet} Have a look at \ref{app:foobar} \begin{appendices} \renewcommand\thetable{\thesection\arabic{table}} ...


13

It is certainly easier to apply such global changes in LaTeX than in Word as LaTeX is really designed for that use. However as in Word the ease of applying global style changes depends greatly on the use of suitable commands within the document. If you change \documentclass{article} to \documentclass{some-journal-class} then the definition of (for ...


13

Here is MWE using the background and the eso-pic package: \documentclass[dvipsnames,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[object=vectorian]{pgfornament} \usepackage{lipsum} % Comment below if you are using the eso-pic version %-------------------------------------------------------------------- ...


12

Your TeX distribution probably has a default paper size setting that is not A4. Unfortunately, specifying paper size as an option to the document class won't always override this default. Specifically, dvips won't know about the option, and the equivalent part of pdfTeX won't know about it either (the standard document classes predate pdfTeX). The simplest ...


12

This would be automatic in book class \frontmatter \tableofcontents \mainmatter ... In other classes you could just borrow the definitions from book.cls \makeatletter \newif\if@mainmatter \@mainmattertrue \newcommand\frontmatter{% \cleardoublepage \@mainmatterfalse \pagenumbering{roman}} \newcommand\mainmatter{% \cleardoublepage ...


12

I took Gonzalo Medina's second solution in his answer to "Inspirational" quote at start of chapter and changed the following: Instead of using the memoir class, the epigraph package (from memoirs author) is loaded; \epigraphfontsize is replaced with \epigraphsize; The etoolbox package is used to patch the internal \@epitext command so that ...


12

You can do this using the xleftmargin option of listings. See the manual page 33, section 4.10 "Margins and line shapes". Example: \documentclass{article} \usepackage{lipsum} \usepackage{color} \definecolor{light-gray}{gray}{0.95} \usepackage{listings} \lstset{numbers=right, numberstyle=\tiny, breaklines=true, ...


11

The titlesec package or secsty might have the resources you need. If it's a longer project, look at the memoir document class, which has more options, but will involve more work to conform to university guidelines. Here's a very quick sectsty version of what you want. \usepackage{sectsty} \sectionfont{% \sectionrule{2ex}{1pt}{-1ex}{1pt}% } And to do ...


11

If you make the first page using \maketitle this may execute \thispagestyle{plain}. You may either redefine page style plain (see the fancyhdr manual for this), or simply add \thispagestyle{fancy} after \maketitle: \documentclass{article} \usepackage{fancyhdr,lastpage} \pagestyle{fancy} \cfoot{Page \thepage{} of \pageref{LastPage}} \begin{document} ...


10

Use the titlepage class option. \documentclass[titlepage]{article} \usepackage{lipsum} \begin{document} \title{(title)} \author{(author)} \maketitle \begin{abstract} \lipsum[1] \end{abstract} \lipsum[1] \end{document}


10

You can cure both problems, that is, the page number on the title page and the message from hyperref by saying \begin{titlepage} \maketitle \thispagestyle{empty} \setcounter{page}{0} \end{titlepage} The page number will be set to one by \end{titlepage} for the following page. The problems are: \maketitle issues a \thispagestyle{plain} instruction, that ...


10

graphicx (and some other packages like hyperref and geometry) actually corrects a problem. Without it it can happen that the pdf size shown by the pdf viewer is not equal to the internal \paperwidth and \paperheight. graphicx sets \pdfpagewidth and \pdfpageheight to avoid this problem. If you are getting the wrong page size, make sure that the option of the ...


10

Let me guess: After the switch from article to report, your \subsection is still unnumbered, but your \section suddenly shows up as "0.x A section" (which resembles the look of \subsection in article)? That is because the report class (and the book class) feature the additional sectioning level \chapter, which becomes the new top level. ...



Only top voted, non community-wiki answers of a minimum length are eligible