Skip to main content

Posts

Showing posts from August, 2010

newcommand in LaTeX

New commandsTo add your own commands, use the
\newcommand{name}[num]{definition}\newcommand{\wbal}{The Wikibook about \LaTeX}This is ‘‘\wbal'' \ldots{} ‘‘\wbal''=> This is “The Wikibook about LaTeX” … “The Wikibook about LaTeX” The next example illustrates how to define a new command that takes one argument. The #1 tag gets replaced by the argument you specify. If you wanted to use more than one argument, use #2 and so on, these arguments are added in an extra set of brackets.

\newcommand{\wbalsup}[1]{This is the Wikibook about LaTeX supported by #1}\newcommand{\wbalTwo}[2]{This is the Wikibook about LaTeX supported by #1 #2}% in the document body:\begin{itemize}\item\wbalsup{Wikimedia}\item\wbalsup{lots of users!}\item\wbalTwo{John}{Doe}\end{itemize}This is the Wikibook about LaTeX supported by WikimediaThis is the Wikibook about LaTeX supported by lots of users!This is the Wikibook about LaTeX supported by John Doe
But there a lot of caveats :-

LaTeX ignores the…

Changing the font size of section headings in LaTex

You have several ways to do so:
1.- A direct redefinition of \section:
\makeatletter \renewcommand\section{\@startsection{section}{1}{\z@}%                                   {-3.5ex \@plus -1ex \@minus -.2ex}%                                   {2.3ex \@plus.2ex}%                                   {\normalfont\large\bfseries}} \makeatother
2.- By means of the titlesec package:
\usepackage{titlesec} \titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
3.- By means of the sectsty package:

\usepackage{sectsty} \sectionfont{\large}source : http://www.latex-community.org/forum/viewtopic.php?f=4&t=3245



Now, I would explain the titlesec package a bit more (because it seems easier to me and with more options) :

To change the section fonts with this package put the following lines in the preamble -

\usepackage{titlesec}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}


Options available are-

a> Font size -

\normalsize \large \Large \huge \Huge
 Increasing size ->

Script for dictionary lookup

#!/bin/bash
# dictionary v1.5.5 - to dump dictionary outputs from the web. Uses the google dictionary but can be used for any other online dictionary.
# Needs lynx to work.
# by JOnes ( August 16, 2010 )

# ANSI Color -- use these variables to easily have different color
#    and format output. Make sure to output the reset sequence after
#    colors (f = foreground, b = background), and use the 'off'
#    feature for anything you turn on.

initializeANSI()
{
  esc=" "

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"

  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${es…