Saarland University
Lehrstuhl für Automatisierungstechnik

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Dymola-Code in Latex
David Elixmann
post Aug 1 2011, 04:07 PM
Post #1


Newbie
*

Group: Members
Posts: 5
Joined: 26-July 11
Member No.: 582,252



In case anyone is interested, here's a language specification setting I found useful for highlighting Modelica syntax with the dtsyntax package:

CODE
\lstdefinelanguage{modelica}{%
    alsoletter={...},%
    %otherkeywords={-, =, +, [, ], (, ), \{, \}, :, *, !},%
    morekeywords=[1]{},% blue Keywords
    morekeywords=[2]{% blue + bold keywords
        annotation,assert,block,class,connector,constant,discrete,%
        else,elseif,elsewhen,end,exit,extends,external,final,flow,for,%
        function,if,in,inner,input,import,loop,model,nondiscrete,outer,%
        output,package,parameter,partial,record,redeclare,replaceable,return,%
        size,terminate,then,type,when,while,algorithm,equation,%
        protected,public,and,false,not,or,true},%
    morekeywords=[3]{% red keywords
        abs,acos,asin,atan,atan2,connect,cos,cosh,cross,der,edge,exp,%
        initial,noEvent,pre,reinit,sample,sign,sin,sinh,tan,tanh,terminal,%
        start,Real,Integer,Boolean,String},%
    comment=[l][\color{darkgreen}]{//}, % comment lines
    morecomment=[s][\color{darkgreen}]{/*}{*/}, % comment blocs
    morestring=[b][\color{darkgreen}]{'}, %
    morestring=[b][\color{darkgreen}]{"},
}[keywords,comments,strings]
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
fritz
post Dec 15 2010, 02:58 PM
Post #2


Newbie
*

Group: Members
Posts: 2
Joined: 13-December 10
Member No.: 170,492



Thank you,

dtsyntax is what I need

cheers, fritz
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Dietmar Winkler
post Dec 15 2010, 11:51 AM
Post #3


Member
**

Group: Members
Posts: 15
Joined: 15-November 06
Member No.: 109



Fritz,

you might try dtsyntax as extension of listings https://code.google.com/p/dtsyntax/

/Dietmar/

Another one is http://pygments.org/ That one is actually used to do the highlighting on trac.modelica.org

/Dietmar/
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
fritz
post Dec 15 2010, 11:16 AM
Post #4


Newbie
*

Group: Members
Posts: 2
Joined: 13-December 10
Member No.: 170,492



Hi,

I'm just writing an documentation and I want to include Dymola code in Latex.
Unfortunatly Dymola/Modelica is not supported in the listings package.
I tried the Highlight Tool but maybe there are other ways

thanks for any suggestions
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 19th November 2019 - 02:38 AM