LaTeX forum ⇒ GeneralCompilation Failure due to invalid Character Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
oscarcapote
Posts: 2
Joined: Sun Jan 27, 2013 1:52 pm

Compilation Failure due to invalid Character

Postby oscarcapote » Sun Jan 27, 2013 2:18 pm

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:
  1. % Definimos el estilo del documento
  2. \documentclass[10.5pt,a4paper,spanish]{article}
  3. % Utilizamos el paquete para utilizar español
  4. \usepackage[spanish]{babel}
  5. % Utilizamos un paquete para gestionar los acentos y las eñes
  6. \usepackage[utf8]{inputenc}
  7. \usepackage[pdftex]{graphicx}
  8. % Definimos la zona de la pagina ocupada por el texto
  9. \oddsidemargin -1.0cm
  10. \headsep -2.4cm
  11. \textwidth=18.5cm
  12. \textheight=26cm
  13. \usepackage{fullpage}
  14. \usepackage{listings}
  15. \usepackage{color}
  16. \usepackage{amssymb}
  17. \usepackage{dsfont}
  18.  
  19.  
  20. \begin{document}
  21.  
  22. \title{\scshape {Tema 4:\\Elementos de mecánica analítica}}
  23. \author{Oscar Fajardo Fontiveros\\original de Jesús González}
  24. %\date{}
  25.  
  26. \maketitle
  27. \definecolor{dkgreen}{rgb}{0,0.6,0}
  28. \definecolor{gray}{rgb}{0.5,0.5,0.5}
  29. \definecolor{mauve}{rgb}{0.58,0,0.82}
  30.  
  31. \lstset{ %
  32. language=Octave, % the language of the code
  33. basicstyle=\footnotesize, % the size of the fonts that are used for the code
  34. numbers=left, % where to put the line-numbers
  35. numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
  36. stepnumber=1, % the step between two line-numbers. If it's 1, each line
  37. % will be numbered
  38. numbersep=5pt, % how far the line-numbers are from the code
  39. backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
  40. showspaces=false, % show spaces adding particular underscores
  41. showstringspaces=false, % underline spaces within strings
  42. showtabs=false, % show tabs within strings adding particular underscores
  43. frame=single, % adds a frame around the code
  44. tabsize=2, % sets default tabsize to 2 spaces
  45. captionpos=b, % sets the caption-position to bottom
  46. breaklines=true, % sets automatic line breaking
  47. breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
  48. title=\lstname, % show the filename of files included with \lstinputlisting;
  49. % also try caption instead of title
  50. numberstyle=\tiny\color{gray}, % line number style
  51. keywordstyle=\color{blue}, % keyword style
  52. commentstyle=\color{dkgreen}, % comment style
  53. stringstyle=\color{mauve}, % string literal style
  54. escapeinside={\%*}{*)}, % if you want to add a comment within your code
  55. morekeywords={*,...} % if you want to add more keywords to the set
  56. }
  57. \tableofcontents
  58. \newpage
  59. \section{\textbf{Cinemática y dinámica}}
  60. \subsection{\textbf{Sistema de coordenadas generalizadas}}
  61. \flushleft
  62. \renewcommand{\labelitemi}{\textbullet}
  63. \renewcommand{\labelitemii}{\textendash}
  64. \begin{itemize}
  65. \item Conjunto formado por el mínimo número de magnitudes necesario para determinar la posición del sistema.
  66. \begin {description}
  67. \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.
  68. \end {description}
  69. \item Ejemplos:
  70. \begin {itemize}
  71. \item Osciladores armónicos simples:$s = 1$ y $S = \left\{ x \right\}$
  72. \item Sistema de dos osciladores acoplados::$s = 2$ y $S = \left\{ x_1,x_2 \right\}$
  73. \item Problema de los dos cuerpos::$s = 6$ y $S = \left\{ X,Y,Z,x,y,z \right\}$
  74. \item Partículas de un campo de fuerzas centrales:$s = 1$ y $S = \left\{ r,\phi \right\}$
  75. \end{itemize}
  76. \item Cinemática:
  77. \begin {itemize}
  78. \item Cada sistema mecánico tiene un número bien definido de grados de libertad. $s \in \mathds{N}$
  79. \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.
  80. \end {itemize}
  81. \end{itemize}
  82. \subsubsection {\textbf{Ligaduras:}}
  83. \begin {itemize}
  84. \item Sistema de $N$ partículas en el espacio: $s=3N$ grados de libertad.
  85. \begin {itemize}
  86. \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\}$
  87. \end {itemize}
  88. \item Coordenadas generalizadas:$S = \left\{ {{q_1},{q_2},...,{q_{3N}}} \right\}$
  89. \item Ligaduras: restricciones sobre el movimiento del sistema.
  90. \item Tipos de ligaduras:
  91. \begin {description}
  92. \item \textbf{Ligaduras holónomas:} Se pueden expresar mediante ecuaciones que relacionan las coordenadas y el tiempo.
  93. \item \textbf{Ligaduras no holónomas:} No se pueden expresar mediante una ecuación de las coordenadas.
  94. \item \textbf{Ligaduras esclerónomas:} No dependen explícitamente del tiempo.
  95. \item \textbf{Ligaduras reónomas:} Dependen del tiempo.
  96. \end {description}
  97. \end {itemize}
  98. \subsubsection {\textbf{Ligaduras holónomas:}}
  99. \begin{itemize}
  100. \item Sistema de $N$ partículas: $f\left( {{q_1},{q_2},{q_3},...{q_{3N}};t} \right) = 0$
  101. \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)$
  102. \item Sistema de $N$ partículas sometidas a $h$ ligaduras holónomas distintas:\[s = 3N - h\]
  103. \item Osciladores harmónicos simples:
  104. \begin{itemize}
  105. \item Tres coordenadas:$S = \left\{ x,y,z \right\}$
  106. \item Dos ligaduras holónomas: $y=0; z=0$
  107. \item Movimiento unidimensional: $s = 1$ con $S = \left\{ x \right\}$
  108. \end{itemize}
  109. \end{itemize}
  110. \end{document}


