Cannot set correct miktex path for pdflatex

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot set correct miktex path for pdflatex

Kelley, Claire
Hi all,

I am having a problem in R where R is finding an old non existent version of miktex rather than the new version. This occurs despite having set the path to the correct location.

For example in bash if I look for the location of pdflatex:

$ which pdflatex
/c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex


It points to the correct MikTex installation.

However in R:

Sys.which("pdflatex")
                                                pdflatex
C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"

Points to the old  (1.9) version of Miktex.

This is my session info:

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_3.5.1

Any thoughts?

I have unsuccessfully tried:


  1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to my path and I can see the addition, but doesn’t fix the problem
  2.  Adding MikTex path to my $PATH variable. This lets bash find the right version of miktex but doesn’t help in R
  3.  Making sure I only have on version of MIktex. I don’t have tiny tex installed (nor can I because I need the full MIkTex for other work) .


Best,
Claire

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set correct miktex path for pdflatex

Eric Berger
Hi Claire,
In Unix (linux) the 'which' command is documented as searching for the
command according to the PATH environment variable.
The different results from
$ which
and
> Sys.which()
would point to the fact that the PATH variable is different in the two
cases.

Compare:
$ echo $PATH

versus

Sys.getenv("PATH")

HTH,
Eric




On Mon, Aug 13, 2018 at 8:18 PM, Kelley, Claire <[hidden email]> wrote:

> Hi all,
>
> I am having a problem in R where R is finding an old non existent version
> of miktex rather than the new version. This occurs despite having set the
> path to the correct location.
>
> For example in bash if I look for the location of pdflatex:
>
> $ which pdflatex
> /c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex
>
>
> It points to the correct MikTex installation.
>
> However in R:
>
> Sys.which("pdflatex")
>                                                 pdflatex
> C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"
>
> Points to the old  (1.9) version of Miktex.
>
> This is my session info:
>
> R version 3.5.1 (2018-07-02)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> Matrix products: default
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.1
>
> Any thoughts?
>
> I have unsuccessfully tried:
>
>
>   1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to
> my path and I can see the addition, but doesn’t fix the problem
>   2.  Adding MikTex path to my $PATH variable. This lets bash find the
> right version of miktex but doesn’t help in R
>   3.  Making sure I only have on version of MIktex. I don’t have tiny tex
> installed (nor can I because I need the full MIkTex for other work) .
>
>
> Best,
> Claire
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Cannot set correct miktex path for pdflatex

Richard M. Heiberger
In reply to this post by Kelley, Claire
You are getting the correct version.  R is using the 8.3 version of the path.
MS DOS often can't handle long MS Windows pathnames, particularly with
blank space characters.
MS therefore provides an 8.3 equivalent for all long names.

C:\>dir /x prog*
dir /x prog*
 Volume in drive C has no label.
 Volume Serial Number is 188D-5BB8

 Directory of C:\

12/03/2017  03:39 PM    <DIR>          PROGRA~1     Program Files
05/17/2018  03:02 AM    <DIR>          PROGRA~2     Program Files (x86)
               0 File(s)              0 bytes
               2 Dir(s)   1,257,172,992 bytes free

C:\>dir /x progra~1\Miktex*
dir /x progra~1\Miktex*
 Volume in drive C has no label.
 Volume Serial Number is 188D-5BB8

 Directory of C:\progra~1

12/18/2015  09:50 PM    <DIR>          MIKTEX~1.9   MiKTeX 2.9
               0 File(s)              0 bytes
               1 Dir(s)   1,257,172,992 bytes free

C:\>
C:\>dir /?
dir /?
Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
  [/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

  [drive:][path][filename]
              Specifies drive, directory, and/or files to list.

  /A          Displays files with specified attributes.
  attributes   D  Directories                R  Read-only files
               H  Hidden files               A  Files ready for archiving
               S  System files               I  Not content indexed files
               L  Reparse Points             -  Prefix meaning not
  /B          Uses bare format (no heading information or summary).
  /C          Display the thousand separator in file sizes.  This is the
              default.  Use /-C to disable display of separator.
  /D          Same as wide but files are list sorted by column.
  /L          Uses lowercase.
  /N          New long list format where filenames are on the far right.
  /O          List by files in sorted order.
  sortorder    N  By name (alphabetic)       S  By size (smallest first)
               E  By extension (alphabetic)  D  By date/time (oldest first)
               G  Group directories first    -  Prefix to reverse order
  /P          Pauses after each screenful of information.
  /Q          Display the owner of the file.
  /R          Display alternate data streams of the file.
  /S          Displays files in specified directory and all subdirectories.
  /T          Controls which time field displayed or used for sorting
  timefield   C  Creation
              A  Last Access
              W  Last Written
  /W          Uses wide list format.
  /X          This displays the short names generated for non-8dot3 file
              names.  The format is that of /N with the short name inserted
              before the long name. If no short name is present, blanks are
              displayed in its place.
  /4          Displays four-digit years

Switches may be preset in the DIRCMD environment variable.  Override
preset switches by prefixing any switch with - (hyphen)--for example, /-W.

On Mon, Aug 13, 2018 at 1:18 PM, Kelley, Claire <[hidden email]> wrote:

> Hi all,
>
> I am having a problem in R where R is finding an old non existent version of miktex rather than the new version. This occurs despite having set the path to the correct location.
>
> For example in bash if I look for the location of pdflatex:
>
> $ which pdflatex
> /c/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex
>
>
> It points to the correct MikTex installation.
>
> However in R:
>
> Sys.which("pdflatex")
>                                                 pdflatex
> C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe"
>
> Points to the old  (1.9) version of Miktex.
>
> This is my session info:
>
> R version 3.5.1 (2018-07-02)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows 7 x64 (build 7601) Service Pack 1
>
> Matrix products: default
>
> locale:
> [1] LC_COLLATE=English_United States.1252
> [2] LC_CTYPE=English_United States.1252
> [3] LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C
> [5] LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] compiler_3.5.1
>
> Any thoughts?
>
> I have unsuccessfully tried:
>
>
>   1.  Adding correct MikTex path to my Renviorn.site. this adds MikTex to my path and I can see the addition, but doesn’t fix the problem
>   2.  Adding MikTex path to my $PATH variable. This lets bash find the right version of miktex but doesn’t help in R
>   3.  Making sure I only have on version of MIktex. I don’t have tiny tex installed (nor can I because I need the full MIkTex for other work) .
>
>
> Best,
> Claire
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.