I created my own environment and it in/for a KOMA-class. It works fine, except that the first paragraph after it has an indentation. It want it to have no indentation at all, which is why I use false- for the class. How can I set that indentation to zero? Screenshot  MWE \documentclass[ 11pt, a4paper, ] {scrartcl}  \usepackage{ lmodern, blindtext }  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}  \usepackage{ multicol, blindtext, }  \newenvironment{teaser}{\vspace{0ex}\par\raggedright\sffamily}{% \par% \rule{0.8\columnwidth}{1pt}\par \vspace{2ex}% }  \listfiles  \begin{document} \begin{center}\huge Title stuff \end{center}  \begin{multicols*}{2} \section{Word}  \begin{teaser} Stuff. Word, some text to fill the void. Here is a longer sentence, quite the long one. \end{teaser}% % How do I have to define the new environment \verb|teaser| so that the first paragraph after it has no indentation?  Words words words words words words words words words words words words words. Words words words words. \end{multicols*} \end{document}
123536
This question led to a new package:  Edit: package is broken since nov 2019. See my comment below for more info. [may 2021]  There are a number of environments which I never want to follow up with an indented paragraph. itemize, enumerate, theorem, definition, etc. I know there are people who  this is bad style. But it's a personal preference. Those environments basically always end a paragraph for me, so the visual clue is not needed in my case. I've found several similar questions, but none of them do what I need:      That third one was actually most useful, but appears to be unreliable for patching existing environments with. It doesn't seem to be working in my memoir document. To be clear, I don't want to remove the actual paragraph break. That's a semantic concept. I just want to patch the document style so that paragraphs following certain environments remain unindented. I've tried the following two 'solutions' (which use etoolbox for patching): \newcommand*{\noindentnext}{\everypar{{\setbox\z@\lastbox}\everypar{}}} \newcommand*{\NoIndentAfterEnv}[1]{\AfterEndEnvironment{#1}{\noindentnext}} \newcommand*{\NoIndentAfterCmd}[1]{\apptocmd{#1}{\noindentnext}{}{}}  \NoIndentAfterEnv{itemize} \NoIndentAfterEnv{theorem} ...  This one is loosely based on the third post from the list above. It sometimes works. It sometimes does nothing. I'm unable to predict when it will fail. The second: \let\old@par\par \newcommand*{\noindentnextpar}{\def\par{\let\par\old@par\par\noindent}} \newcommand*{\NoParIndentAfterEnv}[1]{\AfterEndEnvironment{#1}{\noindentnextpar}} \newcommand*{\NoParIndentAfterCmd}[1]{\apptocmd{#1}{\noindentnextpar}{}{}}  I invented this one myself. It breaks when the patched environment is not followed by a paragraph. It has also shown itself to inexplicably fail in other situations. Once and for all, I'd like to have a reliable way to do this. Let me give an example of what I need, just to be clear: \NoIndentAfterEnv{itemize}  \begin{itemize}     \item ... \end{itemize}  This starts a new paragraph. Note the empty line. But it should not be indented.  But this paragraph \emph{should} be indented.
92616
Here's my preamble:  \documentclass[11pt]{amsart} \usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots. \geometry{letterpaper}                   % ... or a4paper or a5paper or ...  %\geometry{landscape}                % Activate for for rotated page geometry %\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent \usepackage{graphicx} \usepackage{amssymb} \usepackage{epstopdf} \usepackage{float} \usepackage[normalem]{ulem}  \DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}  \title{\emph{Research Proposal:}\\Perceptual Effects of Cross-Contextualized Soundscapes within the Built Environment}   Here's what happens:    Any ideas?
36987
I would like to define a theorem environment with custom layout. In particular, I want the body of the theorem to be indented, like this  Text body. Text body. Text body.  Theorem 1 (Pythagoras).     Let a,b,c the sides of a rectangular triangle.     Without loss of generality, we assume that  a&lt;b&lt;c .     Then, the following equality holds:            a^2 + b^2 = c^2  More text. And even more text.   This is similar to the quote environment, I believe.  How can I do this?  Preferably, I would like to use the existing \newtheorem command, but that's not mandatory.
13960
I am looking for an automated mechanism to change the effective \textwidth at the first pagebreak of a letter in scrpage2. I've tried \afterpage and \nextpage (ideally they would be set within \firsthead), both without success. I do not want to use the geometry package because firstly, IMO scrlttr2 should work with a change of KOMAoptions and friends and secondly, it does not seem to work anyways if used within scrlttr2 and the KOMA layout. Ideas and suggestions are very welcome.   Here's a MNWE. Page 2 and following should have a wider text block than the first page &mdash; but doesn't.  \documentclass{scrlttr2}% \usepackage[english]{babel} \usepackage{lipsum,afterpage}% \setlength{\textwidth}{125mm}% \nexthead{%   \global\areaset{170mm}{\textheight}%   \global\KOMAoptions{DIV=areaset}%   \global\recalctypearea% } \afterpage{%   \global\areaset{170mm}{\textheight}%   \global\KOMAoptions{DIV=areaset}%   \global\recalctypearea% } \begin{document} \begin{letter}{Receipient}   \opening{Dear receipient,}   \lipsum[1-6]   \closing{Yours} \end{letter} \end{document}   And BTW, I genuinely think that this is not covered by  and related questions and instead somehow relates to the internals of the KOMA classes.
13867
I want to create an multiple choices question with this indenting format  1. ########    A. ###    B. ###    C. ### 2. ########    ########    A. ###    B. ###    C. ###   The choices have same indentation as the question text.  But, using the default exam documentclass, I get this format  1. ########      A. ###      B. ###      C. ### 2. ########    ########      A. ###      B. ###      C. ###   Hence, I try to set the \leftmargin to 0pt inside the choices environment to get what I want.  \documentclass{exam} \begin{document} \begin{questions}   \question   How old are you?   \begin{choices}     \setlength{\leftmargin}{0pt}     \choice 14     \choice 17     \choice 19     \choice 20     \choice 23   \end{choices} \end{questions} \end{document}   But, It get nowhere.  So, What is the right way to set indentation of choice in exam documentclass?
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?
28759
Does someone know how to indent the text within captionof?  I have a long caption that I want to make two paragraphs out of but indent does not seem to work.  \documentclass{article}  \usepackage{caption} \usepackage[demo]{graphicx}  % make demo figure \makeatletter   \AtBeginDocument{%     \def\Ginclude@graphics#1{%       \begingroup\fboxsep=-\fboxrule       \fbox{\rule{\@ifundefined{Gin@@ewidth}{150pt}{\Gin@@ewidth}}{0pt}%         \rule{0pt}{\@ifundefined{Gin@@eheight}{100pt}{\Gin@@eheight}}}\endgroup}} \makeatother  \begin{document}  \noindent \begin{minipage}[c]{\linewidth} \centering \includegraphics{} \captionof{figure}{\textbf{Title} \newline \indent Paragraph 1 is found here with a lot of text lot of text lot of text lot of text lot of text lot of text \newline \indent Paragraph 2 is found here with a lot of text lot of text lot of text lot of text lot of text lot of text} \label{fig:angio} \end{minipage}  \end{document}
37482
I am trying to center this page but it will not work.  All is get is for the first line to be indented about one "tab" space to the right, but the second line will not shift.  However, the first line's indent does not appear to be centered either.  Is it possible that the binding offset or the indentfirst package is interacting with this negatively?  All of the other pages seem to work just fine. Any help would be appreciated.  \documentclass[12pt, a4paper, twoside]{article} \usepackage[margin=1in,bindingoffset=15.5mm,heightrounded]{geometry} \usepackage[T1]{fontenc} \usepackage{indentfirst} \begin{document} \pagestyle{empty} \vspace*{36 pt} {\centering \textbf{\emph{\Huge{Since I Saw You Last,\\There's a Change Upon You}}} } \end{document}
579
I have defined my own language whose syntax is very close to the one of Pascal. I would like to type the following program for instance. Many people use the packages algorithmicx or algorithm2e to print programs, but it seems that we have to use their specific keywords of its syntax like procedure, end while.  I just want to indent spaces when needed, and bold some words when I want (sorry that I could not bold letters in the following figure). Do I have to use  texttt for each line? Also, with verbatim, I could not bold words...  Also, as the program is not large, I would need to put it on the left side of the page, and leave space for some explanasion text on its right hand side. So I  guss I need to get them all together, and use multicols.  Could anyone help?  program test                                      some text here var   i : integer;                                    ...    b : boolean; begin    i := 1;                                        ...    b := true;    while i &lt; 15 do       i := i  + 1;       b := not b                                  some text here    od end   Edit1: Following @Werner's tabbing solution, I have made the code a minipage:  \begin{minipage}[t]{0.48\linewidth}% \begin{tabbing} Werner's solution \end{tabbing} \end{minipage}\hfill \begin{minipage}[t]{0.48\linewidth} a paragraph \end{minipage}   Actually as the code shows, I want the texts to be another separated minipage on the right hand side of the code. I have then 2 questions:   is it reasonable to make 0.48\linewidth instead of 0.5\linewidth? 0.48\linewidth is a conventional choice? is it possible to make a frame around the code, and use \caption and \label to make it a reference (I prefer figures)?
54412
My code are as follows:   \documentclass{article}     \usepackage[utf8]{inputenc}     \usepackage{lipsum}     \usepackage{booktabs}     \input{insbox}     \makeatletter     \@InsertBoxMargin = 12pt     \makeatother     \usepackage{nccmath}     \usepackage[showframe, nomarginpar]{geometry}     \usepackage{etoolbox} \usepackage{graphicx}     \newcommand*{\wrapitem}{\apptocmd{\labelenumi}{\hskip\leftmargin}{}{}\item\apptocmd{\labelenumi}{\hskip-\leftmargin}{}{}}     %     \newcommand{\InsertListL}[3][]{%     \setlength{\leftskip}{\leftmargin}\mbox{}\vspace*{-\baselineskip}%     \InsertBoxL{#2}{#3}[#1]\par \hspace{\itemindent}     }%     \newcommand{\InsertListR}[3][]{%     \mbox{}\vspace*{-\baselineskip}\setlength{\leftskip}{\leftmargin}%     \InsertBoxR{#2}{\hskip-\leftmargin#3\hskip\leftmargin}[#1]     }%      \begin{document}      \begin{enumerate}%      \wrapitem%     \InsertListL[2]{2}{\includegraphics{./images/c01uf006.pdf}}%     \lipsum[1]       \item     \InsertListR[12]{-40}{\includegraphics{./images/c01uf007.pdf}}     \lipsum[2]      \wrapitem%     \InsertListL[2]{2}{\includegraphics{./images/c01uf006.pdf}}%     \lipsum[1]      \end{enumerate}      \end{document}   Please suggest the below:   How can I move the wrap images vertically (upper and down movement)? How can I control unnecessary vertical white spaces?   Also, please correct any errors in coding.
29
I've created a new environment called 'Example' like this:  \newenvironment{example}     {\textbf{Example:} \begin{itemize}}     {\end{itemize}}   The environment works fine, but the items are starting after the Example: text. Is it possible to start with the first item on the same line as the Example: text and vertically aline the rest of the items with the first item?
94564
Starting code is as follows. I'd like a hanging indent for first text column:  MWE:  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{paracol} \usepackage{parskip} \setlength{\parindent}{15pt} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{paracol} \usepackage{parskip} \setlength{\parindent}{15pt} \usepackage{CJKutf8}  \begin{document}  \section*{Random Text} \begin{paracol}{2} %\hangindent  Person 1: "\blindtext" %\hangafter \switchcolumn \noindent Person 2: "\blindtext" \end{paracol}  \end{document}   Random text on subsequent lines needs to be justified to the opening quote of first line. This should continue until I indicate it to end even with new lines.
38363
I need to include a couple of Python code listings, where the indentation of the lines (using some number of spaces) is significant. I would like for the code listings to be copyable, so the spaces at the beginning of the line need to be be copied along with the text.  This question has been asked in various ways before (e.g. , or ). Those questions focus on making line numbers uncopyable, though.  Making the spaces at the beginning of a line copyable seems to be harder: "I am not sure it is possible to specify in the PDF (at least in a viewer-independent way) that the indentation should be copied too" (). At , Philippe Goutet suggests a solution (turning the spaces into visible spaces, and coloring them in the background color so that they appear invisible) that works using Acrobat Reader, but not all readers. He says "It works under Acrobat Reader and it's extremely pleasant to be able to quickly copy/paste code without problem (perhaps the problem can be circumvented by writing direct PDF code to tell that it's a space, I've never had the time to try)".  Is it possible to produce a PDF with a code listing with copyable real spaces at the beginning of a line?  Minimal example: The line return x should start with four spaces.  \documentclass{article}  \begin{document} \begin{verbatim} def myfunction(x):     return x \end{verbatim} \end{document}   I know that I could attach the code to the PDF as a file, but that's not what I want.
99061
How to get correct indentation after entering a nested list? I am writing a code review and I could not figure this out by googling. Here is an example of the three formatting styles I tried to use (but none of them works as I would like):  Case 1  The task is to align the last line (see below) "In the first line you use camelCase..." with the last line above the numbered list. In my first attempt, I added a new line (empty line) after the second numbered list item, and then indented by 4 spaces:     Variable name casing: See  on "Snake Case". In Perl, we use "snake_case" instead of "camelCase", and be consistent. Example:   Line 14: my $testType  Line 18: my $right_frame   In the first line you use camelCase, whereas in the second you use     snake_case.     As you can see, this gives the correct indentation but it introduces a blank line above the first numbered item.  Case 2  In this case I do not add the blank line after the second numbered list item ( but still indent by 4 spaces ):     Variable name casing: See  on "Snake Case". In Perl, we use "snake_case" instead of "camelCase", and be consistent. Example:   Line 14: my $testType  Line 18: my $right_frame In the first line you use camelCase, whereas in the second you use     snake_case.      In this case the line is considered as part of the last list item  Case 3  In this case, I try to add two blank spaces (invisible) at the end of the second list item:     Variable name casing: See  on "Snake Case". In Perl, we use "snake_case" instead of "camelCase", and be consistent. Example:   Line 14: my $testType  Line 18: my $right_frame In the first line you use camelCase, whereas in the second you use     snake_case.      In this case the line is considered part of the second item, and hence not correctly indented.  How to achieve the correct indentation?
91651
I know that it isn't a new question (I read already some others questions) but:   the question was asked many months ago; my problem, perhaps, is a little different!   Well, as I wrote in the previous message I'm blind and when I try to insert a question I have many problems with correctly indenting my code! I try the shortcut ctrl+K but it add the first 4 spaces and nothing else! If I try to indent this code, for example:  String buf; if(buf!=null) buf="buf isn't null"; else buf="buf is null";   If I selected all rows and press ctrl+K all rows are shifted to right by 4 spaces and the check returns an error because the rows 3 and 5 aren't indentent correctly and now there is the problem... if I select lines 3 and 5 and press ctrl+K again, the editor deletes the 4 spaces!  My question is: why don't you implement an HTML tag (something like &lt;bad code&gt;) that skips the control and, the negative thing, add a "bad reputation" to the author? I don't ask a workaround, but I can't lose 3 hours (yesterday I lost this time) for a question that already I can't post because the code is blocked! Another suggestion: could we be to able ask a moderator to add that bad reputation if he/she see the author never indent his/her code or remove the "bad reputation" if he/she see the author try to indent the code but it isn't indent perfectly! What do you think about it?  P.S.: This post is caused by the frustration that I have because from yesterday to today I can't insert a question on stack overflow because my code isn't indented correctly... If you should see how many times I try to fix it tou could understand my frustration!  P.S.2: can you implement the tag title on your toolbar icon? It could help me to use it.  @Hammar: ok, I write here what I think should be the correct code:     String buf;     if(buf!=null)         buf="buf is not null";     else         buf="buf is null"; ...  There are some errors to this code?  Ok, now I understand that the error wasn't where I thought (or better it COULD be in another place) so my new suggestion is: why don't you create a function that insert a tag for delimited where is the error? I not that you already change the post (for example deleting the initial phrase: "Hello all,") but i don't know how you do the check so I don't know if it is possible!  Ok, now I inset the question that caused this post and my frustration, the question is this:    and I resolve the check adding 4 space around all "suspected" code and adding some empty line... Tell me if it is better change the title for only the last suggestion or is better keep all things for, in the future, understand why and what I asked...
15707
I am trying to (partially) reproduce the algorithm displayed in Figure 4 from   My problem is with the multi-line conditions present in the "IFs". I want them to be indented, but \Indp does not seem to take effect if a new line \\ is not present in the same line.  This is what I tried:  \begin{algorithm}[htb]     \SetAlgoNoLine%     \SetNoFillComment     \SetKwIF{If}{ElseIf}{Else}{if}{:}{elif}{else:}{}%      \If{(SYNs from both hosts and \\             \Indp SYNs in earliest NFs of both hosts and \\             \Indp hosts' earliest packets differ)}{         Host with earliest NF is originator      }     \If{(SYN only from one host and \\         \Indp SYN is in connection's earliest NF)}{     Host is originator     }     \If{one host uses port 20 (ftp-data)}{     Host is originator     }     \If{only one host uses a well-known port}{     Host is responder     }     \If{start of hosts' first packets differ}{     Host with earliest NF is originator     }     Arbitrarily choose originator     \caption{Pseudo code for determining connection server side}     \label{algo:serverside2} \end{algorithm}   For instance, the line "SYNs in earliest NFs of both hosts and" is indented correctly, but "hosts' earliest packets differ" is not.
10921
I'm trying to get a description's list hanging indent to lie flush with the first line of text.  I have a description list such as the following:  \begin{description}  \item[Label the first] Lorem ipsum dolor sit amet, consectetur adipisicing                         elit, sed do eiusmod tempor incididunt ut labore et                         dolore magna aliqua.  \item[The longest label] Ut enim ad minim veniam, quis nostrud exercitation                           ullamco laboris nisi ut aliquip ex ea commodo                           consequat.  \item[Shrtlbl] Duis aute irure dolor in reprehenderit in voluptate velit esse                 cillum dolore eu fugiat nulla pariatur. \end{description}   This produces the following output:    I would like to have each paragraph indented so that the following lines are flush with the first letter of the list item's text, the way it's laid out in my TeX.  For instance, the "s" of "sectetur" should be right under the "L" of "Lorem".  I've tried looking through the documentation of , but I can't seem to find a good option.  I tried specifying [leftmargin=3cm, style=sameline], but this results in the following:    This isn't quite right: I'm trying to get each item lined up differently, so that the "L" of "Lorem" is not necessarily flush with the "U" of "Ut" or the "D" of "Duis".  Does anybody know a good way to do this?