Affichage des articles dont le libellé est Latex. Afficher tous les articles
Affichage des articles dont le libellé est Latex. Afficher tous les articles

lundi 29 décembre 2014

Install Latex Style File in Mac OS X

In Mac OS X put your .sty file (or .tex file) in 
usr/local/texlive/2014/texmf-dist/tex/latex/base
Then, run sudo -s texhash command. 

vendredi 24 mai 2013

BEAMER customize the navigation bar (tree)


\documentclass{beamer}
\useoutertheme{tree}

\makeatletter
\setbeamertemplate{headline}
{%
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{upper separation line head}
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}
      \usebeamerfont{title in head/foot}\insertshorttitle
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{section in head/foot}
      \usebeamerfont{section in head/foot}%
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \hskip2pt\raise1.9pt\hbox{\vrule width0.4pt height1.875ex\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip6pt%
      \fi%
      \insertsectionhead
      \usebeamerfont{subsection in head/foot}%
      \ifbeamer@tree@showhooks
        \setbox\beamer@tempbox=\hbox{\insertsubsectionhead}%
        \ifdim\wd\beamer@tempbox>1pt%
          \ \raise1.9pt\hbox{\vrule width 5pt height0.4pt}%
          \hskip1pt%
        \fi%
      \else%  
        \hskip12pt%
      \fi%
      \insertsubsectionhead\hfill\insertframenumber/\inserttotalframenumber\hspace{0.5em}
    \end{beamercolorbox}
    \begin{beamercolorbox}[wd=\paperwidth,colsep=1.5pt]{lower separation line head}
    \end{beamercolorbox}
}
\makeatother
\title{Tree Outer Theme}
\begin{document}

\section{Test Section}
\begin{frame} test \end{frame}
\subsection{Test Subsection One}
\begin{frame} test \end{frame}
\subsection{Test Subsection Two}
\begin{frame} test \end{frame}

\end{document}

vendredi 26 avril 2013

