sorry if the title is badly worded but I wasn't sure how to word it.  My question is this: I have a lot of things before  \begin{document} in my latex file, maybe like 180 lines of setting up commands and use packages.  I was wondering if I could put all the code above the line \begin{document} into a package and import that in so I can save lines.  Thanks
58098
Since I am using (almost) the same set up for my tex documents, I wonder if there is a way to create a preamble with my default packages and to recall it anytime I want to create a tex document.  If yes, how I can call this "default" preamble?  Thanks in advance
94821
I have been using LaTeX for standard things like letters and scientific reports. I recently came to visit my grandmother who writes some poetry and told her I could make a nice pdf from her handwritten verses -- which I start to regret :P... I used the package verse and it is going all right, but in some specific poems, she wants a very 'exotic'  kind of positioning. She wants some lines to start exactly where the former line finishes like in this example:    Do you know how I could, for instance, write a magic command \magicom{} that would generate the text above when used like:  This is some\\ \magicom{}text I would\\ like to\\ \magicom{}format\\ How can I do this with\\ \magicom{}LaTeX?
116807
I have quite a bad habit of copy-and-pasting my packages from one LaTeX document to another. Is there any way we can detect unused packages (i.e. \usepackage commands) so that they can be removed from the LaTeX document?
59293
I'm not very good at LaTeX but I've been using it to write my dissertation. Have just come to the end and trying to format everything correctly. Whenever I try to put my Abstract paragraph into the form \begin{abstract} (writing here) \end{abstract} and click play the whole abstract section just disappears. What am I doing wrong?  \documentclass[12pt]{amsart}  \begin{document}  \begin{abstract} (my abstract here) \end{abstract} \end{document}
46666
Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory.  I want to input all files from within my main LaTeX document. Actually I can create a list of those files using C# in advance.  To enrich my view about LaTeX or TeX, could you tell me whether or not this job can be done only by using pure TeX or LaTeX?
123559
I like my code to look like this:  \documentclass{article} \begin{document}  \begin{enumerate}   \item test text    \begin{enumerate}     \item 1     \item 2     \item 3     \item 4     \item 5   \end{enumerate} \end{enumerate}  \end{document}   For the sake of readability I like to put a blank line before a new environment starts. In the particular case I'm considering, the blank line adds some vertical space between the item from the first level enumerate and the first item from the second level enumerate.  So my question is: is there a best practice to format code related to blank lines before environments start? Should I avoid it? Should I comment out the blank line?  Clarification:  I'm talking about the vertical space between "test text" and "1". But, I'm not asking for a way to remove the extra space added by the blank like, I already know how to do that. My reasoning is the following:  Since adding a blank like before a new enumerate adds vertical space, it means that that blank line is meaningful for TeX. Since it is meaningful for TeX, is it OK to use it for the mere purpose of formatting code or should I avoid it?
17276
\documentclass[]{phstyle} \usepackage{latexsym,amsfonts,amssymb, undertilde} \usepackage[fleqn]{amsmath} \usepackage{makeidx}  %Preamble  \numberwithin{equation}{chapter} %\renewcommand{\theequation}{\thesection.\arabic{equation}}  \begin{document}  %\include{chapI}   these 2 lines are because the chapters are different tex files  %\include{chap1}  \renewcommand{\thechapter}{\Roman{chapter}}  %\setcounter{chapter}{0} %\renewcommand{\theequation}{\thechapter.\arabic{equation}}  \chapter{Introduction}  \section{Chap I Section1}  \begin{equation} this is equation I.1 \end{equation}  \begin{equation} this is equation I.2 \end{equation}  \section{Chap I Section2}  \begin{equation} this is equation I.3 \end{equation}  \chapter{Chapter 1}  \section{Chap 1 Section 1}  \begin{equation} this is equation 1.1.1 \end{equation}  \begin{equation} this is equation 1.1.2 \end{equation}  \end{document}     I have been typing Chapters 1-5 that contain sections and subsections and equations. The equations were numbered globally, i.e. if I had 3 equations in section 1 of Chap 1, they were numbered 1.1.1, 1.1.2, 1.1.3 and for Section 2, the equations were 1.2.4, 1.2.5, etc.  Recently I had to change Chap 1 and everything in it to Chapter I (roman number) and Chap 2 were renumbered to Chap 1, etc.  My problem is that LaTeX started numbering the equations in Chap I (the other chapters did not have this problem) according to the sections and not globally anymore. That is, the 3 equations in Chap I were I.1, I.2, I.3, and the equations in the second section of Chap I became I.1, I.2, etc instead of I.4, I.5, etc  I needed the prefix to be the chapter and not the sections. I don't understand why there is a change. I have never used \numberwithin in my book  Here are some of my codes  \documentclass[]{phstyle} \usepackage{latexsym,amsfonts,amssymb, undertilde} \usepackage[fleqn]{amsmath}   for the equation numbering in Chap I  \renewcommand{\thechapter}{\Roman{chapter}} \renewcommand{\theequation}{\thechapter.\arabic{equation}} **   Previously when Chap I was Chap 1, ** was  \renewcommand{\theequation}{\thesection.\arabic{equation}}   I have also tried the line below but it didn't work  \renewcommand{\theequation}{I.\arabic{equation}}   Thank you in advance
68704
Is it possible to modify LaTeX so that good old $$...$$ behaves like \[...\] (and by this I mean that it should be synonymous to it).  If yes: Dear LaTeX3 developer, please integrate this into LaTeX3! (Not that I really believe you will actually do this.)  MWE (even if I don't really see its use in this case):  \documentclass{article}  \begin{document}  I've forgotten we're not in the plain \TeX\ world anymore: $$ x = 3\alpha^2 + \beta   = \int f\, d\mu. $$  \end{document}
41025
I need to install a new TeX/LaTeX/ConTeXt package on my computer.  I'm running Ubuntu/Fedora/Slackware/Some-Version-Of Linux.  What are the possible ways to do this?    Note:&nbsp;&nbsp; We get a number of questions that essentially reduce to this one; it was felt a good idea to have one question-and-answer that can cover all the standard methods.  See  for the discussion.  The question-and-answer are CW so that more information can be easily added.  If you have information to add, please do so.  If you are unsure, leave a comment here or (preferably) in .  Comments on the question and answer will be periodically removed to ensure that the information is clear.
92499
I work with many documents which I hope will have the same style throughout.. When making a decision about the design, I want that to be applied to all of the documents uniformly. I've created 1 file that has the start and ending code. Then, all of my other files just have the text, and some minimal code (defining things like chapters and sections). E.g.:  \documentclass{article}  \title{The First Document} %\title{The Second Document} %\title{The Third Document}  \begin{document}      \input{document01}     %\input{document02}     %\input{document03}  \end{document}   To compile a different document, I just move the %'s to another line and run pdflatex on this file.   Is there a better system for managing these? Can I put some details, such as the \title information in the beginning of each document (document01.tex, etc.) Is there any way to compile all of the documents at once as separate PDFs?
96413
MWE:  \documentclass{article}  \usepackage{listings}  \begin{document}  IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII hardware/software  \end{document}   This results in this output:    If \usepackage{listings} is commented out, the hyphenation rules return to normal:    And just to note, in the actual environment I'm working in, it will also hyphenate between hard•ware, while with listings enabled, it hyphenates hardware/•software, as in the first image:    Two questions:   Why is this happening? Is there a way to disable this? I don't really want this behaviour just because I'm typing code occasionally in a document.
21622
I would like to have my whole document showing a blank line (or space) between paragraphs and no indentation. I know how to do it line by line, but is there a way to change that with just one or a few lines at the beginning of the document? Like a package you can install, or a new command?
106510
When looking in books or at sample code, I always see \documentclass appearing first. Is that absolutely necessary?  I have created some test code which seems to compile fine:  \def\SetClass{article} \documentclass{\SetClass} \begin{document}     This is some text. \end{document}   Is there any problem with placing other items, such as \input, \usepackage, or such details before the \documentclass?
6671
I can't find official documentation for the \@startsection command. I already looked in:   LaTeX Wikibook LaTeX: Structured document for TEX, 2008 beginLatex — a book that comes with ProTeX in the files that comes with MikTeX in the folder doc   and Google. I found a lot of sites that show examples and discussions about it but I'd like to find the official help or document.
42274
For a some simple cases it seems to me that there would be no important difference between   putting some code in a file preamble.tex and having \input{preamble.tex} in the main .tex file putting it in a file preamble.sty (with appropriate modifications such as a \ProvidesPackage)   What are the pros and cons of each?
118876
I wanted to make a command that outputs a number in math mode. This is how my file looks like:  \documentclass{scrartcl}  %\usepackage{epsdice} %\newcommand{dice}[1]{\epsdice{#1}}  \newcommand{dice}[1]{\ensuremath{#1}}  \begin{document} Lorem ipsum... \end{document}   But when I compile this with XeTeX, I always get this error:  ! LaTeX Error: Missing \begin{document}.  See the LaTeX manual or LaTeX Companion for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.13 \newcommand{dice}[1]{\ensuremath{#1}}   I have not that much experience with TeX, I think the solution is quite easy.
24114
Is there an easy method to compile a LaTeX document ignoring contents of \begin{figure} ... \end{figure} blocks altogether?   I am looking for an equivalent for draft and demo options (as in \documentclass[demo]{article} or \usepackage[draft]{graphics}) that will ignore figure environment completely. Specifically, don't want to see any placeholders nor figure captions, just continuous text.   Is there a way to do the same thing for table environments?