Dollarzeichen in programm Umgebung

Redefinition von Makros, Definition eigener Befehle sowie neuer Umgebungen


freaksta
Forum-Newbie
Forum-Newbie
Beiträge: 3
Registriert: Mi 21. Jan 2009, 10:40

Dollarzeichen in programm Umgebung

Beitrag von freaksta »

Hallo Leute!

Ich bin neu hier und habe auch gleich ein erstes Problem. Ich bin im Moment am schreiben eines Artikels in Latex. Dazu habe ich das ganze mit dieser Umgebung erweitert um Programmteile einbinden zu können:
% Use a small font for the verbatim environment
\makeatletter  % makes '@' an ordinary character
\renewcommand{\verbatim@font}{
  \ttfamily\tiny\itshape\catcode`\<=\active\catcode`\>=\active }
\makeatother % makes '@' a special symbol again
%
% Prettyprint of XML
\usepackage{float}
\floatstyle{ruled}
\newfloat{program}{h}{lop}
\floatname{program}{Code}
%
Nun habe ich aber das Problem, dass ich in einer Programm Umgebung ein $ Zeichen brauche. Normal sollte er ja einfach das rausschreiben was in dieser Umgebung steht...aber es kommt statt Dollar ein Pfund-Zeichen (das komische L)...

...weiß einer Rat?

Danke schonmal!
Zuletzt geändert von freaksta am Do 22. Jan 2009, 11:54, insgesamt 1-mal geändert.

Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2500
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Dollarsymbol

Beitrag von Stefan Kottwitz »

Hallo,

willkommen im Forum!
Wenn Du ein Minmimalbeispiel zeigst, könnten wir das Problem konkret nachvollziehen.

Viele Grüße,

Stefan

DonCube
Forum-Guru
Forum-Guru
Beiträge: 291
Registriert: So 29. Jun 2008, 21:17
Wohnort: Bocholt

Beitrag von DonCube »

Also Stefans Rat solltest du zunächst beherzigen. Aber vielleicht meinst du einfach ein $ Zeichen in deinem Dokument? Versuch mal \$. Das müsste gehen.
Schau mal hier rein goLaTeX-Wiki, und gaaaanz wichtig Minimalbeispiel

freaksta
Forum-Newbie
Forum-Newbie
Beiträge: 3
Registriert: Mi 21. Jan 2009, 10:40

Beitrag von freaksta »

Achja, stimmt...sorry, hier ist das Beispiel:
\documentclass[a4paper]{article}

% Use a small font for the verbatim environment
\makeatletter  % makes '@' an ordinary character
\renewcommand{\verbatim@font}{
  \ttfamily\tiny\itshape\catcode`\<=\active\catcode`\>=\active }
\makeatother % makes '@' a special symbol again
%
% Prettyprint of XML
\usepackage{float}
\floatstyle{ruled}
\newfloat{program}{h}{lop}
\floatname{program}{Code}
%

\begin{document}

\begin{program}
\begin{verbatim}

$   \$

\end{verbatim}
\caption{Example for dollar}
\label{code:creator}
\end{program}

\end{document}
escapen funktioniert nicht, da er alle zeichen einfach rausschreibt...keine ahnung warum das dann mitm $ nicht geschieht...

...danke schonmal für die Bemerkungen!

Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2500
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Schriftcodierung

Beitrag von Stefan Kottwitz »

Hallo,

es funktioniert mit
\usepackage[T1]{fontenc}
Viele Grüße,

Stefan

freaksta
Forum-Newbie
Forum-Newbie
Beiträge: 3
Registriert: Mi 21. Jan 2009, 10:40

Beitrag von freaksta »

Super!!! Dankeschön :)

Es funktioniert damit zumindest schon mal in meinem Minimalbeispiel...leider mit dem Style den ich verwenden muss nicht...

Benutzeravatar
Stefan Kottwitz
Admin
Admin
Beiträge: 2500
Registriert: Di 8. Jul 2008, 00:39
Kontaktdaten:

Schriftcodierung

Beitrag von Stefan Kottwitz »

Hallo,

Du könntest Deine Vorlage als Anhang hier posten, dann kriegen wir das sicher auch hin. Oder versuche, aus der Vorlage heraus ein Minimalbeispiel zu produzieren, durch schrittweise Reduktion. Evtl. poste die Einstellungen der Vorlage, die mit Schriftart bzw. Schriftcodierung zu tun haben.

Viele Grüße,

Stefan

SWNbg

php code ausgeben mit $ und "

Beitrag von SWNbg »

Hallo,
das ist mein php-Script.
<?php

/********************************************
PayReceipt.php

This file is called after the user clicks on a button during
the Pay process to use PayPal's AdaptivePayments Pay features.
The user logs in to their PayPal account.
Called by sp_...php
Calls  CallerService.php,and APIError.php.
********************************************/

require_once '../lib/AdaptivePayments.php';
require_once 'web_constants.php';