And this is an example of a document that can't compile well. They have the same preamble.
  1. % Definimos el estilo del documento
  2. \documentclass[10.5pt,a4paper,spanish]{article}
  3. % Utilizamos el paquete para utilizar español
  4. \usepackage[spanish]{babel}
  5. % Utilizamos un paquete para gestionar los acentos y las eñes
  6. \usepackage[utf8]{inputenc}
  7. \usepackage[pdftex]{graphicx}
  8. % Definimos la zona de la pagina ocupada por el texto
  9. \oddsidemargin -1.0cm
  10. \headsep -2.4cm
  11. \textwidth=18.5cm
  12. \textheight=26cm
  13. \usepackage{fullpage}
  14. \usepackage{listings}
  15. \usepackage{color}
  16. \usepackage{amssymb}
  17. \usepackage{dsfont}
  18.  
  19.  
  20. \begin{document}
  21.  
  22. \title{\scshape {Tema 4:\\Elementos de mecánica analítica}}
  23. \author{Oscar Fajardo Fontiveros\\original de Jesús González}
  24. %\date{}
  25.  
  26. \maketitle
  27. \definecolor{dkgreen}{rgb}{0,0.6,0}
  28. \definecolor{gray}{rgb}{0.5,0.5,0.5}
  29. \definecolor{mauve}{rgb}{0.58,0,0.82}
  30.  
  31. \lstset{ %
  32. language=Octave, % the language of the code
  33. basicstyle=\footnotesize, % the size of the fonts that are used for the code
  34. numbers=left, % where to put the line-numbers
  35. numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
  36. stepnumber=1, % the step between two line-numbers. If it's 1, each line
  37. % will be numbered
  38. numbersep=5pt, % how far the line-numbers are from the code
  39. backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
  40. showspaces=false, % show spaces adding particular underscores
  41. showstringspaces=false, % underline spaces within strings
  42. showtabs=false, % show tabs within strings adding particular underscores
  43. frame=single, % adds a frame around the code
  44. tabsize=2, % sets default tabsize to 2 spaces
  45. captionpos=b, % sets the caption-position to bottom
  46. breaklines=true, % sets automatic line breaking
  47. breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
  48. title=\lstname, % show the filename of files included with \lstinputlisting;
  49. % also try caption instead of title
  50. numberstyle=\tiny\color{gray}, % line number style
  51. keywordstyle=\color{blue}, % keyword style
  52. commentstyle=\color{dkgreen}, % comment style
  53. stringstyle=\color{mauve}, % string literal style
  54. escapeinside={\%*}{*)}, % if you want to add a comment within your code
  55. morekeywords={*,...} % if you want to add more keywords to the set
  56. }
  57. \tableofcontents
  58. \newpage
  59. \section{\textbf{Creo que cinemática.}}
  60. \subsection{\textbf{Transformaciones de Galileo:}}
  61. \subsubsection{Crítica de la física clásica:}
  62. \flushleft
  63. \renewcommand{\labelitemi}{\textbullet}
  64. \renewcommand{\labelitemii}{\textendash}
  65. \begin{itemize}
  66. \item Mecánica Clásica: Estudio del movimiento:
  67. \begin {itemize}
  68. \item Isaac Newton ($1687$): \textit{\underline{Philosophiae naturalis principia mathematica}.}
  69. \item Joseph-Louis Lagrange ($1811$):\textit{\underline{Mecánique analítique}.}
  70. \item William Rowan Hamilton ($1834, 1835$):\textit{\underline{On a general method in Dynamics}} en \textit{\underline{The Philosophical Transactions of the Royal Society}.}
  71. \end {itemize}
  72. \item Electromagnetismo: Estudios de fenómenos eléctricos y electromagnéticos.
  73. \begin {itemize}
  74. \item James Clerk Maxwell ($1837$):\textit{\underline{A Treatise on Electricity and Magnetism}.}
  75. \end{itemize}
  76. \item Aplicación conjunto de ambas construcciones teóricas, se contradicen entre ellas.
  77. \item Teoría de la Relatividad Especial (Albert Einstein, $1905$: \textit{\underline{Zur Elektrodynamic bewegter körper}} en \textit{\underline{Annalen der Physic}}.
  78. \end{itemize}
  79. \subsubsection {\textbf{Fundamentos de mecánica clásica:}}
  80.  
  81. \begin {itemize}
  82. \item Espacio absoluto y universal:
  83.  
  84. \begin {itemize}
  85. \item Todo suceso ocurre en un espacio que es el mismo para todos los experimentos.
  86. \end {itemize}
  87.  
  88. \item Tiempo absoluto y universal:
  89.  
  90. \begin {itemize}
  91. \item Todo proceso discurre en un tiempo idéntico para todos los experimentos.
  92. \end {itemize}
  93.  
  94. \item Sistema de referencia absoluto:
  95.  
  96. \begin {itemize}
  97. \item Existe un sistema de referencia en el que son válidas las leyes de la Mecánica.
  98. \item Problema: ¿Cómo son las leyes de la Mecánica en un sistema de referencia distinto del absoluto?
  99. \end {itemize}
  100.  
  101. \item Esquema teórico:
  102.  
  103. \begin {itemize}
  104. \item Sistema de referencia, $S$, con coordenadas $x,y,z,t$.
  105. \item Sistema de referencia, $S'$, con coordenadas $x',y',z',t'$.
  106. \item $S'$ se mueve con velocidad \[\vec v = cte\].
  107. \end {itemize}
  108.  
  109. \item Elección de sistema de coordenadas:
  110.  
  111.  
  112. \begin{itemize}
  113. \item Eje homónimos paralelos.
  114. \item Eje
  115. \end{itemize}
  116.  
  117. \end {itemize}
  118. \end {document}


Thak you.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7804
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Jan 27, 2013 2:31 pm

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
Site admin

Link:
BBcode: Topic is solved[/url]" title="Click to select post's link in BBcode format" onclick="this.focus();this.select();" />
HTML: Topic is solved</a>" title="Click to select post's link in HTML format" onclick="this.focus();this.select();" />
Hide post links
Show post links

oscarcapote
Posts: 2
Joined: Sun Jan 27, 2013 1:52 pm

Postby oscarcapote » Sun Jan 27, 2013 2:47 pm

Ohhh!! Thank's a lot! I do it and compiles fine thank you!

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Sun Jan 27, 2013 3:13 pm

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.
  1. \usepackage{selinput} % Semi-automatic determination
  2. \SelectInputMappings{ % of input encoding by a
  3. aacute={á}, % list of selected glyphs
  4. ntilde={ñ}, % see: http://partners.adobe.com/public/developer/en/opentype/glyphlist.txt
  5. Euro={€}
  6. }



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

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: Yahoo [Bot] and 12 guests