We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
under Windows, "ipython3 nbconvert "C:/blabla/first_try.ipynb" --to latex --post PDF" POST processing action fails because of a bad parameter
Hello,

The "one single step" option to create a ".pdf" from a .ipynb" fails on my windows python3 pc 

Nbconvert  apparently  tries compile ".TEX"  result with 

"pdflatex .\first_try.tex" 

==> It generates a bad behaviour of pdflatex, which picks "pdfTex" option instead of "PdfLatex".

The working option, on my Windows PC  and when I do it by hand, is not to put the ".\" 

"pdflatex first_try.tex" 

UPDATE : replacing ".\" per "./" seems also to be a solution.
"pdflatex ./first_try.tex" 

Hint to  the problem comes from here 
http://tex.stackexchange.com/questions/78178/miktex-how-to-run-pdflatex-from-cmd-prompt-on-windows-7-compared-to-windows-xp 

Details below.

Sheers

*\* instruction *\* 
ipython3 nbconvert "C:/blabla/first_try.ipynb" --to latex --post PDF"

**\* (start of the output ) ***
C:\Users\parent\Desktop\winpython\WinPython-32bit-3.3.2.1rc1\python-3.3.2>ipytho
n3 nbconvert "C:/blabla//first_try.ipynb" --to latex --po
st PDF
[NbConvertApp] Using existing profile dir: 'C:\Users\parent\Desktop\winpytho
n\WinPython-32bit-3.3.2.1rc1\settings\.ipython\profile_default'
[NbConvertApp] Converting notebook C:/blabla/first_try.ipynb to latex
[NbConvertApp] Support files will be in first_try_files\
[NbConvertApp] Loaded template latex_article.tplx
[NbConvertApp] Writing 53680 bytes to .\first_try.tex
[NbConvertApp] Building PDF: `pdflatex .\first_try.tex`
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX)
 restricted \write18 enabled.
entering extended mode
! Undefined control sequence.
<_> .\first
           _try.tex
