Giter VIP home page Giter VIP logo

gnuplottex's People

Contributors

larskotthoff avatar uhoefel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

uhoefel

gnuplottex's Issues

Incorrect options for lualatex in example for terminal tikz using tikzexternalize

gnuplottex/gnuplottex.dtx

Lines 632 to 633 in b12efdb

% \verb+\tikzset{external/system call={lualatex -shell-escape -halt-on-error+\\
% \verb+-interaction=batchmode -jobname "\image" "\texsource"}}+\\

suggests

\tikzset{external/system call={lualatex -shell-escape -halt-on-error
-interaction=batchmode -jobname "\image" "\texsource"}}

However, lualatex uses two hyphens in front of options (in contrast to pdflatex; an inconsistency which could have been avoided). I have checked following versions of lualatex: 0.79.1, 0.80 and 0.95.0 all use two hyphens.

$ lualatex --help
...
  The following regular options are understood:

   --credits                     display credits and exit
   --debug-format                enable format debugging
   --draftmode                   switch on draft mode (generates no output PDF)
   --[no-]file-line-error        disable/enable file:line:error style messages
   --[no-]file-line-error-style  aliases of --[no-]file-line-error
   --fmt=FORMAT                  load the format file FORMAT
   --halt-on-error               stop processing at the first error
   --help                        display help and exit
   --ini                         be iniluatex, for dumping formats
   --interaction=STRING          set interaction mode (STRING=batchmode/nonstopmode/scrollmode/errorstopmode)
   --jobname=STRING              set the job name to STRING
   --kpathsea-debug=NUMBER       set path searching debugging flags according to the bits of NUMBER
   --lua=FILE                    load and execute a lua initialization script
   --[no-]mktex=FMT              disable/enable mktexFMT generation (FMT=tex/tfm)
   --nosocket                    disable the lua socket library
   --output-comment=STRING       use STRING for DVI file comment instead of date (no effect for PDF)
   --output-directory=DIR        use existing DIR as the directory to write files in
   --output-format=FORMAT        use FORMAT for job output; FORMAT is 'dvi' or 'pdf'
   --progname=STRING             set the program name to STRING
   --recorder                    enable filename recorder
   --safer                       disable easily exploitable lua commands
   --[no-]shell-escape           disable/enable system commands
   --shell-restricted            restrict system commands to a list of commands given in texmf.cnf
   --synctex=NUMBER              enable synctex
   --version                     display version and exit

So the example should read

\tikzset{external/system call={lualatex --shell-escape --halt-on-error
--interaction=batchmode -jobname "\image" "\texsource"}}

Error if gnuplottex loaded but not used

catchfile results in an error when trying to locate the *.gnuploterrors file for documents in which gnuplottex ist loaded, but not used. Minimal working example:

\documentclass{minimal}
\usepackage{gnuplottex}
\begin{document}
\end{document}

XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/Debian)
Package: gnuplottex 2015/12/13 v0.9.1 gnuplot graphs in LaTeX

File `gnuplotttex.sty' not found

Running the first example given in "The gnuplottex package" (dated April 6, 2020) results in the LaTeX Error: File `gnuplotttex.sty' not found.
What should I do to get it running? gnuplottex - when it works as described - might be the tool I have been looking for!
Thanks in advance!
Franz
PS-1: the file extension of attached source files have been changed from "tex" to "txt" in order to be able to attach them to this message
PS-2:
I am working with Linux (openSUSE Leap 15.1), LaTeX-version:
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017/TeX Live for SUSE Linux)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
and GNUPLOT
test-defs.txt
test-latex.txt

Version 5.2 patchlevel 2 last modified 2017-11-15

Output to file only? +specify name?

Hello,

First of all thank you for this wonderful package. It's such a relief that I don't have to write my gnuplot code separately from my latex.

I notice with terminal=pdf, a pdf file is generated. Is it possible to get gnuplottex to only generate a pdf file, which I can later include using \includegraphics?

In that same vein, is it possible to specify a filename for the generated pdf?

Thanks in advance.

not working for data from a file

Latex reports system returned with code 256 and is raising a waring if I try to plot data from a file. Of cause there is no figure in the created in the latex pdf. The code seems to be converted properly in the .gnuplot file. There is no cleated pdf of the plot and the .tex plot file is empty. The code is working perfectly if run directly with gnuplot.

