Search This Blog

Showing posts with label LaTex. Show all posts
Showing posts with label LaTex. Show all posts

Monday, February 18, 2013

customized .bst file


/usr/share/texmf-texlive/bibtex/bst/natbib/

there are many .bst files, which one can modify.

After type/enter

$ texhash





Tuesday, November 29, 2011

Install style files in LyX

http://flukylogs.blogspot.com/2009/09/install-style-files-in-lyx.html

LyX is a frontend to LaTeX and so installation of any style file in LyX essentially mean: (1) installation of that style file in underlying LaTeX; and then (2) getting that style file work in LyX (using LyX layout files). Installation method for different types of style files are given below:

Install LaTeX class (.cls)
create new directory with name under /usr/share/texmf-texlive/tex/latex/
copy .cls file (& other files, if present) in the new directory
sudo texhash
create  a file .layout in ~/.lyx/layouts
edit the layout file according to the instructions given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).
open LyX and click 'tools -> Reconfigure' and restart LyX when done. The new Document Class should be available now.
For Example, to install IEEEconf class file, download the zip files from here. Create .cls file by executing 'latex IEEEconf.ins'. Copy the folder IEEEconf to /usr/share/texmf-texlive/tex/latex/. Run sudo texhash. Find IEEEtran.layout file & copy it to a new file named IEEEconf.layout in ~/.lyx/layouts (IEEEconf and IEEEtran are very similar, so IEEEtran-layout file can be used as layout file for IEEEconf). Edit the the second line in IEEEconf.layout from
# \DeclareLaTeXClass{article (IEEEtran)}
to
# \DeclareLaTeXClass{article (IEEEconf)}
and it should turn up when you reconfigure LyX.

Install LaTeX style (.sty)

Style file (.sty) is an addition to class files (.cls) files and they provides special formatting rules which overrides the similar rules in class  files, if present. So each style file must be associated with a class file. Installation process is similar to that of class files (see previous section of this post). Layout files (step 5 above) have different format. Instructions are given in Chapter 5 of "Customizing LyX: Features for the Advanced User" (Help->Customization in LyX).

For Example, to install ACRA style file, download the files from here. Copy the file acra.sty to /usr/share/texmf-texlive/tex/latex/ACRA/. Run sudo texhash. Find article.layout file & copy it to a new file named acra.layout in ~/.lyx/layouts (acra.sty uses "article" class). Edit the the second line in acra.layout from
#  \DeclareLaTeXClass{article}
to
#  \DeclareLaTeXClass[article, acra.sty]{article (ACRA)}
Then add in next line

Preamble
    \usepackage{acra}
EndPreamble

and it should turn up when you reconfigure LyX.

Install BibTeX Style (.bst)
create new directory with name under /usr/share/texmf-texlive/bibtex/bst/
copy .bst file (& other files, if present) in the new directory
sudo texhash
open LyX and click 'tools -> Reconfigure' and restart LyX when done.
open LyX and click 'tools -> TeX Information' and choose BibTex Styles. Click 'Rescan' The new BibTeX should be available now.

Tuesday, April 26, 2011

How to use UHthesis2e in Lyx

=== Ubuntu ===

Become a root by
$ sudo bash

Go to the latex directory (/usr/share/texmf-texlive/tex/latex)
$ cd /usr/share/texmf-texlive/tex/latex

Make a uhthesis directory
$ mkdir uhthesis
$ cd uhthesis

Copy uhthesis setup files to the dir.
$ cp /somewhere/uhthesis2e.cls  ./
$ cp /somewhere/uht10.clo       ./
$ cp /somewhere/uht11.clo       ./
$ cp /somewhere/uht12.clo       ./


Go to
$ /usr/share/lyx/layouts
$ vi uhthesis2e.layout

Add following lines
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[uhthesis2e]{article (uhthesis2e)}
# Input general definitions
Input stdclass.inc

Start Lyx and in Lyx
do: Tools > Reconfigure ; Restart Lyx.

And you will see "article (uhthesis2e)"
Now you should be able to use the document class in LyX as usual:
Document > Settings > Document Class > Document Class > article (uhthesis2e)


Download UHthesis2e.zip

Tuesday, January 11, 2011

LaTex symbols: space and carriage return

To show space as upward square cup:


\newcommand{\spc}{$_{\sqcup}$}


To show the enter key character using "mathabx" package
\usepackage{mathabx}

\newcommand{\enter}{$\dlsh$}

Friday, December 3, 2010

LaTex \newcommand

\newcommand{\dd}{\mathrm{d}}
\newcommand{\dt}{\mathrm{d}t}
\newcommand{\tr}{\mathrm{tr}}
\newcommand{\bmcal}[1]{\bm{\mathcal{#1}}}


\newcommand{\mycolor}{white}%purple, white
\newcommand{\mypause}{\pause}%
\newcommand{\justmoment}{\mypause}
%
\newcommand{\tcol}[1]{\textsf{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolred}[1]{\textsf{\textcolor{red}{#1}}}
\newcommand{\tcolpurple}[1]{\textbf{\textcolor{purple}{#1}}}
\newcommand{\tcolul}[1]{\underline{\textbf{\textcolor{\mycolor}{#1}}}}
\newcommand{\tcolep}[1]{\emph{\textbf{\textcolor{\mycolor}{#1}}}}
\newcommand{\tcolmath}[1]{{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolmathblue}[1]{{\textcolor{blue}{#1}}}
\newcommand{\tcolmathbf}[1]{\mathbf{\textcolor{\mycolor}{#1}}}
\newcommand{\tcolmathrm}[1]{\mathrm{\textcolor{\mycolor}{#1}}}
\newcommand{\textrtblue}[1]{\textrt{\textcolor{blue}{#1}}}
%\newcommand{\tcol}[1]{\textbf{\textcolor{white}{#1}}}
%\newcommand{\tcolmath}[1]{\mathbf{\textcolor{white}{#1}}}
%
\newcommand{\dbar}{d\mkern-6mu\mathchar'26}
\newcommand{\degree}{\textdegree}
\newcommand{\FigurePath}{/Users/albertsk/svn2009/Library/Figures}
\newcommand{\xunit}{\mathbf{i}}
\newcommand{\yunit}{\mathbf{j}}
\newcommand{\zunit}{\mathbf{k}}
\newcommand{\ii}{\mathbf{i}}
\newcommand{\jj}{\mathbf{j}}
\newcommand{\kk}{\mathbf{k}}
\newcommand{\textrt}[1]{\textit{\textrm{#1}}}
\newcommand{\paren}[1]{\left[{#1}\right]}
\newcommand{\prn}[1]{\left({#1}\right)}
\newcommand{\jmitem}{\justmoment \item}
\newcommand{\pitem}{\justmoment \item}
\newcommand{\lb}{\ \mathrm{lb}}
\newcommand{\ft}{\ \mathrm{ft}}
\newcommand{\inch}{\ \mathrm{in}}
\newcommand{\lbft}{\ \mathrm{lb}\cdot\mathrm{ft}}
\newcommand{\N}{\ \mathrm{N}}
\newcommand{\kN}{\ \mathrm{kN}}
\newcommand{\kip}{\ \mathrm{kip}}
\newcommand{\mm}{\ \mathrm{mm}}
\newcommand{\m}{\ \mathrm{m}}
\newcommand{\Nm}{\ \mathrm{N}\cdot\mathrm{m}}
\newcommand{\comment}[1]{}
\newcommand{\skipframe}[1]{}
\newcommand{\myvspace}{3cm}
\newcommand{\commentvspace}[1]{\vspace{\myvspace}}
\newcommand{\myfirstsection}{1}
\newcommand{\D}{\mathrm{d}}
\newcommand{\second}{\,\mathrm{sec}}
\newcommand{\minute}{\,\mathrm{min}}
\newcommand{\minutes}{\,\mathrm{mins}}
\newcommand{\hour}{\,\mathrm{hr}}
\newcommand{\hours}{\,\mathrm{hrs}}
\newcommand{\Pe}{\mathrm{Pe}}
\newcommand{\Plus}{^{+}}
\newcommand{\PlusPlus}{^{2+}}
\newcommand{\Minus}{^{-}}
\newcommand{\MinusMinus}{^{2-}}
\newcommand{\subs}[1]{$_{#1}$}
\newcommand{\supers}[1]{$^{#1}$}
\newcommand{\mailto}[1]{\href{mailto:#1}{#1}}


Monday, November 15, 2010

Latex: how to change footnote symbols

Arabic numerals, e.g., 1, 2, 3...
\renewcommand{\thefootnote}{\arabic{footnote}}


Roman numerals (lowercase), e.g., i, ii, iii...\renewcommand{\thefootnote}{\roman{footnote}}



Roman numerals (uppercase), e.g., I, II, III...
\renewcommand{\thefootnote}{\Roman{footnote}}

Alphabetic (lowercase), e.g., a, b, c...

\renewcommand{\thefootnote}{\alph{footnote}}

Alphabetic (uppercase), e.g., A, B, C...

\renewcommand{\thefootnote}{\Alph{footnote}}

A sequence of nine symbols (try it and see!)

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

LaTex: Long arrow



If 


\longrightarrow

is not sufficiently long, try


\[ \xrightarrow{\hspace*{3cm}} \]

Friday, January 8, 2010

Locations of MacTex files and how to texhash

Class files: /usr/local/texlive/2009/texmf-dist/tex/latex/
BST files: /usr/local/texlive/2009/texmf-dist/bibtex/bst/
STY files: /usr/local/texlive/2009/texmf-dist/tex/latex/

To update ls-R database, type and enter in Mac Terminal

>>sudo /usr/texbin/texhash

Friday, December 19, 2008

Short LaTex Math Guide

A short LaTex Math Guide can be found here.

Click the link to download a pdf file.

Tuesday, December 2, 2008

Happy Face in LaTex

$\ddot\smile$

Try!

Thursday, November 20, 2008

changing paper size in LaTex

Sometimes a certain specific class file does not support options of paper size.  Default is usually A4.  The following line in the very front of your LaTex file, just below, will allow you to generate letter-sized pdf file as an outcome.

\usepackage[letterpaper]{geometry}

Bibtex capital letters

Edit your bibtex file and use {} for words that you want to keep the style.

@article{greenwade93,        
   author  = "George D. Greenwade",        
   title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",        
   year    = "1993",        
   journal = "TUGBoat",        
   volume  = "14",     
   number  = "3",     
   pages   = "342--351" 
}

source: http://www.andy-roberts.net/misc/latex/latextutorial3.html

Tuesday, November 4, 2008

Not to show URLs in LaTex generated papers

When I prepare a manuscript using LaTex with Elsevier package, two reference styles are provided, elsart-num.bst and elsart-harv.bst, which generate reference lists ordered by citation number and author's name, respectively.  It often shows long URLs, which is absolutely not necessary for any purposes. 

Not to show URLs in my final manuscript, I did as follows:

1. Open .bst file.
2. Search "write.url" and replace it by "% write.url" within
  • FUNCTION {article}
  • FUNCTION {book}
  • FUNCTION {booklet}
  • FUNCTION {inbook}
  • FUNCTION {incollection}
  • FUNCTION {inproceedings}
  • FUNCTION {manual}
  • FUNCTION {masterthesis}
  • FUNCTION {misc}
  • FUNCTION {phdthesis}
  • FUNCTION {proceedings}
  • FUNCTION {techreport}
  • FUNCTION {unpublished}
But, do not make any changes where "write.url" is defined in FUNCTION {write.url}.

3. Another way is to redefine FUNCTION {write.url}, but I did not figure out how to yet.




Friday, September 12, 2008

How to make landscape documents or pages using LaTex

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

Adjusting space between items

\begin{itemize}\setlength{\itemsep}{-2mm}
\item
\end{itemize}

Friday, September 5, 2008

Inline figure in LaTex

\usepackage{wrapfig }

\begin{wrapfigure}{r}{0.4\textwidth}
\centering
\includegraphics[width=0.4\textwidth]{leadfield.eps}
\caption{Text wrap around figure}
\noindent
%\hrulefill
\label{test}
\end{wrapfigure}

Friday, August 29, 2008

LaTex new commands

\newcommand{\degrees}{$\!\!$\char23$\!$}
\newcommand{\pageseparate}{\clearpage}
\newcommand{\refhere}{\textcolor{red}{(Refs.) }}
\newcommand{\tcol}[1]{\textcolor{red}{#1}}
\newcommand{\vspaceOne}{\vspace{1in}}
\newcommand{\vspaceTwo}{\vspace{2in}}

Sunday, August 24, 2008

LaTex Useful Packages

\usepackage{amsmath}
\usepackage{color} % To make texts and math colored
\usepackage{geometry}\geometry{letterpaper} % To change size of paper
\usepackage{graphics,graphicx,epstopdf,psfig} % Graphic packages frequently used
\usepackage{nomencl} % To generate nomenclature
\usepackage{setspace}\doublespacing %To set doublespacing and singlespacing
\usepackage{revnum} % To reverse enumerate, 4,3,2, and 1.
\usepackage{wrapfig } % To have inline figures
\usepackage{hyperref} % To have hypertext protocol references
\usepackage{soul} % To highlight texts
\usepackage{ulem} %To strike words

Saturday, August 16, 2008

How to change the background image of beamer

It is possible to use a different background template, e.g. an empty
Powerpoint file that is converted to PNG, JPG, EPS or PDF.

\usebackgroundtemplate{
\includegraphics[width=\paperwidth,
height=\paperheight]{LaQuSo}
}

Tuesday, February 12, 2008

latex strike

latex strike
\usepackage{ulem}
\sout{Bill Clinton}G.W. Bush is the pres.

from here



Labels