5

I am using the class scrbook and I would like to have parts without prefixes (similar to the default chapters in scrbook), i. e.

\documentclass{scrbook}

\begin{document}
  \part{This Is Part One}
\end{document}

Part I.

This Is Part One

should become

I. This Is Part One

I have not found a way to do this in the documentation of koma-script, but I hope there is a simple solution.

1
  • 2
    German: Hallo. Es ist hier üblich, dass man ein sogenanntes Minimalbeispiel bereitstellt. Also einen vollständig kompilierbaren Beispielcode. So können, die die helfen wollen einfach ausgehen von dem helfen. Das hat auch Keks Dose in seiner Antwort angedeutet. English: Please provide a complete code example which shows the pwoblem and will produce a document. So others have less troble to help you. This is kind of normal here. Aug 16, 2014 at 10:04

3 Answers 3

6

Well, the documentation of koma-script helped me to find a solution after all:

\documentclass{scrbook}

\renewcommand{\partheadmidvskip}{\enskip}
\renewcommand{\partformat}{\thepart\autodot}
\setkomafont{partnumber}{\usekomafont{part}}

\begin{document}
  \part{This Is Part One}
\end{document}

However, since I am not a very experienced user of LaTeX I don't know if there are any caveats associated with it.

4
  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The StackExchange staff can merge them together for you. Aug 16, 2014 at 15:05
  • But I can edit my original post and leave comments... ?
    – Staubfrei
    Aug 16, 2014 at 15:15
  • Ok, now I see that the account that asked the question is different from this one...
    – Staubfrei
    Aug 16, 2014 at 15:18
  • That's because you've now gained enough reputation with both accounts, and your edit was approved by other users (not necessary when using your own account). Consider this image. And here are the two accounts: one and two Aug 16, 2014 at 15:19
1

There is no possibility to set this behavior with an option. You would need to hack KOMAScript.

Copy the class-file scrbook.cls to the same directory as your tex-document. Rename it, e.g. to mybook.cls

The lines you want to change are 100 and 2533, also you need to comment out the lines 2529-2532, these are the lines, where the Part I-Line is created.

In line 100 change scrbook to mybook

2533 is setting the title, here you want to add the number.

old : \size@part{#2}\strut

new : \size@part{\thepart\autodot\ #2}\strut

you can experiment with other spaces after autodot.

Now you can use it in your document:

\documentclass{mybook}
\begin{document}
\part{Test A}
\chapter{Test 1}
\part{Test A}
\chapter{Test 1}
\end{document}
2
  • I made a wrong comment, see following comment below. Deleted.
    – Keks Dose
    Aug 16, 2014 at 12:52
  • I wrote "copy it into the same directory as your tex-document", so it works directly without updating. If you would want to use the class globally you would need to pu it somewhere in the texmf-local folder and rund texhash of course.
    – MaxNoe
    Aug 16, 2014 at 12:53
1

What about

\renewcommand*{\partformat}{\thepart\autodot}

? If you provide an example, we can test...


Edit:

@cgnieder, tohecz, Jubos, who deleted my first answer: This is an answer, it solves the OP's question partially. There is no reason to close it. Go and help people who have questions. E.g., solve this question here.

4
  • 1
    How about you leave this as a comment? It would serve the same purpose and won't clutter the answer area until it is confirmed by the question owner. That's why it is deleted as far as I can see, not because it is wrong.
    – percusse
    Aug 16, 2014 at 12:57
  • No, it's not an answer. It is a question (»What about [...]?«) with a request for an MWE and clarification (»If you provide [...]«). As such this is better suited as a comment.
    – cgnieder
    Aug 16, 2014 at 13:10
  • Listen folks, I regard my answer as an answer, regardless of the use of a rhethorical question, which is answered in itself. EOD.
    – Keks Dose
    Aug 16, 2014 at 13:13
  • My last comment: your statement »Go and help people who have questions. E.g., solve this question here.« implies that you haven't solved/answered the question? This is very contradictory. (Not even mentioning the fact that an MWE was added an hour ago, i.e., before you posted this answer...)
    – cgnieder
    Aug 16, 2014 at 13:17

You must log in to answer this question.

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