1

In the simple code given below, the bode plot does not plot with used in XeLaTeXify. I did put in the --shell-escape -enable-write18 in the XeLaTeX console window:

enter image description here However, I just get the grid and no plot.

I do see gnuplot in the WinEdt path.

Can you tell me if bodegraph works with XeLaTeXify? If so, can you tell me how to get this code to compile in XeLaTex within WinEdt. Thanks!

CODE:

\documentclass[10pt]{article}
\usepackage{amsmath,amssymb}

\usepackage{tikz}
\usepackage{bodegraph}

\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}


\begin{document}

\begin{tikzpicture}[>=latex',
    ref lines/.style={thin, blue!60},
    ref points/.style={circle, black, opacity=0.7, fill, minimum size= 3pt, inner sep=0},
    every node/.style={font=\small},
    bode lines/.style={very thick, blue},
    Gclabel/.style={text=blue},
    xscale=12/3]
%
\begin{scope}[yshift=-3.5cm,yscale=4/80]
\UnitedB
\semilog{-2}{2}{-60}{80}

%% Bode plot (magnitude) for the original system, 4/(s/(1+2s)).
%% Asymptotic line
\BodeAmp[ref lines, red!60]{-1:1.8}{\POAmpAsymp{18}{2.0}+\IntAmp{1}}
%% Bode plot
\BodeAmp[bode lines, black, name path=Gomagnitude]{-1:1.35}{\POAmp{4}{2.0}+\IntAmp{1}}

%
% Axes label
\node [below=6pt] at (0.5,-60) {Frequency, $\omega$};
\node [rotate=90] at (-2.2,5) {Magnitude, $20\log(|G(\text{j}\omega)|)$};


\end{scope}

\end{tikzpicture}

\end{document} 
9
  • 1
    Your code is not a XeLaTeX code... you have to add at least a language... try to add \usepackage{polyglossia} \setmainlanguage{english} \setmainfont{A Font Here} ... I don't have gnuplot and I don't know what XeLaTeXify is
    – koleygr
    Jun 22 '17 at 3:43
  • 1
    If you dont use polyglossia use the command \usepackage[english]{babel}... It works for me, but it can not open a gnuplot file...
    – koleygr
    Jun 22 '17 at 3:52
  • @koleygr, thanks for your solution, XeLaTeXify - runs Biber and PDFTeXify with with the XeLaTeX engine. I had to put those commands above --shell-escape -enable-write18 in the PDFTeXify tab for the code to work. Thank you!
    – Joe
    Jun 22 '17 at 4:08
  • Please write it as an answer and chose it as correct for users who will find the same problem....Oooops thought that you was a new user of forum ... lol
    – koleygr
    Jun 22 '17 at 4:14
  • 1
    You don't need both (--shell-escape and --enable-write18) . The options are synonyms. And polyglossia or babel are not required for xelatex, but it is sensible to add one of this package (I would use babel for an english document). Jun 22 '17 at 7:44
2
+25

A little background: what is PDFTexify?

PDFTexify is a WinEdt command and not the name of a compiler. It mimics the behaviour of MiKTeX's texify.exe accessory by running a LaTeX compiler, whose default value is pdflatex.exe as can be seen in the picture below:

enter image description here

together with other programs that take care of bibliographies, indexes, glossaries, etc., to get a fully compiled document (if you install the needed plugins, it also compiles Asymptote figures, PythonTeX code, etc.).

The default engine for compiling bibliographies is bibtex.exe as can be seen in the picture below:

enter image description here

The name of the compiler is stored in an environmental variable called PDFLATEX while the name of the other compilers are stored into WinEdt variables like BibTeX-Executable for the bibliography compiler.


A little background: what is XeLaTexify

XeLaTexify is also a WinEdt command, available when you install the plug-in LaTeXify, which (excerpt from the plug-in documentation):

XeLaTeXify (runs Biber and PDFTeXify with XeLaTeX engine)

Shortcut: Ctrl+Alt+E

and this is its definition in the MainMenu.ini configuration script:

