Little bit of LaTeX I-IV

Before reading- if you think that LaTeX is some kind of sex toy or material, click next.

I:

Before yesterday decided to install TexLive, to add Latvian support and to start form my P3A. Decided for TexLive, because I’ll most likely use TexLive in Linux too.

Wanted to use our school newspaper manual to do it, but it turned out, that LV is already in LiveTex2009 by defalt.

After downloading texlive2009-20091107.iso.xz from torrent (torrents are not illegal, but files that are downloaded often are!!),I got image, that is compressed as xz. I was confused. It was said that I could use 7Zip, but I couldn’t get him to do the work. Luckily, there was folder xz with all that you need. Since I hadn’t any willing to spear with directory stuff in Windows, I just:

  • put the .iso.xz file in xz directory,
  • runned CMD,
  • changed directory to …\texlive2009\xz
  • xzdec <texlive2009-20091107.iso.xz >texlive2009.iso
  • mounted it with Daemon tools
  • installed all
  • now use TeXWorks Editor to compile PDF’s, but I think that’s temporary.

So after installing I just need to add:

%For multiple languages
\usepackage{polyglossia}

%To set default language (for titles such as Bibliography etc.)

\setdefaultlanguage{french}

And I can freely use French accents and Latvian diacritical marks. Little downside- to use polyglossia, you need to compile with XeLaTeX. Hope that won’t cause lot of problems afterwards.

For more- TexDoc GUI contains many documents about latex- not very beautiful made, but it’s good in case you don’t have internet (all the basic package descriptions, you would need to download anyway to read).

Happy ending…

II:

Yesterday wanted to highlight unfinished details in my LaTeX file. I already knew \underline command, but wanted hinghlighting functionality.

Found soul package:

\usepackage{soul}

It made beautiful overstrike and underline, but instead of highlighting it underlined my text… Found this in soul manual:

“The \hl command does only highlight if the color package was loaded, otherwise
it falls back to underlining.”
This explains. So I added color package.

\usepackage{color}

So I got nice command to highlight text. For marking places to work on, I added my own command:

\def\metodo{\hl}

So unfinished stuff can be found in text marked as “metodo” and can be seen marked yellow.

III:

Today among other things, wanted to add some pictures.

Used this solution:

For JPG and PNG

\documentclass{article}
%For multiple languages
\usepackage{polyglossia}
%To set default language (for titles such as bibliography etc.)
\setdefaultlanguage{french}
\usepackage[xetex]{graphicx}
\begin{document}
\includegraphics[scale=0.4]{picture.jpg}
\end{document}

for EPS:

\documentclass{article}
%For multiple languages
\usepackage{polyglossia}
%To set default language (for titles such as bibliography etc.)
\setdefaultlanguage{french}
\usepackage[dvips]{graphicx}
\begin{document}
\includegraphics[scale=0.4]{mywcos_2_0.5.eps}
\end{document}

Happy ending? NOT!!! Latex obviously isn’t so user friendly

1.When I wanted to include both jpg & eps in the same document, only suggestion that i got was “convert all of them to one format”.

2. After succeeding with:

\documentclass{article}

%For multiple languages

\usepackage{polyglossia}

%To set default language (for titles such as bibliography etc.)

\setdefaultlanguage{french}

%To add images

\usepackage[xetex]{graphicx}

%To highlight

\usepackage{soul}

\usepackage{color}

%Define my function

\def\metodo{\hl}

\begin{document}

\metodo{Text to add Here}

\includegraphics[scale=0.4]{picture.jpg}

\end{document}

 

(it makes cool highlighted text and inserts picture.)

I decided to include my eps instead. So I tryed the same code but with dvips driver:

 

\documentclass{article}

%For multiple languages

\usepackage{polyglossia}

%To set default language (for titles such as bibliography etc.)

\setdefaultlanguage{french}

%To add images

\usepackage[dvips]{graphicx}

%To highlight

\usepackage{soul}

\usepackage{color}

%Define my function

\def\metodo{\hl}

\begin{document}

\metodo{Text to add Here}

\includegraphics[scale=0.4]{mywcos_2_0.5.eps}

\end{document}

 

BUT it didn’t work. Problem was caused by color package, that (I guess) tries to use some other driver.

I found 2 solutions:

  • force color package to use dvips driver (or xetex driver accordingly):

\usepackage[dvips]{color} or \usepackage[xetex]{color}

  • change the sequence of loading packages:

\documentclass{article}

%For multiple languages

\usepackage{polyglossia}

%To set default language (for titles such as bibliography etc.)

\setdefaultlanguage{french}

%To highlight

\usepackage{soul}

\usepackage{color}

%To add images

\usepackage[dvips]{graphicx}

%Define my function

\def\metodo{\hl}

\begin{document}

\metodo{Text to add Here}

\includegraphics[scale=0.4]{mywcos_2_0.5.eps}

\end{document}

 

I found second solution more simple (because you don’t need to change drivers in many places). Hope it will not cause problems afterwards.

 

IV:

To cut line that is too long:

Valid:

  • \includegraphics[scale=0.4]{mywcos_2_0.5.eps}

  • \includegraphics

[scale=0.4]

{mywcos_2_0.5.eps}

  • \includegraphics[scale=0.4]{mywco%

s_2_0.5.eps}

  • \includegraphics

[scale%

=0.4]

{mywcos_2_0.5.eps}

  • \includegraphics

[scale=0.4]

{mywco%

s_2_0.5.eps}

Invalid:

  • \includegrap%

hics

[scale=0.4]

{mywcos_2_0.5.eps}

 

Long story short- you can’t cut command name into multiple lines. But you can write different parts of command (option, argument) in new lines without % sign (which truncates all the spaces until next letter).

Have fun reading.

If I got something wrong, feel free to tell.

If there is something that bugs you for a long period of time, fell free…

Enjoy.

Cordialement,

Petit Bonhomme

Birkas:

Komentēt

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Mainīt )

Twitter picture

You are commenting using your Twitter account. Log Out / Mainīt )

Facebook photo

You are commenting using your Facebook account. Log Out / Mainīt )

Google+ photo

You are commenting using your Google+ account. Log Out / Mainīt )

Connecting to %s


%d bloggers like this: