Giter Site home page Giter Site logo

latex.tmbundle's Introduction

About

This is the official repository for TextMate's LaTeX bundle. For a description of some of the features provided by this bundle, please take a look at the help document.

Installation

You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. Please keep in mind that it sometimes takes a little while before Michael or Allan have time to deploy the changes made to this bundle.

If there are some changes that you want to test immediately, then please follow these instructions:

  1. Uninstall the LaTeX bundle inside TextMate's preferences

  2. Open Terminal

  3. Go to the bundle folder:

    cd ~/Library/Application\ Support/TextMate/Managed/Bundles
  4. Clone the repository:

    git clone https://github.com/textmate/latex.tmbundle.git
  5. Restart TextMate (^ + + Q) to make sure it registered the changes

Feedback

Before you report an issue please read the FAQ. You can report bugs or feature request via the issue tracker. If you have a more general problem, then please use the mailing list.

Contribute

There are many ways in which you can contribute to the bundle:

  • Spread the word
  • Report bugs or tell us what features you want to see next
  • Show your appreciation by starring this repository
  • Improve the bundle by committing your own code

Before you contribute any code, please read both the bundle styleguide and the commit styleguide. Please also make sure, that your changes do not break any of the bundle tests.

License

If not otherwise specified (see below), files in this repository fall under the following license:

Permission to copy, use, modify, sell and distribute this
software is granted. This software is provided "as is" without
express or implied warranty, and with no claim as to its
suitability for any purpose.

An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”.

latex.tmbundle's People

Contributors

bakkerv avatar bnmnetp avatar ciaran avatar dgrady avatar dhowden avatar dxmtb avatar grahamdennis avatar gvdgdo avatar heptadecagon avatar hesstobi avatar infininight avatar jeg2 avatar jeroenh avatar jimmyti avatar juandesant avatar lilyball avatar markushont avatar miltonrg avatar muzimuzhi avatar mwillsey avatar mys721tx avatar nruth avatar piptin avatar russoedu avatar sanssecours avatar schoeps avatar scoskey avatar sorbits avatar soryu avatar szymtor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

latex.tmbundle's Issues

File drag and drop issues

When dragging an image onto the latex document, the bundle generates this:

\begin{figure}[htbp]
    \centering
        \includegraphics[width=htbp]{Lofa.pdf}
    \caption{caption}
    \label{fig:Lofa}
\end{figure}

This causes errors, due to the [width=htbp] which might be hard to notice for those new to latex. I'm not sure why its doing this from the code, and I am PRETTY sure it used to work recently.

Citation completion chokes if a \input{\variable} statement is present

If you have a \input statement in your tex-file, the FileScanner in LaTeXUtils.rb will search for the given file and raise an error if it is not found. If your argument is not a filename but a variable like in \input{\variable} it will search for a file called \variable and fail (and thus not complete the citation).

A simple fix could be to ignore arguments for \input that contain commands. I did this on my local copy by changing line 192 in LaTeXUtils.rb as follows:

