nav-left cat-right
cat-right
Home » Blog » 2007 » Mai

Existenz von Paketen prüfen...

In meiner LaTeX Vorlage hatte ich Abfragen eingebaut die auf die Existenz von Befehlen als auch der geladenen Klassen prüfen. Davon ausgehend hat mich Markus Kohm darauf hingewiesen dass es grundsätzlich keine gute Idee ist auf die geladene Klasse zu prüfen wenn man nur daran interessiert ist ob eine Anweisung vorhanden ist (in meinem Fall z.B. der Befehl \chapter) oder nicht. Hier ein Beispiel zur Umsetzung der Prüfung auf Existenz der Anweisung \chapter bool Variable definieren
\newboolean{chapteravailable}%
\setboolean{chapteravailable}{false}%
Möglichkeiten zum Testen der Existenz einer Anweisung
  • TeX
    \begingroup\expandafter\expandafter\expandafter\endgroup
    \expandafter\ifx\csname chapter\endcsname\relax
      \setboolean{chapteravailable}{false}%
    \else
      \setboolean{chapteravailable}{true}%
    \fi
  • e-TeX
    % Is \chapter undefined? (needs e-TeX)
    \ifcsname chapter\endcsname
      \setboolean{chapteravailable}{true}%
    \else
      \setboolean{chapteravailable}{false}%
    \fi
  • feature of package scrkbase
    % Is \chapter undefined or relax?
    \RequiresPackage{scrkbase}
    \ifundefined{chapter}{% using a beta feature of KOMA-Script
      \setboolean{chapteravailable}{false}%
    }{
      \setboolean{chapteravailable}{true}%
    }
  • feature of KOMA-Script
    % Is \chapter undefined or relax and define it \relax,
    % if it was undefined
    \@ifundefined{chapter}{% using a beta feature of KOMA-Script
      \setboolean{chapteravailable}{false}%
    }{
      \setboolean{chapteravailable}{true}%
    }
Die entgültige Anweisung zum Test auf \chapter
\providecommand{\IfChapterDefined}[1]{\ifthenelse{\boolean{chapteravailable}}{#1}{}}%
\providecommand{\IfElseChapterDefined}[2]{\ifthenelse{\boolean{chapteravailable}}{#1}{#2}}%

changing of the mouse cursor...

The following code sets the mouse cursor to the waiting state and back to its default before:

	HCURSOR hCursorWait;
	HCURSOR hCursorDefault;
	hCursorWait = LoadCursor(NULL,IDC_WAIT);
	hCursorDefault = ::SetCursor(hCursorWait);
 
	::SetCursor(hCursorDefault);

Wordpress Plugins for WP 2.1.x...

  1. Pre Installed Plugins
  2. Admin
  3. Search
  4. Widgets
  5. Advertisment
  6. Comments
  7. Tables
  8. Web statistik and other information
    1. General Information
    2. Sitemap
  9. PHP inside Wordpress
  10. Syntax Highlighting
    1. … using Geshi
    2. … using javascript
  11. Post Processing
  12. Template extension
    1. Change Fontsize
    2. Breadcrumps
    3. Meta Keywords
    4. Print
    5. pages and navigation
  13. Contact Form
    1. no Ajax
    2. Ajax using
  14. Text Features
  15. Page expansion
  16. Editor Extensions
    1. WYSIWYG
    2. Spell checking
    3. Quicktags
  17. Image Gallery
  18. Ajax Extension

Pre Installed Plugins

  • Update-Monitor
  • Akismet
  • Follow-URL
  • o42-clean-umlauts 0.2.0
  • Time Zone
(weiterlesen…)