2010-05-12 15 views
7

Sto utilizzando LaTeX e recentemente è stato rilasciato LaTeX Lab, un'interfaccia LaTeX online per Google Documenti.Come posso utilizzare un compilatore personalizzato per il mio documento LaTeX in LaTeX Lab?

Per la maggior parte questo compilatore LaTeX on-line è grande, e posso ottenere un documento come questo per la compilazione:

\documentclass[12pt]{article} 
\usepackage[utf8]{inputenc} 
\usepackage{amsmath} 
\title{\LaTeX without extra usepackages} 
\date{} 
\begin{document} 
    \maketitle 
    I would like to know how to use \LaTeX{} with extra packages. 

    % This is a comment; it is not shown in the final output. 
    % The following shows a little of the typesetting power of LaTeX 
    \begin{align} 
    E &= mc^2        \\ 
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}} 
    \end{align} 
\end{document} 

Tuttavia, documenti di grandi dimensioni che utilizzano più pacchetti non fanno compilare, anche se lo fanno su installazioni locali di LaTeX. Un esempio è qui sotto:

% 
% This document illustrates using LaTeX. LaTeX2HTML and DVIPDFM together 
% for graphics and hyperlinks. 
% 
% 
\documentclass[12pt,a4paper,dvipdfm]{article} 
\usepackage[dvips]{graphicx} 
\usepackage[usenames,dvipsnames]{color} 
\usepackage{html} 
% 
% The lines below to use HYPERREF need to be commented out to get numbering to work 
% in the HTML version. Once commented out, run LaTeX several times, and then LaTeX2HTML: 
% 
%\usepackage[dvipdfm, latex2html, 
%       colorlinks, linkcolor=blue, urlcolor=blue, citecolor=blue, 
%       bookmarks, bookmarksopen, bookmarksnumbered, 
%       pdfauthor={Charles Clayton}]{hyperref} 
% 
% The command below simplifies the process of including an image. It assumes that the images 
% are in a sub-folder called "graphics" in the folder that the .tex document lives in. 
% It also assumes a bounding box file created e.g. with EBB exists in the subdirectory. 
% If the graphic is (for example) called graph.jpg, then the bounding box file should be graph.bb 
% The first parameter is the name of the image, the second the text for the ALT tag. 
% Note that for some reason it goes wrong if you use \begin{htmlonly}...\end{htmlonly} 
% instead of \html. This "feature" might however change in subsequent versions. 
% 
\newcommand{\img}[2]{ 
\begin{makeimage} 
\end{makeimage} 
\centering 
\latex{\includegraphics{graphics/#1}} 
\html{\htmladdimg[ALT="#2"]{../graphics/#1}}} 
% 
% The next two commands are just modified versions of \img 
% The first shows how to put a box round things in both the HTML and PDF versions 
% The seconds shows how to scale the image. 
% 
\newcommand{\boxedimg}[2]{ 
\begin{makeimage} 
\end{makeimage} 
\centering 
\latex{\fbox{\includegraphics{graphics/#1}}} 
\html{\htmladdimg[ALT="#2" BORDER="1"]{../graphics/#1}}} 
% 
\newcommand{\scaledimg}[2]{ 
\begin{makeimage} 
\end{makeimage} 
\centering 
\latex{\includegraphics[scale=0.5]{graphics/#1}} 
\html{\htmladdimg[ALT="#2" WIDTH="5cm"]{../graphics/#1}}} 
% 
% 
% 
\title{Example Document} 
\author{Charles Clayton} 

\begin{document} 
\maketitle 

\abstract{ 
This document includes graphics and hyperlinks and should run correctly through 
both LaTeX2HTML and DVIPDFM. See the document 
\htmladdnormallink{Getting \LaTeX\ and \LaTeX2HTML\ and DVIPDFM to Work Together} 
{http://members.tripod.com/charlesclayton/index.htm} for more information.} 

\tableofcontents\section{Hyperlinks} 

These links should `work' (i.e. be clickable) in both the PDF and HTML documents. 
\begin{itemize} 
\item A link to an external web page: \htmladdnormallink{Amazon.com}{http://www.amazon.com} 
\item A link to the \htmlref{next section}{sec:Gr} 
\item A link to the next section, using a standard \verb+\ref+: Section \ref{sec:Gr}. 
To get section numbers you must use the \verb+show_section_numbers+ command line 
option with \LaTeX2HTML. Also, the line that uses the \verb+hyperref+ package must 
be commented out (due to a bug) and LaTeX re-run several times before running \LaTeX2HTML. 
\item It does not seem possible to get a single link to e.g. `Section 2', as 
\verb+\ref+ does not work within \verb+\htmlref+ and similar commands. 
One can get nearly there by combining an \verb+\htmlref+ 
and a \verb+\ref+: \htmlref{Section}{sec:Gr} \ref{sec:Gr}. 
\item This is an ordinary \verb+\cite+: \cite{ref1}. Note that \verb+\htmlcite+ does not 
seem to work in the PDF version (unlike \verb+\htmlref+ which works in both) 
\item This is a reference to equation \ref{eqn1} 
\item This is a reference to the \htmlref{same equation}{eqn1} done with \verb+\htmlref+ 
\end{itemize} 

\section{Graphics} 
\label{sec:Gr} 
The figures in this document demonstrate including a JPEG image in both the PDF and HTML 
versions. For details of how to use EPS graphics, see the document 
\htmladdnormallink{Getting \LaTeX\ and \LaTeX2HTML\ and DVIPDFM to Work Together} 
{http://members.tripod.com/charlesclayton/index.htm}. Notice that 
\begin{itemize} 
\item the ALT tag is set in the HTML versions; 
\item if the \verb+\caption+ comes before the \verb+\includegraphics+, 
the caption will be above the image, otherwise it will be below the image. 
This is only the case in the PDF document, however. 
\end{itemize} 

\begin{figure} 
\img{graphic.jpg}{A graph of some statistical distributions} 
\caption{A graphic} 
\end{figure} 

\begin{figure} 
\boxedimg{graphic.jpg}{A boxed graph} 
\caption{A boxed graphic} 
\end{figure} 

\begin{figure} 
\caption{A scaled graphic. In the PDF version, the caption will be on top of the image} 
\scaledimg{graphic.jpg}{A scaled graph} 
\end{figure} 

\section{Other Remarks} 
\begin{itemize} 
\item Note that the PDF version has working bookmarks; 
\item The author field is also set in the PDF document information; 
\item Note the use of a ALT tag in the equation below. 
This provides meaningful alternative text if the equation is not displayed or a tool tip 
\end{itemize} 
\begin{equation} 
\htmlimage{ALT="A fundamental equation"} 
\label{eqn1} 
e^{i\pi}=-1 
\end{equation} 


\begin{thebibliography}{99} 
\bibitem{ref1} A test bibliography entry. 
\end{thebibliography} 

\end{document} 

Vorrei utilizzare LaTeX Labs per accedere, modificare, e compilare i documenti di lattice on-line. Sta usando un compilatore privato sul mio server una soluzione a questo problema? C'è un modo più semplice? In caso contrario, qualcuno può indicarmi la direzione giusta per configurarlo? Il main tutorial page for this è vuoto. (Update: Ora c'è un po 'di descrizione.)

Non ci sono altre pagine del tutorial così:

+0

Penso che ci siano due problemi qui: 1) Come utilizzare il servizio di CLSI 2) come gestire la revisione di tesi con il supervisore Non credo che il supervisore è desiderando a che fare con il codice LaTeX. Rivedrebbe invece il contenuto della tesi; in questo caso, fornirgli il pdf è meglio. Ho sbagliato? –

+0

Hai sollevato un buon punto, penso che il PDF sia il migliore per il mio supervisore. Ancora ci sono molti altri usi per questa soluzione. Cosa succede se sono in biblioteca e voglio aggiungere qualcosa alla mia tesi? Cosa succede se sto collaborando con altre persone tecniche su un foglio? Lavoro in bioinformatica, quindi programmiamo tutti, anche se forse non tutti abbiamo familiarità con il funzionamento interno del lattice. Ci sono molti documenti in lattice che mi piacerebbe poter accedere, modificare e compilare online. Per ora mi interesserebbe 1) come usare il servizio clsi. –

risposta

3

Invece di utilizzare il CLSI, se siete interessati ad inserire un paio di pacchetti extra è possibile caricarle come documenti stile

File -> Carica file

Quindi è possibile includere nella vostra compilation

Compiler -> Risorse di progetto

Per esempio ho caricato i seguenti due file :

http://www.math.toronto.edu/~drorbn/VasBib/html.sty

http://lx2.saas.hku.hk/Conference/IascAsian05/hkustasc/template/graphicx.sty

ed è stato in grado di compilare il documento Tex nella domanda precedente.

1

Potete trovare alcuni documentazione su fanalino di un'istanza del server CLSI sul sito del progetto CLSI: http://code.google.com/p/common-latex-service-interface/wiki/InstallAndConfig

Per indicazioni su utilizzando un ambiente CLSI personalizzato con LaTeX Lab consultare la seguente pagina: code.google.com/p/latex-lab/wiki/UsingPrivateCompiler

Vorrei solo proporre un'istanza CLSI se si prevede di esporre un compilatore personalizzato, forse più potente, LaTeX, a un insieme di utenti. Per evitare i pacchetti mancanti, ti consiglio di seguire la risposta di DW.

Ci sarà un'opzione nel prossimo futuro per l'utilizzo di un'installazione locale TeX Live/MikTeX, in questo modo sarà possibile utilizzare un ambiente LaTeX personalizzato senza creare un server CLSI.

+0

+1 Grazie per il collegamento. È utile e nuovo credo. –