
Me he tirado demasiado del pelo en este caso, así que ahora pido ayuda para saber dónde he hecho las cosas mal.
Ejemplo de trabajo mínimo:
\documentclass[12pt,a4paper,twoside]{report}
\usepackage{newxjobb}
\usepackage[swedish]{babel} % date format and hyphenation rules(?)
\selectlanguage{swedish}
\usepackage{blindtext}
%--------------------
% Four subsections
\usepackage{titlesec}
\setcounter{secnumdepth}{4}
% Fugly hack to remove section numbers in ToC
\renewcommand{\thesection}{}
\renewcommand{\thesubsection}{}
\renewcommand{\thesubsubsection}{}
%-------------------- Remove section numbering
\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother
%--------------------
\begin{document}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagenumbering{roman}
\pagestyle{empty} % Empty until the abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
\hfil\hspace*{-4mm}
\begin{minipage}{100mm}
\center {
\vbox to 56mm{\vfil\LARGE\textbf{Shiny Title}}}
\vspace*{2.5mm}
\textbf{Things and stuff} \\
\vspace*{7mm}
\textbf{\large Mr. Name Nameson} \\
City 2019 \\
\vspace*{7mm}
Should you fancy something erronious, drop a mail: \\
[email protected]
\end{minipage}\hfil
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\clearpage
\thispagestyle{empty}
\setcounter{page}{0}
\tableofcontents
%-------------------- Document start
\pagenumbering{arabic}
\pagestyle{fancy}
\chapter{Foo}
\blindtext
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\chapter{Bar}
\blindtext[2]
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\chapter{Gazonk}
\blindtext[3]
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\end{document}
Produce un PDF con este contenido:
El paquete "newxjobb" es un paquete no estándar (no creado por mí) que algunos estudiantes usan en mi facultad, así que lo agregaré aquí también en caso de que el error esté ahí. Este paquete siempre se ha utilizado con documentos en inglés, mi documento es el primero que utiliza sueco. Si esa es la causa del problema, no lo sé.
Paquete "nuevoxtrabajo":
% Package file with options making me feel better...
% (Author: Stefan Langemark)
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{newxjobb}[2018/11/16 *** To be reviewed! ***]
\RequirePackage{parskip}
\RequirePackage{geometry}
\RequirePackage[T1]{fontenc} % ... the following line doesn't make much sense
% without this one
\RequirePackage[utf8]{inputenc}
\RequirePackage{fancyhdr}
%
%--------------------------------
% Paper layout
% (no room for margin notes)
%--------------------------------
%
% paper=b5paper,
\geometry{
paperwidth = 165mm, paperheight = 240mm,
% paper = a4paper,
total = {130mm,200mm},
% marginparsep = 2mm,
% marginparwidth = 15mm,
includemp = false,
%twosideshift = 10pt
}
\addtolength{\headheight}{10pt} % ??? (use "\geometry{...}" instead!)
%-------------------------------
% Header/Footer
%-------------------------------
\pagenumbering{arabic}
\renewcommand{\headrulewidth}{0.4pt}
\fancyhf{}
\fancyhead[RO]{\bfseries\leftmark}
\fancyhead[LE]{\bfseries\rightmark}
\fancyhead[RO,LE]{\bfseries\thepage}
\pagestyle{fancy}
\fancypagestyle{headings}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}
}
%
%-------------------------------------
% Redefine {chapter,section}mark to
% remove ugly all-uppercase
%-------------------------------------
%
% feck off
\renewcommand{\chaptermark}[1]{\markboth{\bfseries ARNE}{HEJHEJ}}
\renewcommand{\sectionmark}[1]{\markright{\bfseries \chaptername\ \thechapter.\enspace #1}}
%
%-------------------------------
% Redefining section styles
% to suit parskip > 0
%-------------------------------
%
%\addtocounter{secnumdepth}{1}% Number subsubsections too
%\addtocounter{tocdepth}{1}% Include subsections in table of contents.
\renewcommand\section{\@startsection%
{section}%
{1}%
{\z@}%
{-2.5ex \@plus -1ex \@minus -.2ex}%
{1.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}%
}
\renewcommand\subsection{\@startsection%
{subsection}%
{2}%
{\z@}%
{-2.25ex\@plus -1ex \@minus -.2ex}%
{0.5ex \@plus .2ex}%
{\normalfont\large\bfseries}%
}
\renewcommand\subsubsection{\@startsection%
{subsubsection}%
{3}%
{\z@}%
{-2.25ex\@plus -1ex \@minus -.2ex}%
{0.1pt \@plus .2ex}%
{\normalfont\mdseries\large\itshape}%
}
%
%
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname}%
\markboth{\contentsname}{\contentsname}%
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename}%
\markboth{\listfigurename}{\listfigurename}%
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
\renewcommand\listoftables{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listtablename}%
\markboth{\listtablename}{\listtablename}%
\@starttoc{lot}%
\if@restonecol\twocolumn\fi
}
%
%-------------------------------------------
% Chapter (stolen from Kluwer book style)
%-------------------------------------------
%
\newcommand*\chapnumber{% chapter number
\fontsize{50}{60}%
\usefont{T1}{lmr}{bx}{n}%
}
\newcommand*\chaptitle{% chapter title
\fontsize{20}{24}%
\usefont{T1}{lmr}{bx}{n}%
}
\def\bigraggedleft{\leftskip0pt plus1fil\relax}
\def\@makechapterhead#1{%\null\vskip-5pc
\vbox to 8pc{\hbox to\textwidth{\hfill\chapnumber\thechapter}
\hyphenpenalty=10000 % No hyphenation in chapter heads
\vskip8pt
\hrule height 2.5pt
\vskip12pt\vskip-\parskip
\def\\ {\vskip-\parskip}\parfillskip=0pt
\bigraggedleft
\chaptitle{\def\\ {\vskip-\parskip}#1}\vskip1sp
\vfill}}
\def\@makeschapterhead#1{\vbox to 7.5pc{
\hrule height 1.5pt
\hyphenpenalty=10000 % No hyphenation in chapter heads
\vskip12pt\vskip-\parskip
\def\\ {\vskip-\parskip}\parfillskip=0pt
\bigraggedleft
\chaptitle{#1}\vskip1sp\vfill}}
% END newxjobb-package
No sé por qué ocurre el problema de numeración y ahora dejé de buscarlo.
¿He cometido un error evidente?
Respuesta1
Tienes
\begin{document}
\pagenumbering{roman}
\pagestyle{empty} % Empty until the abstract
% Title page
\hfil\hspace*{-4mm}
\begin{minipage}{100mm}
\center {
\vbox to 56mm{\vfil\LARGE\textbf{Shiny Title}}}
\vspace*{2.5mm}
\textbf{Things and stuff} \\
\vspace*{7mm}
\textbf{\large Mr. Name Nameson} \\
City 2019 \\
\vspace*{7mm}
Should you fancy something erronious, drop a mail: \\
[email protected]
\end{minipage}\hfil
\clearpage
\thispagestyle{empty}
\setcounter{page}{0}
\tableofcontents
%-------------------- Document start
\pagenumbering{arabic}
\pagestyle{fancy}
que tiene varias inconsistencias.
\pagenumbering{roman}
Mejor debería ser el primero \pagenumbering{Alph}
(comprenderás por qué cuando agregues hyperref
).
A continuación, cambie \setcounter{page}{0}
a \clearpage\pagenumbering{roman}
y \pagenumbering{arabic}
a \clearpage\pagenumbering{arabic}
.
¿Cuál es el problema? tu \pagenumbering{arabic}
es encontradoantesTeX ha expulsado la última página de la tabla de contenidos, por lo que esa página pasa a tener el número 1.
También \pagestyle{fancy}
se debe mover antes \tableofcontents
.
Por cierto, si no desea numerar secciones y subsecciones, es mucho más fácil emitir
\setcounter{secnumdepth}{0} % only numbers chapters
Aquí hay una versión editada.
\documentclass[12pt,a4paper,twoside]{report}
\usepackage{newxjobb}
\usepackage[swedish]{babel} % date format and hyphenation rules(?)
\usepackage{blindtext}
%--------------------
% Four subsections
\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\begin{document}
\pagenumbering{Alph}
\pagestyle{empty} % Empty until the abstract
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Title page
\begin{center}
{\LARGE\textbf{Shiny Title}\\}
\textbf{Things and stuff} \\[7mm]
{\large\textbf{Mr. Name Nameson} \\}
{\large City 2019 \\[7mm]}
Should you fancy something erroneous, drop a mail: \\
[email protected]
\end{center}
\clearpage
\pagenumbering{roman}
\pagestyle{fancy}
\tableofcontents
%-------------------- Document start
\clearpage
\pagenumbering{arabic}
\chapter{Foo}
\blindtext
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\chapter{Bar}
\blindtext[2]
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\chapter{Gazonk}
\blindtext[3]
\subsection{asdf0}
\subsection{asdf1}
\subsection{asdf2}
\subsection{asdf3}
\subsection{asdf4}
\subsection{asdf5}
\subsection{asdf6}
\subsection{asdf7}
\subsection{asdf8}
\subsection{asdf9}
\end{document}
Último comentario:erróneoes, ejem,erróneo.