Featured Book

LaTeX Beginners Guide

Who is online

In total there are 21 users online :: 0 registered, 0 hidden and 21 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 21 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Compilation Failure due to invalid Character Topic is solved

charactersinput-encodingsAdd tags LaTeX specific issues not fitting into one of the other forums of this category.

Compilation Failure due to invalid Character

Postby oscarcapote on Sun Jan 27th, 2013

Hello,

I have a problem with all my new documents. When I started to make my firsts documents, it compiled well, but now always appears the same problem.
Text line contains an invalid character.

I searched on the net and I didn't found nothing. This is an example of a document that compiles well:
Code: Select all  •  Open in writeLaTeX
% Definimos el estilo del documento
\documentclass[10.5pt,a4paper,spanish]{article}
% Utilizamos el paquete para utilizar español
\usepackage[spanish]{babel}
% Utilizamos un paquete para gestionar los acentos y las eñes
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx
}
% Definimos la zona de la pagina ocupada por el texto
\oddsidemargin -1.0cm
\headsep -2.4cm
\textwidth=18.5cm
\textheight=26cm
\usepackage{fullpage}
\usepackage{listings}
\usepackage{color}
\usepackage{amssymb}
\usepackage{dsfont}


\begin{document}

\title{\scshape  {Tema 4:\\Elementos de mecánica analítica}}
\author{Oscar Fajardo Fontiveros\\original de Jesús González
}
%\date{}

\maketitle
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82
}
 
\lstset{ %
  language=Octave,                % the language of the code
  basicstyle=\footnotesize,           % the size of the fonts that are used for the code
  numbers=left,                   % where to put the line-numbers
  numberstyle=\footnotesize,          % the size of the fonts that are used for the line-numbers
  stepnumber=1,                   % the step between two line-numbers. If it's 1, each line
                                  % will be numbered
  numbersep=5pt,                  % how far the line-numbers are from the code
  backgroundcolor=\color{white},      % choose the background color. You must add \usepackage{color}
  showspaces=false,               % show spaces adding particular underscores
  showstringspaces=false,         % underline spaces within strings
  showtabs=false,                 % show tabs within strings adding particular underscores
  frame=single,                   % adds a frame around the code
  tabsize=2,                      % sets default tabsize to 2 spaces
  captionpos=b,                   % sets the caption-position to bottom
  breaklines=true,                % sets automatic line breaking
  breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
  title=\lstname,                   % show the filename of files included with \lstinputlisting;
                                  % also try caption instead of title
  numberstyle=\tiny\color{gray},        % line number style
  keywordstyle=\color{blue},          % keyword style
  commentstyle=\color{dkgreen},       % comment style
  stringstyle=\color{mauve},         % string literal style
  escapeinside={\%*}{*)},            % if you want to add a comment within your code
  morekeywords={*,...}               % if you want to add more keywords to the set
}
\tableofcontents
\newpage
\section{\textbf{Cinemática y dinámica}}
\subsection{\textbf{Sistema de coordenadas generalizadas}}
\flushleft
\renewcommand{\labelitemi}{\textbullet}
\renewcommand{\labelitemii}{\textendash}
\begin{itemize}
        \item Conjunto formado por el mínimo número de magnitudes necesario para determinar la posición del sistema.
        \begin {description}
        \item Notación: $S = \left\{ {{q_1},{q_2},...,{q_s}} \right\}$\\ Donde $s$ es el número de grados de libertad ($s=CardS$) y $q_i$ es una coordenada generalizada.
        \end {description}
        \item Ejemplos:
        \begin {itemize}
        \item Osciladores armónicos simples:$s = 1$ y $S = \left\{ x \right\}$
        \item Sistema de dos osciladores acoplados::$s = 2$ y $S = \left\{ x_1,x_2 \right\}$
        \item Problema de los dos cuerpos::$s = 6$ y $S = \left\{ X,Y,Z,x,y,z \right\}$
        \item Partículas de un campo de fuerzas centrales:$s = 1$ y $S = \left\{ r,\phi \right\}$
        \end{itemize}
        \item Cinemática:
        \begin {itemize}
        \item Cada sistema mecánico tiene un número bien definido de grados de libertad. $s \in \mathds{N}$
        \item Existe un conjunto de $s$ números reales, $S = \left\{ {{q_1},{q_2},...,{q_s}} \right\} \in \mathds{R}^s $ que determinan la posición del sistema en el espacio.
        \end {itemize}
