minted-2.1-remove-extra-curly-brace.patch 2.4 KB

12345678910111213141516
  1. # compilation of minted.dtx fails as there is an extra curly brace at line
  2. # 1390. While passing -interaction=batchmode (what latex-package.eclass does)
  3. # it compiles without warning but a return value of -1 and therefore is assumed
  4. # as failed by latex-package.eclass.
  5. --- minted.dtx 2015-09-09 22:40:04.000000000 +0200
  6. +++ minted.dtx 2016-03-06 14:20:46.544180149 +0100
  7. @@ -1387,7 +1387,7 @@
  8. %
  9. %
  10. % \begin{macro}{\minted@jobname}
  11. -% At various points, temporary files and directories will need to be named after the main |.tex| file. The typical way to do this is to use |\jobname|. However, if the file name contains spaces, then |\jobname| will contain the name wrapped in quotes (older versions of MiKTeX replace spaces with asterisks instead, and \texttt{XeTeX} apparently \href{http://tex.stackexchange.com/a/93829/10742}{allows double quotes within file names}, in which case names are wrapped in single quotes}). While that is perfectly fine for working with \LaTeX\ internally, it causes problems with |\write18|, since quotes will end up in unwanted locations in shell commands. It would be possible to strip the wrapping quotation marks when they are present, and maintain any spaces in the file name. But it is simplest to create a ``sanitized'' version of |\jobname| in which spaces and asterisks are replaced by underscores, and double quotes are stripped.
  12. +% At various points, temporary files and directories will need to be named after the main |.tex| file. The typical way to do this is to use |\jobname|. However, if the file name contains spaces, then |\jobname| will contain the name wrapped in quotes (older versions of MiKTeX replace spaces with asterisks instead, and \texttt{XeTeX} apparently \href{http://tex.stackexchange.com/a/93829/10742}{allows double quotes within file names}, in which case names are wrapped in single quotes). While that is perfectly fine for working with \LaTeX\ internally, it causes problems with |\write18|, since quotes will end up in unwanted locations in shell commands. It would be possible to strip the wrapping quotation marks when they are present, and maintain any spaces in the file name. But it is simplest to create a ``sanitized'' version of |\jobname| in which spaces and asterisks are replaced by underscores, and double quotes are stripped.
  13. % \begin{macrocode}
  14. \StrSubstitute{\jobname}{ }{_}[\minted@jobname]
  15. \StrSubstitute{\minted@jobname}{*}{_}[\minted@jobname]