ITEM="XeLaTeXify"
  CAPTION="&XeLaTeXify"
  IMAGE="TeXXeLaTeXify"
  SAVE_INPUT=1
  MACRO=`Assign("Old-BibTeX-Executable","%$('BibTeX-Executable');");`+
        `Assign("BibTeX-Executable","biber.exe");`+
        `Assign("OLD-PDFLATEX","%@('PDFLATEX');");`+
        `SetEnvVar("PDFLATEX","xelatex.exe");`+
        `Exe('%b\Exec\TeX\PDFTeXify.edt');`+
        `Assign("BibTeX-Executable","%$('Old-BibTeX-Executable');");`+
        `Release("Old-BibTeX-Executable");`+
        `SetEnvVar("PDFLATEX","%$('OLD-PDFLATEX');");`+
        `Release("OLD-PDFLATEX");`
  SHORTCUT="49221::Ctrl+Alt+E"
  REQ_FILTER=:"%!M=TeX"|"%!M=TeX:STY"|"%!M=TeX:AUX"

What does this mean?

The XeLaTeXify command is a wrapper around the WinEdt command PDFTeXify which sets the environmental variable PDFLATEX to the value xelatex.exe and the inner variable BibTeX-Executable to the value biber.exe before calling the command PDFTeXify itself (these values are restored after the execution).

In other words, when you click on the button XeLaTeXify you are running

  • xelatex

  • biber

  • (eventually) other compilers like makeindex, makeglossaries, etc.

  • xelatex (again if needed)

  • biber (again if needed)

  • xelatex (again if needed)

The whole process is handled by the PDFTeXify macro, which is called by XeLaTeXify.


Conclusions and answer to the question

Being XeLaTeXify a wrapper around PDFTeXify, this means that if you want to modify its behavior like adding command-line switches, as in your case, you have to modify the properties of the PDFTeXify command in the Execution Modes dialog.

enter image description here

1

The comments from @koleygr pointed me to the solution. As XeLaTeXify runs Biber and PDFTeXify with with the XeLaTeX engine, by putting in the --shell-escape under the PDFTeXify tab helps fix the issue. Building on what @koleygr said, we also need to include

\usepackage{polyglossia} 
\setmainlanguage{english} 
\usepackage{avant}
\usepackage{microtype}

Also, from the comment made by @Ulrike Fischer, we need to only put --shell-escape under PDFTeXify. Here is the update to the PDFTeXify:

enter image description here

Here is the full code:

\documentclass[10pt]{article}
\usepackage{polyglossia} 
\setmainlanguage{english} 
\usepackage{avant}
\usepackage{microtype}

\usepackage{amsmath,amssymb}

\usepackage{tikz}
\usepackage{bodegraph}

\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}


\begin{document}

\begin{tikzpicture}[>=latex',
    ref lines/.style={thin, blue!60},
    ref points/.style={circle, black, opacity=0.7, fill, minimum size= 3pt, inner sep=0},
    every node/.style={font=\small},
    bode lines/.style={very thick, blue},
    Gclabel/.style={text=blue},
    xscale=12/3]
%
\begin{scope}[yshift=-3.5cm,yscale=4/80]
\UnitedB
\semilog{-2}{2}{-60}{80}

%% Bode plot (magnitude) for the original system, 4/(s/(1+2s)).
%% Asymptotic line
\BodeAmp[ref lines, red!60]{-2:1.8}{\POAmpAsymp{18}{2.0}+\IntAmp{1}}
%% Bode plot
\BodeAmp[bode lines, black, name path=Gomagnitude]{-1:1.35}{\POAmp{4}{2.0}+\IntAmp{1}}

%
% Axes label
\node [below=6pt] at (0.5,-60) {Frequency, $\omega$};
\node [rotate=90] at (-2.2,5) {Magnitude, $20\log(|G(\text{j}\omega)|)$};

\end{scope}

\end{tikzpicture}

\end{document}
3
  • 1
    Don't use \usepackage[T1]{fontenc} with xelatex. And the avant package won't work correctly either. Use the commands of fontspec to setup the fonts. Jun 22 '17 at 15:34
  • Edited solution with your comment and deleted \usepackage[T1]{fontenc}
    – Joe
    Jun 22 '17 at 15:41
  • 1
    Nice joe.. I don't use much add ons... I prefer pdfLaTeX or XeLaTeX ... but I am happy you found the solution... I use the package [utf8]{inputenc} but this is for Greek +1 for posting a detailed answer... Somebody will need it and all we are learning new stuff :)
    – koleygr
    Jun 26 '17 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.