?
*_\* (end of the output ) ***


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `IPython/nbconvert/writers/files.py`
Content:
```
1 """
2 Contains writer for writing nbconvert output to filesystem.
3 """
4 #-----------------------------------------------------------------------------
5 #Copyright (c) 2013, the IPython Development Team.
6 #
7 #Distributed under the terms of the Modified BSD License.
8 #
9 #The full license is in the file COPYING.txt, distributed with this software.
10 #-----------------------------------------------------------------------------
11 
12 #-----------------------------------------------------------------------------
13 # Imports
14 #-----------------------------------------------------------------------------
15 
16 import io
17 import os
18 import glob
19 
20 from IPython.utils.traitlets import Unicode
21 from IPython.utils.path import link_or_copy
22 
23 from .base import WriterBase
24 
25 #-----------------------------------------------------------------------------
26 # Classes
27 #-----------------------------------------------------------------------------
28 
29 class FilesWriter(WriterBase):
30     """Consumes nbconvert output and produces files."""
31 
32 
33     build_directory = Unicode(".", config=True, 
34                               help="""Directory to write output to.  Leave blank
35                               to output to the current directory""")
36 
37 
38     # Make sure that the output directory exists.
39     def _build_directory_changed(self, name, old, new):
40         if new and not os.path.isdir(new):
41             os.makedirs(new)
42 
43 
44     def __init__(self, **kw):
45         super(FilesWriter, self).__init__(**kw)
46         self._build_directory_changed('build_directory', self.build_directory, 
47                                       self.build_directory)
48     
49     def _makedir(self, path):
50         """Make a directory if it doesn't already exist"""
51         if not os.path.isdir(path):
52             self.log.info("Making directory %s", path)
53             os.makedirs(path)
54 
55     def write(self, output, resources, notebook_name=None, **kw):
56             """
57             Consume and write Jinja output to the file system.  Output directory
58             is set via the 'build_directory' variable of this instance (a 
59             configurable).
60 
61             See base for more...
62             """
63 
64             # Pull the extension and subdir from the resources dict.
65             output_extension = resources['output_extension']
66 
67             # Write all of the extracted resources to the destination directory.
68             # NOTE: WE WRITE EVERYTHING AS-IF IT'S BINARY.  THE EXTRACT FIG
69             # TRANSFORMER SHOULD HANDLE UNIX/WINDOWS LINE ENDINGS...
70             for filename, data in resources.get('outputs', {}).items():
71 
72                 # Determine where to write the file to
73                 dest = os.path.join(self.build_directory, filename)
74                 path = os.path.dirname(dest)
75                 self._makedir(path)
76 
77                 # Write file
78                 self.log.debug("Writing %i bytes to support file %s", len(data), dest)
79                 with io.open(dest, 'wb') as f:
80                     f.write(data)
81 
82             # Copy referenced files to output directory
83             if self.build_directory:
84                 for filename in self.files:
85 
86                     # Copy files that match search pattern
87                     for matching_filename in glob.glob(filename):
88 
89                         # Make sure folder exists.
90                         dest = os.path.join(self.build_directory, filename)
91                         path = os.path.dirname(dest)
92                         self._makedir(path)
93 
94                         # Copy if destination is different.
95                         if not os.path.normpath(dest) == os.path.normpath(matching_filename):
96                             self.log.info("Linking %s -> %s", matching_filename, dest)
97                             link_or_copy(matching_filename, dest)
98 
99             # Determine where to write conversion results.
100             dest = notebook_name + '.' + output_extension
101             if self.build_directory:
102                 dest = os.path.join(self.build_directory, dest)
103 
104             # Write conversion results.
105             self.log.info("Writing %i bytes to %s", len(output), dest)
106             with io.open(dest, 'w', encoding='utf-8') as f:
107                 f.write(output)
108             return dest
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/IPython/nbconvert/writers/files.py b/IPython/nbconvert/writers/files.py
--- a/IPython/nbconvert/writers/files.py
+++ b/IPython/nbconvert/writers/files.py
@@ -30,7 +30,7 @@
     """Consumes nbconvert output and produces files."""
 
 
-    build_directory = Unicode(".", config=True, 
+    build_directory = Unicode("", config=True,
                               help="""Directory to write output to.  Leave blank
                               to output to the current directory""")

{"golden_diff": "diff --git a/IPython/nbconvert/writers/files.py b/IPython/nbconvert/writers/files.py\n--- a/IPython/nbconvert/writers/files.py\n+++ b/IPython/nbconvert/writers/files.py\n@@ -30,7 +30,7 @@\n     \"\"\"Consumes nbconvert output and produces files.\"\"\"\n \n \n-    build_directory = Unicode(\".\", config=True, \n+    build_directory = Unicode(\"\", config=True,\n                               help=\"\"\"Directory to write output to.  Leave blank\n                               to output to the current directory\"\"\")\n", "issue": "under Windows, \"ipython3 nbconvert \"C:/blabla/first_try.ipynb\" --to latex --post PDF\" POST processing action fails because of a bad parameter\nHello,\n\nThe \"one single step\" option to create a \".pdf\" from a .ipynb\" fails on my windows python3 pc \n\nNbconvert  apparently  tries compile \".TEX\"  result with \n\n\"pdflatex .\\first_try.tex\" \n\n==> It generates a bad behaviour of pdflatex, which picks \"pdfTex\" option instead of \"PdfLatex\".\n\nThe working option, on my Windows PC  and when I do it by hand, is not to put the \".\\\" \n\n\"pdflatex first_try.tex\" \n\nUPDATE : replacing \".\\\" per \"./\" seems also to be a solution.\n\"pdflatex ./first_try.tex\" \n\nHint to  the problem comes from here \nhttp://tex.stackexchange.com/questions/78178/miktex-how-to-run-pdflatex-from-cmd-prompt-on-windows-7-compared-to-windows-xp \n\nDetails below.\n\nSheers\n\n*\\* instruction *\\* \nipython3 nbconvert \"C:/blabla/first_try.ipynb\" --to latex --post PDF\"\n\n**\\* (start of the output ) ***\nC:\\Users\\parent\\Desktop\\winpython\\WinPython-32bit-3.3.2.1rc1\\python-3.3.2>ipytho\nn3 nbconvert \"C:/blabla//first_try.ipynb\" --to latex --po\nst PDF\n[NbConvertApp] Using existing profile dir: 'C:\\Users\\parent\\Desktop\\winpytho\nn\\WinPython-32bit-3.3.2.1rc1\\settings\\.ipython\\profile_default'\n[NbConvertApp] Converting notebook C:/blabla/first_try.ipynb to latex\n[NbConvertApp] Support files will be in first_try_files\\\n[NbConvertApp] Loaded template latex_article.tplx\n[NbConvertApp] Writing 53680 bytes to .\\first_try.tex\n[NbConvertApp] Building PDF: `pdflatex .\\first_try.tex`\nThis is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX)\n restricted \\write18 enabled.\nentering extended mode\n! Undefined control sequence.\n<_> .\\first\n           _try.tex\n?\n*_\\* (end of the output ) ***\n\n", "before_files": [{"content": "\"\"\"\nContains writer for writing nbconvert output to filesystem.\n\"\"\"\n#-----------------------------------------------------------------------------\n#Copyright (c) 2013, the IPython Development Team.\n#\n#Distributed under the terms of the Modified BSD License.\n#\n#The full license is in the file COPYING.txt, distributed with this software.\n#-----------------------------------------------------------------------------\n\n#-----------------------------------------------------------------------------\n# Imports\n#-----------------------------------------------------------------------------\n\nimport io\nimport os\nimport glob\n\nfrom IPython.utils.traitlets import Unicode\nfrom IPython.utils.path import link_or_copy\n\nfrom .base import WriterBase\n\n#-----------------------------------------------------------------------------\n# Classes\n#-----------------------------------------------------------------------------\n\nclass FilesWriter(WriterBase):\n    \"\"\"Consumes nbconvert output and produces files.\"\"\"\n\n\n    build_directory = Unicode(\".\", config=True, \n                              help=\"\"\"Directory to write output to.  Leave blank\n                              to output to the current directory\"\"\")\n\n\n    # Make sure that the output directory exists.\n    def _build_directory_changed(self, name, old, new):\n        if new and not os.path.isdir(new):\n            os.makedirs(new)\n\n\n    def __init__(self, **kw):\n        super(FilesWriter, self).__init__(**kw)\n        self._build_directory_changed('build_directory', self.build_directory, \n                                      self.build_directory)\n    \n    def _makedir(self, path):\n        \"\"\"Make a directory if it doesn't already exist\"\"\"\n        if not os.path.isdir(path):\n            self.log.info(\"Making directory %s\", path)\n            os.makedirs(path)\n\n    def write(self, output, resources, notebook_name=None, **kw):\n            \"\"\"\n            Consume and write Jinja output to the file system.  Output directory\n            is set via the 'build_directory' variable of this instance (a \n            configurable).\n\n            See base for more...\n            \"\"\"\n\n            # Pull the extension and subdir from the resources dict.\n            output_extension = resources['output_extension']\n\n            # Write all of the extracted resources to the destination directory.\n            # NOTE: WE WRITE EVERYTHING AS-IF IT'S BINARY.  THE EXTRACT FIG\n            # TRANSFORMER SHOULD HANDLE UNIX/WINDOWS LINE ENDINGS...\n            for filename, data in resources.get('outputs', {}).items():\n\n                # Determine where to write the file to\n                dest = os.path.join(self.build_directory, filename)\n                path = os.path.dirname(dest)\n                self._makedir(path)\n\n                # Write file\n                self.log.debug(\"Writing %i bytes to support file %s\", len(data), dest)\n                with io.open(dest, 'wb') as f:\n                    f.write(data)\n\n            # Copy referenced files to output directory\n            if self.build_directory:\n                for filename in self.files:\n\n                    # Copy files that match search pattern\n                    for matching_filename in glob.glob(filename):\n\n                        # Make sure folder exists.\n                        dest = os.path.join(self.build_directory, filename)\n                        path = os.path.dirname(dest)\n                        self._makedir(path)\n\n                        # Copy if destination is different.\n                        if not os.path.normpath(dest) == os.path.normpath(matching_filename):\n                            self.log.info(\"Linking %s -> %s\", matching_filename, dest)\n                            link_or_copy(matching_filename, dest)\n\n            # Determine where to write conversion results.\n            dest = notebook_name + '.' + output_extension\n            if self.build_directory:\n                dest = os.path.join(self.build_directory, dest)\n\n            # Write conversion results.\n            self.log.info(\"Writing %i bytes to %s\", len(output), dest)\n            with io.open(dest, 'w', encoding='utf-8') as f:\n                f.write(output)\n            return dest", "path": "IPython/nbconvert/writers/files.py"}], "after_files": [{"content": "\"\"\"\nContains writer for writing nbconvert output to filesystem.\n\"\"\"\n#-----------------------------------------------------------------------------\n#Copyright (c) 2013, the IPython Development Team.\n#\n#Distributed under the terms of the Modified BSD License.\n#\n#The full license is in the file COPYING.txt, distributed with this software.\n#-----------------------------------------------------------------------------\n\n#-----------------------------------------------------------------------------\n# Imports\n#-----------------------------------------------------------------------------\n\nimport io\nimport os\nimport glob\n\nfrom IPython.utils.traitlets import Unicode\nfrom IPython.utils.path import link_or_copy\n\nfrom .base import WriterBase\n\n#-----------------------------------------------------------------------------\n# Classes\n#-----------------------------------------------------------------------------\n\nclass FilesWriter(WriterBase):\n    \"\"\"Consumes nbconvert output and produces files.\"\"\"\n\n\n    build_directory = Unicode(\"\", config=True,\n                              help=\"\"\"Directory to write output to.  Leave blank\n                              to output to the current directory\"\"\")\n\n\n    # Make sure that the output directory exists.\n    def _build_directory_changed(self, name, old, new):\n        if new and not os.path.isdir(new):\n            os.makedirs(new)\n\n\n    def __init__(self, **kw):\n        super(FilesWriter, self).__init__(**kw)\n        self._build_directory_changed('build_directory', self.build_directory, \n                                      self.build_directory)\n    \n    def _makedir(self, path):\n        \"\"\"Make a directory if it doesn't already exist\"\"\"\n        if not os.path.isdir(path):\n            self.log.info(\"Making directory %s\", path)\n            os.makedirs(path)\n\n    def write(self, output, resources, notebook_name=None, **kw):\n            \"\"\"\n            Consume and write Jinja output to the file system.  Output directory\n            is set via the 'build_directory' variable of this instance (a \n            configurable).\n\n            See base for more...\n            \"\"\"\n\n            # Pull the extension and subdir from the resources dict.\n            output_extension = resources['output_extension']\n\n            # Write all of the extracted resources to the destination directory.\n            # NOTE: WE WRITE EVERYTHING AS-IF IT'S BINARY.  THE EXTRACT FIG\n            # TRANSFORMER SHOULD HANDLE UNIX/WINDOWS LINE ENDINGS...\n            for filename, data in resources.get('outputs', {}).items():\n\n                # Determine where to write the file to\n                dest = os.path.join(self.build_directory, filename)\n                path = os.path.dirname(dest)\n                self._makedir(path)\n\n                # Write file\n                self.log.debug(\"Writing %i bytes to support file %s\", len(data), dest)\n                with io.open(dest, 'wb') as f:\n                    f.write(data)\n\n            # Copy referenced files to output directory\n            if self.build_directory:\n                for filename in self.files:\n\n                    # Copy files that match search pattern\n                    for matching_filename in glob.glob(filename):\n\n                        # Make sure folder exists.\n                        dest = os.path.join(self.build_directory, filename)\n                        path = os.path.dirname(dest)\n                        self._makedir(path)\n\n                        # Copy if destination is different.\n                        if not os.path.normpath(dest) == os.path.normpath(matching_filename):\n                            self.log.info(\"Linking %s -> %s\", matching_filename, dest)\n                            link_or_copy(matching_filename, dest)\n\n            # Determine where to write conversion results.\n            dest = notebook_name + '.' + output_extension\n            if self.build_directory:\n                dest = os.path.join(self.build_directory, dest)\n\n            # Write conversion results.\n            self.log.info(\"Writing %i bytes to %s\", len(output), dest)\n            with io.open(dest, 'w', encoding='utf-8') as f:\n                f.write(output)\n            return dest", "path": "IPython/nbconvert/writers/files.py"}]}