download pdf in mvc : Save pdf to tiff SDK software service wpf winforms html dnn listings4-part336

4.15 Interface e tofancyvrb
The fancyvrb b package|fancy y verbatims|from Timothy van n Zandt t provides
macros forreading,writingandtypesettingverbatimcode. . Ithassomeremark-
ablefeaturesthelistingspackagedoesn’thave. (Somearepossible,butyoumust
ndsomebodywhowillimplementthem;-).
fancyvrb=htruejfalsei
activates or deactivates the interface. . If f active, verbatim code is readby
fancyvrb but typeset by listings, , i.e. . with emphasized d keywords, , strings,
comments, and d so on. . Internally y we use a very special denition of
\FancyVerbFormatLine.
Thisinterfaceworks withVerbatim,BVerbatimandLVerbatim. . But t you
shouldn’tusefancyvrb’sdefineactive. (AsfarasIcanseeitdoesn’tmatter
sinceitdoesnothingatall,butforsafety....)Iffancyvrbandlistingsprovide
similarfunctionality,youshouldusefancyvrb’s.
\overlay1
fvcmdparams=hcommand
1
ihnumber
1
i...
morefvcmdparams=hcommand
1
ihnumber
1
i...
Ifyouusefancyvrb’scommandchars,youmusttellthelistingspackagehow
manyargumentseachcommandtakes. Ifacommandtakesnoarguments,
thereisnothingtodo.
Therst(third,fth,...) parametertothekeysisthecommandandthe
second(fourth,sixth,...) isthenumberofargumentsthatcommandtakes.
So,ifyouwanttouse\textcolor{red}{keyword}withthefancyvrb-listings
interface,youshouldwrite\lstset{morefvcmdparams=\textcolor 2}.
First verbatim line.
Second
verbatim line.
First verbatim line.
Second
verbatim line.
\lstset{morecomment=[l]\ }% :-)
\fvset{commandchars=\\\{\}}
\begin{BVerbatim}
First verbatim line.
\fbox{Second} verbatim line.
\end{BVerbatim}
\par\vspace{72.27pt}
\lstset{fancyvrb}
\begin{BVerbatim}
First verbatim line.
\fbox{Second} verbatim line.
\end{BVerbatim}
\lstset{fancyvrb=false}
Thelines typeset by the listingspackage arewidersince the default basewidth
doesn’tequalthewidthofasingletypewritertypecharacter.Moreover,notethat
therstspacebeginsacommentasdenedatthebeginningoftheexample.
4.16 Environments
If youwant to deneyour ownpretty-printing environments, try thefollowing
command. ThesyntaxcomesfromLAT
E
X’s\newenvironment.
41
Save pdf to tiff - Convert PDF to tiff images in C#.net, ASP.NET MVC, Ajax, WinForms, WPF
Online C# Tutorial for How to Convert PDF File to Tiff Image File
convert pdf to tiff file online; how to convert pdf to tiff format online
Save pdf to tiff - VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.net, ASP.NET MVC, Ajax, WinForms, WPF
Free VB.NET Guide to Render and Convert PDF Document to TIFF
online pdf to tiff conversion; c# pdf to tiff
\lstnewenvironment
{hnamei}[hnumberi][hopt.defaultarg.i]
{hstartingcodei}
{hendingcodei}
Asasimpleexamplewecouldjustselectaparticularlanguage.
\lstnewenvironment{pascal}
{\lstset{language=pascal}}
{}
for i:=maxint t to 0 0 do
begin
f do o nothing g
end;
\begin{pascal}
for i:=maxint to o 0 0 do
begin
{ do nothing g }
end;
\end{pascal}
Doingotherthingsisaseasy,forexample,usingmorekeysandaddinganoptional
argumenttoadjustsettingseachlisting:
\lstnewenvironment{pascalx}[1][]
{\lstset{language=pascal,numbers=left,numberstyle=\tiny,float,#1}}
{}
4.17 ShortInline e ListingCommands
Shortequivalentsof\lstinlinecanalsobedened,inamannersimilartothe
shortverbatimmacrosprovidedbyshortvrb.
\lstMakeShortInline[[hoptionsi]]hcharacteri
deneshcharacteritobeanequivalentof\lstinline[[hoptionsi]]hcharacteri,
allowingforaconvenientsyntaxwhenusinglotsofinlinelistings.
\lstDeleteShortInlinehcharacteri
removesadenitionofhcharactericreatedby \lstMakeShortInline,and
returnshcharacteritoitspreviousmeaning.
4.18 Languagedenitions
Youshouldrstreadsection3.2foranintroductiontolanguagedenitions. Oth-
erwiseyou’reprobablyunpreparedforthefullsyntaxof\lstdefinelanguage.
\lstdefinelanguage
[[hdialecti]]{hlanguagei}
[[hbasedialecti]{handbaselanguagei}]
{hkey=valuelisti}
[[hlistofrequiredaspects(keywordcomments,texcs,etc.)i]]
denesthe(givendialectofthe)programminglanguagehlanguagei. Ifthe
languagedenitionisbasedonanotherdenition,youmustspecifythewhole
[hbase dialecti]{handbase languagei}. . Notethatanemptyhbase e dialecti
usesthedefaultdialect!
42
C# Create PDF from Tiff Library to convert tif images to PDF in C#
desStream). Description: Convert to PDF/TIFF with specified resolution and save it into stream. Parameters: Name, Description, Valid Value.
pdf to tiff converter without watermark; program to automatically convert pdf to tiff
C# TIFF: Get to Start - Create, Load, & Save TIFF in C#.NET
C# TIFF - Create, Load and Save TIFF File. How to Load, Create and Save TIFF Image File Using C#.NET Programming. C# TIFF - How to Save TIFF Image File.
pdf to tiff c# open source; convert pdf into tiff
The last optionalargument shouldspecifyallrequiredaspects. . This s isa
delicatepointsincetheaspectsaredescribedinthedeveloper’sguide. You
mightuseexistinglanguagesastemplates. Forexample,ANSICuseskey-
words,comments,stringsanddirectives.
\lst@definelanguagehasthesamesyntaxandisusedtodenelanguages
inthedriverles.
! WhereshouldI I put my language denition?
If you u need the language for one partic-
ulardocument, putit into thepreambleof that document. . Otherwise e createthe localle
‘lstlang0.sty’ oradd the e denition n to that le, , but t use ‘\lst@definelanguage’ instead
of ‘\lstdefinelanguage’. . However, , you might wantto send the denition tothe address
insection2.1. Thenitwill l beincluded withthe rest of f the languages distributedwiththe
package,andpublishedundertheLAT
E
XProjectPublicLicense.
\lstalias{haliasi}{hlanguagei}
denesanalias for aprogramminglanguage. . Eachhaliasiisredirectedto
thesamedialectofhlanguagei. It’s s alsopossibletodeneanaliasforone
particulardialectonly:
\lstalias[haliasdialecti]{haliasi}[hdialecti]{hlanguagei}
Hereallfourparametersarenonoptional andanaliaswithemptyhdialecti
will select the default dialect. . Note e that aliases cannot be chained: : The
two aliases s ‘\lstalias{foo1}{foo2}’ ’ and ‘\lstalias{foo2}{foo3}’ will
not redirectfoo1tofoo3.
Allremainingkeysinthissectionareintendedforbuildinglanguagedenitions.
Nootherkeyshouldbeusedinsuchadenition!
Keywords Webeginwithkeywordbuildingkeys. . Note: Ifyouwanttoenter
\,{,},%,#or&as(partof)anargumenttothekeywordsbelow,youmustdoit
withaprecedingbackslash!
†bug
keywordsprefix=hprexi
Allidentiersstartingwithhprexiwillbeprintedasrstorderkeywords.
Bugs: Currentlythereareseverallimitations. (1)Theprexisalwayscase
sensitive. (2)Onlyoneprexcanbedenedatatime. (3)Ifused‘stan-
dalone’outsidealanguagedenition,thekeymightworkonlyafterselecting
anonemptylanguage(andswitchingbacktotheemptylanguageifneces-
sary). (4)Thekeydoesnotrespectthevalueof f classoffsetandhasno
optionalclasshnumberiargument.
keywords=[hnumberi]{hlistofkeywordsi}
morekeywords=[hnumberi]{hlistofkeywordsi}
deletekeywords=[hnumberi]{hlistofkeywordsi}
dene,addtoorremovethekeywordsfromkeywordlisthnumberi.Theuse
of keywordsis discouragedsinceitdeletes allpreviouslydenedkeywords
inthelistandisthusincompatiblewiththealsolanguagekey.
Pleasenotethekeysalsoletterandalsodigitbelowifyouuseunusual
charatersinkeywords.
43
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
Convert to DOCX/TIFF with specified zoom value and save it into DocumentType.DOCX DocumentType.TIFF. zoomValue, The magnification of the original PDF page size.
how to convert pdf to tiff image; pdf to tiff file conversion
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Description: Convert to PDF/TIFF and save it on the disk. Parameters: Description: Convert to PDF/TIFF and save it into stream. Parameters:
program to convert pdf to tiff; compare pdf to tiff
deprecated
ndkeywords={hlistofkeywordsi}
deprecated
morendkeywords={hlistofkeywordsi}
deprecated
deletendkeywords={hlistofkeywordsi}
dene,addtoorremovethekeywordsfrom keywordlist 2; notethat this
is equivalent t tokeywords=[2]...etc. . The e use of f ndkeywords s is s strongly
discouraged.
addon,optional
texcs=[hclassnumberi]{hlistofcontrolsequences(withoutbackslashes)i}
addon,optional
moretexcs=[hclassnumberi]{hlistofcontrolsequences(withoutbackslashes)i}
addon,optional
deletetexcs=[hclassnumberi]{hlistofcontrolsequences(withoutbackslashes)i}
DittoforcontrolsequencesinT
E
XandLAT
E
X.
optional
directives={hlistofcompilerdirectivesi}
optional
moredirectives={hlistofcompilerdirectivesi}
optional
deletedirectives={hlistofcompilerdirectivesi}
denescompilerdirectivesinC,C++,Objective-C,andPOV.
sensitive=htruejfalsei
makes the keywords, control sequences, and directives case sensitive e and
insensitive,respectively. This s key aects thekeywords,control l sequences,
anddirectivesonlywhenalistingisprocessed.Inallothersituationstheyare
case sensitive, for example, deletekeywords={save,Test} removes ‘save’
and‘Test’,butneither‘SavE’nor‘test’.
alsoletter={hcharactersequencei}
alsodigit={hcharactersequencei}
alsoother={hcharactersequencei}
Allidentiers (keywords,directives, , andsuch) consist ofa letter r followed
byalpha-numericcharacters(lettersanddigits). Forexample,ifyouwrite
keywords={one-two,\#include},theminussignmustbecomeadigitand
thesharpalettersincethekeywordscan’tbedetectedotherwise.
Table2showthestandardcongurationofthelistingspackage. Thethree
keys overwrite the default behaviour. . Eachcharacterof f the sequence be-
comesaletter,digitandother,respectively.
otherkeywords={hkeywordsi}
Deneskeywords thatcontainothercharacters,or startwithdigits. . Each
given‘keyword’isprintedinkeywordstyle,butwithoutchangingthe‘letter’,
‘digit’ and‘other’status s of the characters. . This s key is designedtodene
keywordslike=>,->,-->,--,::,andsoon.Ifonekeywordisasubsequence
ofanother(like--and-->),youmustspecifytheshorterrst.
renamed,optional
tag=hcharacterihcharacteri
or
tag={}
Therstorderkeywordsareactiveonlybetweentherstandsecondchar-
acter. ThiskeyisusedforHTML.
44
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Description: Convert to PDF/TIFF and save it on the disk. Parameters: Description: Convert to PDF/TIFF and save it into stream. Parameters:
pdf to tiff converter open source c#; convert pdf to 300 dpi tiff
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Description: Convert to PDF/TIFF and save it on the disk. Parameters: Description: Convert to PDF/TIFF and save it into stream. Parameters:
batch pdf to tiff converter; convert pdf images to tiff
Table2: Standardcharactertable
class
characters
letter
A B B C D E F G H I J K L M N O P Q R S T T U U V W X Y Z
a b b c d e f g h i j k l m n o p q r s t t u u v w x y z
@ $ $ _
digit
0 1 1 2 3 4 5 6 7 8 9
other
! " " # % & ’ ( ) * + , - . / : ; < = > ?
[ \ \ ] ^ { | } ~
space
chr(32)
tabulator chr(9)
formfeed chr(12)
Note:Extendedcharactersofcodes128{255(ifdened)arecurrentlyletters.
Strings
string=[hbjdjmjbdjsi]{hdelimiter(character)i}
morestring=[hbjdjmjbdjsi]{hdelimiteri}
deletestring=[hbjdjmjbdjsi]{hdelimiteri}
dene,addtoordeletethedelimiterfromthelistofstringdelimiters.Start-
ingandendingdelimitersarethesame,i.e.inthesourcecodethedelimiters
mustmatcheachother.
Theoptionalargumentisthetypeandcontrolsthehowthedelimiteritself
isrepresentedinastringorcharacterliteral: it t is escapedbyabackslash,
doubled(orbothis allowedvia a bd). . Alternately,the e typecanrefertoan
unusualformofdelimiter: stringdelimiters(akintothescommenttype)or
matlab-styledelimiters.ThelatterisaspecialtypeforAdaandMatlaband
possiblyotherlanguageswherethestringdelimitersarealsousedforother
purposes. Itisequivalenttod,except t thatastringdoesnot startafter a
letter,arightparenthesis,arightbracket,orsomeothercharacters.
Comments
comment=[htypei]hdelimiter(s)i
morecomment=[htypei]hdelimiter(s)i
deletecomment=[htypei]hdelimiter(s)i
Dittofor comments,butsome types require more thanasingle delimiter.
Thefollowingoverviewusesmorecommentastheexample,buttheexamples
applytocommentanddeletecommentaswell.
morecomment=[l]hdelimiteri
The delimiter starts acommentline,whichingeneralstarts withthede-
limiterandendsatendofline. Ifthecharactersequence//shouldstarta
commentline(likeinC++,Comal80or Java),morecomment=[l]//isthe
correctdeclaration.ForMatlabitwouldbemorecomment=[l]\%|notethe
precedingbackslash.
45
C# TIFF: How to Convert TIFF File to PDF Document in C# Project
doc = new TIFFDocument(@"demo1.tif"); if (null == doc) throw new Exception("Fail to load TIFF Document"); // Convert Tiff to PDF and save PDF as file.
best pdf to tiff converter; program convert pdf to tiff
C# TIFF: TIFF Editor SDK to Read & Manipulate TIFF File Using C#.
Excel/PPT/PDF/Jpeg to Tiff conversion. Tiff File Processing in C#. Refer to this online tutorial page, you will see: 1. Create, load, and save Tiff file using C#
converting pdf to tiff; how to convert pdf file to tiff
morecomment=[s]{hdelimiteri}{hdelimiteri}
Here we have two o delimiters. . The e second ends a comment starting
with the rst delimiter. . If f you require e two such h comments s you can
use this s type e twice. . C, , Java, , PL/I, , Prolog and SQL all dene sin-
gle comments via morecomment=[s]{/*}{*/}, , and d Algol does it with
morecomment=[s]{\#}{\#},whichmeansthatthesharpdelimitsbothbe-
ginningandendofasinglecomment.
morecomment=[n]{hdelimiteri}{hdelimiteri}
is similar to type e s, , but comments s can be e nested. . Identical l arguments
are not t allowed|think k a while about t it! ! Modula-2 2 and Oberon-2 use
morecomment=[n]{(*}{*)}.
morecomment=[f]hdelimiteri
morecomment=[f][commentstyle][hn=precedingcolumnsi]hdelimiteri
The delimiter starts a comment t line e if f andonly y if it appears on n a xed
column-number,namelyifitisincolumnn(zerobased).
optional
keywordcomment={hkeywordsi}
optional
morekeywordcomment={hkeywordsi}
optional
deletekeywordcomment={hkeywordsi}
Akeywordcommentbeginswithakeywordandendswiththesamekeyword.
Considerkeywordcomment={comment,co}. Then‘comment...comment’
and‘co...co’arecomments.
optional
keywordcommentsemicolon={hkeywordsi}{hkeywordsi}{hkeywordsi}
The denition n of f a ‘keyword d comment semicolon’ requires s three keyword
lists, e.g. . {end}{else,end}{comment}. . A A semicolon n always s ends s such a
comment. Anykeywordof f therst argument begins acomment andany
keywordofthesecondargumentendsit(andasemicolonalso);acomment
starting with any y keyword of the e thirdargument t is terminated with the
nextsemicolononly.Intheexampleallpossiblecommentsare‘end...else’,
‘end...end’ (does not t start a comment again) and ‘comment...;’ and
‘end...;’. Maybeacuriousdenition,butAlgolandSimulausesuchcom-
ments.
Note: Thekeywordshereneednottobeasubsetofthedenedkeywords.
Theywon’tappearinkeywordstyleiftheyaren’t.
optional
podcomment=htruejfalsei
activatesordeactivatesPODs|Perlspecic.
4.19 Installation
Softwareinstallation
1. FollowingtheT
E
Xdirectorystructure(TDS),youshouldputthelesofthe
listingspackageintodirectoriesasfollows:
46
VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
this RasterEdge XDoc.PDF SDK, you can simply delete a single page from a PDF document using VB.NET or remove any page from a PDF document and save to local
pdf to tiff conversion online; pdf to tiff file
listings.pdf
!
texmf/doc/latex/listings
listings.dtx,listings.ins,
listings.ind,lstpatch.sty,
lstdrvrs.dtx
!
texmf/source/latex/listings
Notethatyoumaynothaveapatchlelstpatch.sty.Ifyoudon’tusethe
TDS,simplyadjustthedirectoriesbelow.
2. Create the directory y texmf/tex/latex/listings or, if f it t exists s already,
removealllesexceptlsthwhateveri0.styandlstlocal.cfgfromit.
3. Changethe workingdirectorytotexmf/source/latex/listingsandrun
listings.insthroughT
E
X.
4. Movethegeneratedlestotexmf/tex/latex/listingsifthisisnotalready
done.
listings.sty,lstmisc.sty,
(kernelandadd-ons)
listings.cfg,
(congurationle)
lstlanghnumberi.sty,
(languagedrivers)
lstpatch.sty
!
texmf/tex/latex/listings
5. IfyourT
E
Ximplementationusesalenamedatabase,updateit.
6. Ifyoureceiveapatchlelateron,putitwherelistings.styis(andupdate
thelenamedatabase).
Notethatlistingsrequires atleastversion1.10ofthekeyval packageincludedin
thegraphicsbundlebyDavidCarlisle.
Software conguration n Readthis s only y if youencounter problems with h the
standardcongurationor if youwantthepackagetosuitforeignlanguages,for
example.
Nevermodifyalefromthelistingspackage,inparticularnottheconguration
le.Eachnewinstallationornewversionoverwritesit.Thesoftwarelicenseallows
modication,but Ican’trecommendit. . It’s s bettertocreateoneormoreofthe
les
lstmisc0.sty for localadd-ons(seethedeveloper’sguide),
lstlang0.sty for locallanguagedenitions(see4.18),and
lstlocal.cfg
as localcongurationle
andputtheminthe same directoryas theotherlistings les. . Thesethreeles
arenottouchedbyanewinstallationunlessyouremovethem. If lstlocal.cfg
exists, it is loadedafter r listings.cfg. . Youmight t want tochange oneof the
followingparameters.
data
\lstaspectfiles containslstmisc0.sty,lstmisc.sty
data
\lstlanguagefiles containslstlang0.sty,lstlang1.sty,lstlang2.sty,lstlang3.sty
Thepackageusesthespeciedlestondadd-onsandlanguagedenitions.
Moreover,youmight wantto o adjust t \lstlistlistingname,\lstlistingname,
defaultdialect,\lstalias,or\lstaliasasdescribedinearliersections.
47
5 Experimentalfeatures
Thissectiondescribes themore or less unestablishedpartsofthispackage. . It’s
unlikelythattheywillallberemoved(unlessstatedexplicitly),buttheyareliable
to(heavy)changesandimprovements. Suchfeatureshavebeen†-markedinthe
lastsections. So, , ifyoundanything†-markedhere, youshouldbevery, very
careful.
5.1 Listingsinside e arguments
Therearesomethingstoconsider if youwanttouse\lstinlineorthelisting
environment insidearguments. . Since e T
E
Xreadsthe argument beforethe‘lst-
macro’isexecuted,thispackagecan’tdoanythingtopreservetheinput: spaces
shrinktoone space,thetabulator andthe endof line areconvertedtospaces,
T
E
X’scommentcharacterisnotprintable,andsoon. Hence,youmustworkabit
more.Youhavetoputabackslashinfrontofeachofthefollowingfourcharacters:
\{}%.Moreoveryoumustprotectspacesinthesamemannerif:(i)therearetwo
ormorespacesfollowingeachotheror(ii)thespaceistherstcharacter inthe
line.That’snotenough:Eachlinemustbeterminatedwitha‘linefeed’^^J.And
youcan’tescapetoLAT
E
Xinsidesuchlistings!
Theeasiestexamplesarewith\lstinlinesinceweneednolinefeed.
\footnote{\lstinline{var i:integer;} } and
\lstinline!protected\ \ \ spaces! ! and
\fbox{\lstinline!\\\{\}\%!}}
yieldsifthe currentlanguage is Pascal. . Notethat t thisexampleshows another
experimentalfeature: useofargumentbracesasdelimiters. Thisisdescribedin
section4.2.
Andnowanenvironmentexample:
!"#$%&’()∗+, ./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[n]^
‘abcdefghijklmno
pqrstuvwxyzfjg~
\fbox{%
\begin{lstlisting}^^J
\ !"#$\%&’()*+,-./^^J
0123456789:;<=>?^^J
@ABCDEFGHIJKLMNO^^J
PQRSTUVWXYZ[\\]^_^^J
‘abcdefghijklmno^^J
pqrstuvwxyz\{|\}~^^J
\end{lstlisting}}
! Youmightwonderthatthisfeatureisstillexperimental. . Thereason: Youshouldn’tuselistings
insidearguments;it’snotalwayssafe.
5.2 †Exportofidentiers
Itwouldbenicetoexportfunctionorprocedurenames.Ingeneralthat’sadream
so far. . The e problem is that programming g languages use e various syntaxes for
functionandproceduredeclarationordenition.Ageneralinterfaceiscompletely
out of the scope e of f this s package|that’s the work k of a a compiler and not t of f a
pretty-printingtool.However,itispossibleforparticularlanguages:inPascal,for
1
vari:integer;andprotected spacesand
nfg%
48
instance,eachfunctionorproceduredenitionandvariabledeclarationispreceded
byaparticularkeyword. Notethatyoumustrequestthefollowingkeyswiththe
procnamesoption: \usepackage[procnames]{listings}.
†optional
{}
procnamekeys={hkeywordsi}
†optional
moreprocnamekeys={hkeywordsi}
†optional
deleteprocnamekeys={hkeywordsi}
each specied keyword indicates s afunctionor procedure denition. . Any
identierfollowingsuchakeywordappearsin‘procname’style. ForPascal
youmightuse
procnamekeys={program,procedure,function}
†optional
keywordstyle
procnamestyle=hstylei
denesthestyleinwhichprocedureandfunctionnamesappear.
†optional
false
indexprocnames=htruejfalsei
Ifactivated,procedureandfunctionnamesarealsoindexed.
Todo: Theprocnamesaspect t is unsatisfactory(and hasbeen unchangedat least
since2000). It t marks andindexesthefunction denitions sofar, but itwould be
possibletomarkalsothefollowingfunctioncalls,forexample. Akeycouldcontrol
whether functionnamesareadded toaspecialkeywordclass,whichthenappears
in ‘procname’style. . But t shouldthese names be addedglobally? ? Therearegood
reasonsforboth. Ofcourse,wewouldalsoneedakeytoresetthenamelist.
5.3 †Hyperlinkreferences
Thisverysmallaspectmustberequestedviathehyperoptionsinceitisexper-
imental. Onepossibilityforthefutureistocombinethisaspectwithprocnames.
Thenitshouldbepossibletoclickonafunctionnameandjumptoitsdenition,
forexample.
†optional
hyperref={hidentiersi}
†optional
morehyperref={hidentiersi}
†optional
deletehyperref={hidentiersi}
hyperlinkthe speciedidentiers (via hyperrefpackage). . A‘click’onsuch
anidentierjumpstothepreviousoccurrence.
†optional
\hyper@@anchor
hyperanchor=htwo-parametermacroi
†optional
\hyperlink
hyperlink=htwo-parametermacroi
setahyperlinkanchorandlink,respectively.Thedefaultsaresuitedforthe
hyperrefpackage.
49
5.4 Literateprogramming
Webeginwithanexampleandhidethecrucialkey=valuelist.
var i:integer;
if (i0) ) i  1;
if (i0) ) i  0;
if (i6=0) ) i  0;
\begin{lstlisting}
var i:integer;
if (i<=0) i i := = 1;
if (i>=0) i i := = 0;
if (i<>0) i i := = 0;
\end{lstlisting}
Funny,isn’tit? Wecouldleavei i := 0inourlistingsinsteadofi  0,butthat’s
notliterate! Nowyoumightwanttoknowhowthishasbeendone. Haveaclose
lookatthefollowingkey.
literate=[*]hreplacementitemi...hreplacementitemi
Firstnotethattherearenocommasbetweentheitems. Eachitemconsists
ofthreearguments: {hreplacei}{hreplacementtexti}{hlengthi}. hreplaceiis
the original character sequence. . Instead d of printing these e characters, we
usehreplacementtexti,whichtakesthewidthof hlengthicharactersinthe
output.
Each ‘printingunit’ in hreplacementtexti i must t be e inbraces unless it’s a
single character. . For r example, , you u must put braces s around d $\leq$. . If
youwanttoreplace<-1->by$\leftarrow1\rightarrow$,thereplacement
item would d be e {<-1->}{{$\leftarrow$}1{$\rightarrow$}}3. . Note e the
bracesaroundthearrows.
Ifonehreplaceiisasubsequenceofanother hreplacei,youmustdenethe
shortersequencerst. Forexample,{-}mustbedenedbefore{--}and
thisbefore{-->}.
Theoptionalstarindicatesthatliterate replacements shouldnotbemade
instrings,comments,andotherdelimitedtext.
Intheexampleabove,I’veused
literate={:=}{{$\gets$}}1 {<=}{{$\leq$}}1 1 {>=}{{$\geq$}}1 1 {<>}{{$\neq$}}1
Todo: Ofcourse,it’sgoodtohavekeysforaddingandremovingsinglehreplacement
itemis. Maybethekey(s)shouldworkinthesamefashionas thestringandcom-
mentdenitions,i.e.oneitemperkey=value. Thiswayitwouldbeeasiertoprovide
betterauto-detectionin caseofasubsequence.
5.5 LGrinddenitions
Yes,it’sanastyideatosteallanguagedenitionsfrom otherprograms. . Never-
theless,it’spossiblefortheLGrinddenitionle|atleast partially. . Pleasenote
thatthislemustbefoundbyT
E
X.
optional
lgrindef=hlanguagei
scansthelgrindeflanguagedenitionleforhlanguageiandactivatesitif
present. NotethatnotallLGrindcapabilitieshavealistingsanalogue.
Notethat‘Linda’languagedoesn’t workproperly sinceit denes compiler
directiveswithpreceding‘#’askeywords.
50
Documents you may be interested
Documents you may be interested