Working with latex frames: Difference between revisions
m (Added licence tag.) |
(Specials : $scribus_file$) |
||
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{HOWTO Index}} | {{HOWTO Index}}[[Category:EN]][[Category:Text]] | ||
This article is intended to be a compilation of operations pertaining to LaTeX frames. | This article is intended to be a compilation of operations pertaining to LaTeX frames. | ||
{{Working_with_toc}} | {{Working_with_toc}} | ||
== Configuration == | == Configuration == | ||
In order to be able to incorporate LaTeX, you will have to configure the path to your LaTeX executable. Go to File -> Preferences -> External Tools and set the paths for the LaTeX executable and your editor. The easiest way to do this is to click on "Rescan" and all required values should be filled in automatically. | |||
=== Manual configuration === | === Manual configuration === | ||
'''Note:''' Manual configuration is only required if something goes wrong or you want to do something special. First try the autoconfiguration by clicking "Rescan"! | '''Note:''' Manual configuration is only required if something goes wrong or you want to do something special. First try the autoconfiguration by clicking "Rescan"! | ||
If you want to manually configure an other LaTeX executable type in the path, but make sure that the following requirement is met: | If you want to manually configure an other LaTeX executable type in the path, but make sure that the following requirement is met: | ||
* The output must be in a format that | * The output must be in a format that Scribus can display in an image frame. (for example PNG, JPEG, PostScript, PDF) This means that you can't use plain LaTeX, because it produces DVI output. | ||
You can use the following | You can use the following placeholders in your command line: | ||
* %dir Temporary directory ( = the directory of the input file) | * %dir Temporary directory ( = the directory of the input file) | ||
* %dpi Current dpi setting | * %dpi Current dpi setting | ||
Line 18: | Line 19: | ||
=== Preamble === | === Preamble === | ||
All | All LaTeX documents are automatically prefixed with an preamble which you also can configure in this dialog. Normally the predefined text should work, but you can input any valid LaTeX source. If you want one frame not to use the globaly defined preamble then you don't have to delete it, but you can disable it on a per frame basis. (see section "Specials" for details) | ||
== Placing | == Placing LaTeX frames == | ||
Select the | Select the [[Image:Latex-button.png]] item from the toolbar and then draw a frame where you want your formula to be placed. After some seconds a default LaTeX file should be rendered. This contains some sample code to make the process of creating your own code more easy. Now you can right-click your frame and select "Edit Latex Source". Depending on your settings either the program you specified as the external editor or the internal one are started. | ||
=== External editor === | === External editor === | ||
Just type your | Just type your LaTeX code, but remember: The preamble and the end is added automatically during processing. So only add the parts between | ||
<pre>\begin{document}</pre> and <pre>\end{ | <pre>\begin{document}</pre> and <pre>\end{document}</pre>See the Section "Latex Documentation" for details about the LaTeX syntax. | ||
== Specials == | == Specials == | ||
There are some | There are some special codes to access Scribus values from your LaTeX document. They all look like this: '''$scribus_XXX$''' | ||
The following variables are available: | The following variables are available: | ||
* '''$scribus_file$''' : name of the temporary file created by the render frame | |||
* '''$scribus_noprepost$''' Disable the preamble (Note: This variable is not replaced by anything so it's a good idea to place it on a comment line!) | * '''$scribus_noprepost$''' Disable the preamble (Note: This variable is not replaced by anything so it's a good idea to place it on a comment line!) | ||
* '''$scribus_width$''' Frame width in pt | * '''$scribus_width$''' Frame width in pt | ||
Line 44: | Line 43: | ||
* '''$scribus_scaleY$''' Scale factor in vertical direction | * '''$scribus_scaleY$''' Scale factor in vertical direction | ||
* '''$scribus_dpi$''' The DPI setting for this frame. Only valid when the frame is processed as raster graphics (i.e. currently always) | * '''$scribus_dpi$''' The DPI setting for this frame. Only valid when the frame is processed as raster graphics (i.e. currently always) | ||
== Working with Bibtex == | |||
Bibtex is not currently supported within the Scribus Latex frame interface dialogue, however it can be called on the Latex frame externally. The steps are: | |||
# Create your latex frame, and include your bibliography stuff at the end of the document as you would for a normal document. i.e. | |||
#: \bibliographystyle{abbrv} | |||
#: \bibliography{refer} | |||
# Find the current temporary filename Scribus is using for Latex rendering. It will be mentioned in the 'Program Messages' listing and will probably include 'scribus_temp_render_'. The file will be in the $TEMP directory. | |||
# Jump into that directory and copy your bib file into the $TEMP directory. | |||
# Run bibtex on the temporary filename. | |||
# Run latex again, and again, using the 'Update' button on the Editor dialogue. The latex rendered frame should now have your bibliography correctly substituted. | |||
== | == LaTeX Documentation == | ||
* http://www.ctan.org/tex-archive/info/lshort/ | * http://www.ctan.org/tex-archive/info/lshort/ | ||
* http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/GSWLaTeX.pdf | * http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/GSWLaTeX.pdf | ||
Line 52: | Line 64: | ||
(please add any useful links you have here) | (please add any useful links you have here) | ||
(C) 2007 Hermann Kraus. This document is licensed under the Open Documentation License. | ---- | ||
(C) 2007 Hermann Kraus. This document is licensed under the Open Documentation License with the same elected options as in the Scribus documentation. |
Latest revision as of 20:19, 13 April 2018
Installation • Usage • PDF issues • Imposition • Other |
This article is intended to be a compilation of operations pertaining to LaTeX frames.
All Working with pages:
Working with text frames |
Configuration
In order to be able to incorporate LaTeX, you will have to configure the path to your LaTeX executable. Go to File -> Preferences -> External Tools and set the paths for the LaTeX executable and your editor. The easiest way to do this is to click on "Rescan" and all required values should be filled in automatically.
Manual configuration
Note: Manual configuration is only required if something goes wrong or you want to do something special. First try the autoconfiguration by clicking "Rescan"! If you want to manually configure an other LaTeX executable type in the path, but make sure that the following requirement is met:
- The output must be in a format that Scribus can display in an image frame. (for example PNG, JPEG, PostScript, PDF) This means that you can't use plain LaTeX, because it produces DVI output.
You can use the following placeholders in your command line:
- %dir Temporary directory ( = the directory of the input file)
- %dpi Current dpi setting
- %file The input file (if this placeholder is not used the last parameter will automatically be the filename)
Preamble
All LaTeX documents are automatically prefixed with an preamble which you also can configure in this dialog. Normally the predefined text should work, but you can input any valid LaTeX source. If you want one frame not to use the globaly defined preamble then you don't have to delete it, but you can disable it on a per frame basis. (see section "Specials" for details)
Placing LaTeX frames
Select the item from the toolbar and then draw a frame where you want your formula to be placed. After some seconds a default LaTeX file should be rendered. This contains some sample code to make the process of creating your own code more easy. Now you can right-click your frame and select "Edit Latex Source". Depending on your settings either the program you specified as the external editor or the internal one are started.
External editor
Just type your LaTeX code, but remember: The preamble and the end is added automatically during processing. So only add the parts between
\begin{document}
and
\end{document}
See the Section "Latex Documentation" for details about the LaTeX syntax.
Specials
There are some special codes to access Scribus values from your LaTeX document. They all look like this: $scribus_XXX$
The following variables are available:
- $scribus_file$ : name of the temporary file created by the render frame
- $scribus_noprepost$ Disable the preamble (Note: This variable is not replaced by anything so it's a good idea to place it on a comment line!)
- $scribus_width$ Frame width in pt
- $scribus_height$ Frame height in pt
- $scribus_realwidth$ Effective frame width after removing left border and applying scale in pt
- $scribus_realheight$ Effective frame height after removing top border and applying scale in pt
- $scribus_offsetX$ Left border in pt
- $scribus_offsetY$ Top border in pt
- $scribus_scaleX$ Scale factor in horizontal direction (e.g. 0.5 = 50%, 1.0 = 100%, 2.0 = 200%)
- $scribus_scaleY$ Scale factor in vertical direction
- $scribus_dpi$ The DPI setting for this frame. Only valid when the frame is processed as raster graphics (i.e. currently always)
Working with Bibtex
Bibtex is not currently supported within the Scribus Latex frame interface dialogue, however it can be called on the Latex frame externally. The steps are:
- Create your latex frame, and include your bibliography stuff at the end of the document as you would for a normal document. i.e.
- \bibliographystyle{abbrv}
- \bibliography{refer}
- Find the current temporary filename Scribus is using for Latex rendering. It will be mentioned in the 'Program Messages' listing and will probably include 'scribus_temp_render_'. The file will be in the $TEMP directory.
- Jump into that directory and copy your bib file into the $TEMP directory.
- Run bibtex on the temporary filename.
- Run latex again, and again, using the 'Update' button on the Editor dialogue. The latex rendered frame should now have your bibliography correctly substituted.
LaTeX Documentation
- http://www.ctan.org/tex-archive/info/lshort/
- http://www.maths.tcd.ie/~dwilkins/LaTeXPrimer/GSWLaTeX.pdf
- http://www.tug.org.in/tutorials.html
(please add any useful links you have here)
(C) 2007 Hermann Kraus. This document is licensed under the Open Documentation License with the same elected options as in the Scribus documentation.