192c192
<       @includes[/^[^%]*(?:\\include|\\input)\s*\{([^\}]*)\}/] = Proc.new {|m|

---
>       @includes[/^[^%]*(?:\\include|\\input)\s*\{([^\}\\]*)\}/] = Proc.new {|m|

Request change TM_LATEX_MASTER to allow paths relative to project root

Currently TM_LATEX_MASTER requires an absolute path if LaTex files are not all located in the project root directory. This behaviour could be changed to allow relative paths with the following small alteration to determine_ts_directory.

Change determine_ts_directory in texMate.py to the following:

def determine_ts_directory(tsDirectives):
"""Determine the proper directory to use for typesetting the current document"""
master = os.getenv('TM_LATEX_MASTER')
proj = os.getenv('TM_PROJECT_DIRECTORY')

  if proj and master:
      texfile = proj
      startDir = os.path.normpath(proj)
  else:
      texfile = os.getenv('TM_FILEPATH')
      startDir = os.path.dirname(texfile)
 ...

Update the latexmk script

Please update the latexmk script to a newer version. You are currently using 3, from 2007, the latest version is 4.22 from Jan 2011.

Or use the system's latexmk, since it ships with MacTeX now.

Create new snippets, etc.

Can anyone please tell me how to create new snippets, macros and commands in TM2? Where is that helpful little + symbol?

Viewer path not shell escaped

I use /My Applications/Skim.app as viewer. This gives an error in the Typeset & View output, although Skim starts fine.

Adding shell_quote around the viewer path (vp) in texMate.py fixes this.

While in there, I noticed that constructing syncPath for PDFView seems to lack an initial shell_quote(vp) +.

cite autocomplete

Hi,
I recently discovered TextMate 2 and decided to write my bachelortheses with it.
when i insert a citation (insert-> citation, ctrl-{ ) it automatically inserts the first entry of my bibtex file. I think it should instead show a menu to pick the right entry.
Also, I would expect TextMate to show me a list of my bibtex entries when autocompleting (by pressing esc). Is this not yet implemented?
I would thank anyone who can clarify.
Greatings, Daniel

Error Latex markup

There's an error in the latex markup for this latex code:

\[\begin{array}{l} \{ \} \end{array}\]

All text from this code on is falsely considered to be still in math mode. The same happens with

\[\begin{array}{l} 
\{ \} 
\end{array}\]

But not with (not the extra space)

\[\begin{array}{l} 
 \{ \} 
\end{array}\]

The problem is probably the escaped {.

\cite completion not working

On both of my systems, BibTeX cite completion has obviously stopped working. I am using the current TextMate 2.0-alpha.9389 with up-to-date bundles, and cannot really say since when the problem exists, but it used to work some weeks ago on the same documents I am editing again now (and actually still works with the same .tex and .bib files in TextMate 1).

I suspect (from title and date of the commit) it might be related to the recent commit in issue #40 but I really have no clue.

If, in my tex document, I type the usual
\cite{Name}
and with caret after 'Name' (or anywhere within the braces) I press alt-escape, just nothing seems to happen. However labels of equations and figures are shown to complete when first letters are given (even in the within \cite command).

If I write an empty
\cite{}
and with caret between the braces press alt-escape, I get an error message

cite-fault

Referencing figures and equations as in \ref{eq:whatever} still works with completion, but brings a similar error message if completion is invoked while the braces are still empty.

Anyone else experiencing this?

show outline fails on nested inputs in folders (with fix)

I found a bug in the Show Outline command.
It occurs when I use nested inputs in combination with files in different folders.

% main.tex
\input{somefolder/a}

% a.tex
\input{somefolder/b}

LaTeX interprets this as a.tex and b.tex both being in the same folder /somefolder, while in the Show Outline command it is interpreted as b.tex being in /somefolder/somefolder.

I fixed this in my version by passing the rootfilename into the outline_points function:
line 33
def outline_points(filename) ===> def outline_points(filename,rootfilename)
line 46
points += outline_points(filename.adjust_end($1)) if ... ===> points += outline_points(rootfilename.adjust_end($1),rootfilename) if ...
line 57
points = outline_points(file) ===> points = outline_points(file,file)

I have no idea how to update the git version (and I don't have the time to look into this now), so if anyone is interested in adding this fix on my behalf, feel free to do so. ;-)

Anton

Reformat table does not support escaped &

The reformat table command does not recognise escaped ampersands correctly, and assumes they are a cell boundary. This causes the table alignment to mess up and extra cells to be added.

Example:

\begin{table*}[htpb]
    \begin{tabular}{|l|l}
cell1   &  cell2\\
\hline
cell\&3 & cell4\\
    \end{tabular}
\end{table*}

Expected result after command:

\begin{table*}[htpb]
    \begin{tabular}{|l|l}
 cell1   & cell2\\
\hline
 cell\&3 & cell4\\

    \end{tabular}
\end{table*}

Actual Result after command:

\begin{table*}[htpb]
    \begin{tabular}{|l|l}
 cell1 & cell2 &      \\
\hline
 cell\ &     3 & cell4\\

    \end{tabular}
\end{table*}

TexShop Always Watches the Document Regardless of Selection in OS X 10.7 Lion

Since upgrading two Macs to OS X 10.7 Lion, the perl script which watches the LaTeX document for changes always defaults to TexShop regardless of the selected viewer in the bundle preferences. I have managed to make it switch back to my choice, Skim, by editing the file latex_watch.pl so that the hard-coded default is Skim rather than TexShop, but something isn't working here. I assume it's an updated version of Perl in Lion but that is a complete guess.

Close Log Window Option Ignored in TM2

The option to "keep log window open" in the LaTeX bundle preferences is being ignored in TM2 -- with the option disabled the log pane isn't closed after Typeset & View is done.

TM2 (9276)

Typset & View Not Working

I am running TextMate 2.0 alpha on Tex2013 on Mavericks.

When I run Typeset & View (PDF) *.ps and *.dvi files are generated but no *.pdf.

Any help on this will be greatly appreciated!

Failure running "Typeset & View (PDF)"

Since I have upgraded to OS X Mavericks I get the following message when I try to visualize a PDF file in Textmate 2 after I have compiled a latex document with the CMD-R shortcut.

Typeset & View (PDF):23:in `exit': no implicit conversion from nil to integer 
(TypeError) from Typeset & View (PDF):23

I have tried to revert the default settings as explained in [1] but the issue still remains.

[1] https://github.com/textmate/textmate/wiki/Reverting-To-Defaults

Many commands break with %!TEX root =

Commands such as dragging a figure into a document, or doing label completion break when the document uses a "%!TEX root = " stanza.

If I have a document which includes a statement "%!TEX root = example.tex" then I get the following error (where the file /Users/jeroen/tmp/example.tex) does actually exist.

/Users/jeroen/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:in `initialize': No such file or directory - /Users/jeroen/tmp/example.tex (Errno::ENOENT)
    from /Users/jeroen/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:in `open'
    from /Users/jeroen/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:in `options'
    from /Users/jeroen/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:45:in `master'
    from /Users/jeroen/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:56:in `get_labels'
    from Label Based on Current Word / Selection…:8

Open Included Item has issues in nested documents

I have a master file in a root directory, say /master.tex and and include a chapter say, /chapters/ch1.tex.

In ch1.tex I input another file, '\input{./quotes/quote1}'. Note - Latex requires that this link is relative to the master file, not ch1.tex.

If I hit enter on this line to trigger the 'Open Included Item' macro, then I am not taken to the /quotes/quote1.tex file as TextMate is seeing this link as being relative to ch1.tex

Watch document doesn't include makeindex

When having a working document with makeindex for nomenclature support and then initiate "Watch document", the nomenclature is removed from the pdf after next update.

Many suggestions and small bugs

Well, again, I don't know if this is the correct place, but I will put here some suggestions and small bugs I'm finding in TextMate 2 LaTeX Bundle.

  1. The frac or fr in command based on current word has a problem: \frac{$1}{$0} and it should be \frac{$1}{$2} $0.
  2. It would be great to include a \binom{}{} command, may be abbreviated as bin or b and which outputs \binom{$1}{$2} $0
  3. The add row in tabulars/arrays would be so much better if it makes the spaces tabulable. I explain, imagine you write \begin{tabular}{ccc} a & b & c and then you press Fn+Enter and then the program gives you this code \\ $0 & &. It would be great that you can go through it pressing tab, like \\ $1 & $2 & $0. I hope you understand.

I will be updating the mini–bugs and suggestions if you don't mind.

Thanks for this incredible bundle.

Documentation for package lookup directories not updated after MacTeX upgrade

I have recently upgraded my Tex Live installation from 2012 to 2013, deleting the old version of Tex Live after the upgrade. Now, whenever I try to look up documentation for LaTeX packages in TextMate, I get the error shown in the screenshot. I had a similar error when I last upgraded from 2011 to 2012, and I somehow solved this by moving things around in my hard drive (unfortunately, I do not recall how I did it). However, I reckon the scripts in TextMate should be capable of updating this.

I did try to run some of the console commands from the specific Bundle (e.g. the kpsewhich ones) and they do return the expected paths (i.e. for TeX live 2013), so I'm at a loss as to what is the origin of the problem.

Any assistance in finding workarounds for this while the problem with TextMate is not resolved will be welcome.
textmate-bug

Regular math (\( \)) broken in TM2?

I use the snippet "Regular math (( ))" in the Experimental Latex Bundle in TM1 all of the time. I think it may be broken in TM2.

Here is the code: ( $0$TM_SELECTED_TEXT )
Scope Selector: text.tex.latex
Key Equivalent: $

In TM1, use of $ (with no selected text) leads to ( $0$ ). I then type some math inside the brackets, for example, ( \alpha ). A second use of $ leads to the cursor placed to the right and outside of ( \alpha ), where it should be.

In TM2, use of $ (with no selected text) leads to ( $0$ ). Good start. Typing \alpha works as it should ( \alpha ). A second use of $, however, leads to ( \alpha ( $0$ ) ). For the life of me, I cannot see why the output is different.

By the way, if I erase the snippet altogether, then $ leads to $ $0$ $. Typing \alpha gives $ \alpha $. A second use of $ puts the cursor outside and to the right, as it should. However, I stopped using $'s in Latex a long time ago. ( \alpha ) is much easier on the eye than $ \alpha $.

This problem stops me from using TM2. I am still hanging onto TM1 and closing my eyes to ST2.

Latex bundle command "Label based on current word/selection" is broken if using multiple .tex files

Dear all,

I am running TextMate version 2.0-alpha.9399. I am writing my thesis using multiple .tex files. I have a master file which includes several chapters, each corresponding to a separate tex file.

When I am in one of the chapter files, the command "Label based on current word/selection" (shortcut alt + esc) does not work and gives me the error message attached below. Interestingly enough, the command works fine when called from the master file, even when referring to a label defined in the children files.

Here is how to reproduce the problem. Create a test.tex file like this one:

\documentclass{article}
\begin{document}

\section{Section 1}
\label{section1}
Ciao

\section{Section 2}
\label{section2}
Sec. \ref{section1} is well written.

\input{include}
Just included Section 3.

\end{document}

and an include.tex file like this one in the same directory:

%!TEX root = test.tex
\section{Section 3}
\label{section3}
This is Section 3. sec

Then invoke the command (alt + esc) next to 'sec' in the include.tex file. At this point, I obtain the error pop-up below.

Please note that this does not happen in Textmate1. It is a little bit of a pain because when the file gets sizeable I spend most of my time hunting down for references.

Thank you for your attention,
Guido Pettinari

Failure running “Label Based on Current Word / Selection…”.
/Users/coccoinomane/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:in initialize': No such file or directory - /Users/coccoinomane/Downloads/test.tex (Errno::ENOENT) from /Users/coccoinomane/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:inopen'
from /Users/coccoinomane/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:19:in options' from /Users/coccoinomane/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:45:inmaster'
from /Users/coccoinomane/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/lib/LaTeXUtils.rb:56:in `get_labels'
from Label Based on Current Word / Selection…:8

TypeError when running pdflatex or bibtex

Running pdflatex or bibtex using the bundle returns the following:

Traceback (most recent call last): 
  File "/Users/fonnescj/Library/Application Support/TextMate/Managed/ 
Bundles/LaTeX.tmbundle/Support/bin/texMate.py", line 465, in <module> 
    tmPrefs = tmprefs.Preferences() 
  File "/Users/fonnescj/Library/Application Support/TextMate/Managed/ 
Bundles/LaTeX.tmbundle/Support/bin/tmprefs.py", line 45, in __init__ 
    self.prefs.update(self.readTMPrefs()) 
TypeError: 'NoneType' object is not iterable 

commenting out line 45 or handling the exception gets rid of the problem.

I got rid of TM1 after installing TM2, so presumably there is no longer a prefs file for TextMate, resulting in the None (?).

Suggestion about commands in tables and arrays

Well, I put new suggestions here, in this case, related to tabulars and more:

First if you are in a tabular or array environment you are able to add new lines by pressing Fn+Enter (I think it's called return, but I'm not sure). This commands adds \\ & & with as many & as you had in the line you were when you called the command.

  1. My first suggestion is that you could go through the columns pressing just tab (not ctrl+tab, as it is right now, because at least for me, it doesn't work well the Previous Cell). For example: if your write a & b and then hit Fn+Enter you get a new line \\ $0 &, I think it would be great to make the command give you this: \\ $1 & $0. And, in case of n columns give you $1, ... , $n-1, $0 so you could just tab to change the cursor.
  2. My second suggestion is to make it work in more environments: matrix, pmatrix, bmatrix, vmatrix, Vmatrix, Bmatrix, smallmatrix, align, flalign, alignat, aligned, alignedat, split, eqnarray, cases, rcases, dcases, etc. and their * associated ones (may be I forgot some of them).

And, in second instance, at least in Mountain Lion 10.8.2, the Add new column and Remove column doesn't work properly. It doesn't add the column to the right of where you are writing (moves the left cell to the right, etc.) and the remove command, doen't remove the cell you are in, it removes some times the first of the row, and sometimes the cell just on the left of you.

So, I will shorten the ideas:

  • Support moving through columns with just tab (and mayus+tab). Which I find logical. (*)
  • Support more environments which use columns and rows.
  • If the first point is not solved, fix the bug with Previous Cell. (*)
  • Fix the bugs with Add new column and Remove column.

Thanks!
yoblanco

PS (*): may be I could change this just changing the key combination which calls the command, but I'm afraid it interfere with other tab and mayus+tab usage.

EDIT: okey, I tried some things. Changing Next cell to tab is fine, but Previous Cell with mayus+tab doen't work. Sometimes the Remove previous/next cell works but forgets about indentation and destroys the looking of the table. This should be revised.

Latex Watch Document uses wrong pdf previewer after MacOS update

Hi!

After installing the MacOS Lion update, the Watch Document command that is part of the TextMate Latex bundle does not use the right pdf previewer anymore.

I use TextMate Version 1.5.10 (1631) to compile my Latex documents. I normally use Skim to view the resulting pdf. The viewer setting in the preference pane of the bundle only affects the viewer that is used by the Typeset and View Pdf command. However, no matter what viewer I configure in the preference pane, the Watch Document command always opens the pdf in TeXShop.

Since this is annoying, I did a quick and dirty hack in the latex_watch.pl script. Namely, I changed Line 114 which is part of the subroutine get_prefs from

    viewer  => getPreference(latexViewer => "TexShop"),

to

    viewer  => getPreference(latexViewer => "Skim"),

Of course, this is not a fix that works for everyone.

Thanks for your help and suggestions!

Philipp

Watch Document Doesn't work

Hi I just upgraded to the new TM2 release since I update my OS to 10.9. It seems that skim is no longer my default pdf viewer and the watch document feature doesn't seem to work. In particular it generates a pdf but then doesn't recompile it when I switch back.

I want to change the pdf viewer back to skim but when I go to the Latex tab at the bottom and click preferences no window appears. Is this a bug? Anyway to get watch document working again? I know that at some point you had to create a new variable TM_VIEWER or something along those lines.

Any help would be much appreciated.

Thanks,

Lucas

Skim and Typeset & View window do not open

I'm having a frustrating and recurring problem with TextMate and the latex.tmbundle: when I execute the TypeSet & View command (either via Cmd-R or the LaTeX Bundle menu), TextMate does not open Skim OR open the Typeset & View window, where the LaTeX messages are supposed to be displayed. All of the parsing works correctly, but I can't read any of the messages or view the file in Skim automatically.

I have updated to the most recent version of the latex.tmbundle, as well as the most recent version of TexLive. I'm on TextMate version 1.5.11 (1635). In TextMate, I have the following shell variables set:

TM_LATEX_VIEWER = Skim
TM_RUBY = /usr/bin/ruby
PATH = <output of echo $PATH command in terminal>

In the bundle preferences, I have the default engine set to pdflatex with the options:

--shell-escape --synctex=1

I've checked "use latexmk.pl" and I have "View in" set to Skim, with both options below that checked. I have also "synced" Skim to TextMate in Skim's preferences.

I have tried using both the original latexmk.pl and a symbolic link to TexLive's version. I'm not sure where to go from here, so any help would be much appreciated!

New LaTeX engine

Hi,

I want to request a new default engine for textmate, I want a "Plain TeX" compiling option, for packages like musixtex.

Thanks!

Wrong indentation in Math display mode

In TextMate 2, on Mac OS X Mountain Lion.
If you create any environment the code gets good indentation.
But, if you press ctrl+mayus+M (to insert display math environment) whatever you write inside goes one indent back (and, if you fix it by manually indentation of the line, so does every other environment you put in there). Example:

  1. You press ctrl+mayus+M and then write asdf. You should get:

    \[
        foo
    \[
    

    but you get

    \[
    foo
    \[
    
  2. Then, if you manually indent the line and create a new environment begin, press tab, write cases, and then write foo2. You should get:

    \[
        foo = \begin{cases}
            foo2
        \end{cases}
    \[
    

    but you get

    \[
        foo = \begin{cases}
        foo2
        \end{cases}
    \[
    
  3. Last, if you don't indent the line manually, everything you get stays at the first line. You get:

    \[
    foo = \begin{cases}
    foo2
    \end{cases}
    \[
    

I hope someone fixes this.

LaTeX symbol based on current word in $inline math$

Using this command on e.g. \phi should cycle between \phi and \varphi. It works in math environments but not in inline math. Probably due to different scope there...

I checked that while in math env. it sends as an input to command a word without leading "" in inline math it sends the whole word, i.e. "\phi". But I can't figure why...

Simple workaround would be to change code of command to

#!/usr/bin/env ruby
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/config_helper.rb"
@plist = Config.load
shortcutHash = @plist['symbols']
currentWord = STDIN.read
regex = /(\W*)(\w*)/
match = currentWord.match regex
if currentWord =~ regex then
  currentWord = match[2]
  prefix = match[1]
else
  prefix = ""
end
if (shortcutHash.has_key?(currentWord)) then
  print prefix + shortcutHash[currentWord]
else
  TextMate.exit_discard
end

latex bundle does not work - error configure.py

I have installed the alpha version of textmate under OSX 10.8 and I get the error "Preferences…: line 6: configure.py: command not found" if I open the preference menu of the latex bundle.

If I run typeset I get also the error: Typeset & View (PDF):4: undefined method `+' for nil:NilClass (NoMethodError)

"fatal error" message after correct typesetting

I get the red error message "A fatal error occured, log file is in ... " in the typesetting window although the typesetting didn't produce any errors.

The minimal example is very weird:
(I should have given this issue a more youtube style title like THE WEIRDEST BUG EVER!!! ;)

Create a tex file with 32 characters in its name (e.g 123456789-123456789-123456789-12.tex) and with the following content

\documentclass{amsart}
\usepackage{lmodern}
\usepackage{hyperref}
\begin{document}
A\\B\\C\\D
\pagebreak
\begin{thebibliography}{}\bibitem{B}\end{thebibliography}
\href{B}{\texttt{B}}
\end{document}

and typeset it with Cmd+R.

If I change anything in this setting the error message disappears, e.g. if I

  • add or remove a character in the file name
  • choose a different document class
  • reduce the number of lines with text
  • remove the pagebreak, bibliography, href or the texttt macro.
  • even if I replace the capital A with a B

I had a look at the source code. I think the following method in bin/texparser.py might be responsible.

     def getRewrappedLine(self):
        """Sometimes TeX breaks up lines with hard linebreaks.  This is annoying.
           Even more annoying is that it sometime does not break line, for two distinct 
           warnings. This function attempts to return a single statement."""
        statement = ""
        while True:
            line = self.input_stream.readline()
            if not line:
                if statement: 
                    return statement
                else:
                    return ""
            statement += line.rstrip("\n")
            if len(line) != 80: # including line break
                break
        return statement+"\n"

In my minimal example the last line that getRewrappedLine returns during the parsing process is
SyncTeX written on 123456789-123456789-123456789-12.synctex.gz.Transcript written on 123456789-123456789-123456789-12.log

If I change something in the tex file the last line becomes
Transcript written on 123456789-123456789-123456789-12.log
and the error message disappears.

Changing in the LaTexParser class the regex

(re.compile('Transcript written on (.*)\.$') , self.finishRun),

to

(re.compile('.*Transcript written on (.*)\.$') , self.finishRun),

fixed this issue for me but I still don't really understand this bug (e.g. the SyncTeX statement has 64 characters and not 80, so the missing line break remains mysterious)
and there might be better solutions than weakening the search pattern.

Watch Document

I've just upgraded to Lion and using "Watch Document", the output is always displayed with TexShop, although set to Skim in Preferences. I can not confirm this is an error directly conected to the Lion update, but it worked until yesterday.

Using Command + R works correctly and shows the document in Skim. Any clues as to what could be wrong?

Textmate Version 1.5.10 (1623)

Failure running typeset

After upgraded to tm2(9309), I cannot typeset anymore. While typing command+R, it prompt undefined method '+' for nil:NilClass (NoMethodError)

Tweak the TextMate's soft wrap

I don't know if this can be done globally or only in concrete bundles. If so, I'm interested in doing it only in the LaTeX files (LaTeX bundle then). If the solution only works globally, well, no problem.

At this moment, with the Soft Wrap option enabled (and with 80 characters per line and a Tab size equal to 3) this is what I get

enter image description here

But I'm interested in getting all the wrapped parts of the line (those identified by a · instead of a line number) indented the same as the first part of the line. Like this

enter image description here

But I don't want the line divided (as in the image), just that the wrapping starts from the same indented place. I.e., while I want TextMate to show me that way, there shouldn't be any tab in the .tex file (I mean, if I open it with another text editor it shouldn't be that way).

Is this possible? How?

Here a more extensive example

enter image description here

Keyboard shortcut conflict with TM 1.5.10 build 1616

TextMate 1.5.10 build 1616 has changed its keyboard shortcuts for "Previous File Tab" and "Next File Tab" to Command-Shift-[ and Command-Shift-], respectively. For standard US QWERTY keyboards (I won't make assumptions about other keyboard layouts), this conflicts with the LaTeX bundle's default shortcuts for "Insert -> Environment Based on Current Word" and "Insert -> Command Based on Current Word".

Bundle tries to use invalid binary after viewer (Skim) update

I ran into a weird problem today. The bundle seemed to have become determined to launch Skim through an executable in /var/tmp rather than the one in /Applications. It seemed like a rather unfortunate freak accident, but it took me quite some time to figure out what was going wrong. Unfortunately, I have since solved it for myself, so all I have to offer is this description.

  1. Open Skim when there is a new version available. The application will not start fully, but instead offer a "new version available" dialog.
  2. Start TextMate (preconfigured to use Skim).
  3. Accept the "new version available" dialog and allow Skim to update.
  4. In TextMate, "Typeset & View".
  5. The bundle now tries to use the temporarily downloaded Skim.app in /var/tmp but fails ("error number 256 opening viewer"). Subsequent "Typeset & View" actions continue doing this, even when the viewer is changed in between.

Workaround: Close TextMate, delete the one in /var/tmp and start it again.

It's not something that is likely to occur, but it is pretty blocking if it does.

Preferences pane not opening (TM2 & OS10.8.5)

Hello,

after upgrading to TM2 on OS10.8.5 I reverted all settings, but still cannot open the Preferences pane of the the latex bundle.

It first only came up with a warning: os.popen4(command) in configure.py is deprecated. I then replaced this with the suggested subprocess.Popen in configure.py and now get the following error:

Traceback (most recent call last):
  File "/Users/cfabric/Library/Application Support/TextMate/Managed/Bundles/LaTeX.tmbundle/Support/bin/configure.py", line 8, in <module>
    sin,result = subprocess.Popen(command)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 623, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1141, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Any ideas?

PS: I started investigating this because my latex files compile, but TM2 would not show the PDF, providing an error (see issue #62 )

Calling Gnuplot form TextMate doesn't work, but does from terminal

I don't know why, but I have fully formatted my computer. Installed MacTeX. Installed MacPorts, installed gnuplot through macports. Installed TextMate (and added the --shell-escape code in the LaTeX Preferences). Everything okay. But I get problems with gnu plot:

If I write a latex file which needs to call gnuplot (namely gnuplottex or tikz/pgfplots) and run it from TextMate, it doesn't call gnu plot, so I don't get any graphics.

BUT, if I call the same file from the terminal with pdflatex --shell-escape myfile.tex then the compiled .pdf DO have the graphics.

What happens? How can I solve this?

Watch document doesn't work in new 'projects'

If you have a master file A.tex which calls (with \input{folder/B.tex}) folder/B.tex you can have a line in B.tex with this code

%!TEX root = ../A.tex

So you can compile all the document when you are in the B.tex file (with cmd + R) but you can't Watch document (with ctrl + cmd + W).

LaTeX bundle disabled

Hello,
I pressed some combination of ctrl-cmd-opt-shift and T because I was turning a bunch of tab-delimited text into a table, and something I pressed disabled the LaTeX bundle. There is no syntax highlighting or tab completion. I tried deleting the bundle from /Users/olgabotvinnik/Library/Application Support/TextMate/Bundles. The default bundle was restored (my custom article class was removed) but there is still no syntax highlighting. Please advise, I would greatly appreciate any help.
Thanks,
Olga

Drop inclusion of SetFile

Presently Support/bin/latex_watch.pl relies on SetFile which is an optional install (DevTools) and therefor a copy is included as Support/bin/SetFile.

I recommend SetFile be removed from this bundle (as it shouldn’t include Apple’s binaries) and latex_watch.pl is changed to only use the tool when available — it seems the only purpose of including it is to clear the “hide extension” bit for the file.

TM2 requires Acrobat Reader

Hi,

After upgrading to TM2 the default PDFViewer is not working any more. Setting "View in: TextMate" requires to have Acrobat Reader installed. Is this an issue or a "feature"?

Thanks

Broken links for LaTeX errors in TM2

The links in the typesetting window don't work if the path contains whitespaces.
It's no problem in TextMate 1.5 but in TextMate 2 (9064) under MacOS Lion a dialog pops up with the message "File Does not Exist"

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.