\end{itemize}
\subsubsection {\textbf{Ligaduras:}}
\begin {itemize}
\item Sistema de $N$ partículas en el espacio: $s=3N$ grados de libertad.
\begin {itemize}
\item $S = \left\{ {{{\vec r}_1},{{\vec r}_2},{{\vec r}_3},...,{{\vec r}_N}} \right\} = \left\{ {{x_1},{y_1},{z_1},{x_2},{y_2},{z_2},{x_3},{y_3},{z_3},...{x_N},{y_N},{z_N}} \right\}$
\end {itemize}
\item Coordenadas generalizadas:$S = \left\{ {{q_1},{q_2},...,{q_{3N}}} \right\}$
\item Ligaduras: restricciones sobre el movimiento del sistema.
\item Tipos de ligaduras:
\begin {description}
\item \textbf{Ligaduras holónomas:} Se pueden expresar mediante ecuaciones que relacionan las coordenadas y el tiempo.
\item \textbf{Ligaduras no holónomas:} No se pueden expresar mediante una ecuación de las coordenadas.
\item \textbf{Ligaduras esclerónomas:} No dependen explícitamente del tiempo.
\item \textbf{Ligaduras reónomas:} Dependen del tiempo.
\end {description}
\end {itemize}
\subsubsection {\textbf{Ligaduras holónomas:}}
\begin{itemize}
        \item Sistema de $N$ partículas: $f\left( {{q_1},{q_2},{q_3},...{q_{3N}};t} \right) = 0$
        \item Reducción del grado de libertad:${q_j} = {f^{ - 1}}\left( {{q_1}\left( t \right),{q_2}\left( t \right),{q_3}\left( t \right),...{q_{3N}}\left( t \right);t} \right)$
        \item Sistema de $N$ partículas sometidas a $h$ ligaduras holónomas distintas:\[s = 3N - h\]
        \item Osciladores harmónicos simples:
                \begin{itemize}
                \item Tres coordenadas:$S = \left\{ x,y,z \right\}$
                \item Dos ligaduras holónomas: $y=0; z=0$
                \item Movimiento unidimensional: $s = 1$ con $S = \left\{ x \right\}$
        \end{itemize}
        \end{itemize}
        \end{document
}


And this is an example of a document that can't compile well. They have the same preamble.
Code: Select all  •  Open in writeLaTeX
% Definimos el estilo del documento
\documentclass[10.5pt,a4paper,spanish]{article}
% Utilizamos el paquete para utilizar español
\usepackage[spanish]{babel}
% Utilizamos un paquete para gestionar los acentos y las eñes
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx
}
% Definimos la zona de la pagina ocupada por el texto
\oddsidemargin -1.0cm
\headsep -2.4cm
\textwidth=18.5cm
\textheight=26cm
\usepackage{fullpage}
\usepackage{listings}
\usepackage{color}
\usepackage{amssymb}
\usepackage{dsfont}


\begin{document}

\title{\scshape  {Tema 4:\\Elementos de mecánica analítica}}
\author{Oscar Fajardo Fontiveros\\original de Jesús González
}
%\date{}

\maketitle
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82
}
 
