This repository has been archived by the owner on Aug 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5272032
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
npm-debug.log | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2014 Thomas Johansen. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# LaTeX package | ||
|
||
A simple utility package for Atom that invokes `latexmk`. | ||
|
||
## Installing | ||
Use the Atom package manager and search for "latex", or run `apm install latex` | ||
from the command line. | ||
|
||
## Status | ||
This package is in an extreme alpha state. Right now everything is very naïve, | ||
there's no error handling, progress indicator, etc. The path to `latexmk` is | ||
hardcoded to `/usr/texbin/latexmk`, and forces usage of `pdflatex`. | ||
|
||
## Usage | ||
Invoke the build command by pressing the default keybind `ctrl-alt-b` while in | ||
a .tex file. | ||
|
||
All output is directed to a directory called `output` within the directory | ||
containing the target file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Keybindings require three things to be fully defined: A selector that is | ||
# matched against the focused element, the keystroke and the command to | ||
# execute. | ||
# | ||
# Below is a basic keybinding which registers on all platforms by applying to | ||
# the root workspace element. | ||
|
||
# For more detailed documentation see | ||
# https://atom.io/docs/latest/advanced/keymaps | ||
'.workspace': | ||
'ctrl-alt-b': 'latex:build' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
path = require "path" | ||
runas = require "runas" | ||
|
||
module.exports = | ||
activate: -> | ||
atom.workspaceView.command "latex:build", => @build() | ||
|
||
build: -> | ||
editor = atom.workspace.activePaneItem | ||
# console.debug editor | ||
|
||
file = editor.buffer.file | ||
# console.debug file | ||
|
||
if file? | ||
# file = editor.getUri() | ||
dir = path.dirname(file.path) | ||
outdir = path.join(dir, "output") | ||
# console.debug outdir | ||
|
||
code = runas("/usr/texbin/latexmk", ["--pdf", "--f", "--interaction=nonstopmode", "--outdir=#{outdir}", file.path]) | ||
# console.debug code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "latex", | ||
"main": "./lib/latex", | ||
"version": "0.1.0", | ||
"private": true, | ||
"description": "A simple utility package that invokes latexmk.", | ||
"repository": "https://github.com/thomasjo/atom-latex", | ||
"license": "MIT", | ||
"engines": { | ||
"atom": ">0.65.0" | ||
}, | ||
"dependencies": { | ||
"runas": "~0.5.4" | ||
} | ||
} |