# What's the difference between executing pdflatex in cmd, and in Texworks?

I'm working on a program in SAS, that writes equations to a TeX file and then compiles it using systask command pdflatex (...). That is, SAS executes a windows command. However, when the equations are too long, they don't wrap properly when compiling the TeX-document from SAS.

When using the same TeX-file as written by SAS, but opening it in Texworks and then using pdflatex the equations wrap perfectly. Is there some inherent difference in compiling from cmd and in Texworks that I need to account for? (I've MikTex installed)

Corrollary: opening CMD and executing the pdflatex command, yields the same wrapping issue as from SAS. Thus, I don't think SAS is the problem. Below is an example of my program's output.

\documentclass{article}
\usepackage[top=2cm, bottom=2cm, left=1cm, right=1cm]{geometry}
\usepackage{framed}
\usepackage{amsmath}
\usepackage{mathpazo}
\usepackage[mathpazo]{flexisym}
\usepackage{breqn}
\setkeys{breqn}{breakdepth={3}}
\usepackage{float}
\author{John Doe}
\title{Some title}

\begin{document}
\maketitle
\begin{dmath*}
<Some long equation>
\end{dmath*}
\end{document}
• there is no difference. texworks is just the editor and it will run tex for you. But the exact command the editor runs will depend on the way it is configured. If you have set up texworks to use pdflatex --shell-escape --batchmode then typing that on the commandline will do the same thing, but typing just pdflatex will not. – David Carlisle May 16 '17 at 10:30
• Compare the log-files of the two calls. – Ulrike Fischer May 16 '17 at 10:38
• Welcome to TeX.SX, by the way :-) – Arzigoglu May 16 '17 at 12:18
• @UlrikeFischer, I honestly don't know what differences in the log-files are pertinent to my problem, but I'll dive more into them. – pehsh May 17 '17 at 12:24
• @Arzigoglu, thank you - and thanks for the edit :-) @DavidCarlisle, entering Tool configuration for the pdflatex command in texworks yields the following: the program it executes is named miktex-pdftex.exe and it uses arguments -synctex=1,-undump=pdflatex$fullname – pehsh May 17 '17 at 12:32 ## 1 Answer @DavidCarlisle pointed out that Texworks default options for pdflatex command could be different from just executing pdflatex. Copying the arguments from Texworks, i.e. adding the options -synctex=1 -undump=pdflatex$fullname to the windows command solved the problem.

The full command executed by SAS is then

systask command "pdflatex -synctex=1 -undump=pdflatex\$fullname texfile.tex";