textmate/latex.tmbundle

Failure running “LaTeX Template”.

Closed this issue · 6 comments

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

#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.

Works,

thank you.

el

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

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"]

See also Issue #187.

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"]