[Latex] use footnote in the caption

  1. \begin{figure}[!ht]  
  2.     \centering  
  3.     \includegraphics[]{ch1_architechture.png}  
  4.     \caption{Architechture du système \protect\footnotemark}  
  5. \end{figure}  
  6. \footnotetext{http://developer.android.com/guide/basics/what-is-android.html}  

  7. By this means, the link of footnote is correct.

jeudi 14 février 2013

[F]No room for a new \dimen when including TikZ

Solution:

Write
\usepackage{etex}
just after the \documentclass line (it should be the first loaded package).

Original link: http://tex.stackexchange.com/questions/7896/no-room-for-a-new-dimen-when-including-tikz

jeudi 31 janvier 2013

[FORWARD] Use bold in att

> Hello,
>
> I fail to bold my word using alltt module
>
> \documentclass{article}
> \usepackage{alltt} % for normal formating inside verbat
> \begin{document}
>
> \begin{alltt}
> hello \textbf{hello}
> \end{alltt}
>
> \end{document}
>
> Any suggestions?

txfonts has bold ttfonts. If you just want set the tt font to be txtt,
just invoke :
\renewcommand{\ttdefault}{txtt}

Example :

\documentclass{article}
\usepackage{alltt}
\renewcommand{\ttdefault}{txtt}

\begin{document}

\begin{alltt}
hello \textbf{hello}
\end{alltt}

\end{document}

--
B.R

Original: http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2006-01/msg00179.html

jeudi 24 janvier 2013

[F]LaTeX: Adding Footnotes to Paragraph Titles

LaTeX: Adding Footnotes to Paragraph Titles

When you put foonotes in paragraph titles or section titles, you will get complaints from LaTeX. The following fixes this and puts no footnotes in the table of contents.
\paragraph[foo-title]{foo-title \protect\footnote{bar-footnote}}
 
original:
http://lesoluzioni.blogspot.fr/2013/01/latex-adding-footnotes-to-paragraph.html

dimanche 20 janvier 2013

[Forward] How to use mathematics in a verbatim-like environment

How to use mathematics in a verbatim-like environment

  1. Add the alltt package to your document.
  2. Enter an encapsulated TeX field.
  3. Type \begin{alltt} to begin the alltt environment.
  4. Begin entering the content of the verbatim environment.
  5. For each mathematical element,
    1. Type \( to begin mathematics.
    2. Type the commands for the mathematical statement or symbol you want.
    3. Type \) to end mathematics.
  6. Complete the content.
  7. Type \end{alltt} to close the environment.
  8. Choose OK.
The package has no options. Alltt is provided automatically with LaTeX and is installed in the TCITeX/TeX/LaTeX/base directory of your program directory. 

The original Website can be found here: http://www.mackichan.com/index.html?techtalk/458.htm~mainFrame

lundi 3 décembre 2012

latex floatflt.sty not found in mac



mkdir -p /usr/share/texmf-texlive/tex/latex/floatflt
cd /usr/share/texmf-texlive/tex/latex/floatflt
rm -f floatflt.* float*.tex
wget http://mirror.ctan.org/macros/latex/contrib/floatflt/floatflt.ins
wget http://mirror.ctan.org/macros/latex/contrib/floatflt/floatflt.dtx
latex floatflt.ins
texhash /usr/share/texmf-texlive
PS: using mac, the folder is ~/Library/texmf/tex/latex, then go to that directory, and run the command wget ...
Ref: Incidentally, if you want to add files to TEX Live for one particular user, install them in a similar tree ~/Library/texmf where ~/Library
 is the Library folder in that user’s home directory. The folder texmf 
and other folders for the tree will have to be created. For instance, 
TEX will find any file in ~/Library/texmf/tex or a subfolder of this location, LATEX will find any file in ~/Library/texmf/tex/latex or a subfolder of this location, and BibTEX will find any .bib file in ~/Library/texmf/bibtex/bib or a subfolder of this location, and any .bst file in ~/Library/texmf/bibtex/bst or a subfolder of this location. It is not necessary to use texhash when adding files to this local tree.    

mercredi 29 août 2012

latex 字体大小

\fontsize{6pt}{0.25cm}\selectfont

6pt: 字体大小
0.25cm: 行距

vendredi 5 février 2010

How to install style files in TexShop in Mac OSX Machine

Michael B. Williams wrote:


I am using the mactex distribution with texshop as my front end.

I have started using a package that does not come with the mactex
distribution, namely cleveref. I have the cleveref.sty file, and
currently if I want to use it I have to keep it in the same directory
as the tex file I am working on.

so, I would like to find out how I can install this package so that I
can use \usepackage{cleveref} from any tex document on my computer.

when I compile I see that texshop looks in the directory /usr/local/
texlive/2007/texmf-dist/tex/latex/ for the standard packages, such as
amsmath. so in this directory I created a new directory cleveref, and
dropped the sty file in it. unfortunately when I try to compile it
says it is missing the cleveref.sty file.

anyone know how I can install this package with my current set up?

Don't put packages not coming with the main distribution there. Rather
use /usr/local/texlive/texmf-local; otherwise the added file will
vanish when an update to the main distribution will be done.

From the Terminal, assuming you are in the directory where the
package files are:

% sudo mkdir -p /usr/local/texlive/texmf-local/tex/latex/cleveref
% sudo mv cleveref.sty /usr/local/texlive/texmf-local/tex/latex/cleveref
% ...(do the same for the other files)...
% sudo mktexlsr

Here "%" stands for the shell prompt, which will be different.
You can also navigate to /usr/local/texlive/texmf-local in the Finder
and copy the files this way. However you'll need to give the

sudo mktexlsr

anyway from the Terminal. If you don't know about "sudo", just do
as stated, giving your password when requested. Of course, this
assumes you are an administrator of the machine. The "mktexlsr"
command makes TeX know about the added files.

Another way is to put the package files in

~/Library/texmf/tex/latex

(~ stands for your home directory). Other users of your machine will
not be able to use the added package, though. With this technique the
"mktexlsr" command is not needed.

Ciao
Enrico

Cite from: http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2008-05/msg00295.html

lundi 1 février 2010

[转] LaTex 注释

在LaTex中的注释有3种:
1. 用%注释一行文字, 在%后的文字都不予编译;
2. 用\iffalse .... \fi 包含一段文字, 被包含的文字被注释掉了;
3. 用\begin{comment} ... \end{comment} 包含被注释的文字, 但是需要在引言区包括相应的宏包, 即 \usepackage{verbatim}.

[转] LNCS LaTeX style works

I’m writing a paper for a conference. It should be written with conformance to the Lecture Notes in Computer Science style. After visiting the page with information for LNCS authors) I though that it might be a sort of magic for many people.
Springer encourages authors to use LaTeX2e, provides a style file for LaTeX, documentation and samples. The samples and instructions are quite good to start writing a paper immediately if
  • you know LaTeX, and
  • the llncs style is installed.
