0

I use a template from my university in order to write my dissertation. I wrote and compiled my second and third chapter and generated a PDF. But, when I add the fourth chapter (Capitulo04.tex) I got a lot of errors like if the packages doesn't work. I write in Spanish, so maybe this package \usepackage[latin1]{inputenc} or this \usepackage[T1]{fontenc} it's not working on the four chapter.

I think the problem isn't what I write in the chapter four because I pasted the chapter two (and I also tried chapter three) in the file of chapter four, I also have problems. Even if I only compile the chapter four I have the problems.

This is the main file:

% Clase de documento: libro
\documentclass[12pt,a4paper]{book} % article, report, book.
% Preámbulo: paquetes, comandos, entornos, estilos y título de página.
\input{A1.Preambulo.paquetes.tex}
\input{A2.Preambulo.commandos.tex}
\input{A3.Preambulo.entornos.tex}
\input{A4.Preambulo.estilodepagina.tex}
%Comando para crear glosario (index en inglés)
\makeindex
% Document body.
%-------------------------------------------------------------------%
\begin{document}
% Formato de documento hasta el capítulo 1 (sin incluirlo)
\frontmatter
% Dedicatoria.
\input{B4.Dedicatoria.tex}
% Acrónimos
\input{B5.Acronimos.tex}
% Tabla de contenidos, figuras y tablas.
\input{B5.TableOfContents.tex}
\input{B5.TableOfFigures.tex}
\input{B5.TableOfTables.tex}
% Formato de documento durante los capítulos.
\mainmatter
% Prólogo.
\input{B6.Prologo.tex}
% Introducción y objetivo
\input{B7.Intro.tex}
% Capítulo 01.
\input{Capitulo01.tex}
% Capítulo 2             
\part{Capítulo 2}
% Capítulo 02.
\input{Capitulo02.tex}
% Capítulo 03.
\input{Capitulo03.tex}
% Capítulo 04.
%\input{Capitulo04.tex}
\input{D0.Conclusiones.tex}
% Anexos
\part{Apéndices}
\appendix
\input{D1.AppendixA.tex}
%\input{D2.AppendixB.tex}
%\input{D3.AppendixC.tex}
% Formato de documento en la parte final.
\backmatter
% Bibliografía
\input{E1.Bibliografia.tex}
% Índice alfabético%
%\input{F1.Index.tex}
\end{document}

This is A1.Preambulo.paquetes.tex:

%1 Codificación e idioma%
\usepackage[latin1]{inputenc} %Codificación en latin-1%
\usepackage[spanish]{babel} %Hyphenation (Guionado) en español%
\usepackage[T1]{fontenc} %Codificación de fuente%
\usepackage{eurofont} %Tipografía euro ()%

%2 Matemáticas y Física %
% Importante para ecuaciones, magnitudes y unidades%
\usepackage{amssymb,amsmath,latexsym,amsfonts} % paquetes estándar%
\usepackage[squaren]{SIunits} %Paquete para magnitudes y unidades físicas%
\usepackage{ifthen} %sentencias if y while%
\usepackage{latexsym} %Binary Operators (incluye el triangulo invertido)
\usepackage{amsmath}

%3 Gráficos%
\usepackage{graphics,graphicx} %paquetes gráficos estándar%
\usepackage{wrapfig} %paquete para gráfica lateral%
\usepackage[rflt]{floatflt} %figuras flotantes%
    % \begin{floatingfigure}[r]/[l]{4.5cm}
    % \end{floatingfigure}
\usepackage{graphpap}   %comando \graphpaper en el entorno picture%
\usepackage{subfig}     %comando \subfloat

%4 Estilo y formato%
\usepackage{fancyhdr}   %cabeceras y pies mejor que con \pagestyle{}%
\usepackage{titlesec,titletoc} %Formateo de secciones y títulos%
\raggedbottom %Para fragmentar versos en varias páginas%
\usepackage{makeidx} %MakeIndex%
%\usepackage{showidx} 
\usepackage{alltt} % Define el environment alltt, como verbatim, excepto que \, { y } tienen su significado normal. Se describe en el fichero alltt.dtx.
\usepackage[pdftex,bookmarksnumbered,hidelinks]{hyperref} %hyper-references%
\usepackage{minitoc} % Para poner tablas de contenido en cada capítulo.
\usepackage{listings} % Para escribir piezas de código C, Python, etc. %
%listings configuration
\lstset{
  language=Python, %Puede ser C, C++, Java, etc.
  showstringspaces=false,
  formfeed=\newpage,
  tabsize=4,
  commentstyle=\itshape,
  basicstyle=\ttfamily,
  morekeywords={models, lambda, forms}
}

\usepackage{tipa} % tipografía IPA (International Phonetic Alphabet)
\usepackage{longtable} 
\usepackage{colortbl}
\usepackage{acronym}  

