GeneralOmit Indentation after a Macro

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Omit Indentation after a Macro

Post by Montag »

Hello,

I'd like "More text." not to be indented like it wouldn't be after \subsection or \end{center}. But in my macro, it is indented, although it is after \end{center}.

How can I implement that command/option to my macro for \reg? :) I still like the usual identation in paragraphs to work though, so I'm not asking for a global solution.

Code: Select all

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\newcommand{\reg}[1]{
\begin{flushleft}
\large{\textbf{#1}}
\end{flushleft}}

\begin{document}
\reg{Some Heading}

More text.
\end{document}
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Omit Indentation after a Macro

Post by localghost »

I'm not sure if you only want an explanation that leads to a solution or if you are also interested in an alternatives. I can't offer an explanation at the moment. But with means of KOMA Script you could simply use an adapted \minisec command for your heading.

Code: Select all

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\setkomafont{minisec}{\normalfont\large\bfseries}

\begin{document}
Preceding text.

\minisec{Some Heading}
Following text.
\end{document}

Thorsten
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Omit Indentation after a Macro

Post by Montag »

Well, I do have some other macros of which some end on \end{flushright} so I'd like the indentation and additional vertical space to disappear. This just mean to make the following text (in this case "More text.") to behave like the text after a command like \section.

By the way, this problem only appears if I use my macros. If I write them down like

Code: Select all

\begin{center}
asdfasdf
\end{center}

Test.
there is no additional vertical space. I understand that and I would like the addictional vertical space after my macro to disappear.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Re: Omit Indentation after a Macro

Post by Montag »

Can no one think of a solution? :/
If I search for it on Google, this thread is already the first result. :(

edit:
Well, after some more heavy googling, I found some partly related questions on tex.stackexchange.com containing \addvspace. So I reached some sort of hack-y solution by adding \addvspace{-1\parskip} at the end of my macros.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Post Reply