Git Product home page Git Product logo

scriptorium's Issues

Error with scriptorium make output file name

Called scriptorium make from directory with paper.mmd (folder name test).

Ryans-MacBook-Pro-2:test ryan$ scriptorium make -o test
Traceback (most recent call last):
File "/usr/local/bin/scriptorium", line 9, in
load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 78, in main
args.func(args)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 12, in make
pdf = scriptorium.to_pdf(args.paper, use_shell_escape=args.shell_escape)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/papers.py", line 76, in to_pdf
print('LaTeX conversion failed with the following output:\n', output)
UnboundLocalError: local variable 'output' referenced before assignment

_MMD_LIB set to null ?

I get this error whatever I try to build:

C:\Users\Roland\Desktop\Thesis\Compile>scriptorium build mypaper.mmd
Traceback (most recent call last):
File "c:\users\roland\appdata\local\programs\python\python39\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\roland\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Roland\AppData\Local\Programs\Python\Python39\Scripts\scriptorium.exe_main
.py", line 7, in
File "c:\users\roland\appdata\local\programs\python\python39\lib\site-packages\scriptorium_main
.py", line 181, in main
args.func(args)
File "c:\users\roland\appdata\local\programs\python\python39\lib\site-packages\scriptorium_main
.py", line 16, in build_cmd
pdf = scriptorium.to_pdf(args.paper, use_shell_escape=args.shell_escape, flatten=args.flatten,
File "c:\users\roland\appdata\local\programs\python\python39\lib\site-packages\scriptorium\papers.py", line 137, in to_pdf
tex_fp.write(pymmd.convert(mmd_fp.read(), fmt=pymmd.LATEX, dname=mmd, ext=pymmd.SMART))
File "c:\users\roland\appdata\local\programs\python\python39\lib\site-packages\pymmd-0.4.0-py3.9.egg\pymmd\mmd.py", line 123, in convert
source, _ = _expand_source(source, dname, fmt)
File "c:\users\roland\appdata\local\programs\python\python39\lib\site-packages\pymmd-0.4.0-py3.9.egg\pymmd\mmd.py", line 83, in _expand_source
_MMD_LIB.g_string_new.restype = ctypes.POINTER(GString)
AttributeError: 'NoneType' object has no attribute 'g_string_new'

Remove bash dependency

Windows does not have a good method of generally supporting the bash dependency. Switching to a python script for performing operations could be useful in helping this.

Make as a dependency could also be removed if this were the case.

Invoking scriptorium make fails.

When trying out the new Python system, running the following on a properly configured paper directory bombs out:

scriptorium make papers/thesis/main

The error produced indicates a failure to import a module.

Traceback (most recent call last):
  File "/usr/local/bin/scriptorium", line 11, in <module>
    load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
  File "/home/hakujin/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 565,
 in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/hakujin/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2598,
 in load_entry_point
    return ep.load()
  File "/home/hakujin/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2258,
 in load
    return self.resolve()
  File "/home/hakujin/.local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2264,
 in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ImportError: No module named main

As far as I know, all python dependencies are satisfied at this point.

Error on building document

Attempted to build a new document after completing the configuration in paper.mmd, but python errors occurred. Paper files are attached below.

tree_classification.zip

$ scriptorium build
Traceback (most recent call last):
File "/usr/local/bin/scriptorium", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.4/dist-packages/scriptorium/main.py", line 181, in main
args.func(args)
File "/usr/local/lib/python3.4/dist-packages/scriptorium/main.py", line 17, in build_cmd
keep_comments=args.keep_comments)
File "/usr/local/lib/python3.4/dist-packages/scriptorium/papers.py", line 116, in to_pdf
fname = paper_root(paper_dir)
File "/usr/local/lib/python3.4/dist-packages/scriptorium/papers.py", line 33, in paper_root
if get_template(fname):
File "/usr/local/lib/python3.4/dist-packages/scriptorium/papers.py", line 54, in get_template
idx = mmf.find(_BLANK_LINK)
TypeError: must be read-only pinned buffer, not bytearray

Breaking out abstracts into separate files.

Current template implementations such as vtthesis have sections such as the abstract and acknowledgements embedded in the metadata.tex file. It'd be snazzy to have the ability to define those as external multimarkdown files to ease creation and maintenance.

Scriptorium new command fails when making a new paper

Scriptorium fails when creating a new paper. I tried with both the ieeetran template and the report template. Traceback is below.

Traceback (most recent call last):
File "/usr/local/bin/scriptorium", line 9, in
load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 78, in main
args.func(args)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 43, in create
if not scriptorium.create(args.output, args.template, force=args.force, config=args.config):
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/papers.py", line 117, in create
shutil.copyfile(giname, os.path.join(paper_dir))
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 21] Is a directory: 'test'

Error during setup

When trying to setup scriptorium on a new Ubuntu 16.04 computer, when the command sudo python -c "import pymmd; pymmd.build_mmd()" is run, the following is reported

Entering 'submodules/greg'
Already up-to-date.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/robert/.local/lib/python2.7/site-packages/pymmd/download.py", line 65, in build_mmd
    subprocess.call(cmake_cmd)
  File "/usr/lib/python2.7/subprocess.py", line 523, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

This prevent the rest of the install from working.

Shell Completions

In the same vein as git's subcommands such as git add, etc. having the ability to tab-complete things like scriptorium bu to scriptorium build would be a quality of life improvement for command-line users.

Missing package latex