The waring is not helpful, it says Gnuplot execution produced errors:plot 'Versuch_4_5_Gruppe_N_am_01_12_2023.dat' every 1::13::524 using 3:($6/$5) . The latex code is:

\documentclass{scrreport}

\usepackage[siunitx, subfolder]{gnuplottex}

\begin{document}
	
\begin{figure}
	\centering
	\begin{gnuplot}[terminal=cairolatex, terminaloptions=color]
		
		plot 'Versuch_4_5_Gruppe_N_am_01_12_2023.dat' every 1::13::524 using 3:($6/$5)
	\end{gnuplot}
	\caption{This is a simple example using the cairolatex-terminal.}
	\label{pic:cairolatex}
\end{figure}

\end{document}

Gnuplottex does not work when inside frame of beamer

Here is my minimal tex file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass{beamer}
\usecolortheme{seahorse}

\usepackage{gnuplottex}
\usepackage{graphicx}

\begin{document}

\begin{frame}

\begin{gnuplot}[terminal=latex]
plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine'
\end{gnuplot}

\end{frame}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I run this on ubuntu 16.04. If I comment out the \begin{frame} and \end{frame} lines, everything works fine, no errors. The output is not great, but that is not the issue.

However, when these commands inside of a frame (like shown above) I get the output to the logfile:


***** PDFLaTeX output:
***** cd "/home/..."
***** pdflatex -synctex=1 --shell-escape -interaction=nonstopmode test2.tex


This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
\write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2016/02/01>

......

Opening gnuplot stream test2-gnuplottex-fig1.gnuplot
Runaway argument?
plot [0:2*pi] sin(x) title 'Sine', cos(x) title 'Cosine' \end {gnuplo\ETC.
! Paragraph ended before \verbatim@ was complete.

\par
l.15 \end{frame}

! LaTeX Error: \begin{gnuplot} on input line 15 ended by \end{beamer@framepause
s}.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...

l.15 \end{frame}

! Extra }, or forgotten \endgroup.
\endbeamer@frameslide ...amer@framepauses}\egroup
\ifx \beamer@frametitle @...
l.15 \end{frame}

! LaTeX Error: \begin{beamer@framepauses} on input line 15 ended by \end{beamer
@frameslide}.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...

l.15 \end{frame}

