The chapter starts on page n but the content starts on page n+1

image

I am having a problem with the numbering of chapters in a book. I must specify that I am stylizing the title of each chapter and adding an index for each chapter (I show it in the first figure), by the way, the content is in Spanish

I am doing the above with the following code:

My problem is that what you see in the image is page 2, and according to the index, chapter 1 starts on page 1 and page 1 remains blank, it gives me an automatic jump to page 2





I should say that I am using input:

and for what it's worth, some of the packages I'm using (they are not all) are the following:

Edit 1: This is the complete code:

It seems to result from an interaction between \mainmatter and the center environment. When I added additional chapters, the extra page was easily avoided. Testing showed the 'extra' page was inserted by \mainmatter. However, it is not a problem with \mainmatter as such since the extra page disappears with a standard definition of \chapter*, for example.

The correct way to do this, IMHO, would be to define \stylizedchapter without \chapter*. However, that's a lot of effort and I have no idea what side-effects it might create in your real document. An alternative is to simply use \centering rather than center. This works, but you may need to tweak the vertical spacing somewhere.

I've also changed the definition so the chapter numbering is automatic, but with an optional argument to override the number, if necessary. I also added \chaptermark{} here because you probably do not want either stale marks or the formatted title etc. This may or may not matter, depending on whether you use marks or not, but it seemed better to set it to something sane.

You need to use the T1 encoding to get the fvs font. With your original code, you aren't actually using this font because LaTeX substitutes a default. This is reported on the console and in the log. Personally, I prefer the output without fvs, which I don't think fits well with the ornament, but I assume you are using the font for a reason.

Regardless of that, you should use T1 for Spanish (unless you use a Unicode engine, but then you are loading the wrong packages).

You should check whether your document is really encoded with ansinew. Almost all editors these days use UTF8 by default, so ansinew is unlikely unless you have been writing your thesis for a very long time or have deliberately changed the encoding.

Be aware than an uncommented line ending or a space before a commented line ending is a space. In a centred context, these may disappear, but leaving the spaces in is a bad habit which will come back to bite you. The exception would be if you had sections of code using expl3 syntax, but that's not the case here.

Note that I minimised your example quite a bit in the process of figuring out what was going on.



I would strongly consider using titlesec to adjust your \chapter command. That will allow \chapter* to still work, and should allow \chaptermark to work as well. Building off of cfr's example, this would look like:

This does change the table of contents from how you had it. If you want the table of contents to have "Capîtulo #" instead of the chapter title (I've never seen the point in that), you can use titletoc to change that.

Ask AI
#1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 #34 #35 #36 #37 #38 #39 #40 #41 #42 #43 #44 #45 #46 #47 #48 #49 #50 #51 #52 #53 #54 #55 #56 #57 #58 #59 #60 #61 #62 #63 #64 #65 #66 #67 #68 #69 #70