When running the scriptorium doctor command, it returns Missing package latex on a new install of Ubuntu 16.04.

Fatal LaTeX errors can cause cause assignment errors in Scriptorium.

A fatal LaTeX error can break error output statements inside Scriptorium. The stack trace and causative error are included below.

Traceback (most recent call last):
  File "/usr/local/bin/scriptorium", line 11, in <module>
    load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
  File "/usr/local/lib/python2.7/dist-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/__main__.py", line 78, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/__main__.py", line 12, in make
    pdf = scriptorium.to_pdf(args.paper, use_shell_escape=args.shell_escape)
  File "/usr/local/lib/python2.7/dist-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/papers.py", line 76, in to_pdf
    print('LaTeX conversion failed with the following output:\n', output)
UnboundLocalError: local variable 'output' referenced before assignment
LaTeX Warning: Citation 'mrx05' on page 1 undefined on input line 16.

pdfTeX warning (ext4): destination with the same identifier (name{page.1}) has
been already used, duplicate ignored
<to be read again>
                   \relax
l.18 \chapter
             {Bibliography} [1

]
Chapter 2.

(/home/hakujin/scriptorium/bin/../templates/./simple_templates/report/footer.te
x

! Package biblatex Error: '\bibliographystyle' invalid.

See the biblatex package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.4   \bibliographystyle{ieeetr}

Here is how much of TeX's memory you used:
 10908 strings out of 495000
 178786 string characters out of 6181170
 614717 words of memory out of 5000000
 14062 multiletter control sequences out of 15000+600000
 8501 words of font info for 30 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 37i,6n,32p,992b,729s stack positions out of 5000i,500n,10000p,200000b,80000s

!  ==> Fatal error occurred, no output PDF file produced!

Expand unit tests

Unit tests are recently added to the repository - adding more to improve coverage would be greatly appreciated. These are relatively simple to write, and I'm happy to review any PRs that introduce additional unit tests.

Subtle difference in how Python 2 mmap stuff works causing error when building papers.

When running scriptorium build under Python 2, the following TypeError exception is thrown:

Traceback (most recent call last):
  File "/usr/local/bin/scriptorium", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/scriptorium/__main__.py", line 161, in main
    args.func(args)
  File "/usr/local/lib/python2.7/dist-packages/scriptorium/__main__.py", line 16, in build_cmd
    pdf = scriptorium.to_pdf(args.paper, use_shell_escape=args.shell_escape, flatten=args.flatten)
  File "/usr/local/lib/python2.7/dist-packages/scriptorium/papers.py", line 61, in to_pdf
    fname = paper_root(paper_dir)
  File "/usr/local/lib/python2.7/dist-packages/scriptorium/papers.py", line 28, in paper_root
    if get_template(fname):
  File "/usr/local/lib/python2.7/dist-packages/scriptorium/papers.py", line 48, in get_template
    idx = mm.find(bytearray(blank_line, 'utf-8'))
TypeError: find() argument 1 must be string or read-only buffer, not bytearray

This does not occur when running under Python 3.

Template update fails with invalid expression

Called template update on both ieeetran and report. Same result.

Ryans-MacBook-Pro-2:scriptorium ryan$ scriptorium template -u report
Traceback (most recent call last):
File "/usr/local/bin/scriptorium", line 9, in
load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 102, in main
args.func(args)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 41, in template_cmd
scriptorium.update_template(args.update)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/templates.py", line 78, in update_template
treeish_re = re.compile(r'[A-Za-z0-9_-.]+')
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 244, in _compile
raise error, v # invalid expression
sre_constants.error: bad character range

Templates should provide their own example frontmatter

Right now, all papers derive from a generic paper example, which suffers from not providing the appropriate metadata each template requires for correct formatting. Templates should be able to provide an example frontmatter with default values inserted.

This would also allow a paper to not require the use of metadata.tex for templates which are simple enough to not require it.

Template command with list option fails with Unicode error

Attempted to check the template list that is installed. I verified that the TEMPLATE_DIR is correct in the scriptorium config file.

Ryans-MacBook-Pro-2:scriptorium ryan$ scriptorium template -l
Traceback (most recent call last):
File "/usr/local/bin/scriptorium", line 9, in
load_entry_point('scriptorium==2.0.0', 'console_scripts', 'scriptorium')()
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 102, in main
args.func(args)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/main.py", line 44, in template_cmd
templates = scriptorium.all_templates(args.template_dir)
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scriptorium-2.0.0-py2.7.egg/scriptorium/templates.py", line 15, in all_templates
for dirpath, _, filenames in os.walk(dname):
File "/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 278, in walk
names = listdir(top)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Consider allowing papers and templates to provide scriptorium configuration values

Currently, certain configuration values are defined on a per-user basis, such as the LATEX_CMD configuration option. This isn't necessarily a per-user setting, however - particular papers may be limited in which LaTeX engine may be used for layout.

Is the LATEX_CMD the only option which would be worth considering for generalization in this fashion? Would the --flatten or --keep-comments be worth including?

Add clean command to remove LaTeX temporary files

LaTeX can get confused sometimes by cruft in temporary files, and having a command to automatically remove these files would be useful. These should not removed every time, since those files are normally required for building the document.

People discuss this issue in related areas and tools (see here), which can serve as a decent starting point.

At a simple cut, this should be a clean function which:

  1. Determines which files are the temporary files (ignored by git, matching temporary files derived from the paper root).
  2. Can remove those files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.