First lines of the file .log:

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6700 64-bit) (preloaded format=pdflatex 2018.6.15)  16 AUG 2019 00:29
entering extended mode
**"./A0.Mi Proyecto fin de carrera.tex"
("A0.Mi Proyecto fin de carrera.tex"
LaTeX2e <2018-04-01> patch level 5
("C:\Program Files\MiKTeX 2.9\tex\latex\base\book.cls"
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\bk12.clo"
File: bk12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@chapter=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(A1.Preambulo.paquetes.tex
("C:\Program Files\MiKTeX 2.9\tex\latex\base\inputenc.sty"
Package: inputenc 2018/04/06 v1.3b Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15

("C:\Program Files\MiKTeX 2.9\tex\latex\base\utf8.def"
File: utf8.def 2018/04/05 v1.2c UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1

Errors

Jinx77
  • 1
  • 1
    Welcome to TeX.SE! Well, seems you have at last one missing $ in your file chapitolo04.tex ... Because you did not show us the code -- or mutch better an minimal working example (MWE) -- we can only guess. And please never show us code as image -- we can not copy it and test it on our computers to help you to find the erroe ... – Mensch Aug 14 '19 at 00:38
  • In this century, you almost certainly want to remove \usepackage[latin1]{inputenc} and save your source files as UTF-8, which is the default. Seems to be unrelated. – Davislor Aug 14 '19 at 01:55
  • You might find it a bit easier to keep track of \( and \) than $, which cannot be nested and might easily be missed. Could help you avoid this error in the future. – Davislor Aug 14 '19 at 01:59
  • @Davislor I checked every ( and ) and there is ok.

    Now I tried to save the fourth chapter into the first and there is no errors. The problem comes when I use Capitulo04.tex even if I write three lines (in spanish of course).

    – Jinx77 Aug 14 '19 at 09:35
  • Check the encoding of Capitulo04.tex. If it's saved as UTF-8, and read in as Latin-1, the letter ñ becomes the two characters ñ. That ± will trigger the error you see. As @Davislor said above, it is safest to have everything in UTF-8 encoding. – Harald Hanche-Olsen Aug 14 '19 at 13:24
  • @HaraldHanche-Olsen Hmm, it does seem to be choking on the ñ in diseño and every ñ and ó (which would be misread as ó) thereafter. The poster is also getting at least one replacement-character, indicating some kind of character-set mismatch. You’re probably right. – Davislor Aug 14 '19 at 15:33
  • In any case, using UTF-8 is generally better in a lot of ways, including allowing your document to compile on newer engines such as LuaLaTeX. It’s also the encoding of all samples on TeX.SX, should you want to be able to copy to and paste from this site. – Davislor Aug 14 '19 at 15:35
  • If I use \usepackage[utf8]{inputenc} I have the next message for all chapters: ! Package inputenc Error: Invalid UTF-8 byte sequence. – Jinx77 Aug 14 '19 at 17:20
  • Yes, because all the other chapters are in latin-1 encoding. You'd need to change that. Since I don't know what operating system you are on, I can't tell you how, sorry. But have a look at this question, it might help. – Harald Hanche-Olsen Aug 14 '19 at 21:09
  • Hm, your line \usepackage[squaren]{SIunits} let me guess you are using an outdated version of TeX Live ... Package siunitx is the current version of that package. Please add the first line of your *.log file to your question, then we can see your used tex distribution and version number! Unrelated: package hyperref should be called as last package in your case as far as I can see. Delete double or more loaded packages in your preamble ... – Mensch Aug 15 '19 at 10:51
  • @Harald Hanche-Olsen I work on windows 10. I've changed all my chapters to utf-8 using Notepad++ and I use '\usepackage[utf8]{inputenc}' but I still have this error: – Jinx77 Aug 16 '19 at 00:21
  • ! Package inputenc Error: Invalid UTF-8 byte sequence. See the inputenc package documentation for explanation. Type H for immediate help. ... l.85 \part{Cap�tulo 2} The document does not appear to be in UTF-8 encoding. Try adding \UseRawInputEncoding as the first line of the file or specify an encoding such as \usepackage [latin1]{inputenc} in the document preamble. Alternatively, save the file in UTF-8 using your editor or another tool_ – Jinx77 Aug 16 '19 at 00:21
  • @Mensch I added the first line of my .log. Also I added the package hyperref* but nothing changed. I think I don't have double packages in my preamble... – Jinx77 Aug 16 '19 at 00:25
  • Change your \part{Capítulo 2} (see special character i with accent!) to \part{Capitulo 2} (use usual i) ... (you can copy my second code in comment and put it in your tex file) – Mensch Aug 16 '19 at 00:30
  • It appears that you haven't changed your main file to utf-8, only the included ones. Fix that, and all should be well (I hope). – Harald Hanche-Olsen Aug 16 '19 at 11:46
  • I tried both, changing \part{Capítulo 2} to \part{Capitulo 2} and also saving my main file in utf-8 but it didn't work. This problem is driving me crazy so I leave here a link to the template of my university in case of anyone wants to try it: link – Jinx77 Aug 16 '19 at 20:46
  • Problem solved. I don't know what it was the problem but I suppose that it was latin1, now I use utf-8. Thank you so much to Mensch, Harald Hanche-Olsen and Davislor. – Jinx77 Aug 26 '19 at 08:07

0 Answers0