[TxMt] Re: LateXCommandCompletions and alt+esc
Alain Matthes
alain.matthes at mac.com
Tue Sep 30 13:30:13 UTC 2008
Le 30 sept. 08 à 12:55, Charilaos Skiadas a écrit :
> I think actually you would want
>
> fileExt = "tex"
>
>
> Does that also work for you?
>
Hello
Yes that works in the two cases and I try it with \label and \ref
and also with normal completion.
I have a question about this? I learn to work with Ruby actually
and I would to understand the problem.
I've some questions
- When I use the completion. I have a list of words (name of macro)
from TeX and LaTeX. Sometimes the list is very big. Perhaps it's
possible
to have a list when the selected language is LaTeX and an other with
TeX ?
- A better idea perhaps is to put this words in files and to put the
name of the files
in a array (with the prefs) Is this possible with Ruby?
- When we work in an environment
\begin{tikzpicture}
\end{tikzpicture}
It would be fine to add completion for latex words and for "tikz" words.
- the last:) I would like to make a simple script to run LaTeX like
the old
script (Typset and view) but with Ruby.
Do you have try to write something like this ? actually when I want
to test
a picture I select the environment
\begin{tikzpicture}
\end{tikzpicture}
and I run the script below but I would like to write this with Ruby
Is it easy ?
Best Regards
Alain
# Source some support functions we need.
. "${TM_SUPPORT_PATH}/lib/html.sh"
. "${TM_SUPPORT_PATH}/lib/webpreview.sh"
# Get the viewer program. Any program (that works with open -a <name>)
can be used,
# except 'html' which is reserved to mean the internal HTML window.
This is also the
# default option.
V=${TM_LATEX_VIEWER:-html}
EL=${TM_LATEX_ERRLVL:-1}
M=${TM_LATEX_MASTER:-$TM_FILEPATH}
PDF="${FILE%.*}.pdf"
CWD="`pwd`/"
DIR="/Users/ego/Boulot/temp"
FILE="temptex.tex"
# Set up TeX compiler, fallback to xelatex if document indicates it
if grep -Esq '\\usepackage{.*(xunicode|fontspec)|program=xelatex' "$M"
then DEF_TEX=xelatex
else DEF_TEX=pdflatex
fi
TEX=${TM_LATEX_COMPILER:-$DEF_TEX}
# Add our tex directory to the TEXINPUTS variable so e.g. pdfsync is
found (even when the user hasn’t installed it)
export TEXINPUTS="$TM_BUNDLE_SUPPORT/tex//:$(kpsewhich --expand-var
'$TEXINPUTS')"
# si nécesaire \graphicspath{{$DIRtemp/}}
cd ${TM_DIR_FOR_TEMP}
cat >temptex.tex<<EOF
\documentclass{$MY_CLASS}
\param[]
\thispagestyle{empty}
\begin{document}
\input $M
\end{document}
EOF
# Switch to the right directory.
cd "$TM_PROJECT_DIRECTORY"
cd "$DIR"
# Prepare output window.
html_header 'Typeset & View' "$FILE"
echo '<h2>Compiling LaTeX…</h2>'
# Check if we actually have a tex compiler
require_cmd "$TEX" "You can either set the <tt>TM_LATEX_COMPILER</tt>
variable to the full path of your LaTeX compiler (e.g. <tt>/opt/local/
bin/pdflatex</tt> or set the <tt>PATH</tt> variable to include the
path of <tt>pdflatex</tt>."
run_tex () {
"$TEX" ${TM_LATEX_OPTIONS:=--shell-escape -interaction=nonstopmode -
file-line-error-style} "$1"
}
# Compile.
run_tex "$FILE" 2>&1
open -a "$V" temptex.pdf
html_footer
More information about the textmate
mailing list