My aim is to write the body text and only the body with a big left skip; theorems, titles and display math starting from the very left, without skips. I use the command \leftskip=4cm, which works good on the body ignoring all the environments, but works also for titles. I'm putting it into the preamble. What do you suggest me? Although LaTeX is the best in organizing text, I want it to write my personal notes and I absolutely need to use my personal typeset. EXAMPLES Here is an example of what I've done till now (I hope not-English examples are allowed, just for the sake of typesetting):  and here is an example of what I'd like to make:  Here is a minimal executible code:    \documentclass[a4paper]{book}     \usepackage{geometry} %typography     \usepackage{lipsum}% http://ctan.org/pkg/lipsum  %   THEOREMS \newtheorem{teo}{Teorema}   %theorems:  unindented environment \newtheorem*{dimostratio}{Proof}  \newenvironment{proof.} %proofs:    indented environment     {\begin{dimostratio}  \leftskip=4.5cm   \mbox{} \noindent\ignorespaces  }     {\end{dimostratio}}  %   TYPOGRAPHY      \geometry{a4paper, top=2cm, bottom=2cm, left=2cm, right=2cm,  bindingoffset=5mm}     \leftskip = 4.5cm           % indentation of everythingh isn't a theorem.   %DOCUMENT \begin{document}     Here is the indented body.       %indented as I like.     \lipsum[1]                   \section{Indented (sic) title}       %indented but I don't like.     \lipsum[2]      \begin{teo} Here is an unindented environment, as I like. \end{teo} \begin{proof.}      And here is an indented environment, as I like.     \end{proof.}      \lipsum[4] \end{document}
37530
How do I indent a whole paragraph at the same distance from my left margin, with the simplest command or environment?
35800
Description of the problem My problem is this. For the proof of a math theorem i use the proof environment of the package amsthm. It adds a \qedsymbol in the last line of the proof, but if the proof ends with a displayed formula the qedsymbol appears in the next line leaving an unwanted blank space. The documentation of  teaches to fix this problem placing the command \qedhere after of the displayed formula but inside of the appropriate environment. This works well if the formula is of one line like \[ax^2+bx+c=0.\qedhere \]  but if the proof ends in a matrix, or cases with a &quot;great height&quot; the qedsymbol is fixed in the baseline at right and it this looks higher than expected (for my taste). The result is showed in this MWE \documentclass{article} \usepackage[width=7cm]{geometry} % Only for reducing space in this MWE  \usepackage{amsmath} % For `bmatrix` \usepackage{amsthm} % For `proof` environment \begin{document} \begin{proof} And this proof ends with \[ \begin{bmatrix}     1 &amp; 0 \\     0 &amp; 1 \\     0 &amp; 0 \end{bmatrix}.\qedhere \] \end{proof} \noindent Text \end{document}  that produces  What I want I'd like something like  with the qedsymbol aligned with the bottom of the matrix. Is this possible?
2671
For some teaching I've been doing, I'd like to have code from two different languages side-by-side.  To do so, I hacked together a newcommand which uses a tabular environment to arrange two verb environments, but the problems are myriad:   Indentation can only be accomplished by changing spaces to ~'s Any math symbols have to be escaped with \, which requires knowing which ones to escape and which ones not to (can't escape the &lt;'s for instance, otherwise it complains) The &lt;- assignment operator gets changed into an upside down !- when compiled.   The listings environment doesn't work either.  Error message is:  Runaway argument? ! Forbidden control sequence found while scanning use of \lst@next. &lt;inserted text&gt;                  \par  l.23 \codeListing{x &lt;- y}{f(g(x))}   Here's some code to reproduce the problem:  \documentclass[english]{article} \usepackage[latin9]{inputenc} \usepackage{geometry} \begin{document}  \newcommand{\codeListing}[2]{ \begin{tabular}{p{8cm} p{8cm}} \begin{lstlisting} #1 \end{lstlisting} &amp; #2\tabularnewline \end{tabular} }  \section{verbatim test} \begin{verbatim} logLik &lt;- function(x) {    y &lt;&lt;- x^2+2   return(sum(sqrt(y+7))) } \end{verbatim}  \section{codeListing test} \codeListing{}{ logLik &lt;- function(x) \{   ~~y &lt;&lt;- x\^2+2  ~~return(sum(sqrt(y+7)))  \}  }  \end{document}   Is there any way to make a newcommand wrap parameter-passed code?  It doesn't have to be keyword-highlighted or do any of the other tricks that the fancier packages do; it just has to preserve whitespace and no interpret code as latex commands.
8199
What package should I use, or what setting can I make to the font in theorems so that the text wouldn't be italic. I use amsmath, and from default, everything I write in theorem environments becomes italic and I don't want that. Thank you
66173
I am trying to learn how to use enumitem's keys to adjust a description list.  In this case, I would like to have my list items and description text both left aligned, but the description text should all start at the same horizontal position.  What I have below comes pretty close, but it seems that the setting of \labelwidth is being ignored, and that there is some other thing I need to add to get the correct value of leftmargin.  The tabular version produces that output I want, but would prefer to use the description list from enumitem.  \documentclass{article} \usepackage{enumitem} \usepackage{calc}  \newcommand*{\LongDescription}{This is a  long sentence to check that when it gets wrapped it is indented properly on the next line, but doesn't seem to when used in the list.}% \newcommand*{\ShortDescription}{A very short description.}%  \begin{document} \newcommand*{\LargestItem}{The Largest Named Item}% \newlength{\MaxWidth}% \settowidth{\MaxWidth}{\LargestItem}% \newlength{\MaxWidthPlusLabelSep}% \setlength{\MaxWidthPlusLabelSep}{\labelsep+\MaxWidth}%  \begin{description} [leftmargin=\MaxWidthPlusLabelSep,labelwidth=\MaxWidth] \item Small Name:     \ShortDescription \item The Largest Named Item: \LongDescription \item Larger Name:     \ShortDescription \end{description}   \hrule\medskip  I want something like this, but should be able to do this with a list:  \bigskip \begin{tabular}{l@{ }p{\linewidth-\MaxWidthPlusLabelSep}} Small Name:     &amp;\ShortDescription\\\\     The Largest Named Item:     &amp;\LongDescription\\\\     Larger Name:     &amp;\ShortDescription \end{tabular} \end{document}   I have tried the solutions on how to  and  but have not been able to adapt them to what I want.
56275
I am writing a document in a class (elsarticle) that indents the first lines of all paragraphs, including the ones following headings.  However, I would like to revert back to the default Latex behavior indenting all but the first paragraphs.  Of course I can do this manually using \noindent, but isn't there a better way?
5155
A colleague explained to me that it is a typographical rule to not set an indent for the first line of the very first paragraph of a text, the one that starts right after the headline. Instead, the indentation should start with the second paragraph. However, I am finding examples in various publications where the indentation starts right with the first paragraph. Then again, others do it the way it was told me.  Is there a "right" way to do it, and if so, why? If not, what are the advantages/disadvantages of either method?
118541
I usually only allow paragraphs to be indented when there's a need for them to be: only if the previous "element" could be confused and thus "merged" with the paragraph in question.  In practical terms, this means that there's no indentation after a \medskip or \bigskip, nor after itemize or enumerate, nor after displayed math.  Now, when typesetting floats it's hard to enforce this style: I'd like to leave no indentation after a float (in my opinion, it's hard to confuse things here).  Given, a paragraph may well finish "flush" to the right margin and continue a new sentence just after the float...  The "solution" I'm looking for then would be to force floats to occur (as many as need to) inside paragraphs, so that the first letter after the float is a lowercase, non indented, letter.  Any ideas?  PS: I usually also set \setlength\parfillskip=2em plus 1 fil, so as to have a consistent "visual clue" that a paragraph is over.
9147
I use declaretheoremstyle to define a theorem environment, and print a list of theorems in the end of my document:  \documentclass[12pt]{book} \usepackage[english]{babel} \usepackage[margin=2cm]{geometry}% just for the example \usepackage{xcolor} \usepackage{amsthm} \usepackage{thmtools} \usepackage{mdframed} \usepackage{etoolbox}  \declaretheoremstyle[   spaceabove=6pt, spacebelow=6pt,   headfont=\normalfont\bfseries,   postheadspace=1em,   notefont=\bfseries,   notebraces={(}{)},   bodyfont=\itshape,   shaded={bgcolor=yellow!20} ]{thmstyle}  \declaretheorem[style=thmstyle,name=Theorem]{theorem}  \begin{document}  \begin{theorem}[Somebody] ... \end{theorem}  \begin{theorem} ... \end{theorem}  \renewcommand{\listtheoremname}{List of Theorems} \addcontentsline{toc}{section}{\listtheoremname} \listoftheorems[ignoreall,show=theorem]  \end{document}   The theorems are numbered from the beginning to the end of the book, and from 1:    However, I would like to number the theorems with chapter number (like Figures or Tables), for instance, 1.1 (the first theorem in Chapter 1), 1.2 (the first theorem in Chapter 2)...  Does anyone know how to do it?
109646
I want to put the section title in the left margin using titlesec. However, it results to a superfluous empty line when using list environment. How should I remove it without using vspace?  Minimal example:  \documentclass{article}  \usepackage{geometry} \geometry{   a4paper,   top=2cm,   bottom=2cm,   left=4.5cm,   right=1.5cm, }  \usepackage{titlesec} \titleformat{\section}[leftmargin]{\large\scshape\sffamily}{}{0cm}{} \titlespacing{\section}{2.5cm}{2ex}{0.5cm}  \usepackage{enumitem}  \usepackage{mwe}  \begin{document}  \section{Section A}  This line is aligned with the section title.  \blindtext  \section{Section B}  \begin{itemize}[nosep]   \item This line is not aligned with the section title. \end{itemize}  \end{document}
30907
Some lines in my document are italicized, with no spaces between words, and continue after the edge of the document. The rest of the document is fine. Here is the beginning:  \documentclass[runningheads]{llncs} \usepackage{graphicx} \usepackage{float} \usepackage{tikz} \usetikzlibrary{arrows} \usepackage[explicit]{titlesec} \usepackage{amsmath,amssymb} % define this before the line numbering. \usepackage[width=122mm,left=12mm,paperwidth=146mm,height=193mm,top=12mm,paperheight=217mm]{geometry} \begin{document} \pagestyle{headings}   And then, for example:   \subsection{b)}\\  \\  Given that h(n) is admissible, the algorithm will be optimal for:\\  f(n)=(2-w)[g(n) + w/(2-w)h(n)]  \\  when w/(2-w) \leq 1, that is when w \leq 1 the algorithm is optimal.\\ It        behaves like an A* algorithm following the heuristic:  f(n) = g(n) + w/(2-w) h(n)   And below is the result:    Any help is appreciated!
9589
Newbie question: Within the body of the text that I've inserted into a Journal's Latex Template, I don't understand why I get a newline and italicized font when I add the command \leq to generate "less than or equal to"...  Below is (1) the Journal's template preamble and (2) my text in the body of the document.  I'm using MacText/TexShop on MacOSx10.6  (1) PREAMBLE  \NeedsTeXFormat{LaTeX2e}[1995/12/01] \documentclass[10pt]{bmc_article}      % Load packages \usepackage{cite} % Make references as [1-4], not [1,2,3,4] \usepackage{url}  % Formatting web addresses   \usepackage{ifthen}  % Conditional  \usepackage{multicol}   %Columns \usepackage[utf8]{inputenc} %unicode support %\usepackage[applemac]{inputenc} %applemac support if unicode package fails %\usepackage[latin1]{inputenc} %UNIX support if unicode package fails \usepackage{times} %so today's date appears on each version \urlstyle{rm}  \def\includegraphic{} \def\includegraphics{}  \setlength{\topmargin}{0.0cm} \setlength{\textheight}{21.5cm} \setlength{\oddsidemargin}{0cm}  \setlength{\textwidth}{16.5cm} \setlength{\columnsep}{0.6cm}  \newboolean{publ}   (2) IN THE BODY OF THE DOCUMENT .tex  coefficients kappa: \leq 0.4 poor to fair; 0.6 moderate agreement.   in Typeset: this pdf reads      coefficients kappa:      &lt;={italics}0.4poortofair;0.6moderateagreement
23449
How can I suppress vertical space between a theorem head and an enumitem environment? I would like the output to look like version 3 below, but I hope there is an automatical solution without ~ and \vspace.  \documentclass{article} \usepackage{amsthm} \usepackage{enumitem} \newtheoremstyle{mythmstyle}% {0.5em}% space above {0.5em}% space below {}% body font {}% indent amount {\sffamily\bfseries}% head font {}% punctuation after head {\newline}% space after head {\thmname{#1}\ \thmnumber{#2}\ \thmnote{(#3)}}% head spec \theoremstyle{mythmstyle} \newtheorem{Theorem}{Theorem} \begin{document}  %% version 1: vertical spacing correct \begin{Theorem} Dummy text \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem}  %% version 2: vertical spacing too large \begin{Theorem} ~ \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem}  %% version 3: desirable output, but ugly solution via \vspace \begin{Theorem} ~\vspace{-1.4em} \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem}  %% version 4: does it work with enumitem alone? (no, topsep seems to be ignored) \begin{Theorem} ~ \begin{enumerate}[label=(\arabic*),leftmargin=*,align=left, topsep=-1.4em] \item Item 1: More dummy text \item Item 2: More dummy text \end{enumerate} \end{Theorem} \end{document}
45795
I have a long and complex document that I want to render as a minimal outline only, without the body of the text. What is the best way to do this?  What I have tried so far is to save a version with titles only, and no other text. This does not work though. The outline gets caught off.  To try and solve the problem, I made a test file like this:  \documentclass{article}  \begin{document} \section{Foo} \subsection{bar} \subsection{bar} \subsection{bar} \section{Foo} \subsection{bar} \subsection{bar} \subsection{bar} [... eight more sections ... ] \end{document}   The output from this is a two page document, the first page of which is blank. On the second page, the outline appears, but it runs right to the margin until it gets cut off.  Adding a little bit of filler text to each section solves the problem. But without doing that, how can I get the output I would expect?  EDIT: I've edited this to emphasize the specific practical objective I am trying to accomplish, rather than the technical issue of empty sections which is covered .
62576
I'm starting my experiment with LaTeX, i'm writing an article and all that I want is to embed an algorithm inside normal text, this is my code:  \documentclass{article} \usepackage{algorithmic} \begin{document} \section{Lettura file .gpx}  Lorem ipsum ...  \algsetup{indent=1.7em} \begin{algorithm} \caption{Alg capt} \label{alg1}  \begin{algorithmic}[1] ... algorithm here... \end{algorithmic} \end{algorithm} \end{document}   This is fully working but algorithmic uses a pagebreak automatically, how can I avoid this break and show the algorithm immediately after "lorem ipsum" part?
45451
Just wondering, how would I reproduce this indentation formalism for certain scientific Journals:    Currently for the following LaTeX input  Draine, B. T., 2003, ARA\&amp;A, 41, 241\\ Dufour, R. J. 1984, in IAU Symp. 108, Structure and Evolution of the Magellanic Clouds, ed. S. van den Bergh \&amp; K. S. de Boer (Dordrecht: Reidel), 353\\ Fitzpatrick, E. L., 1986, AJ, 92 , 1068\\ Fitzpatrick, E. L., 1999, PASP, 111, 63\\   I am seeing this:    Would be nice to see a little indentation going on for the Dufour reference. Any pro tips would be warmly welcomed!
98923
I am finding this very inefficient, every time I type up something MiKTeX just indents for me and I have to enclose everything in \noindent{...}.  Is there a quick way of going past this?