LyXundefined control sequence \addto

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Re: undefined control sequence -LyX

Post by pooz »

Hi Stefan_K,

this might be a bit old, because I couldn´t get any help, unfortunately :cry:

I could not solve any problems, yet. The only difference is, I am trying to compile this template with TeXShop right now, but the first 2 errors are still the same. Hitting 2 times <enter> will continue compiling, but this doesn´t sound good to me :-)

I would be glad, if we could solve this problem both in LyX and in TeXShop. But TeXShop only would be fine, too!

Thanks for any help
pooz

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

undefined control sequence \addto

Post by Stefan Kottwitz »

A quick look at this posting of the same topic and regarding the following posts:
  • You are using \chapter* with the article class, it's not supporting chapters, a class like book or report is necessary.
  • In order to use \arrayrulecolor you have to load the package colortbl or xcolor:

    Code: Select all

    \usepackage{colortbl}
    or

    Code: Select all

    \usepackage[table]{xcolor}
  • The colors hsurot and hsugrau have to be defined before use.
  • Package keyval Error: directivestyle undefined. seems to concern the listings package, but I need more information like the corresponding code.
  • Package ifpdf Error - do you really need this package? I would get rid of it.
  • Undefined control sequence. \addto There it seems that the babel backage has not been loaded.
  • \start_of_appendix should belong to LyX, here's also more information needed.
Have a look at these points, we can discuss details further. Just post additional error messages together with the corresponding code, we will have a look at it.

Stefan
LaTeX.org admin
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

undefined control sequence \addto

Post by pooz »

Thanks Stefan,

for your help.
Due to trying to use the same template in 2 different programs (LyX and TeXShop), I suggest solving my problem fist only for TeXShop.

TeXShop only produces the first 2 errors of this post e.g
( 1.) Package keyval Error: directivestyle undefined, 2.) Package ifpdf Error)

To error Nr.1)
When pressing "go to error" the cursor jumps to the curly brace '}' in the last line.

Code: Select all

\usepackage{listings}

\lstloadlanguages{}

\lstloadlanguages{C,C++,Java,Matlab,HTML,TeX,XML}


%\lstset{}% restore default
%# title={Titel}:  gibt einen Titel zur Umgebung an (erscheint ¸ber dem Code zentriert)
%# caption={Titel}:  
%# label=Name:

\lstset{
				frame=lines, %Umrandung (single|none|shadowbox|lines|bottomline|topline|leftline)
				framerule=1pt, %Rahmenbreite
				tabsize=4, %Anzahl der Zeichen f¸r ein TAB
				backgroundcolor=\color{lightgray}, %Hintergrundfarbe
				emph={}, %hebt die angegebenen Wˆrter hervor
				emphstyle=\underbar, %unterstreicht hervorgehobene Wˆrter
				columns=fixed, %Zeichenabstand (fixed | flexible | fullflexible)
				lineskip=0pt, %Zeilenabstand
				basicstyle=\ttfamily,%\ttfamily,
				identifierstyle=\color{black},
        commentstyle=\color{darkgreen},
        stringstyle=\color{viola},
        keywordstyle=\color{darkblue},
				ndkeywordstyle=\color{black},
				directivestyle=,
				showspaces=false,
				showtabs=false,
				numbers=none, %Zeilennummern (none|left|right)
				%numbertype=\ttfamily,
				breaklines=true,
        captionpos=b,
        extendedchars=false
}

To error Nr.2)
I don´t know what this package is used for. It is written in the template the institute of the university gave to me and which all other students should use also. Maybe I can ask them, what I need them for?

In the case, it has to be used, what might be the error there?
Thank you!
pooz
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

undefined control sequence \addto

Post by Stefan Kottwitz »

1) just remove the line

Code: Select all

directivestyle=,
if you don't need this style. It's available for certain languages only.

2) perhaps just remove the line

Code: Select all

\usepackage{ifpdf}
or post the class file as attachment here to examine it.

Stefan
LaTeX.org admin
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

undefined control sequence \addto

Post by pooz »

1.)
What is this style for? I wasn´t able to google a proper answer?

2.)

Code: Select all

% pdf-tex settings:
% ------------------------
% detect automatically if run by latex or pdflatex
\newif\ifpdf  
\ifx\pdfoutput\undefined
   \pdffalse
\else
   \pdfoutput=1
   \pdftrue
\fi

