Manual

arno_b edited this page Dec 30, 2016 · 40 revisions

Current issues

  • Check with and without the hardware acceleration. To do so, go in the preferences, in the quality tab, and check/uncheck the OpenGL check box. This option may lead to glitches with some graphical cards. If you cannot access the preferences through the user interface (e.g. the screen is white without any widget accessible), you can modify the preferences file that is located: ~/.latexdraw/.preferences.xml on Linux; AppData\Local\latexdraw.preferences.xml on Windows (AppData may be a hidden directory); /Library/Preferences/latexdraw/.preferences.xml on MacOSX. Then, modify or create the .preferences.xml file as explained here.

  • Installation on Linux+Wayland. on Linux with Wayland, the installation will fail since Wayland forbids graphical applications to run in sudo/su mode. See this discussion. The workaround consists of installing LaTeXDraw using a X11 session, or manually (see below). We will fix that in a next release.

How to report a bug

Before reporting a bug, please check the following elements:

  • Make sure you use the latest LaTeXDraw version.

  • For Linux users, make sure you use the OracleJDK and not the OpenJDK (that does not work correctly). I know, Oracle is Evil regarding open-sourcing, but I had so many problems related the OpenJDK that I now advise the use of the OracleJDK.

  • Did it work with the previous release? Please download the previous version and check whether the problem was already here.

  • Do you have LaTeX and some required packages installed? The required packages are: `pstricks, pstricks-add, pst-grad, pst-plot, geometry, pst-tools.

  • With MikTeX, check that the auto-install of missing packages is enable. MikTeX can install on-demand (during the compilation of a document) the missing packages. Go in the MikTeX preferences to check that this feature is enable (either 'yes' or 'ask me first'), as depicted by the following screenshot:

miktext config

If you still have a problem, please do the following steps while reporting the bug:

  • Copy/paste in a bug report or on the forum the information provided in the "system" tab you can find here: "Help" menu -> "About LateXDraw" menu item -> "system" tab.

  • Provide either a scenario that I can execute to reproduce the problem, or an SVG document plus some instructions regarding the problem.

  • Be nice. You did not pay for the software and I develop it on my free time since more than one decade.
  • Report your bug either here: https://launchpad.net/latexdraw, the official bug report system, or here: https://sourceforge.net/p/latexdraw/bugs/?source=navbar

Supporting

You can support this software by making a donation, reporting bugs, or translating it.

Requirements

To run latexdraw, Java 8 (at least) must be installed. You can check your Java version here: https://www.java.com/en/download/installed.jsp.

To produce LaTeX documents using PSTricks, LaTeX and its PSTricks package must be installed. On Windows using Miktex, you can use the package manager to look for pstricks. On linux, and usually with texlive, search for a package pstricks, such as texlive-pst-tools.

Installation

On Windows you must use the install_windows.vbs to install LaTeXDraw. This script activates the "run as administrator" feature to install files in dedicated directories such as "Program Files". It may ask you your password. On Linux, the script install_debian_ubuntu will ask administrator privileges before launching the installer. This script simply runs gksu 'java -jar installer.jar'. On MacOSX, try to run the file installer.jar directly.

If you are not able to install LaTeXDraw using these processes, the folder 'data' contains all the required files that you can put in a folder manually. To launch the application, runs the file latexdraw.jar.

Presentation

screenshot

Latexdraw is a vector-drawing editor for LaTeX. It uses the graphical LaTeX language PSTricks for producing either:

  • PSTricks code that can be integrated into LaTeX documents.
  • PS/PDF pictures that can be included into LaTeX documents without any compilation constraint.

The PSTricks code corresponding to the current drawing is automatically generated and updated in its dedicated tab PST. PST Code

Shapes

Various shapes can be created by clicking on the corresponding button.

lines polygon Bézier Bézier Lines, polygons, and Bézier curves can be created by clicking on the drawing area (the canvas). Left-clicking adds a point. Right-clicking or middle-clicking stops the creation. Simple lines (2 points) or chained-lines (more than 2 points) can be produced. A polygon must contains at least 3 points. Pressing the key escape during the editing stops the process.

rect ellipse triangle rhombus Rectangles, ellipses, triangle, and rhombuses can be created using the same process: a drag-and-drop (DnD, press-move*-release) must be performed on the canvas to produce the shape. Pressing the key escape during the editing stops the process.

square circle Arc Squares circles, and arcs can be created using the same process: a drag-and-drop (DnD, press-move*-release) must be performed on the canvas to produce the shape. Contrary to rectangles and co, the position of the mouse pressure identifies the centre of the shape. Moving the mouse thus defines their width. Pressing the key escape during the editing stops the process.

Dot Grid Axes Dots, grids and axes can be created by clicking on the canvas.

Text As grids and axes, text shapes can be created by clicking on the canvas. Then, a text field appears to define the text following the LaTeX format.More details on how to obtain a LaTeX rendering is provided in the next section.

Freehand Freehand shapes can be created by pressing on the canvas on moving the mouse. Points are created until releasing the mouse button. Pressing the key escape during the editing stops the process.

Picture Pictures can be added to a drawing. Clicking on the canvas shows a file chooser that permits to select the picture to include. It is not possible to include ps/pdf pictures yet. To be usable in the LaTeX environment, the picture is converted in postscript. So, a ps file is normally created near the original file. This ps file is used during the compilation in pdf/ps and in the pstricks code.

PST code PSTricks code can be inserted in the drawing (converted in shapes). Clicking on the button dedicated for this purpose displays a window with a text area. In this text area can be put the PSTricks code. All the PSTricks commands are not managed yet. Only commands generated by Latexdraw should be used here.

LaTeX text rendering

Text in LaTeX Adding text

Texts added to a drawing can be rendered in LaTeX. LaTeX commands may need specific packages to be complied. These packages can be defined by clicking on the button: LaTeX package icon at the bottom of the user interface. A text area appears and the package can be put there. Adding packages

Recurrent packages can be put in the preferences dialogue box (Edit -> Preferences -> LaTeX tab). Adding packages

In the text field you can write as in your LaTeX editor. For instance, you can set the font size by typing in the text field: \Huge my text. Commands used in one text shape do not have any side effect on the other text shapes of the drawing.

Typing the key combo shift-enter permits to create a new line in the text field (not in the rendered LaTeX text). For the moment, the commands \\ and \newline do not create a new line in the rendered LaTeX text. So, the only way to do that is to use \begin{tabular}.

If a text is not rendered in LaTeX, check the error message: put the cursor over the text, the error message should appear.

Error log

You can also open the text panel and look at the log.

Error log panel

Then, you can check that:

  • All the required packages are used. Maybe some math or internationalisation packages are missing. Check the wikibook on LaTeX, notably the internationalisation and math pages.
  • There is no LaTeX error
  • You have LaTeX and all the PSTricks packages installed

Editing shapes

Selecting shapes

Shapes can be selected in the selection mode (button selection mode). A shape can be selected by clicking on it or by doing a drag-and-drop on the canvas to intersect the wanted shapes. All the shapes can be selected using the shortcut ctrl+A.

Translating/scaling/rotating shapes

When shapes are selected, handlers appear.

Handlers

2 standard handlers exists: a unique rotation handler rotation handler and 8 scaling handlers. Pressing on a handler and moving it rotates or scales the selected shape(s). When shapes are selected they can be moved by:

  • left-pressing on one of the selected shapes and moving the mouse.
  • right-pressing anywhere on the canvas and moving the mouse.

Editing shape properties

Some shapes provide with handlers to edit some specific properties. For arcs, 2 rectangular handlers exist to set the arc angles. Drag-n-droping them changes the arc's angles.

Arc handler

Similarly, polygons, lines, and bézier curves have rectangular handler to move each point. Drag-n-droping them moves the targeted point. Bézier curves also have rounded handlers to edit the control points of each points.

Bezier handlers

All the other properties can be edited using the widgets located in the toolbar at the bottom of the user interface. There is 2 ways for setting shape properties:

  • Before creating a shape you can set properties (i.e. customising the pencil). Then, these properties will be applied to all the shapes created afterwards.
  • After having created shapes you can select them and set properties. In this case, the properties will be applied to the selected shapes only.

The different properties are grouped by concern:

  • Line TB This toolbar allows the editing of the border line of shapes: thickness, colour, line style, border position, corner roundness.
  • Dble border TB This toolbar concerns the double border line of shapes: having double border line or not, the colour of the gap; the size of the gap.