I'm trying to create a new command called \domanda{}, that makes use of the \paragraph{} to create a series of questions with Q: in-built, together with their answers on a new line, WITHOUT indentation. However this is not giving the expected results. Can you help me find a solution? Please refer to the extensive code below.

\documentclass[a4paper, 10pt]{article}


\usepackage[top=2cm, bottom=2cm, left=3cm, right=2cm]{geometry}
\hypersetup{pdfstartview=FitH} %fits pdf to width, FitV= fits pdf to hight

\newcommand{\domanda}[1]{\paragraph{Q: #1\newline}}

The new sentence I type after the \paragraph{} start on a new line but WITH indentation.


Please always post complete minimal documents that show the problem. I have removed the packages not relevant here.

\paragraph is a sectioning command, and LaTeX supports two styles of such commands: display and run-in. Run in headings do not invoke the code to suppress paragraph indentation. Placing a forced line break in the heading does not produce the correct effect as you see.

You could redefine \paragraph not to be run-in, but then it would be more or less the same as \subsubsection so I have just used that here:

enter image description here

\documentclass[a5paper, 10pt]{article}

\newcommand{\domanda}[1]{\subsubsection*{Q: #1}}


a a a a a a a a a a a a a a a a a a a a a a
a a a a a a a a a a a a a a a a a a a a a a

Here's a possible solution:

\documentclass[a4paper, 10pt]{article}

\newcommand{\domanda}[1]{\paragraph{Q: #1}\mbox{}\par\nobreak\noindent\ignorespaces}


test text


enter image description here

  • Any thing a little bit simpler? I'm not familiar w/ all those brackets and numbers and symbols... Basically I don't understand why \setlength\parindent{0pt} doesn't work ;) – WobblyWindows May 9 '13 at 18:39
  • @WobbyWindows please see my updated answer. – Gonzalo Medina May 9 '13 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.