session_start();

			try {
				
		        /* The servername and serverport tells PayPal where the buyer
		           should be directed back to after authorizing payment.
		           In this case, its the local webserver that is running this script
		           Using the servername and serverport, the return URL is the first
		           portion of the URL that buyers will return to after authorizing payment                */
		
		           $serverName = $_SERVER['SERVER_NAME'];
		           $serverPort = $_SERVER['SERVER_PORT'];
		           $url=dirname('http://'.$serverName.':'.$serverPort.$_SERVER['REQUEST_URI']);
		
		
		           /* The returnURL is the location where buyers return when a
		            payment has been succesfully authorized.
		            The cancelURL is the location buyers are sent to when they hit the
		            cancel button during authorization of payment during the PayPal flow                 */
		
		           $returnURL = $url. "../";
		           $cancelURL = $url. "../";
		           //$currencyCode =$_REQUEST['currencyCode'];
		           $currencyCode = "EUR";
		           //$email = $_REQUEST["email"];
		           $email = "buyer_1257249283_pre@domain.tld";
				   //$preapprovalKey = $_REQUEST["preapprovalKey"];
				   $preapprovalKey = "PA-nummer";	
		           $requested='';
		           //$receiverEmail='';
		           $receiverEmail = 'seller_1265314515_biz@domain.tld';
		           $amount='';
		           $count= count($_POST['receiveremail']);
		           //$customerID = $_REQUEST["customerId"];
		           $customerID = "2072355";
		           $memo = $_REQUEST["memo"];
		           $memo = "Matrikelnummer: " . $customerID . "<br /> Verwendungszweck: " . $memo;
		                                 
		           $payRequest = new PayRequest();
		           $payRequest->actionType = "PAY";
				   $payRequest->cancelUrl = $cancelURL ;
				   $payRequest->returnUrl = $returnURL;
				   $payRequest->clientDetails = new ClientDetailsType();
				   $payRequest->clientDetails->applicationId ="APP-1JE4291016473214C";
		           $payRequest->clientDetails->deviceId = "127001";
		           $payRequest->clientDetails->ipAddress = "127.0.0.1";
		           /*customerId*/
		           $payRequest->clientDetails->customerId = $customerID;
		           
		           $payRequest->currencyCode = $currencyCode;
		           $payRequest->senderEmail = $email;
		           $payRequest->requestEnvelope = new RequestEnvelope();
		           $payRequest->requestEnvelope->errorLanguage = "en_US";
		           if($preapprovalKey != "")
		           {
		           	$payRequest->preapprovalKey = $preapprovalKey ;
		           }          	
		           $receiver1 = new receiver();
		           //$receiver1->email = $_POST['receiveremail'][0];
		           $receiver1->email = $receiverEmail;
		           $receiver1->amount = $_REQUEST['amount'][0];
		           
		           //$receiver2 = new receiver();
		           //$receiver2->email = $_POST['receiveremail'][1];
		           //$receiver2->amount = $_REQUEST['amount'][1];
		           	
		           $payRequest->receiverList = array($receiver1);
		           	           	
		           $payRequest->memo = $memo;
		           		           	
		           /* Make the call to PayPal to get the Pay token
		            If the API call succeded, then redirect the buyer to PayPal
		            to begin to authorize payment.  If an error occured, show the
		            resulting errors
		            */
		           $ap = new AdaptivePayments();
		           $response=$ap->Pay($payRequest);
		           
		           if(strtoupper($ap->isSuccess) == 'FAILURE')
					{
						$_SESSION['SOAPFAULT']=$ap->getLastError();
						$location = "APIError.php";
						header("Location: $location");
					
					}
					else
					{
						$_SESSION['payKey'] = $response->payKey;
						if($response->paymentExecStatus == "COMPLETED")
						{
							//$location = "../sp_details.php";
							$location = "../";
							header("Location: $location");
						}
						else
						{
							$token = $response->payKey;
							$payPalURL = PAYPAL_REDIRECT_URL.'_ap-payment&paykey='.$token;
		                    header("Location: ".$payPalURL);
						}
					}
			}
			catch(Exception $ex) {
				
				$fault = new FaultMessage();
				$errorData = new ErrorData();
				$errorData->errorId = $ex->getFile() ;
  				$errorData->message = $ex->getMessage();
		  		$fault->error = $errorData;
				$_SESSION['SOAPFAULT']=$fault;
				$location = "APIError.php";
				header("Location: $location");
			}

?>
Den binde ich wie alle meine Listings per
\lstinputlisting[caption={sp-receipt.php - Datenverarbeitung},label=code:sp_receipt.php]{listings/webapp/sp_receipt.php}
ein.

Leider kommen 101 Fehlermeldung, hauptsächlich zu den $- und "-Zeichen.

Jemand einen Rat?

Vielen Dank.

Gruß Stefan

Antworten