user symbols

kile
Daniel
2008-08-18
2012-07-03
1 2 > >> (Page 1 of 2)
  • Daniel

    Daniel - 2008-08-18

    First of all, i am french, so i apologize for my english...

    I use Kile as an editor for lilypond and it works well.

    I recently discover (on v2.0) that it is now possible to add personnal symbols in /.kde/share/apps/kile/mathsymbols/user/ but i can't find where to write the commands that go with these symbols.

    I think that i should write something like
    \input{definitions}

    \begin{document}
    \command{\coda}
    \end{document}
    in a user.tex file but this doesn't work.

    Thanks for a help...

    PS If someone is interested i make a lot of musical symbols, and a lilypond completion file, and i can share them.

     
    • Thomas Braun

      Thomas Braun - 2008-08-25

      Hello Daniel,

      have you already read http://kile.sourceforge.net/Documentation/html/latex.html#latex_library ?
      For that you need the kile sources which you can get from kile.sf.net.

      I found a more elaborate manual here, http://matheplanet.com/matheplanet/nuke/html/viewtopic.php?rd2&topic=94327&start=0#p693502, but it is in german only.

      And we are definitly interested in the cwl file and maybe also in the symbol list.

      Bye,
      Thomas

       
      • Daniel

        Daniel - 2008-08-31

        Hi Thomas,

        First of all sorry if i answer late but i'm just back from holydays with the children :-)

        Thanks for the links... Unhappily i cant read german, but the 1st link seems very interresting. I go on creating the symbols i need and then i test this.

        No pb to share my cwl file and png, just tell me how to do this.

        However i realise that kile still miss something for the purpose i aim. It is impossible to (un)display the symbols tabs... If i write a music score, i dont need greek symbols etc. but i have hundreds of musical symbols, some of them very specifics, for instance some are only for the piano, or the guitar... It would be useful to be able to create more than only one user tab symbols... And activate them or not, depending on if i write for piano or organ or guitar...

        Do you think it is difficult to implement ?

        Otherwise some stuff must overwrite the existing lilypond code, just as some math functions do in the maths toolbar... Eg replacing c d with < c d \myfunction >. For what i understood it can't be make with the symbols, so it would be great to be able to create e musical toolbar. I can work on this if you want but i dunno how to write the code...

        For the moment i think that kile could be the ultimate music editor for lilypond with just a few specific implementations.

         
        • Thomas Braun

          Thomas Braun - 2008-08-31

          Hi Daniel,

          no need to hurry :)

          You can send the cwl file and the latex document for generating symbols (I dont' need the pngs) to kile-devel@lists.sourceforge.net.

          Multiple user symbols views are in principle no problem to add, I can send you a patch in a few days.
          Turning on and off the symbol views is a bit more difficult and currently not on our TODO list.

          The replacement stuff, you can either try abbreviations or the latex user tags.

          Bye,
          Thomas

           
          • Daniel

            Daniel - 2008-08-31

            OK, i will soon send a cwl file for lilypond, but it is a first try, and will certainly be completed later.

            For the symbols i cant understand how you can use my tex file without the png... And i still have to organize them in about 10 families, which is not so obvious...

            About the multiple tabs, i found that renaming /usr/share/apps/kile/mathsymbols to /usr/share/apps/kile/mathsymbolsold and then adding the equivalent subdirectories with some symbols in ~/.kde.... just replace the kile symbols by mine. I just have to modify the kile.po to have my own tabs names, but it is a bit tricky... And replacing the po may need a compilation, that i would like to avoid, cause i would like anybody to be able to use kile for music the more easily possible.

            I already tried to use the latex user tags but if they ar powerfull as they allow to enter text on multiple lines, they have two limits :
            - i can have only 10;
            - i want to select some notes, and then apply them an effet, and that mean a { will be added before the notes, and a \command } after.

            I also tried the abbreviations, but i have the same limitations. Though i remember i have read somewhere (but where ?) a syntax to do that... A link ?

            Thanks

             
            • Thomas Braun

              Thomas Braun - 2008-08-31

              >For the symbols i cant understand how you can use my tex file without the png... And i still have to >organize them in about 10 families, which is not so obvious...

              Well the symbol generation works like that. The gesymb progamm invokes latex and dvipng and then attaches the latex commands to the pngs.
              So If I have the tex file I can also produce the pngs.

              Have you seen the special tags in the user tags?
              See http://kile.sourceforge.net/Documentation/html/latex_usertags.html
              For example
              $ %M $
              as usertag places the marked text inside math mode.

              And you can use more than ten user tags. You can also plug them into a toolbar if you want. By default only the first ten get shortcuts.

              bye,
              Thomas

               
              • Daniel

                Daniel - 2008-09-01

                Thanks a lot the link was exactly what i was looking for. And if it is possible to have more than 10 user tags, i can do about all i need, except creating a new toolbar, i'll just empty he math one to put my tools inside. With some abbreviation files to complete all that, it will be really powerfull.

                I'm completing my lilypond.cwl file, and i post it today or to-morrow.

                 
                • Daniel

                  Daniel - 2008-09-03

                  I get one more error if i try to compile gesymb :

                  [daniel@localhost symbols]$ make gesymb
                  Makefile:438: .deps/gesymb.Po: Aucun fichier ou répertoire de ce type
                  make: *** Pas de règle pour fabriquer la cible « .deps/gesymb.Po ». Arrêt.

                  i'll try to translate : there is no file deps/gesymb.Po and no rule to make it in the makefile (if i'm not mistaken...)

                  Thanks for your help, i'm close now...

                  And i think i will have another question sooner or later : the syntax of the commands in my user.tex...
                  If i want the command to be :
                  <<{ } \ {} >>
                  is it allowed to write
                  \command<<{ } \ {} >>{\symbol_for_polyphonie}
                  or do i have to escape some signs?

                  And if i want new lines and tabs to have a result like this :
                  <<{

                  } \\
                  

                  {

                  } >>
                  is it possible ?

                   
                  • Thomas Braun

                    Thomas Braun - 2008-09-03

                    You do have called configure in the kile source tree before calling make gesymb?

                    If never had this error before. I can also post my gesymb binary.

                    The command should look like
                    \command[<<{ } \ {} >>]{\symbol_for_polyphonie}

                    With newlines and tabs you can have a try with adding \n and \t but I don't know if it works.

                    Thomas

                     
                    • Daniel

                      Daniel - 2008-09-03

                      Okj it's a long time i havn't tried to compile something :-)

                      Calling configure gives : configure: error: C++ preprocessor "/lib/cpp" fails sanity check

                      Sorry to be so newbie...

                       
                      • Daniel

                        Daniel - 2008-11-16

                        I finally succeeded inserting package names in my symbols. Dunno why i failed the first times...

                        I already have more than 400 lilypond symbols now, with the commands inserted, maybe it could be interresting to make them available for anyone? How?

                        I would like to know if it would be possible to display not only the command an package meta-data when the mouse is over the symbol but also the comment so i could put some explanations on how to use the symbol.

                        Otherwise i made a lot of personal tags that i can use in all the new toolbars i made, but i find it ugly to have the number of the tag before the name, and this is the same in the menus... Is it possible to avoid this?

                        Thanks

                         
                        • Thomas Braun

                          Thomas Braun - 2008-11-18

                          Hi Daniel,

                          yes please make them available.
                          The easiest thing would be to send it me via email to braun ähht physik.fu-berlin.de.
                          I hope your are fine with publishing your work under GPL version2 or later license. This is the only license used in kile.

                          For the package meta data stuff please file a bug report at bugs.kde.org so that I remember it.

                          The same goes for the number of the tag infront of the name. I agree that it looks ugly, but it is some work to check it completely.

                          Thanks for your help!

                          Thomas

                           
    • Daniel

      Daniel - 2008-09-03

      It doesn't work :-(

      I put my symbols in kile-2.0/src/kile/symbols/user, and mysymbols.tex in kile-2.0/src/kile/symbols(where are gesymb.cpp and gesymb.h

      i tried gesymb mysymbols.tex user and i get this :
      bash: gesymb: command not found

      I missed something somewhere but what?

      Thanks for a help...

       
      • Thomas Braun

        Thomas Braun - 2008-09-03

        You have to create the gesymb binary first.

        Change to your kile src directory and there to kile/symbols and type "make gesymb", this creates the gesymb binary and you only need that one.

        Thomas

         
    • Thomas Braun

      Thomas Braun - 2008-09-03

      I've uploaded my gesymb binary to http://www.data2cd.de/gesymb.

      Hope that works :)

       
      • Daniel

        Daniel - 2008-09-04

        ok i got it, thanks but i need a lot of new packages, like libqt3 (done) and now libaudio.so.2. I installed a lot of packages thinking it was the good ones but it still don't work... I use a mdv 2008.1. Do you know which one i must install, and by the way what should i need a libaudio for this ?...

         
        • Bastian Weber

          Bastian Weber - 2008-12-02

          Allthough I never tried it, getting gesymb running seems to be quite a problem for many people. On my ubuntu 8.04 'apt-file search gesymb' did not find anthing usefull either. So I gave it up even before starting.

          I decided to write my own python based tool. For me it works quite well. Maybe it will do so for other people. Or may be it serves a inspiration to ease the process for creating user defined symbols. In my opinion this kind of customization things are very (!) important to have a good LaTeX expirience.

          The python script currently is available here:
          http://www.python-forum.de/viewtopic.php?p=118092#118092

          The thread is in german, but the script I wrote in english ;).

          I called it kilehilfe.py and if you have installed, latex, dvipng, pngcrush and python simply calling 'python kilehilfe.py' should generate you a couple of png files. Each of them, while showing one of the symbols, already has the right meta-tag added so you just have to copy them to ~/.kde/share/apps/kile/mathsymbols/user/ to use them after a restart.

          btw: would it be possible to implement updating the user defined symbols without restarting kile?

          To define your own symbols you "simply" have to edit the variable symbolList.

          Last but not least (as this is my first entry to the kile-forum):
          Thank you for this great pice of open source software!

           
          • Thomas Braun

            Thomas Braun - 2008-12-02

            Hi there,

            well the gesymb binary started as a interal tool for me and I didn't actually think that it is very interesting for the common user. But I was wrong ;)

            Ideally the gesymb code would be implemented in kile directly. But I haven't had any time to do so.

            Your python script looks nice btw.
            I would read in the symbols from a file.
            You might also want to have a look at the dvipng options in gesymb, see http://websvn.kde.org/branches/extragear/kde3/office/kile/kile/symbols/gesymb.cpp?revision=791377&view=markup.

            Thomas

             
        • Thomas Braun

          Thomas Braun - 2008-09-05

          Grab it from http:/data2cd.de/gesymb.

          Well kile does not need libaudio directly. I have no idea why at all ...

          On my debian box the package is called libaudio2 and its description states:
          The Network Audio System (NAS). (shared libraries)

          Hope that helps,
          Thomas

           
          • Daniel

            Daniel - 2008-09-09

            i already had a similar pb, i think it is a funny depenbdency in latex... But don't know why...

            I tried to install nas before asking (i should have to say it, sorry) but i have a dependency pb probably because à have a 64bit mdv, and i get conflicts somewhere...

            Before i triy to to the stuff on an other box, can you tell me what does exactly gesymb? Maybe it is possible to do it otherwise ?... Or can i ask you if you can compile the following code for me :

            \documentclass[a4paper,10pt]{article}
            \usepackage[latin10]{inputenc}
            \usepackage[T1]{fontenc}

            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            % Author: Daniel Cartron
            % begin: 8 Aout 2008
            % last edit: --
            % License: GPLv2 or later
            % Author : Daniel Cartron - daniel at cartron dot org
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

            \input{definitions}
            \begin{document}
            \command\bar "|" {\bar0}
            \command\bar "|:" {\bar1}
            \command\bar "||" {\bar2}
            \command\bar ":|" {\bar3}
            \command\bar ".|" {\bar4}
            \command\bar ".|." {\bar5}
            \command\bar ":|:" {\bar6}
            \command\bar "||:" {\bar7}
            \command\bar "|." {\bar8}
            \command\bar ":" {\bar9}
            \end{document}

            and send me the result, so i can understand what happend.

            Otherwise, i found the way to have some more toobars, i just have to edit kileui.rc. And i can change all the menus as i want, and replace the entries with user tags. The pb is that they appear as "49:My entry" which is not really elegant... And i have hundreds of user tags. The same in the menu latex > user tags, i see all of them though i would like to hide some... Is it possible to hide the 49: before the user tag name ?

             
            • Thomas Braun

              Thomas Braun - 2008-09-09

              Hi,

              well the main thing of gesymb is invoking latex, dvipng and then writing the latex commands into the png file as comment.

              See e.g.:
              thomas@thomas:~/devel/svn/2.0-branch-office/kile/kile/symbols/misc-text$pngmeta img100misc-text.png
              pngmeta: PNG metadata for img100misc-text.png:
              Command: \textbigcircle
              Packages: {textcomp}

              And this comment is inside kile read out and if you click on a icon, it is inserted.

              Actually there is no clean way around gesymb. If you get problems with gesymb or encounter limitations I happily help.

              Concering your example, that does not work.

              The file must be valid latex code, and here it does not compile.

              You can have a look at the definition files for the kile's current symbols, located in the same folder as gesymb.cpp.
              We also got a project symbols.kilepr ;)

              And also testfile.tex gives some hints.

              (I'm sorry that the documentation is so scattered ...)

               
              • Daniel

                Daniel - 2008-09-10

                Thanks. Of course my code is not valid latex one, it is lilypond code.

                I tried several ways to insert code in the png, but noone works, even if i change the existing one (just one letter, for instance nearrow to nwarrow whitch is a valid command as well) the command donesn't show anymore. So there must be some control caracters that i can't understand.

                It's really a pity that it is impossible to compile lilypond code, it would be a fantastic tool to edit .ly files...

                Are you sure there is absolutely no way ?

                 
                • Thomas Braun

                  Thomas Braun - 2008-09-10

                  Hi,

                  okay now things are clearing up. I totally forgot how lilypond works.
                  And now I also see why gesymb does not work for you.

                  The alternative way:
                  - create a png which represents the tag you want to insert (doing it with a screeshot gives usually bad quality)
                  - add the tag to the png with the following command
                  pngcrush -text b "Command" "myTag" pic.png picWithCommand.png
                  For the latex tags the additional type "Packages" instead of "Command" can be added (In your case this does not make sense)
                  - Copy the pngs to the mathsymbols/user directory
                  - restart kile

                  I'm sorry I completely messed up things,
                  Thomas

                   
                  • Daniel

                    Daniel - 2008-09-11

                    well finally it works, pngcrush is much more efficient than convert, that i also tried...

                    I could use packages informations, we also have this kind of things in lilypond but th package name doesn't appears in kile :(
                    I made : pngcrush -text b "Packages" "musette-init.ly" zm_arh.png z1_arh.png
                    is it correct ?

                    For making the png i used the pdf made by kile and gimp, it gives a pretty good quality.

                    Having a new line in the command doesn't work with \n, maybe it is just not possible...

                    I also have a pb with this one :
                    pngcrush -text b "Command" "\times 2/3 { %M } %C" nolet.png nolets.png
                    makes the png to have the command
                    \times 2/3 { %M } %C
                    it appears correctly in konqueror but not in kile, i just have
                    \times 2/3 {
                    Something with the % ??? I must escape it ? \ doesn't work for escaping....

                     
                    • Thomas Braun

                      Thomas Braun - 2008-09-11

                      I made : pngcrush -text b "Packages" "musette-init.ly" zm_arh.png z1_arh.png

                      Packages are here defined as latex packages. So if you insert a symbol which has Packages equal to "textcomp", kile will issue a warning if you have not included this package with \usepackage.

                      The %M, %C and so on shurtcuts are not supported inside the symbolview commands. The reason is that % is used as an internal delimiter.
                      I can have a look if it can be changed.

                      Thomas

                       
1 2 > >> (Page 1 of 2)

Log in to post a comment.