\lstset{ %
  language=Octave,                % the language of the code
  basicstyle=\footnotesize,           % the size of the fonts that are used for the code
  numbers=left,                   % where to put the line-numbers
  numberstyle=\footnotesize,          % the size of the fonts that are used for the line-numbers
  stepnumber=1,                   % the step between two line-numbers. If it's 1, each line
                                  % will be numbered
  numbersep=5pt,                  % how far the line-numbers are from the code
  backgroundcolor=\color{white},      % choose the background color. You must add \usepackage{color}
  showspaces=false,               % show spaces adding particular underscores
  showstringspaces=false,         % underline spaces within strings
  showtabs=false,                 % show tabs within strings adding particular underscores
  frame=single,                   % adds a frame around the code
  tabsize=2,                      % sets default tabsize to 2 spaces
  captionpos=b,                   % sets the caption-position to bottom
  breaklines=true,                % sets automatic line breaking
  breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
  title=\lstname,                   % show the filename of files included with \lstinputlisting;
                                  % also try caption instead of title
  numberstyle=\tiny\color{gray},        % line number style
  keywordstyle=\color{blue},          % keyword style
  commentstyle=\color{dkgreen},       % comment style
  stringstyle=\color{mauve},         % string literal style
  escapeinside={\%*}{*)},            % if you want to add a comment within your code
  morekeywords={*,...}               % if you want to add more keywords to the set
}
\tableofcontents
\newpage
\section{\textbf{Creo que cinemática.}}
\subsection{\textbf{Transformaciones de Galileo:}}
\subsubsection{Crítica de la física clásica:}
\flushleft
\renewcommand{\labelitemi}{\textbullet}
\renewcommand{\labelitemii}{\textendash}
\begin{itemize}
        \item Mecánica Clásica: Estudio del movimiento:
        \begin {itemize}
        \item Isaac Newton ($1687$): \textit{\underline{Philosophiae naturalis principia mathematica}.}
        \item Joseph-Louis Lagrange ($1811$):\textit{\underline{Mecánique analítique}.}
        \item William Rowan Hamilton ($1834, 1835$):\textit{\underline{On a general method in Dynamics}} en \textit{\underline{The Philosophical Transactions of the Royal Society}.}
        \end {itemize}
        \item Electromagnetismo: Estudios de fenómenos eléctricos y electromagnéticos.
        \begin {itemize}
        \item James Clerk Maxwell ($1837$):\textit{\underline{A Treatise on Electricity and Magnetism}.}
        \end{itemize}
        \item Aplicación conjunto de ambas construcciones teóricas, se contradicen entre ellas.
        \item Teoría de la Relatividad Especial (Albert Einstein, $1905$: \textit{\underline{Zur Elektrodynamic bewegter körper}} en \textit{\underline{Annalen der Physic}}.
\end{itemize}
\subsubsection {\textbf{Fundamentos de mecánica clásica:}}

\begin {itemize}
\item Espacio absoluto y universal:

\begin {itemize}
\item Todo suceso ocurre en un espacio que es el mismo para todos los experimentos.
\end {itemize}

\item Tiempo absoluto y universal:

\begin {itemize}
\item Todo proceso discurre en un tiempo idéntico para todos los experimentos.
\end {itemize}

\item Sistema de referencia absoluto:

\begin {itemize}
\item Existe un sistema de referencia en el que son válidas las leyes de la Mecánica.
\item Problema: ¿Cómo son las leyes de la Mecánica en un sistema de referencia distinto del absoluto?
\end {itemize}

\item Esquema teórico:

\begin {itemize}
\item Sistema de referencia, $S$, con coordenadas $x,y,z,t$.
\item Sistema de referencia, $S'$, con coordenadas $x',y',z',t'$.
\item $S'$ se mueve con velocidad \[\vec v = cte\].
\end {itemize}

\item Elección de sistema de coordenadas:


\begin{itemize}
        \item Eje homónimos paralelos.
        \item Eje
\end{itemize}

\end {itemize}
                \end {document
}


Thak you.
oscarcapote
 
Posts: 2
Joined: Sun Jan 27th, 2013

Re: Compilation Failure due to invalid Character  Topic is solved

Postby Stefan_K on Sun Jan 27th, 2013

Hi,

welcome to the board!

The second example works for me without errors. I guess your original document contains an invisible invalid character (or has a wrong encoding). Try copy and paste into a new document. That was what I did: I copied and pasted from the browser from your forum post.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6413
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Compilation Failure due to invalid Character

Postby oscarcapote on Sun Jan 27th, 2013

Ohhh!! Thank's a lot! I do it and compiles fine thank you!
oscarcapote
 
Posts: 2
Joined: Sun Jan 27th, 2013

Re: Compilation Failure due to invalid Character

Postby localghost on Sun Jan 27th, 2013

Some concerns regarding your code.

  • The option 10.5pt for the document class is invalid. You should get a corresponding warning in the log file (*.log). Valid options are 10pt (default), 11pt or 12pt.

  • The language option (spanish here) for babel should either be given globally to the document class or local only to the package, but not both. A global option is preferable since other packages could benefit.

  • The driver option pdftex for graphicx should be dropped. It is superfluous since the package does best in choosing the right driver. Such an option can cause more problems than it solves.

  • The page and paper dimensions are better set by geometry and not the way as done in your examples.

Finally a tip regarding input encoding. As replacement for inputenc with a fixed input encoding you can use a semi-automatic mechanism by the selinput package from the oberdiek bundle. For Spanish this could look like the following.
Code: Select all  •  Open in writeLaTeX
\usepackage{selinput}  % Semi-automatic determination
\SelectInputMappings{  % of input encoding by a
  aacute={á},          % list of selected glyphs
  ntilde={ñ},          % see: http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
  Euro={€}
}



Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany


Topic Tags

charactersinput-encodings

Return to General

Who is online

Users browsing this forum: No registered users and 21 guests