Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make latexmk the defautl for TeX-command-master #33

Open
pprw opened this issue Aug 25, 2018 · 3 comments
Open

Make latexmk the defautl for TeX-command-master #33

pprw opened this issue Aug 25, 2018 · 3 comments

Comments

@pprw
Copy link

pprw commented Aug 25, 2018

After installing auctex-latexmk, the user has the choice to use latexmk when activate TeX-command-master (C-c C-c). However, the default choice for compiling is still "LaTeX". If you create a new .tex document and do only C-c C-c RET, it will launch LaTeX. If you want latexmk, you have to use autocompletion to select it.

There is no really the need to compile with only latex when using latexmk. So installing auctex-latexmk should also make it the default for TeX-command-master. C-c C-c should call latexmk by default except if there is no need to compile, then it should launch the view command.

In the past, It was simple to modify TeX-command-default (setq TeX-command-default "LatexMk") but if seems to be more complicated nowadays. It is one more reason to include the feature request in auctex-latexmk package.

@tom-tan
Copy link
Owner

tom-tan commented Sep 9, 2018

Sorry for late reply.

There are mainly two ways to make TeX-run-latexmk (it is a function called in C-c C-c LatexMk) by default:

  • Make LatexMk default by taking care of related variables and functions. I guess it is an ideal solution. It will be OK if it could be done by just setting several variables but I guess it is not. It needs more work to achieve it. I am not sure it is a reasonable option comparing to the latter option.
  • Override the LaTeX command. auctex-latexmk does not do it because it may break other packages that depend on auctex. However, it is simple enough and less additional code to be maintained.

I suggest to overwrite LaTeX command by user code. For example:

(setq TeX-command-list
      (cons
       `("LaTeX" . ,(cdr (assoc "LaTexMk" TeX-command-list)))
       TeX-command-list))

@HumHongeKamyaab
Copy link

The overwriting solution (see below snippet) is not working,

(setq TeX-command-list
      (cons
       `("LaTeX" . ,(cdr (assoc "LaTexMk" TeX-command-list)))
       TeX-command-list))

It is giving following error on selecting "LaTeX",

TeX-command-expand: Wrong type argument: stringp, nil

@UlrikBuchholtz
Copy link

Another way to do it via a hook:

(add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default "LatexMk")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants