Showing posts with label Latex. Show all posts
Showing posts with label Latex. Show all posts

Monday, April 14, 2014

Online LaTeX Equation Editor - create, integrate and download

Online LaTeX Equation Editor - create, integrate and download:



This is a pretty neat little app.  If you don't have MathType and or don't want to use equation editor for Microsoft products (or similar), such as PowerPoint, then this is a nice way to display equations through an image.

Monday, January 28, 2013

LaTeX Tips: Displayed Math - adding sections, subsections, etc. to equation numbers

LaTeX Tips: Displayed Math

How to number equations. By default, LaTeX will number equations consecutively, as (1), (2), etc., assuming you use the automatic equation numbering mechanism. If the paper is very short, or if there are only a few numbered equations, this is fine, but once the numbers get into the twenties and higher, a scheme that numbers equations by section, as in (1.1), (1.2), ..., (2.1), etc., is preferable. In fact, for the vast majority of journal articles, the latter is probably the best numbering scheme. To get equations numbered by section, just put the following into the preamble: " \numberwithin{equation}{section} ". For books, theses, or very long papers, an equation numbering scheme that is three levels deep (with numbers like (4.1.1), etc.) may be appropriate. To get this, just replace "section" above by "subsection", or the corresponding innermost level. The same mechanism works for other counters, e.g., theorem counters, instead of "equation".

If you have a thesis or some other class/document type it may be different.  In my case (UTK thesis/diss class) it automatically numbered 3.1 for chapters.  So for "3.1.1" it was "section," and "3.1.1.1" I used "subsection."

Tuesday, January 8, 2013

Everything You Forget About LaTeX: Formatting Tables - Adding space to rows and columns

Everything You Forget About LaTeX: Formatting Tables

Column Width: \tabcolsep
Usage: \renewcommand\tabcolsep{6pt}
Explanation: tabcolsep is HALF the space between two columns. Default value is 6pt

Row Height: \arraystretch
Usage: \renewcommand\arraystretch{1}
Explanation: arraystretch is a FACTOR representing the distance between two rows. Default is 1

Landscape in LaTeX - Good for large figures and/or tables

http://texblog.org/2007/11/10/landscape-in-latex/

To change whole document to landscape use the command:

\usepackage[landscape]{geometry}

To change the page content but not the page layout use:

\documentclass[landscape, 12pt]{report}

To change a section (for printing):

\usepackage{lscape}

To change a section (for screen viewing):

\usepackage{pdflscape}

where sections are wrapped in the environment

\begin{landscape}
...
\end{landscape}

Tuesday, December 11, 2012

setspace - Double line spacing - TeX - LaTeX

setspace - Double line spacing - TeX - LaTeX

For double spaced lines in LaTeX (one line space between each line, e. g. so someone could write in the white space for editing purposes) I used:

\usepackage[doublespacing]{setspace}

Monday, November 19, 2012

Sunday, November 18, 2012

Placing LaTeX .sty files in Ubuntu/Mint/Linux

Ok, so since switching to Mint I had to reinstall all software programs including TeX Live.  I forgot that I had installed the latest version TeX Live 2012 in Ubuntu from this post so I just installed from the repositories which is version 2009 (uses the same or similar repositories as Ubuntu) for Mint 13.

I was trying to compile a .tex file in Kile when I received an error stating that the bigints.sty could not be found.  Now there are a few ways to solve this.  One is to install TeX Live 2012 which is what I did before.  Two is to download and install the bigints.sty file from

http://www.tex.ac.uk/CTAN/macros/latex/contrib/bigints/

or

http://www.ctan.org/tex-archive/macros/latex/contrib/bigints

and then place it into the directory of the file you are compiling.  This is a per file thing.  if you want to install universally you can either install into the directory (for me at least) /usr/local/share/texmf/ where I found to go onto /usr/local/share/texmf/tex/latex.  It is then suggested to create a folder named after whatever the file name is.  So in this case something like /usr/local/share/texmf/tex/latex/bigints.  However, I could not create a folder in Nautilus probably because I am not logged in as admin.  I tried to open a terminal and did su and typed in my password and went back to Nautilus with no luck.  I didn't feel like looking up the commands to do this in the terminal which would have probably worked fine especially since I saw an alternative I could try.  This alternative is to create the same file structure in your home directory.  This is useful especially if you DON'T have access as an admin.  So I created ~texmf/tex/latex/bigints and placed the .sty file there.  Oh, I also saw where you might have to run texhash which I did through Kile's built in Konsole.  Viola!  It worked!

I also noticed that there is a texmf-texlive file under the share folder so this might be a possibility as well if the other route through just texmf doesn't work.






Found help from the following links:

http://www.volkerschatz.com/tex/tpacks.html
http://tex.stackexchange.com/questions/39771/finding-a-ubuntu-package-for-a-sty-file
http://stackoverflow.com/questions/1911713/add-find-style-files-in-to-latex
http://ubuntuforums.org/showthread.php?t=334047

Saturday, November 10, 2012

Header/Footer in Latex with Fancyhdr « LaTeX Matters

Again, I apologize for not updating as much and not being able to get to comments :(.  Really busy with school and behind, but I am trying to make an effort to update a bit now!

Header/Footer in Latex with Fancyhdr « LaTeX Matters

Good blog post on a bit about the LaTeX package fancyhdr which controls and gives options for headers and footers.

Some other links:

http://en.wikibooks.org/wiki/LaTeX/Page_Layout

http://latexforhumans.wordpress.com/2009/01/09/fancyhdr/

http://timmurphy.org/2010/08/07/headers-and-footers-in-latex-using-fancyhdr/

As an example, I wanted to place a line at the bottom of the page (or footer) right above the page number for every page, except the title page of course.

Here is some of the "code."


\usepackage{fancyhdr}  % controls headers and footers
\pagestyle{fancy}
% \fancypagestyle{plain}
\fancyhf{} % clear all header and footer fields
% \fancyhead{} % clear all header fields
% \fancyfoot{} % clear all footer fields
\fancyfoot[C]{--\thepage--}
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0.4pt}



Here is the result.



Friday, July 20, 2012

Highlighting in LaTeX with the soul package - highlighting citations

Ok, after a quick search, I found that if you put an extra set of brackets around the \cite{}, then the highlighting should work!!

 So for example, \hl{{\cite{citation}}}

 It should work for other citation types too, \citeyear, etc.  I haven't tried it, but it probably works for other environments.

http://tex.stackexchange.com/questions/20021/how-to-highlight-paragraph-linebreak-preserving-as-well-as-itemize-tabular-et

Here is a screen shot from me:



Thursday, July 12, 2012

installation - How do I install the latest 2012 TeX Live on 12.04? - Ask Ubuntu

