## LaTeX forum ⇒ MiKTeX and proTeXt ⇒ MiKTex 2.9 build pdf with no toc/hyperlinks Topic is solved

Information and discussion about MikTeX distribution for Windows and the related proTeXt: Installing, updating, configuring
NikoKatich
Posts: 4
Joined: Mon Mar 28, 2016 1:57 pm

### MiKTex 2.9 build pdf with no toc/hyperlinks

Hi there!

In texstudio pdf compilation works fine using pdflatex.
But if I run cmd and pdflatex.exe with the same parameters, output pdf appears without hyperlinks (TOC and all hyperlinks in document are absent).

In cmd (c:\Program Files\MiKTeX 2.9\miktex\bin\x64>) I use the following command:

`pdflatex.exe -synctex=1 -interaction=nonstopmode c:\test\1\2\test.tex -output-directory "C:\test\1\2"`

I aslo try to run this command for several times, but the result is the same (pdf without toc and links).

In my preamble hyperlink support looks like:
`\usepackage[colorlinks,urlcolor=black,linkcolor=black,pagecolor=black]{hyperref}`

I want to build my docs automatically using TeamCity, so I need some kind of command that can build the same document as texstudio that I use as editor.

What I'm doing wrong?

Stefan Kottwitz
Posts: 9088
Joined: Mon Mar 10, 2008 9:44 pm
Hi Niko,

welcome to the forum!

Perhaps execute pdflatex in the same directory as your document is.

Such as:

`cd c:\test\1\2c:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe -synctex=1 -interaction=nonstopmode test.tex`

Stefan

NikoKatich
Posts: 4
Joined: Mon Mar 28, 2016 1:57 pm
Hi, Stefan!

It works (copy pdflatex.exe to the folder with my project).

Stefan Kottwitz
Posts: 9088
Joined: Mon Mar 10, 2008 9:44 pm
Hi Niko,

it would be better to add the file path to the Windows path variable, so Windows would find the original pdflatex.exe. I just don't know how to explain this for Windows, as I use Linux and Mac OS. But if it works for you, fine. Just to mention it for the case somebody else reads it.

Keep in mind that an update of TeX, which may update pdflatex.exe, may need to copy it again over the old one.

Well, you could make a batch file (.bat) which calls the original pdflatex.exe with arguments. Or does the whole translation of this document like written here.

Stefan

NikoKatich
Posts: 4
Joined: Mon Mar 28, 2016 1:57 pm
Hi Stefan,
I've made a .bat file, that calls pdflatex.exe with all nessecary parameters.
Thanks again