{"id":101,"date":"2007-08-03T11:59:50","date_gmt":"2007-08-03T09:59:50","guid":{"rendered":"http:\/\/www.hackenberger.at\/blog\/ktikz-editor-for-the-tikz-language\/"},"modified":"2023-07-26T10:48:51","modified_gmt":"2023-07-26T08:48:51","slug":"ktikz-editor-for-the-tikz-language","status":"publish","type":"page","link":"https:\/\/www.hackenberger.at\/blog\/ktikz-editor-for-the-tikz-language\/","title":{"rendered":"KtikZ &#8211; Editor"},"content":{"rendered":"<p>KtikZ is a small application helping you to create TikZ (from the LaTeX pgf package) diagrams for your publications. It requires qt4, libpoppler, LaTeX (pdflatex), the LaTeX preview-latex-style package [1] and pgf itself [2]. For the eps export functionality you also need the poppler-utils package. If you&#8217;d like to improve this little tool just clone it from <a href=\"https:\/\/github.com\/fhackenberger\/ktikz\">https:\/\/github.com\/fhackenberger\/ktikz<\/a> and send a pull request.<\/p>\n<p><a href=\"https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-228\" src=\"https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13-300x163.png\" alt=\"\" width=\"300\" height=\"163\" srcset=\"https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13-300x163.png 300w, https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13-1024x556.png 1024w, https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13-768x417.png 768w, https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13-1536x833.png 1536w, https:\/\/www.hackenberger.at\/blog\/wp-content\/uploads\/2023\/07\/screenshot_v0.13.png 1666w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>KtikZ is available as an Ubuntu\/Debian package and as a Windows installer. For Linux there are two versions available: KtikZ and QtikZ. KtikZ is integrated with the KDE4 platform, whereas QtikZ has the traditional Qt-only interface. Thanks go to Glad Deschrijver, Agustin Martin and Stuart Prescott for their contributions.<\/p>\n<p><a title=\"Source code on GitHub\" href=\"https:\/\/github.com\/fhackenberger\/ktikz\">Source code on GitHub<\/a><\/p>\n<p>Here are some archived old versions:<br \/>\n<a title=\"Source code for KtikZ\" href=\"http:\/\/www.hackenberger.at\/ktikz\/ktikz_0.10.tar.gz\">Source code tarball for ktikz 0.10<\/a><br \/>\n<a title=\"Binary package for Ubuntu\" href=\"http:\/\/www.hackenberger.at\/ktikz\/ubuntu_lucid\/ktikz_0.10-1_i386.deb\">KtikZ 0.10 binary package for Ubuntu Lucid<\/a><br \/>\n<a title=\"Binary package for Ubuntuy\" href=\"http:\/\/www.hackenberger.at\/ktikz\/ubuntu_lucid\/qtikz_0.10-1_i386.deb\">QtikZ 0.10 binary package for Ubuntu Lucid<\/a><br \/>\n<a title=\"Binary package for Debian\" href=\"http:\/\/www.hackenberger.at\/ktikz\/debian_squeeze\/ktikz_0.10-1_i386.deb\">KtikZ 0.10 binary package for Debian Squeeze<\/a><br \/>\n<a title=\"Binary package for Debian\" href=\"http:\/\/www.hackenberger.at\/ktikz\/debian_squeeze\/qtikz_0.10-1_i386.deb\">QtikZ 0.10 binary package for Debian Squeeze<\/a><br \/>\n<a title=\"Installer for Windows\" href=\"http:\/\/www.hackenberger.at\/ktikz\/windows\/qtikz-0.10.1-install.exe\">QtikZ 0.10.1 Installer for Windows (Windows-only patch release)<\/a><\/p>\n<p>If you need packages for a different Ubuntu or Debian version, you can compile the source package on your own machine using pbuilder. See the <a title=\"pbuilder\" href=\"https:\/\/wiki.ubuntu.com\/PackagingGuide\/Complete#The%20Personal%20Builder:%20pbuilder\" target=\"_blank\" rel=\"noopener\">Ubuntu Packaging Howto<\/a>. You can get the source package from <a href=\"https:\/\/github.com\/fhackenberger\/ktikz\">https:\/\/github.com\/fhackenberger\/ktikz<\/a>. Installation instructions are in INSTALL file.<\/p>\n<p>[1] <a href=\"http:\/\/www.gnu.org\/software\/auctex\/preview-latex.html\">http:\/\/www.gnu.org\/software\/auctex\/preview-latex.html<\/a><br \/>\n[2] <a href=\"http:\/\/www.ctan.org\/tex-archive\/graphics\/pgf\/\">http:\/\/www.ctan.org\/tex-archive\/graphics\/pgf\/<\/a><\/p>\n<p><strong>Changelog from old versions:<\/strong><\/p>\n<p><em>Version 0.10 (2010-08-26):<\/em><br \/>\n&#8211; KDE integration (the possibility to compile Qt-only still exists)<br \/>\n&#8211; template files on remote machines can be used using KIO (only in the KDE<br \/>\nversion)<br \/>\n&#8211; TikZ source files on remote machines can be loaded, saved and exported<br \/>\nusing KIO (only in the KDE version)<br \/>\n&#8211; error messages while generating the preview are shown in the preview<br \/>\nwindow itself<br \/>\n&#8211; zooming is done in a separate thread now, so the interface is not blocked<br \/>\nwhen zooming at large sizes<br \/>\n&#8211; a kpart is available that can be used to view TikZ source files in<br \/>\nkonqueror (the kpart opens files having the text\/x-pgf mimetype)<br \/>\n&#8211; update list of tikz commands<br \/>\n&#8211; remove bug which causes ktikz to hang (since Qt 4.6) when typesetting<br \/>\na picture<br \/>\n&#8211; remove bug: cannot find TikZ documentation when selecting &#8220;TikZ Manual&#8221;<br \/>\nin the Help menu, even if configured correctly<br \/>\n&#8211; display description of a newly inserted tikz command (using command<br \/>\ncompletion or menu) in the statusbar, so that the user still sees the<br \/>\nusage of a command after it is inserted<br \/>\n&#8211; add option to compile the TikZ code only when pushing a &#8220;Build&#8221; button<br \/>\n&#8211; add reload button<br \/>\n&#8211; add shell script and ktikz template to the examples directory which can<br \/>\nbe used to generate the preview with the latex; dvips; ps2pdf sequence<br \/>\ninstead of pdflatex (the usage is described in the shell script code)<br \/>\n&#8211; check whether the file has changed when ktikz gets the focus (similar<br \/>\nto kwrite)<br \/>\n&#8211; in the kpart check for file changes and reload if there are any (similar<br \/>\nas in okular)<br \/>\n&#8211; the zoom percentage field is now displayed and edited in the user&#8217;s locale<br \/>\n&#8211; added documentation<br \/>\n&#8211; remove bug: when the error box is larger than the preview and the next<br \/>\ncompilation does not give errors, the error box is still visible outside<br \/>\nthe area covered by the preview<br \/>\n&#8211; try to find or use the default hard-coded (configurable in conf.pri and<br \/>\nCMakeLists.txt) path to the TikZ documentation when an empty path is<br \/>\nstored in the local settings (this is the case e.g. when ktikz is run<br \/>\nfor the first time)<br \/>\n&#8211; when inserting code using code-completion, the arguments and options that<br \/>\nmust be filled in are marked by a bullet, the bullets can be browsed with<br \/>\nthe Tab-key<br \/>\n&#8211; now also an URL to an online version of the TikZ documentation can be<br \/>\nspecified in the configuration dialog<br \/>\n&#8211; an icon for Windows and an NSIS Windows Installer script are now available<br \/>\n&#8211; the &#8220;Insert&#8221; menu is now also translated<\/p>\n<p><em>Version 0.9 (2009-09-10):<\/em><br \/>\n&#8211; remove bug that on startup the item selected in the template combobox<br \/>\ndid not correspond to the text in the lineedit of the combobox<br \/>\n&#8211; correct the height of the lineedits in the configuration dialog<br \/>\n&#8211; the path to the TikZ documentation must now be set in the configuration<br \/>\ndialog<br \/>\n&#8211; don&#8217;t wait one second before generating the preview when a file is<br \/>\nloaded, the template is changed or shell escaping is toggled<br \/>\n&#8211; only files are used now as a template file (previously directories<br \/>\nand everything with a valid path was used), otherwise the default<br \/>\ntemplate is used<br \/>\n&#8211; if the replacement text is empty, then the default template is used<br \/>\ninstead of giving non-informative errors<br \/>\n&#8211; when the commands dock is visible (instead of the menu), the code that<br \/>\nwill be inserted is visible in the status bar on hovering the item in<br \/>\nthe list<br \/>\n&#8211; clicking on an item in the commands dock only includes the corresponding<br \/>\ncode once (instead of twice)<br \/>\n&#8211; added file name completion to the template line edit and the line edits<br \/>\nin the configuration dialog<br \/>\n&#8211; space and tab markers resize according to the font size of the main text<br \/>\n&#8211; the color of the space and tab markers can be changed in the<br \/>\nconfiguration dialog<br \/>\n&#8211; white space and tabulator settings are separate now<br \/>\n&#8211; scrolling in the text edit with the arrow keys is faster now<br \/>\n&#8211; better completion of \\begin{&#8230; and \\end{&#8230;<br \/>\n&#8211; allow to use the icons set in KDE4 when the appropriate variable in<br \/>\nconf.pri is set<br \/>\n&#8211; remove bug that the &#8220;Next Image&#8221; and &#8220;Previous Image&#8221; buttons remained<br \/>\nvisible when emptying the code text area<br \/>\n&#8211; remove bug: statustip of the toggle view actions in the Settings menu is<br \/>\nnot shown when a toolbar or sidebar is hidden on startup<br \/>\n&#8211; add support for session management (open windows will be reopened after<br \/>\nlogging out and logging in again)<br \/>\n&#8211; added option in the config dialog to enable\/disable completion of the<br \/>\ntikz commands<br \/>\n&#8211; trying to open a file from the &#8220;Open Recent&#8221; menu that does not exist<br \/>\nanymore does not cause an empty window to be opened anymore, furthermore<br \/>\nthe file is removed from the &#8220;Open Recent&#8221; list<\/p>\n<p><em>Version 0.8 (2009-03-29):<\/em><br \/>\n&#8211; allow text under icons in toolbar<br \/>\n&#8211; remove bug: when a second ktikz window is closed while typesetting,<br \/>\nthe cursor is not restored from busy to normal<br \/>\n&#8211; remove bug: when the document is untitled and not yet saved, then<br \/>\nopening a file opens the file in the current window, destroying the<br \/>\nunsaved text<br \/>\n&#8211; added some tikz commands to the list of commands<br \/>\n&#8211; disable &#8220;Save&#8221; and &#8220;Save As&#8221; actions when the file in the text editor<br \/>\nis the same as on disk<br \/>\n&#8211; replace the &#8220;Replace this occurrence&#8221; dialog by a widget shown at the<br \/>\nbottom of the text editor<br \/>\n&#8211; added filter &#8220;PGF files&#8221; in &#8220;Open File&#8221; dialog<br \/>\n&#8211; the previously selected templates can now be selected from a combobox<br \/>\n&#8211; added &#8220;Clear&#8221; button to each line edit<br \/>\n&#8211; remove bug: the size of the default font did not change after setting<br \/>\na new font size in the config dialog<br \/>\n&#8211; new way of writing the temporary latex and pgf files, this also solves<br \/>\nthe bug in which the line numbers in the log window did not correspond<br \/>\nto the line numbers in the editor<br \/>\n&#8211; each time the template is changed a new QTemporaryFile is used, this<br \/>\navoids the bug that if the template contains less characters, then the<br \/>\nbottom of the old template is still there in the file (luckily latex<br \/>\nstops parsing at the first \\end{document}, so this bug was not visible)<br \/>\n&#8211; allow to use KDE4 file dialogs when the appropriate variable in conf.pri<br \/>\nis set<br \/>\n&#8211; remove bug (I hope) that caused ktikz to crash when zooming while ktikz<br \/>\nis typesetting<\/p>\n<p><em>Version 0.7 (2008-08-26):<\/em><br \/>\n&#8211; disable previous image button if the first image is shown, disable<br \/>\nnext image button if the last image is shown<br \/>\n&#8211; the first time that the End button is pressed the cursor is moved to<br \/>\nthe end of the line (on screen), the second time the cursor is moved<br \/>\nto the end of the block (end of the line in the file)<br \/>\n&#8211; don&#8217;t run latex on startup when no document is loaded from the command<br \/>\nline<br \/>\n&#8211; adjust size of the viewport in which the preview is displayed when new<br \/>\nitems are added to the tikz picture<br \/>\n&#8211; added completion of the tikz commands<br \/>\n&#8211; the tikz commands are now loaded from an XML file<br \/>\n&#8211; corrected the size of the colored background around the highlighted<br \/>\nbrackets<br \/>\n&#8211; remove bug in ConfigDialog::selectFont() (replace &#8220;if (&amp;ok)&#8221; by &#8220;if (ok)&#8221;)<br \/>\n&#8211; the command &#8220;New&#8221; in the &#8220;File&#8221; menu now opens a new empty window,<br \/>\nthe commands &#8220;Open&#8221; and &#8220;Open Recent&#8221; open the selected file in a new<br \/>\nwindow, a &#8220;Close&#8221; command is added which empties the current window<br \/>\n&#8211; the (empty) document is not typesetted anymore when the &#8220;Close&#8221; command<br \/>\n(which has the same behavior as the old &#8220;New&#8221; command) is executed<br \/>\n&#8211; add the directory in which the template file is located to the<br \/>\n$TEXINPUTS environment variable (useful if the template \\inputs other<br \/>\nfiles)<br \/>\n&#8211; layout changes in the configuration dialog<\/p>\n<p><em>Version 0.6:<\/em><br \/>\n&#8211; added find and replace<br \/>\n&#8211; added go to line<br \/>\n&#8211; added indent selected paragraph<br \/>\n&#8211; remove crash when first character of the document is &#8216;\\&#8217;<br \/>\n&#8211; allow usage of -shell-escape, so that functions can be plotted using<br \/>\ngnuplot from within tikz<br \/>\n&#8211; added highlighting of the current line in code editor<br \/>\n&#8211; added show white spaces<br \/>\n&#8211; added show matching brackets<br \/>\n&#8211; allow scrolling of code editor without moving the cursor with Ctrl+Up<br \/>\nand Ctrl+Down<br \/>\n&#8211; added template support for the LaTeX file in which the PGF picture<br \/>\nis included<br \/>\n&#8211; updated the icons to the latest version of Oxygen (now available at<br \/>\nsvn:\/\/anonsvn.kde.org\/home\/kde\/trunk\/KDE\/kdebase\/runtime\/pics\/oxygen\/)<\/p>\n<p><em>Version 0.5:<\/em><br \/>\n&#8211; removed memory leaks<br \/>\n&#8211; added Qt logo to the &#8220;About Qt&#8221; item in the Help menu<br \/>\n&#8211; zooming now keeps the same object in the center of the visible area<br \/>\nthat was previously in the center (instead of scrolling to position<br \/>\n(0,0))<br \/>\n&#8211; the tikz commands can be inserted from either a menu or a dockwidget<br \/>\n&#8211; more tikz commands are added to the menu\/dockwidget<br \/>\n&#8211; put the preview area in a dock widget which allows more flexibility<br \/>\nthan a splitter<br \/>\n&#8211; added an item in the Help menu for opening the file pgfmanual.pdf in<br \/>\nthe PDF viewer configured in the system (if that file is located<br \/>\nsomewhere in the LaTeX texmf tree)<br \/>\n&#8211; switched to poppler version 0.6<br \/>\n&#8211; removed bug in the config dialog which caused the table items to<br \/>\nnot be shown as disabled upon opening the config dialog when the<br \/>\nhighlighting is set to standard<br \/>\n&#8211; added a What&#8217;s This button in the configuration dialog<br \/>\n&#8211; remove crash when zooming at startup before loading or editing tikz<br \/>\ncode<br \/>\n&#8211; ktikz now remembers the zoom factor from the previous session<br \/>\n&#8211; the application icon is now also installed and is referred to in the<br \/>\ndesktop file (so the icon also appears in the KMenu)<br \/>\n&#8211; the build files (*.o *.ui moc_* qrc_*) are now put in a separate build<br \/>\ndirectory (when building), leaving the source directory clean<\/p>\n<p><em>Version 0.4:<\/em><br \/>\n&#8211; added German translation<br \/>\n&#8211; show status tip for the &#8220;Open Recent&#8221; and &#8220;Export&#8221; submenus<br \/>\n&#8211; it is now possible to have more than one image in one document: just<br \/>\nput the different tikzpictures one below the other in the code and<br \/>\nthen press the &#8220;Show previous image&#8221; and &#8220;Show next image&#8221; button to<br \/>\nbrowse between the previews (but it is not possible to save or export<br \/>\nthem separately)<br \/>\n&#8211; the previous picture is not displayed anymore in the preview when<br \/>\nthe text edit becomes empty (or when the user starts a new document)<br \/>\n&#8211; the document modification status is shown correctly now in the title bar<br \/>\n&#8211; the preview can be scrolled by dragging the image<br \/>\n&#8211; added undo, redo and select all to the Edit menu and to the toolbar<br \/>\n&#8211; added comment\/uncomment of the current line or selection<br \/>\n&#8211; the scrollbars will disappear if the image becomes smaller than the<br \/>\nview when zooming out<br \/>\n&#8211; added a menu with tikz commands<br \/>\n&#8211; a better highlighting of the tikz code is implemented based on the<br \/>\ncontents of the tikz commands menu<br \/>\n&#8211; made an application icon (I just took the kate icon from oxygen and<br \/>\nadded the text &#8220;KTikZ&#8221;, the text in the icon is in the Fertigo font<br \/>\nfrom http:\/\/www.josbuivenga.demon.nl\/fertigo.html)<br \/>\n&#8211; added What&#8217;s This texts for most widgets and icons<br \/>\n&#8211; added a configuration dialog (the highlighting colors and fonts, the<br \/>\nnumber of entries in the &#8220;Open Recent&#8221; menu and the path to pdflatex<br \/>\nand pdftops can be set)<br \/>\n&#8211; messages on standard output are only shown when compiled in debug mode<br \/>\n&#8211; in the log box short messages are shown instead of the contents of the<br \/>\nlog file; the contents of the log file can be viewed by pressing the<br \/>\n&#8220;View Log&#8221; button<br \/>\n&#8211; added an &#8220;Abort typesetting&#8221; button; for example, typesetting the<br \/>\nfollowing code never exits:<br \/>\n\\begin{tikzpicture}[x=1cm,y=1cm % note the missing ]<br \/>\n\\draw[-&gt;] (0,0) &#8212; (4,0);<br \/>\n\\end{tikzpicture}<br \/>\n&#8211; added a context menu to the preview area<br \/>\n&#8211; more sensible default sizes for the different widgets in the main<br \/>\nwindow on first startup<\/p>\n<p><em>Version 0.3:<\/em><br \/>\n&#8211; show in the statusbar the position of the cursor in the text edit<br \/>\n&#8211; the preview image (in PDF format) is displayed using poppler instead<br \/>\nof converting the PDF file to PNG first and displaying the PNG file<br \/>\n(poppler version 0.5.4 is used)<br \/>\n&#8211; added zooming of the image (using poppler)<br \/>\n&#8211; export to PNG is done directly in Qt now; as a consequence (of this<br \/>\nand of using poppler to display the preview image) ktikz no longer<br \/>\ndepends on ImageMagick<br \/>\n&#8211; added &#8220;Open Recent&#8221; menu<br \/>\n&#8211; if ktikz is run on the command line, then it loads the first argument<br \/>\n(if it is a valid file name)<br \/>\n&#8211; the open\/save file dialog remembers the last directory in which a<br \/>\nPGF source file was opened\/saved<br \/>\n&#8211; loading of translations if available<br \/>\n&#8211; added French translation<br \/>\n&#8211; changed qmake files so that the files will be installed in the correct<br \/>\nplace (the installation prefix can be configured in the file conf.pri)<br \/>\n&#8211; the wait cursor is displayed while typesetting the PGF picture to PDF<br \/>\n<em>Version 0.2:<\/em><br \/>\n&#8211; replaced the icons in XPM format by icons in PNG format from KDE4&#8217;s<br \/>\nOxygen theme (obtained from<br \/>\nsvn:\/\/anonsvn.kde.org\/home\/kde\/trunk\/KDE\/kdelibs\/pics\/oxygen)<br \/>\n&#8211; placed the text edit and the preview area in a splitter so that their<br \/>\nrelative width can be changed by the user<br \/>\n&#8211; placed the log text edit in a dockwidget (which can be hidden)<br \/>\n&#8211; temporary files are now put in QDir::tempPath() + &#8220;\/ktikz&#8221;<br \/>\n(on Linux this is \/tmp\/ktikz), so your working directory remains clean<br \/>\n&#8211; closing the application now removes all temporary files and stops the<br \/>\nthread<br \/>\n&#8211; the first time that the thread (generating the output image) is<br \/>\nexecuted is not on startup anymore, but when the user actually<br \/>\nchanges the text or loads a file<br \/>\n&#8211; images can now be exported to EPS, PDF and PNG<br \/>\n&#8211; for some standard actions, the standard key sequence is used (e.g.<br \/>\nQKeySequence::Open instead of Ctrl+O)<br \/>\n&#8211; the toolbars can be hidden<br \/>\n&#8211; corrected typo &#8220;TiKz&#8221; to &#8220;TikZ&#8221;<br \/>\n&#8211; a function runProcess is used which makes the code of generatePdfFile<br \/>\nand generatePngFile easier (in tikzpngpreviewer.cpp)<br \/>\n&#8211; made a better about dialog<\/p>\n","protected":false},"excerpt":{"rendered":"<p>KtikZ is a small application helping you to create TikZ (from the LaTeX pgf package) diagrams for your publications. It requires qt4, libpoppler, LaTeX (pdflatex), the LaTeX preview-latex-style package [1] and pgf itself [2]. For the eps export functionality you also need the poppler-utils package. If you&#8217;d like to improve this little tool just clone &hellip; <a href=\"https:\/\/www.hackenberger.at\/blog\/ktikz-editor-for-the-tikz-language\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">KtikZ &#8211; Editor<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/pages\/101"}],"collection":[{"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":6,"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/pages\/101\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/pages\/101\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/www.hackenberger.at\/blog\/wp-json\/wp\/v2\/media?parent=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}