Inkscape.org
Beyond the Basics How to assign a shortcut for LaTeX in Ubuntu?
  1. #1
    Archisman Panigrahi Archisman Panigrahi @archisman
    *

    I need to repeatedly use `Extensions -> Render -> Mathematics -> LaTeX (pdflatex)` in Inkscape. It is quite painful to browse through so many menu items to open it (I need to use this function ~30 times to create certain diagrams). I want to assign a shortcut to it.

    I found this question in Ask Ubuntu, which suggests saving the following in ~/.config/inkscape/keys/default.xml.

    <?xml version="1.0"?>
    <keys name="My Customization">
        <bind key="k" modifiers="Ctrl,Alt"
              action="org.inkscape.effect.eqtexsvg" display="true"/>
    </keys>
    

    However, it does not work in Inkscape 1.1.1,

    When I run it form terminal, I get the error message

    $ inkscape
    Unable to find: org.inkscape.effect.eqtexsvg
    Shortcut::read: invalid verb: org.inkscape.effect.eqtexsvg

     

  2. #2
    Tyler Durden Tyler Durden @TylerDurden

    That extension might not be updated for new versions of Inkscape.

    Maybe this one will be helpful, or point you in the direction. https://github.com/seebk/LaTeXText

  3. #3
    Archisman Panigrahi Archisman Panigrahi @archisman

    Just to clarify, this extension is present in the default installation. The extension you had suggested is something else.

  4. #4
    Tyler Durden Tyler Durden @TylerDurden

    Maybe you have seen this: https://github.com/julienvitard/eqtexsvg.  Last updated in 2015.

     

  5. #5
    Archisman Panigrahi Archisman Panigrahi @archisman
    *

    It seems that the extension eqtexsvg is not even installed in my computer (I could not find it anywhere with `locate`). An extension called pdflatex is installed in usr/share/inkscape/extensions. Here are the contents of pdflatex.inx.

    <?xml version="1.0" encoding="UTF-8"?>
    <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
        <name>LaTeX (pdflatex)</name>
        <id>org.inkscape.generate.pdf_latex</id>
        <dependency type="executable" location="path">pdflatex</dependency>
        <param name="formule" type="string" gui-text="LaTeX input:">\(\displaystyle\frac{\pi^2}{6}=\lim_{n \to \infty}\sum_{k=1}^n \frac{1}{k^2}\)</param>
            <param name="packages" type="string" gui-text="Additional packages (comma-separated):"></param>
        <effect>
        <object-type>all</object-type>
          <effects-menu>
           <submenu name="Render">
              <submenu name="Mathematics" />
            </submenu>
          </effects-menu>
        </effect>
        <script>
            <command location="inx" interpreter="python">pdflatex.py</command>
        </script>
    </inkscape-extension>

    This must be the extension I had been using, as I can find it under `Render -> Mathematics`.

    How do I assign a shortcut to that?

  6. #6
    Archisman Panigrahi Archisman Panigrahi @archisman
    *

    The solution is to add the following to ~/.config/inkscape/keys/default.xml .

    <?xml version="1.0"?>
    <keys name="My Customization">
        <bind key="k" modifiers="Ctrl,Alt"
              action="org.inkscape.generate.pdf_latex" display="true"/>
    </keys>

    I got the ID org.inkscape.generate.pdf_latex from usr/share/inkscape/extensions/pdflatex.inx

    Then, the extension works with ctrl + alt + k.

  7. #7
    Archisman Panigrahi Archisman Panigrahi @archisman
    *

    For some reason, this does not work in the development version of inkscape (1.2). I installed from source. I have the same configuration file, but nothing happens when I press the same key combination. Did the procedure of assigning a shortcut change?

  8. #8
    Tyler Durden Tyler Durden @TylerDurden

    Development versions are recommended only for testing, and might not be complete.

Inkscape Inkscape.org Inkscape Forum Beyond the Basics How to assign a shortcut for LaTeX in Ubuntu?