\ifpdf % compiling with pdflatex
   \usepackage[pdftex]{graphicx}
   \DeclareGraphicsExtensions{.pdf, .png, .jpg}
   \usepackage[pdftex,
	bookmarks,
	%colorlinks=false, % instead of colors, now boxes are used for links
	colorlinks=true,
	urlcolor=black, %blue,
	linkcolor=black, %red, %normal internal links
	citecolor=black, %green, %citation links
	%pagebackref, %link from references back to page of citation
	linktocpage, 
	% im Inhaltsverzeichnis Link auf Seitenzahl (sonst Probleme bei langen Zeilen)
	%breaklinks = true, % f¸r Links l‰nger als 1 Zeile
	%hypertexnames = false,  % f¸r Links zu Figures?
	bookmarksopen, %open all bookmark folders
	bookmarksnumbered, %use section numbers with bookmarks
    pdfpagemode=UseOutlines, %show bookmarks
	% http://www.tex.ac.uk/cgi-bin/texfaq2html?label=pdfpagelabels
	plainpages=false, % eigene Seitenanker f¸r rˆmische/arabische Seitenzahlen
	pdfpagelabels, % im Abode Reader Seitenzahl als z.B. "iii (3 von 20)" anzeigen
%	pdfstartview=FitH
	pdfstartview=FitV
	]{hyperref}
    \pdfadjustspacing=1                %%% force LaTeX-like character spacing
    \pdfcompresslevel=9
	\pdfcatalog{                 
	% Catalog dictionary of PDF output. 
    % /PageMode /UseNone          
    % /URI (http://www.fi.muni.cz/)
	%       
	% pdfscreen-like setting might look like:
	%     /PageMode /none 
	%     /ViewerPreferences << 
	%         /HideToolbar true            
	%         /HideMenubar true 
	%         /HideWindowUI true 
	%         /FitWindow true 
	%         /CenterWindow true 
	%	
	% /PageMode determines how Acrobat displays the document on startup. 
	% The possibilities for the latter are explained below:
	% Supported /PageMode values.
	% /UseNone 		neither outline nor thumbnails visible
	% /UseOutlines 	outline visible
	% /UseThumbs 	thumbnails visible
	% /FullScreen 	full--screen mode
	% In full--screen mode, there is no menu bar, window controls, 
	% nor any other window present. The default setting is /UseNone.
	} %end of \pdfcatalog
\else % compiling with latex
  \usepackage[dvips]{graphicx}
%  \usepackage{color}
  \DeclareGraphicsExtensions{.eps}
  \usepackage[
    dvips,
%	ps2pdf,  % statt dvips, Unterschied???
	bookmarks,
  	colorlinks=false,  % for final paper without colors
%  	colorlinks=true,
	linktocpage, 	
	% im Inhaltsverzeichnis Link auf Seitenzahl (sonst Probleme bei langen Zeilen)
	%breaklinks = true, % f¸r Links l‰nger als 1 Zeile
	% funktioniert *nicht* korrekt f¸r lange Zeilen mit gs < 7.05.3 ?
%	pdfstartview=FitH, % funktioniert NICHT mit Adobe Distiller
	bookmarksopen, %open all bookmark folders
	bookmarksnumbered, %use section numbers with bookmarks
    pdfpagemode=UseOutlines, %show bookmarks
	pdfstartview=FitV
   ]{hyperref}
  % hyperrefs are active is the pdf file after conversion
  \hypersetup{
	pdfcreator  = {LaTeX with hyperref package},
	pdfproducer = {dvips + ps2pdf}
  }
\fi
Thank you!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

undefined control sequence \addto

Post by Stefan Kottwitz »

1.) it determines the style of language directives, if existent. Just look for directives in the listings manual, type texdoc listings or look on CTAN.

2.) the definition of \ifpdf clashes with the ifpdf package. Remove the code you don't need, you probably know if you want to produce pdf or dvi. A workaround could be to disable \ifpdf like

Code: Select all

\ifpdf % compiling with pdflatex
   \let\ifpdf\relax
   \usepackage[pdftex]{graphicx}
   \DeclareGraphicsExtensions{.pdf, .png, .jpg}
...
Stefan
LaTeX.org admin
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

undefined control sequence \addto

Post by pooz »

1. Unfortunately I didn´t get the meaning of texdoc listings type, although I´ve understood the function of listings :?

2. "relax-Command" works.

To both: I don´t understand, why there are these errors in a template, created by an institute of a university. Is this an environment-problem, concerning that I am on OS X while the template was configured for Windows? Because I am not the first one unsing this template. Didn´t all the other students have these problems? *confused...

Thanks for your help, Stefan.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10320
Joined: Mon Mar 10, 2008 9:44 pm

Re: undefined control sequence -LyX

Post by Stefan Kottwitz »

I assume the template has been working fine for some time, but though LaTeX is stable additional packages have been developed further. Previously used methods could become obsolete, conflicts may occur. Packages today using the ifpdf package internally could now conflict with older styles/classes using a self-defined \ifpdf before the ifpdf package came up.

Stefan
LaTeX.org admin
pooz
Posts: 65
Joined: Sat Apr 11, 2009 10:47 am

Re: undefined control sequence -LyX

Post by pooz »

Ok, thank you very much. I will later ask the creator, if this template is up-to-date.
And after all, I will try to import this template into LyX. I will import the main .tex file with LyX and give a feedback.

Greetings
Pooz
Post Reply