Tuesday, July 25, 2017

RevTex and Weavr and included figures

Weavr is a logical successor to SpartanTex which was a free LaTeX service using a cloud installation of LaTex rather than maintaing one’s own version.

The following text which constitutes a complete file, compiles properly using Weavr into a document. This means one can store one's LaTeX manuscripts (including RevTex based manuscripts) on Google Drive (Docs) and use Weavr to process them. However, one does not obtain intermediate files which have to be submitted with or inside LaTeX submissions for journal publication.

In any case, here is the Google file:

==================BEGIN OF COMPLETE WEAVR FILE==================

<<input.tex>>=
\documentclass[eqsecnum,aps]{revtex4-1}
\usepackage{graphicx,cancel,framed,ulem,braket}
\begin{document}
\title{Weavr Illustration and Bibliography using RevTex}
\author{it doesn’t matter}


\affiliation{University t\\
Department of Something, Emeritus\\
}
\date{\today}
\maketitle


\section{Poems}
\begin{quotation}
Be not sad because all men\\
Prefer a lying clamour before you:\\
Sweetheart, be at peace again -- - \\
Can they dishonour you?\\
\\
They are sadder than all tears;\\
Their lives ascend as a continual sigh.\\
Proudly answer to their tears: \\
As they deny, deny
\cite{joyce}.
\end{quotation}


Or\\
\begin{figure[h]}
\fbox{<<pointer1>>}
\caption{An illustration.}
\label{fig1}
\end{figure}


Or


\begin{quotation}
Twas brillig, and the slithy toves\\
Did gyre and gimble in the wabe; \\
All mimsy were the borogoves, \\And the mome raths outgrabe. \\
Beware the Jabberwock, my son \\
The jaws that bite, the claws that catch\cite{Carroll}!
\end{quotation}





\bibliographystyle{apsrev4-1}
\bibliography{abib.bib}

\end{document}
@


<<abib.bib>>=


@article{joyce,
  author = "Joyce, J.",
  journal = "Reprtinted Everywhere",
  volume = "18",
  year =1905
}
@article{Carroll,
  author = "Carroll, L.",
  journal = "Through the Looking Glass",
  volume = "Jabberwocky",
  year =1871
}


@


<<pointer1>>=
\includegraphics[width=5in]{fig1.png}
@
<<fig1.png>>=
@





==================END OF COMPLETE WEAVR FILE==================

Almost all of the above can be cut and pasted into a Weavr created file on Google Drive and it should compile properly into a pdf-file. The pictures will not work, I think. Of course, the greater than and less than symbols may need editing. And don't forget that files referenced which reside on Google Drive need to have their permissions set properly for "remote" access.

Notice that this is easier than the WEAVR documentation method (for figures) which ceased working during my last efforts. This method imports the documents directly into the WEAVR file for submission to the LaTeX engine. Also, it seems to me that this method allows verification that the figures are the ones intended (compared to a web address).

If there is any error here, please contact me. Thanks.




====================================NEXT=====================


Saturday, July 22, 2017

Using Weavr for online LaTex composing (obsolete, use overleaf.com)

This is not a programming post. instead, it is a LaTeX post in support of Weavr, the on-line service which allows users to use Google Docs for Latex .tex (and .bib) storage and Weavr as a front-end for compiling and generating PDFs.
By being cloud based, one need not maintain a local version of LaTeX nor need one maintain local versions of LaTeX input files.



A special thanks to Neil Crawforth who answered my questions in record time with perfect answers.

I had two major questions concerning Weavr, and cutting and pasting the help from the site proved impossible (for me). The first question concerned including figures, and the solution is shown below:


<<input.tex>>=
\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}
\begin{document}
BEFORE
\colorbox{yellow}{<<My pointer>>}
AFTER
\end{document}
@
<<My pointer>>=
\includegraphics[width=4in]{GS.png}
@
<<GS.png>>=
@


The second example uses BibTex, a common tool for academic writing:




<<input.tex>>=
\documentclass[11pt]{article}
\usepackage{cite}
\begin{document}
\title{My Article}
\author{Nobody Jr.}
\date{Today}
\maketitle
Normal text\footnote{taken in part from \url{http://www.bibtex.org/Using/}}
\bibliographystyle{plain}
\end{document}

with a reference: Nobody ~\cite{Nobody06},
which comes out as one expects (hopes?).
For blogging purposes, the bibliography will be maintained on Google Docs so that cutting and pasting this document should refer to the same bibliography.
\bibliography{mybib.bib}{}
@
<<mybib.bib>>=
<<https://docs.google.com/document/d/1JkbtbAcNCNdWSB0x3lx-PAA9P9GIhlAPHzeCmpAmhqo>>
@


Each of these is a complete unit, contained in one file on Google Docs, and compiled by Weavr upon command.


I hope that these are helpful in easing the pain of transitioning to Weavr (which I find incredible).
In both cases, the url's are to actual files which exist on my Google Docs drive. 

Remember, external docs on Google Docs need to he shared with Weavr.co.uk so that it can be remotely accessed.

Be warned that cutting and pasting from this post may require editing of right and left angle brackets (greater than and less than) from HTML to actual representations.

If there is an error (above) or lack of clarity in the material (above), please tell me.