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

Failure running “LaTeX Template”. #189

Closed
ondohotola opened this issue Dec 24, 2021 · 6 comments
Closed

Failure running “LaTeX Template”. #189

ondohotola opened this issue Dec 24, 2021 · 6 comments

Comments

@ondohotola
Copy link

ondohotola commented Dec 24, 2021

When I attempt to insert a LaTeX Template into an otherwise empty file, on Monterery 12.1 on both x86_64 and arm64 I get the error

Failure running “LaTeX Template”.

/Users/el/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/command.rb:423:in `template_text': uninitialized constant OSX (NameError)
from /Users/el/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/command.rb:430:in `insert_template'
from LaTeX Template:9
@rbenit68
Copy link

rbenit68 commented Jan 5, 2022

#187

Please include the following line inside command.rb import section:

require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist'

otherwise the OSX variable cannot be set and the template selector will not trigger.

@ondohotola
Copy link
Author

Works,

thank you.

el

@AlainMatthes
Copy link

When I attempt to insert a LaTeX Template into an otherwise empty file, on Monterery 12.1 on both x86_64 and arm64 I get the error

Failure running “LaTeX Template”.

/Users/el/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/command.rb:423:in `template_text': uninitialized constant OSX (NameError)
from /Users/el/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/Ruby/command.rb:430:in `insert_template'
from LaTeX Template:9

With which version of TextMate? No problem with 2.0.17 but problem with 2.0.23 for me

@juandesant
Copy link
Contributor

Changed it LaTeX.tmblundle/Support/lib/Ruby/command.rb, and now the UI for selecting each of the templates is fine. However, it seems something else is broken in my environment (macOS 12.6), because why I get as output is something like this:

["\t\t\t% !TEX TS-program = xelatex\n", "\t\t\t%\n", "\t\t\t% Created by Juande Santander-Vela on date: illegal time format usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]] [-I[date | hours | minutes | seconds]] [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format].\n", "\t\t\t% Copyright (c) date: illegal time format usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]] [-I[date | hours | minutes | seconds]] [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] .\n", "\t\t\t\documentclass[addpoints]{exam}\n", "\t\t\t\n", "\t\t\t\usepackage{polyglossia}\n", "\t\t\t\n", "\t\t\t\firstpageheader{Course}{Exam}{Page \thepage\ of \numpages}\n", "\t\t\t\firstpageheadrule\n", "\t\t\t\n", "\t\t\t\begin{document}\n", "\t\t\t\n", "\t\t\t\begin{center}\n", "\t\t\t \fbox{\parbox{0.9\textwidth}{\centering\n", "\t\t\t Answer the questions in the spaces provided on the\n", "\t\t\t question sheets. If you run out of room for an answer,\n", "\t\t\t continue on the back of the page.}}\n", "\t\t\t\end{center}\n", "\t\t\t\n", "\t\t\t\vspace{0.5cm}\n", "\t\t\t\makebox[0.9\textwidth]{Name:\enspace\hrulefill}\n", "\t\t\t\n", "\t\t\t\begin{questions}\n", "\t\t\t\question[5] First question\n", "\t\t\t\end{questions}\n", "\t\t\t\n", "\t\t\t\end{document}\n", "\t\t\t"]

@juandesant
Copy link
Contributor

See also Issue #187.

@juandesant
Copy link
Contributor

Don't mind this: it seems it was the result of having also changed the actual TextMate command to use /usr/bin/env ruby instead of /usr/bin/env ruby18. Restoring the LaTeX bundle to the latest released, and then adding the require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist' at the beginning of LaTeX.tmblundle/Support/lib/Ruby/command.rb does indeed resolve the issue.

Changed it LaTeX.tmblundle/Support/lib/Ruby/command.rb, and now the UI for selecting each of the templates is fine. However, it seems something else is broken in my environment (macOS 12.6), because why I get as output is something like this:

["\t\t\t% !TEX TS-program = xelatex\n", "\t\t\t%\n", "\t\t\t% Created by Juande Santander-Vela on date: illegal time format usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]] [-I[date | hours | minutes | seconds]] [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format].\n", "\t\t\t% Copyright (c) date: illegal time format usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]] [-I[date | hours | minutes | seconds]] [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] .\n", "\t\t\t\documentclass[addpoints]{exam}\n", "\t\t\t\n", "\t\t\t\usepackage{polyglossia}\n", "\t\t\t\n", "\t\t\t\firstpageheader{Course}{Exam}{Page \thepage\ of \numpages}\n", "\t\t\t\firstpageheadrule\n", "\t\t\t\n", "\t\t\t\begin{document}\n", "\t\t\t\n", "\t\t\t\begin{center}\n", "\t\t\t \fbox{\parbox{0.9\textwidth}{\centering\n", "\t\t\t Answer the questions in the spaces provided on the\n", "\t\t\t question sheets. If you run out of room for an answer,\n", "\t\t\t continue on the back of the page.}}\n", "\t\t\t\end{center}\n", "\t\t\t\n", "\t\t\t\vspace{0.5cm}\n", "\t\t\t\makebox[0.9\textwidth]{Name:\enspace\hrulefill}\n", "\t\t\t\n", "\t\t\t\begin{questions}\n", "\t\t\t\question[5] First question\n", "\t\t\t\end{questions}\n", "\t\t\t\n", "\t\t\t\end{document}\n", "\t\t\t"]

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