Ubuntu 12.04 comes with an old 2009 version of TeX Live.  I recently got my Ubuntu desktop back in shape (still not %100 but it's managable. and I was using Kile to compile a LaTeX document which had the bigints package.  This worked fine on my Windows using TeXstudio.  I think because I just recently installed TeX Live and it was the 2011 version.  I could have just placed the .sty file in the appropriate location as a solution.

http://blog.irrepupavel.com/2007/02/installing-latex-style-files-sty-on.html THIS LINK IS DEAD!

SEE post http://timothyandrewbarber.blogspot.com/2012/11/placing-latex-sty-files-in.html for manually installing .sty files instead!

However, I noticed, as I previously mentioned, that the version of TeX Live in Ubuntu 12.04 was outdated.  Ubuntu tends to run behind on some things in its repositories.

To install the latest TeX Live, 2012, I found this:

installation - How do I install the latest 2012 TeX Live on 12.04? - Ask Ubuntu

I ran:


sudo apt-add-repository ppa:texlive-backports/ppa

and then:

sudo apt-get update && sudo apt-get install texlive

I then installed the texlive-full package through synaptic just because I didn't feel like going through and picking the packages I needed, :P.

http://stackoverflow.com/questions/1911713/add-find-style-files-in-to-latex


$ sudo apt-get install texlive-full


It looks like 12.10 should come with the 2012 version of TeX Live.

Sorry the blog is messy.  I've been quite busy.  I also apologize to not replying to some comments.  I just haven't had the time at the moment.  Got some good stuff coming though such as using Asymptote.  I really like it.  It's not too hard and the figures look great.  I am happy so far as it replaces Origin for my needs.

sectioning - How to put a line-break in section heading? - TeX - LaTeX

sectioning - How to put a line-break in section heading? - TeX - LaTeX

I was running into problems with this.  I had the "//" in the section for line breakage but was getting errors. I finally fixed it with using

\section[Really long title here]{Really long title // here}

Thursday, April 19, 2012

Update on the xfrac LaTeX package (\sfrac command) - TeX Live - Ubuntu 11.10

I was trying to compile my LaTeX document and thought I had all the packages I needed for TeX Live because I was working on a fairly new computer on which I had just installed Ubuntu 11.10 and relevant goodies.  I had the xfrac package initialized in the preamble and was using the /sfrac command for a better looking slanted fraction.  I was getting an error:

"xfrac.sty not found"

and was quite confused because I thought I had all the dependencies installed.  The old dependency was texlive-math-extra, but it has now been moved to texlive-latex3.  I scrolled through the USC and sure enough I had missed this package install.  Installed it, and BAM!  It works!!

Friday, March 16, 2012

Beamer class (presentation mode) in LaTeX - an example of subfloats

I'd thought I'd post an example of a subfloat (a subfigure, but subfig is the package and subfloat the command; the subfigure package and command are older, see http://www.faqoverflow.com/tex/1966.html and http://texblog.org/tag/subfigure/) in Beamer, a presentation class for LaTeX.

\begin{frame}

  \begin{figure}[t]
   \centering
   \captionsetup[subfloat]{labelformat=empty}
   \subfloat[]{\label{} \includegraphics[scale = 0.15]{Sentinel_Bradford_et_al_07.png}} 
   \subfloat[]{\label{} \includegraphics[scale = 0.15]{Hyperion_(3)_Olds_et_al_99.png}}\\
   \subfloat[]{\label{} \includegraphics[scale = 0.15]{Stargazer_Olds_et_al_99.png}}
   \subfloat[]{\label{} \includegraphics[scale = 0.15]{Quicksat_(2)_Bradford_et_al_04.png}}
%    \captionsetup{labelsep=period, labelfont=sc} %\caption{} \label{fig:}
  \end{figure}

\end{frame}

Screenshot:


These are some concept hypersonic vehicles.  I just used this as an ending slide for my MS defense presentation.

Clockwise beginning at top-right:

Sentinel:
Bradford, J. E., Olds, J. R., & Wallace, J. G. (2007). Concept Assessment of a Hydrocarbon Fueled RBCC-Powered Military Spaceplane. 54th Joint Army-NavyNASA-Air Force (JANNAF) Propulsion Meeting (JPM) and 5th Modeling and Simulation / 3rd Liquid Propulsion / 2nd Spacecraft Propulsion Joint Subcommittee Meeting. Denver, Colorado.

Hyperion:
Olds, J. R., Bradford, J. E., Charania, A. C., Ledsinger, L., McCormick, D. J., & Sorensen, K. L. (1999). Hyperion: An SSTO Vision Vehicle Concept Utilizing Rocket-Based Combined Cycle Propulsion. 9th International Space Planes and Hypersonic Systems and Technologies Conference and 3rd Weakly Ionized Gases Workshop. Norfolk, VA.


Quicksat:
Bradford, J. E., Charania, A., Wallace, J., & Eklund, D. R. (2004). Quicksat: A Two-Stage to Orbit Reusable Launch Vehicle Utilizing Air-Breathing Propulsion for Responsive Space Access. Space 2004 Conference and Exhibit. San Diego, California.


Stargazer:
Olds, J. R., Ledsinger, L., Bradford, J. E., Charania, A., McCormick, D., & Komar, D. R. (1999). Stargazer: A TSTO Bantam-X Vehicle Concept Utilizing Rocket-Based Combined Cycle Propulsion. 9th International Space Planes and Hypersonic Systems and Technologies Conference and 3rd Weakly Ionized Gases Workshop. Norfolk, VA.

LaTeX - formatting - utilizing vertical space - \vspace

Again, I was adjusting the look of my CV using the \vspace command because there were extra spaces between section headings, an horizontal line, and the first entry of the section like so:


Here is that section of code:

\section*{Employment} 
\HRule 
\begin{itemize}
\item \textbf{Graduate Research Assistant}
\item University of Tennessee Space Institute, Tullahoma, TN
\item November 2011 - Present
 \begin{itemize}
 \item AFRL Prime Contract No. FA9300-06-C-0023
 \item Assisted major advisor who was a reviewer for journal papers in critiquing and writing summaries
 \item Assisted major advisor in building and proofreading research grant proposals
 \end{itemize}
\end{itemize}
\HRule
\begin{itemize}
\item \textbf{Graduate Research Assistant}
\item University of Tennessee Space Institute, Tullahoma, TN
\item August 2006 - May 2011
 \begin{itemize}
 \item Worked on AFOSR grant No. FA9101-06-D-0001/0003, Advanced High-Speed Propulsion Development; Out of the grant I produced and presented one AIAA conference paper and my MS thesis in Aerospace Engineering

So I tightened it like this:


\section*{Employment} \vspace{-5 mm}
\HRule \vspace{-6 mm}
\begin{itemize}
\item \textbf{Graduate Research Assistant}
\item University of Tennessee Space Institute, Tullahoma, TN
\item November 2011 - Present
 \begin{itemize}
 \item AFRL Prime Contract No. FA9300-06-C-0023
 \item Assisted major advisor who was a reviewer for journal papers in critiquing and writing summaries
 \item Assisted major advisor in building and proofreading research grant proposals
 \end{itemize}
\end{itemize}
\HRule \vspace{-6 mm}
\begin{itemize}
\item \textbf{Graduate Research Assistant}
\item University of Tennessee Space Institute, Tullahoma, TN
\item August 2006 - May 2011
 \begin{itemize}
 \item Worked on AFOSR grant No. FA9101-06-D-0001/0003, Advanced High-Speed
Propulsion Development; Out of the grant I produced and presented one AIAA conference paper and my MS thesis in Aerospace Engineering

So little things like this make LaTeX, IMO, very versatile/customizable and small changes can make big differences in looks.

LaTeX formatting - right alignment \ruggedleft

Here is a small thing, but I'd thought I'd post it since the small things can be big. Anyways, I was cleaning up my CV and the template I found and am using had my information at the top using this code.

\begin{minipage}[t]{0.5\textwidth}
  212 E. Emerald Ave \\
  Knoxville, TN 37917-5531
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
 Phone: (812) 531-9006 \\
Email: \href{mailto:timothy.andrew.barber@gmail.com}{timothy.andrew.barber@gmail.com} \\
Homepage: \href{http://timothyandrewbarber.blogspot.com/}{http://timothyandrewbarber.blogspot.com/}
\end{minipage}


Now the CV looked like this.





Now this is ok, but I decided I wanted it aligned to the right.  So I use the command \raggedleft to do this.  Found here: http://en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting

The code now looks like this:

\begin{minipage}[t]{0.5\textwidth}
  212 E. Emerald Ave \\
  Knoxville, TN 37917-5531
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
 \raggeleft Phone: (812) 531-9006 \\
\href{mailto:timothy.andrew.barber@gmail.com}{timothy.andrew.barber@gmail.com} \\
\href{http://timothyandrewbarber.blogspot.com/}{http://timothyandrewbarber.blogspot.com/}
\end{minipage}

So I decided to remove the "Email:" and "Homepage:" as well.  Don't worry, my CV is a page on my blog and a few other sites so my info is out there anyways.