Springer can’t help with the first issue. But it isn’t important.
The problem is that they don’t provide (or I haven’t found) help on installing the style. The number of people that can do it is much smaller of those who know LaTeX.
Fortunately, I’m one from that small group. Here is my way to use the style locally without putting it into the core LaTeX directories.
The style files are stored in the file llncs2e.zip. I unpacked them into the folder “~/univer/gpce05/springer/texmf/tex/latex/llncs2e“. In fact, the path before “texmf” is not important.
First of all, I decided to check the sample file llncs.dem. As dvi-file already exists, I generated pdf:
$ pdflatex llncs.dem
$ pdflatex llncs.dem
The command was given twice to get correct links. On the first run, the database of links is created, and on the next runs the database is used.
Now goes local installation of the style. I’m not going to comment it. Consider it as magic:
$ export TEXMFLOCAL=~/univer/gpce05/springer/texmf
$ texconfig rehash
$ file ~/univer/gpce05/springer/texmf/ls-R
The first command specifies location of the local TeX repository. The second commands indexes the repository, and the last one just makes sure that the index is created.
To check, use the sample from the file typeinst.zip. Let me demonstrate a failure first. Open a new window and try to compile the TeX-file:
$ latex typeinst.tex
You get an error like:
LaTeX Error: File `llncs.cls' not found.
The right way is to specify the location of the repository first:
$ export TEXMFLOCAL=~/univer/gpce05/springer/texmf
$ latex typeinst.tex
$ latex typeinst.tex
Again, I’m running LaTeX twice to get correct links.
Original link: http://uucode.com/blog/2005/04/08/lncs-latex-style-works/

lundi 26 octobre 2009

How to input French in MacTex

Insert the following lines in front of your main document:

\usepackage[T1]{fontenc}
\usepackage[frenchb]{babel}
\usepackage[applemac]{inputenc}

mardi 15 septembre 2009

Footnotes in LaTeX section headings

The \footnote command is fragile, so that simply placing the command in \section’s arguments isn’t satisfactory. Using \protect\footnote isn’t a good idea either: the arguments of a section command are used in the table of contents and (more dangerously) potentially also in page headers. While footnotes will work in the table of contents, it’s generally not thought a “good thing” to have them there; in the page header, footnotes will simply fail. Whatever the desirability of the matter, there’s no mechanism to suppress the footnote in the page header while allowing it in the table of contents, so the footnote may only appear in the section heading itself.

To suppress the footnote in headings and table of contents:

  • Take advantage of the fact that the mandatory argument doesn’t ‘move’ if the optional argument is present:

    \section[title] {title\footnote{title ftnt}}

  • Use the footmisc package, with package option stable — this modifies footnotes so that they softly and silently vanish away if used in a moving argument. With this, you simply need:
    % in the document preamble
    \usepackage[stable]{footmisc}
    ...
    % in the body of the document
    \section{title\footnote{title ftnt}}

vendredi 21 août 2009

Latex 排版艺术

Latex排版不短时间了,配置已经不是问题。问题是美观,我想作一个新的文档模板。

侯先生这本《Word排版艺 术》告诉我,据他多年排版的经验,正文可用9.5磅字(比五号字略小),字体是华康简宋(实践证明,这会使字体间距不一,还是Adobe无敌),行距16 磅(或18磅),段前4磅,段后 8磅。这样排出来的正文很均匀美观,没有常见的那种挤成一团的感觉,可直接付印。

下面是来自法国的一些latex模板,我想会很有帮助。

封面模板

chapter模板

section模板
再推荐一个不错的Latex学习站点吧。里面也有一些更酷的模板。

看了这么多,发现关于Latex排版美化的网站大多都是法国的,法国真是个足够浪漫的地方。

Latex 调整表格位置

table

\begin{table}[placement]

body of the table

\caption{table title}
\end{table}

Tables are objects that are not part of the normal text, and are usually "floated" to a convenient place, like the top of a page. Tables will not be split between two pages.

Note that there is an *-form: \begin{table*} ... \end{table*}. This form will put the table in a single column when in two column mode; in one column mode it is identical to the non-* form

The optional argument [placement] determines where LaTeX will try to place your table. There are four places where LaTeX can possibly put a float:

  • h Here - at the position in the text where the table environment appears.
  • t Top - at the top of a text page.
  • b Bottom - at the bottom of a text page.
  • p Page of floats - on a separate float page, which is a page containing no text, only floats.
The standard report and article styles use the default placement tbp.

The body of the table is made up of whatever text, LaTeX commands, etc., you wish.

The \caption command allows you to title your table.