1

I want create theorem like this one:theorem pharagraph symbol before arabic number, then dot, then theorem name, then subsection with dot and no \newline at the end. "Na to żeby iloczyn nieskończony" is part written in theorem. I have tried many times. I found this topic: Theorem style like (1.1 Theorem) and custom theorems like (1.2 Intermadiate Value Theorem) Copied code with definition and guess how it works with reverse engineering, but still my output doesnt look like I want. Any idea how to make this?!

\documentclass[12 pt, a4paper]{article}

\usepackage[cp1250]{inputenc}

\usepackage{polski,enumerate,amsmath,amssymb, multicol,mathtools,ragged2e,amsthm} \newcounter{mycounter}

\usepackage[a4paper, bindingoffset=0.2in, top=1in, bottom=1in, footskip=.25in]{geometry}

\setcounter{page}{104} \swapnumbers \newtheoremstyle{theorem}% name {}% Space above, empty = `usual value' {}% Space below {\itshape}% Body font {}% Indent amount {\bfseries}% Head font {.}% Punctuation after head { }% Space after head: \newline = linebreak {$\S;${#1}\ifx\temp\empty\thmnumber{#2}\else \thmnumber{#2}\thmnote{ #3}\fi}% Head spec \theoremstyle{theorem} \newtheorem{theo}{Twierdzenie} \begin{document}

\begin{theo}lorem ipsum \end{theo} \end{document}

Thats short version of my code including all that interferes theorem.

1 Answers1

1

You might consider using a different theorem package, like ntheorem, which makes custom markup a bit easier, imho anyway.

For example:

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}
\usepackage{ntheorem}
\newtheoremstyle{mytheorem}{%
    %style without optional argument, ##2 for number, ##1 for theorem name
    \item\normalfont\textbf{\S\;##2.\;##1\;\arabic{subsection}.\;}\itshape
}{%
   % style with optional argument
    \item\normalfont\textbf{\S\;##2.\;##1\;\arabic{subsection}\;(##3).\;}\itshape
}
\theoremstyle{mytheorem}
\newtheorem{theo}{Twierdzenie}
\begin{document}
\setcounter{theo}{96}
\setcounter{subsection}{117}

\begin{theo} Na to żeby iloczyn nieskończony \end{theo} \end{document}

ntheorem example

Not sure if that's what you meant by "subsection", but hopefully you can figure out how to tweak it if need be.

frabjous
  • 41,473
  • Gr8 man, do you know how to make curved font normal? Not counting this your answer is just PERFECT. I think also about using diffrent styles in diffrent theorems. – DScounterGO Jan 06 '23 at 20:38
  • bcs \theoremstyle{mytheorem} is global. Am I right? – DScounterGO Jan 06 '23 at 20:40
  • "make curved font normal"? Do you mean you don't want italics? Just leave off the \itshape. \theoremstyle{mytheorem} will be in effect until you issue another \theoremstyle{...} command before a \newtheorem{...}. – frabjous Jan 07 '23 at 01:40