! Package catchfile Error: File `test2.gnuploterrors' not found.

See the catchfile package documentation for explanation.
Type H for immediate help.
...

l.17 \end{document}

)
Runaway argument?
\ifx \gnuploterrors@ @empty \else \PackageWarningNoLine {gnuplottex}\ETC.
! File ended while scanning use of \gnuploterrors@eatpar.

\par
<*> test2.tex

! Emergency stop.
<*> test2.tex

! ==> Fatal error occurred, no output PDF file produced!
Transcript written on test2.log.

Putting gnuplot inside of a figure environment improves the look of the output, but does not eliminate the errors.

shell escape with luatex 1.0

Currently, if one uses --enable-write18, this will fail if you use luatex 1.0.
\usepackage{shellesc} should probably solve that Problem.

Gnuplottex wont plot and cant find `rm` or `touch`.

I'm running Mac OS 10.10.5 with MacPorts Version 2.4.0 and gnuplottex ver. 0.9.2 with MacTex 2017 (also tested on MacTex 2015 - same result).

pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04

I want to compile the following document

\documentclass[12pt,a4paper]{scrartcl}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc} 
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{pdfpages}
\usepackage[pdftex]{thumbpdf}
\usepackage{epstopdf}
\usepackage{graphicx}
\usepackage{color}
\usepackage{float}
\usepackage{rotating}
\usepackage{hyperref}
\usepackage{wrapfig}
\usepackage{booktabs}
\usepackage{ltablex}
%\usepackage{tabularx}
\usepackage{mathtools}
%\usepackage{drawmatrix}
\usepackage{multirow}
\usepackage{chngcntr}

\usepackage{latexsym}
\usepackage{keyval}
\usepackage{ifthen}
\usepackage{moreverb}
%\usepackage{shellesc}

\usepackage{gnuplottex}


% custom identifiers

\makeatletter
\@addtoreset{section}{part}
\makeatother
[...]
\begin{document}
[...]
\newpage
\part{Mechanik}
\section{Mechanik von Massepunkten}
\begin{figure}[h]%
	\centering%
	\begin{gnuplot}[terminal=epslatex, terminaloptions=color dashed]
		plot  sin(x)
	\end{gnuplot}
	\caption{This is a simple example using the epslatex-terminal.}%
	\label{pic:epslatex}%
\end{figure}%
[...]

\end{document}

The log-file reveals:
Package gnuplottex Warning: Shell escape not enabled. (gnuplottex) You'll need to convert the graphs yourself..

The pdftex warning output is:

Process started: /usr/texbin/pdflatex --shell-escape -synctex=1 -interaction=nonstopmode "abc".tex

sh: touch: command not found

system returned with code 32512

sh: rm: command not found

system returned with code 32512

sh: rm: command not found

system returned with code 32512

Process exited normally

It creates the dummy write18-test file and writes to it but after that it will not hand over any commands past that. So in fact ShellEscape works but it strange enough can't preform touch or rm.

total 3152
drwxr-xr-x@ 17 leifstolberg  staff   578B Jul 22 11:20 .
drwxr-xr-x@ 22 leifstolberg  staff   748B Jan  6  2017 ..
-rw-r--r--@  1 leifstolberg  staff   6.0K Jul 21 14:58 .DS_Store
-rw-r--r--@  1 leifstolberg  staff    42K Oct 31  2016 physics copy.tex
-rw-r--r--@  1 leifstolberg  staff    89B Jul 22 11:20 physics-gnuplottex-fig1.gnuplot
-rw-r--r--@  1 leifstolberg  staff    18K Jul 22 11:20 physics.aux
-rw-r--r--@  1 leifstolberg  staff   380K Jul 22 11:05 physics.dvi
-rw-r--r--@  1 leifstolberg  staff   108K Jul 22 11:20 physics.log
-rw-r--r--@  1 leifstolberg  staff   8.3K Jul 22 11:20 physics.out
-rw-r--r--@  1 leifstolberg  staff   372K Jul 22 11:20 physics.pdf
-rw-r--r--@  1 leifstolberg  staff   440K Jul 22 11:20 physics.synctex.gz
-rw-r--r--@  1 leifstolberg  staff   117K Jul 22 11:20 physics.tex
-rw-r--r--@  1 leifstolberg  staff    13K Jul 22 11:20 physics.toc
drwxr-xr-x@  9 leifstolberg  staff   306B Jul 21 12:56 tmp
**-rw-r--r--@  1 leifstolberg  staff     2B Jul 21 17:01 w18-test-2017721788.tex**
-rw-r--r--@  1 leifstolberg  staff    42K Oct 30  2016 zahlenmengen.jpg

When in \begin{gnuplot} the [terminal=...] option isn't defined, it is set to default value terminal=latex. But in recent gnuplot the latex terminal is replaced with newer ones

Ok, I am building "example-pdf.tex", included in the package.

When the code

\begin{gnuplot}[scale=0.8]
set grid
set title 'gnuplottex test $e^x$'
set ylabel '$y$'
set xlabel '$x$'
plot exp(x) with linespoints
\end{gnuplot}

is translated by gnuplottex, the file "example-pdf-gnuplottex-fig2.gnuplot" is generated with the contents:

set terminal latex
set output 'gnuplottex/example-pdf-gnuplottex-fig2.tex'
set grid
set title 'gnuplottex test $e^x$'
set ylabel '$y$'
set xlabel '$x$'
plot exp(x) with linespoints

The problem is that the modern gnuplot 5.4.1 does not have the latex terminal (so treats this as "set terminal unknown").
So in this example the second graph is not built by gnuplot and, consecuently, is absent in resulting file "example-pdf.pdf".

Proof on page 261 of Gnuplot_5_4.pdf documentation:
"Latex
Note: Legacy terminal (not built by default). The latex, emtex, eepic, and tpic terminals in older versions
of gnuplot provided minimal support for graphics styles beyond simple lines and points. They have been
directly superseded by the pict2e terminal. For more capable TeX/LaTeX compatible terminal types see
cairolatex (p. 239), context (p. 245), epslatex (p. 251), mp (p. 266), pstricks (p. 280), and tikz
(p. 286)."

When setting a size different to 1,1, the plot itself gets too small

After updating to Ubuntu 21.04, the gnuplot-figure included to my tex-files get the wrong size, when I set a size different to 1,1:

grafik

The ticmarks and the labels "x" and "y" are placed correctly.
I found the version (I thtink):

\ProvidesPackage{gnuplottex}
[2020/03/19 v0.9.5 gnuplot graphs in LaTeX]

This is how I created the Plot:

    \begin{gnuplot}[terminal=cairolatex, terminaloptions=color]
        set size .6,.7
        xmin = -3;   xmax = 4
        ymin = -3;  ymax = 4
        alabel = '$x$' 
        olabel = '$y$' 

        load "./gnuplotinit.gnu"
        
        set xtics 1
        set ytics 1
        
        x1 = 0 
        x2 = -1
                
        f(x) = (x - 1)**2 -2
        g(x) = f(abs(x))
        f1(x)=( x>0 ? f(x) : 1/0 ) 
        f2(x)=( x<0 ? f(x) : 1/0 ) 
        
        
        set label '$\rot{(|x| - 1)^2 -2}$' at 0.2, -2.9
        
        plot f(x)  lt 2 lc rgb 'red' lw 4 dashtype 2 ,\
             g(x)  lt 2  lc rgb 'red' lw 4 
    \end{gnuplot}

The included file "gnuplotinit.gnu" is:

  set sample 200
  unset border
  unset key
  set grid
  set tmargin 5
  set rmargin 10 
  set xr [xmin:xmax]
  set yr [ymin:ymax]
  set xzeroaxis lt -1
  set yzeroaxis lt -1
  set xtics axis
  set ytics axis
  set decimalsign ','
  xarrowdist = ((abs(xmin) + abs(xmax)) / 2) * 0.15 
  yarrowdist = ((abs(ymin) + abs(ymax)) / 2) * 0.2
  set arrow from 0, graph 0 to 0,ymax+yarrowdist, graph 1 filled
  set arrow  to xmax+xarrowdist,0, graph 1 filled

  alocx = xmax+xarrowdist
  alocy = yarrowdist*.3
  
  olocx =  xarrowdist*.3
  olocy =  ymax+yarrowdist
  
  set grid
  
  set label alabel at alocx, alocy
  set label olabel at olocx, olocy

tikz externalize in beamer overlays creates hundreds of files

When combining beamer overlays, gnuplottex and the externalize function of tikz (in pdflatex) an absurd amount of files is generated. Consider this example, where the externalized files should be placed in the folder gnuplottmp. However, after compilation there are now 72 temporary files in the main folder of the main.tex file with the name main-gnuplottex-fig[1 to 36].[tex or gnuplot]. Additionally, in the subfolder gnuplottmp/ there are now 2808 files which take up almost 50MB. These have names like main-figure0-gnuplottex-fig1.gnuplot, main-figure35-gnuplottex-fig36.tex and so on. Most of the files seem to be duplicates of each other as well… e.g. in this case I spotted main-figure0.pdf and main-figure6.pdf to be identical.

The externalization does work in principle, successive compilations are definitely faster than the first one, but what is going on here?

%%%%%%%%%%%%%%%%%%%%
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{gnuplot-lua-tikz}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize[prefix=gnuplottmp/]
\usepackage[siunitx]{gnuplottex}

\begin{document}
\begin{frame}[fragile]{Some title}
\centering

\begin{onlyenv}<1>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot sin(x)
\end{gnuplot}
\end{onlyenv}

\begin{onlyenv}<2>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot cos(x)
\end{gnuplot}
\end{onlyenv}

\begin{onlyenv}<3>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot tan(x)
\end{gnuplot}
\end{onlyenv}

\begin{onlyenv}<4>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot sin(x)*cos(x)
\end{gnuplot}
\end{onlyenv}

\begin{onlyenv}<5>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot sin(x)**2
\end{gnuplot}
\end{onlyenv}

\begin{onlyenv}<6>
\begin{gnuplot}[terminal=tikz, terminaloptions={color size 10cm,7cm}]
plot sin(x)*x
\end{gnuplot}
\end{onlyenv}

\end{frame}
\end{document}

tikz not working in XeLatex

The tikz terminal does not work when using XeLatex. Not sure if it is related to XeLatex, I do not have LuaLatex. If tikz terminal is set with XeLatex, I get the error Package pgfkeys Error: I do not know the key '/tikz/gnuplot' and I am going to ignore it. Perhaps you misspelled it. \begin{tikzpicture}[gnuplot].

Is tikz with XeLatex supported?

No figure if file name contains space

If there is a space in the Latex document containing the gnuplottex code, the figure will be created but not displayed in Latex. Maybe because the created pdf and tex files from gnuplottex contain " in them.

A minimalistic example in a file named test empty.tex:

\documentclass{scrreport}

\usepackage[siunitx, subfolder]{gnuplottex}

\begin{document}
	
\begin{figure}
	\centering
	\begin{gnuplot}[terminal=cairolatex, terminaloptions=color]
		set key box top left
		set key width 4
		set key height 0.25
		set key spacing 1.2
		set key opaque
		set sample 1000
		set xr [-5:5]
		set yr [-1:1]
		plot sin(x) title "$\sin(x)$"
	\end{gnuplot}
	\caption{This is a simple example using the cairolatex-terminal.}
	\label{pic:cairolatex}
\end{figure}

\end{document}

Screenshot_20231203_225224

Subfolder is ignored with shell escape disabled

Checking write access to the subfolder is currently implemented involving \write18.
Thus, in the environment with shell escape disabled, it falls back to not using the subfolder even if the latter exists. This contradicts the warning wording "You'll need to create the folder yourself", because creating the folder manually won't be of any help in such a case.

I believe it would be much better, if possible, to implement lines

\immediate\write18{echo test > "gnuplottex/\tmpfile"}
and
\immediate\write18{touch "gnuplottex/\tmpfile"}
in some way without \write18.
My use case, which I believe to be quite natural, is to disable shell-escape when one wants to use pre-generated figures to save time (and I do it by passing --no-shell-escape to latex rather than by changing shell option in \include{gnuplottex} back and forth).

Missing support for '-output-directory'

Using TeX Live 2019 and 2020. As soon as I pass -output-directory=../build or anything else which is not . to xelatex this package does not work for the follwing reason: \immediate\openout\verbatim@out #1% takes the out dir internally into account when doing open():

49775: open("../build/./index-gnuplottex-fig1.gnuplot",O_WRONLY|O_CREAT|O_TRUNC,0666) = 9 (0x9)
49775: write(1,"\n",1)               = 1 (0x1)
49775: write(1,"Opening gnuplot stream ./index-gnuplottex-fig1.gnuplot",54) = 54 (0x36)
49775: fstat(9,{ mode=-rw-r--r-- ,inode=6994442,size=0,blksize=32768 }) = 0 (0x0)
49775: write(9,"set terminal epslatex\nset output './index-gnuplottex-fig1.tex'\n    plot tan(x)\n",79) = 79 (0x4f)
49775: close(9)                  = 0 (0x0)

but the code does not know that and creates an invalid gnuplot file as well as an invalid gnuplot call:

Package gnuplottex Warning: Gnuplot execution produced errors:
line 0: Cannot open script file './index-gnuplottex-fig1.gnuplot'

I don't know how this can reasonably be solved, but we started to patch commands in a halfbreed fashion to get this work.

Do you see way to support this? Maybe through: \begin{gnuplot}[outdir=../build]. This would only apply to \write18 since even tests spill my src/ directory.

Some references:

Tex capacity exceeded happens when tics font is set

This seems to be an issue:
Setting tics font with,

\begin{gnuplottex}[terminal=tikz]
.....
set tics font ",5"
....
\end{gnuplottex}

causes pdflatex to failed with message:
Tex capacity exceeded, sorry [input stack size=5000] ....
no matter the chosen font size.

Further investigation shows that the "set tics font" command creates in the corresponding fig1.tex file the line,

\tikzset{every node/.append style={font={\fontsize{5.0pt}{6.0pt}\selectfont}}}

which is the cause for running out of capacity.

The workaround I've found was to set the font size by

{\fontsize{5.0pt}{6.0pt}\selectfont
\begin{gnuplottex}[terminal=tikz]
...
...
;;;
\end{gnuplottex}
}

TikZ externalize | Error handling

The recent implementation does not allow non-gnuplot TikZ pictures to be inserted. Apparently, externally generated and inserted TikZ graphs do not feature a \jobname.gnuploterrors file which results in an exception when calling \CatchFile at \AtEndDocument. Commenting the respective lines (bypassing the check for \jobname.gnuploterrors) resolves the issue, as expected. This, however, deactivates any error handling in general. Maybe a conditional error handler could be implemented for gnuplottex jobs only.

suggestion:

\AtEndDocument{%
\ifmiktex
\else
+\IfFileExists{\jobname.gnuploterrors}{
\CatchFileDef\gnuploterrors@{\jobname.gnuploterrors}{\endlinechar=^^J \catcode\ =12 }%
\expandafter\gnuploterrors@eatpar\gnuploterrors@@nil
\ifx\gnuploterrors@@empty\else
\PackageWarningNoLine{gnuplottex}{Gnuplot execution produced errors:^^J%
\detokenize\expandafter{\gnuploterrors@}}%
\fi
+}{}
\fi
}

Error using `do for {...}` inside gnuplot environment

Hello. I want to be able to use iterators like do for and while loops within the gnuplot environment. I haven't been able to escape the curly brackets { so that gnuplot can process them without latex giving an error. This is a simple example that reproduces the problem:

\begin{gnuplot}[terminal=cairolatex,terminaloptions={transparent font "arial,10" fontscale 1.0 linewidth 3}]
    do for [i=1:2] {replot x*i}
\end{gnuplot}

This code works fine if I copy-paste it in the gnuplot terminal. Thanks in advance.

vim syntax highlighting for gnuplottex environment

I am heavily using gnuplottex for years now, and I have massaged my vim editor syntax highlighting in a way that, inside gnuplot environments, the gnuplot source code is displayed with gnuplot syntax highlighting (and not TeX).
This was originally a remedy in case of an odd number of ($1):($2)… column specifiers messing up with TeX's math mode highlighting, but has proven very helpful in various contexts over the years.

" Place this file somewhere where your vim sources it after the syntax
" highlighting definitions of TeX.

" Source gnuplot syntax file, but without the 'end' keyword
unlet b:current_syntax
syn include @gnuplottex !sed 's/\<end\>//' syntax/gnuplot.vim
let b:current_syntax = "tex"

" Match ignored stuff after \end{gnuplot}
syn match gnuplottexEOL ".*$" contained

" Define match region between gnuplot environment delimiters, containing
" gnuplot syntax highlighting
syn region texParaZone matchgroup=gnuplottex start="\\begin{gnuplot}"he=e+3 end="\\end{gnuplot}.*$"he=s+12 contains=@gnuplottex,texBeginEnd nextgroup=gnuplottexEOL

" Colouration of gnuplottex matches
hi link gnuplottex PreCondit
hi link gnuplottexEOL Error

It is not a masterpiece of code quality, but it may be useful for someone else though.
I'm not quite sure where the best place for such a code snippet is. Somewhere here, because it is closest to the main audience (the gnuplottex users)? By the vim syntax upstream at https://github.com/vim/vim/tree/master/runtime/syntax? Some vim plugin (a new one when in doubt)?

Documentation

Not a real issue, just a little demand to update the documentation:
Could you please correct/update the Documentation (August 21, 2016)

1.) Put '--shell-escape' instead of '-shell-escape'
2.) explain how to set '\gnuplotexe'

I found many questions about the latter and it troubled me also:
I have several gnuplot versions, and "my" gnuplot points to a bash-script for choosing a version (if a parameter is given, otherwise it starts the standard version).
Latex runs gnuplot, but the shell-escape does not work any more after the bash-script.
Therefore, I had to put in the Latex-files :

\def\gnuplotexe{/usr/local/bin/gnuplot}.

It would be nice to put (this as) an example of how to set \gnuplotexe to the path instead of saying : 'In addition, you can set \gnuplotexe to the path to the gnuplot executable. Normally, you don’t need to do this; use this option only if LATEX doesn’t find gnuplot.'

Thanks a lot in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.