1

I love the \paragraph{...} command, but if I use it right after \begin{proof} it does not work.

Is there a way to define my own paragraph-command such that I can use it right after \begin{proof}.


\documentclass[a4paper,fontsize=12pt,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[inline]{enumitem}

\setlength{\parindent}{0ex}
\setlength{\parskip}{1ex}
\setlength{\jot}{12pt}
\usepackage[onehalfspacing]{setspace}

\newtheoremstyle{my_theorem_style}
  {20pt}{20pt}%
  {\itshape}{}%
  {\bfseries}{.}%
  {\newline}{}%

\theoremstyle{my_theorem_style}
\newtheorem{theorem}{Theorem}[section]


\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum.

\begin{theorem}
Aliquam ultrices sagittis orci a scelerisque purus semper eget. Eget sit amet tellus cras adipiscing enim eu turpis egestas:
%
\begin{enumerate}
\item Nunc vel risus commodo.
\item Libero nunc consequat.
\item Diam maecenas sed enim ut. 
\end{enumerate}
%
\end{theorem}


\begin{proof}...
%
\paragraph{ad 1.} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum. 

\paragraph{ad 2.} Amet nulla facilisi morbi tempus iaculis urna id volutpat. Adipiscing elit duis tristique sollicitudin nibh sit. Aliquam ultrices sagittis orci a scelerisque purus semper eget. 

\paragraph{ad 3.} Habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Libero nunc consequat interdum varius sit amet mattis. Fermentum leo vel orci porta non. 
%
\end{proof}

\end{document} 

enter image description here

If I use \paragraph{...} right after \begin{proof} it wont even compile.

So I alsways have to write something (sometimes bs) right after \begin{proof}.

6
  • How exactly are you defining the proof environment? What should the output look like?
    – campa
    Oct 28, 2021 at 12:10
  • What exactly do you like about \paragraph? Do you include the paragraph numbers in the table of contents? (The TOC normally stops at subsections.) Oct 28, 2021 at 12:31
  • I like that (1) I dont have to take care of vertical space manually, (2) I dont have to use \textbf{...} manually. I do not include any paragraphs numerbers in the TOC. Oct 28, 2021 at 12:34
  • 1
    The proof env here is made via a list, and \paragraph cannot start a list. In a number of book I've used a homepage macro that for the first use inside proof will use *something* and for later uses in the same proof will use \paragraph internally.
    – daleif
    Oct 28, 2021 at 12:57
  • 2
    imho you are misusing a heading command for a visual effect, but from the technical side this is the problem described in this issue github.com/latex3/latex2e/issues/553 Oct 28, 2021 at 13:09

2 Answers 2

1

I think that the macro mypara defined below does what you want. It gives a \paragraph looking output but has no numbering or ToC entry.

% paraprob.tex  SE 620506

\documentclass[a4paper,fontsize=12pt,egregdoesnotlikesansseriftitles]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{fix-cm}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage[inline]{enumitem}

\setlength{\parindent}{0ex}
\setlength{\parskip}{1ex}
\setlength{\jot}{12pt}
\usepackage[onehalfspacing]{setspace}

\newtheoremstyle{my_theorem_style}
  {20pt}{20pt}%
  {\itshape}{}%
  {\bfseries}{.}%
  {\newline}{}%

\theoremstyle{my_theorem_style}
\newtheorem{theorem}{Theorem}[section]

\newcommand{\mypara}[1]{%
\vspace{\parskip}
\vspace{\baselineskip}
\textbf{#1 }%
}


\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum.

\begin{theorem}
Aliquam ultrices sagittis orci a scelerisque purus semper eget. Eget sit amet tellus cras adipiscing enim eu turpis egestas:
%
\begin{enumerate}
\item Nunc vel risus commodo.
\item Libero nunc consequat.
\item Diam maecenas sed enim ut. 
\end{enumerate}
%
\end{theorem}


\begin{proof}...
%
\paragraph{ad 1.} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum. 

\paragraph{ad 2.} Amet nulla facilisi morbi tempus iaculis urna id volutpat. Adipiscing elit duis tristique sollicitudin nibh sit. Aliquam ultrices sagittis orci a scelerisque purus semper eget. 

\paragraph{ad 3.} Habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Libero nunc consequat interdum varius sit amet mattis. Fermentum leo vel orci porta non. 
%
\end{proof}

\begin{proof}...

\mypara{ad 1.} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pretium vulputate sapien nec sagittis aliquam malesuada bibendum. 

\mypara{ad 2.} Amet nulla facilisi morbi tempus iaculis urna id volutpat. Adipiscing elit duis tristique sollicitudin nibh sit. Aliquam ultrices sagittis orci a scelerisque purus semper eget. 

\mypara{ad 3.} Habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Libero nunc consequat interdum varius sit amet mattis. Fermentum leo vel orci porta non. 
%
\end{proof}

\end{document} 

enter image description here

0

Kinda Noob answer: but i find that putting in a
$\;$\\ often helps out.
This gives you a Math enviorment and just ads in a space with a line break after it.
Basicly an empty row without using commands that dont work righ after each other.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .