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

Running make file on specific folder/file #174

Closed
mk-uc opened this issue Sep 10, 2015 · 13 comments
Closed

Running make file on specific folder/file #174

mk-uc opened this issue Sep 10, 2015 · 13 comments

Comments

@mk-uc
Copy link

mk-uc commented Sep 10, 2015

Hi,

In the specific folder that I'm working in, I have a make file that uses pandoc to convert a markdown file to pdf, docx, and html. However when I use the build command I think it attempts to convert the whole project and thus immediately runs into an error in trying to convert the Read Me file in the root of my project. Is there a way to specify the command so that it will only run the make file in the current folder I'm in?

Thanks!

@noseglid
Copy link
Owner

Yes, you can set the current working directory in a custom atom-build file:

{
  "cmd": "make",
  "cwd": "{FILE_ACTIVE_PATH}"
}

Save this as .atom-build.json in the root folder and it will run make in whatever path the currently active file resides in. Read more about replacements

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

Thanks for the quick reply!

I'm getting an error though which says

you have a syntax error in your build file: /Users/[user]/github/papers/.atom-build.json: Unexpected string

I copied exactly what you put up there into the file.

@noseglid
Copy link
Owner

Can you paste the contents of your .atom-build.json?

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

{ "cmd": "make" "cwd": "{FILE_ACTIVE_PATH}" }

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

Sorry, but with the proper line breaks.

@noseglid
Copy link
Owner

There's no comma after "make".

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

ah of course! Thanks!
Ok one more quick problem, as I said I'm using pandoc to convert a markdown file, and I'm using xelatex as the latex engine. It runs fine when I run it through the terminal but if I run it here I get this: pandoc: xelatex not found. xelatex is needed for pdf output.
Any idea why this wouldn't work?

Thanks again for your help

@noseglid
Copy link
Owner

I'm guessing the PATH is not set correctly when you open Atom. You probably have something in your .zshrc, .bashrc or equivalent shell init scripts which adds wherever xelatex is to your PATH. You could try to close Atom and start it from a terminal where it works. If it works then, you know it's a path issue.

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

I'm sorry, I don't quite understand what you mean when you say you could try to close Atom and start it from a terminal where it works.

@noseglid
Copy link
Owner

  • So, quit atom completely. (Atom -> Quit).
  • Go to a terminal where Make works and start atom from there.
  • Run build. If it works, it is definitely a PATH issue.

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

You're right! That worked, would you mind telling me how to fix the PATH issue?

Thanks for all your help with this, I really do appreciate it.

@noseglid
Copy link
Owner

It's no problem. It depends on the operating system. On Unix/Linux, you can inspect the PATH variable by e.g. echo $PATH. It will be a colon : separated list of locations to search for binaries (such as xelatex).

See this issue and this issue for solutions from people with similar problems.

@mk-uc
Copy link
Author

mk-uc commented Sep 10, 2015

Ok, so I added a line in my .bash_profile which says export PATH="$PATH:$HOME/usr/texbin/xelatex"

As I understand it, that should add xelatex to the end of my path (and I think it did based on echo $PATH

Anyways, now the build works! Thanks for your help.

@mk-uc mk-uc closed this as completed Sep 10, 2015
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

2 participants