LaTeX/Q&A

From Wikibooks, the open-content textbooks collection

< LaTeX
Jump to: navigation, search

Welcome to the LaTeX questions and answers page.
Post any questions you have while learning LaTeX. Please sign and date your entries by inserting -- ~~~~ at the end.
If you have questions about this book, post them on the LaTeX discussion page.


Ask a question!


Contents

[edit] Who?

Who wrote this? It seems a rather phenomenal piece of work! We'd love to publish an article or a notice about it in one of the TeX journals. I looked at the history of a couple pages, but the answer was not apparent ... anyway, thanks, whoever you are! --karl@tug.org

well, there is the authors section for this :-) I wrote lots of parts of the book. As you can see, we have the permission to include several existing books on LaTeX here. I have added most of the "not so short introduction...", but I still have to finish. As soon as I have a lot of free time (July I guess), I'll work on introducing all of them and this will be a very good book, (hopefully) having the best of all the others. The main good point is that LaTeX changes quite quickly, while most of the existing guides are really old and mostly outdated. This Wikibook gets updated continuously thanks to lots of contributors. I have seen lots of anonymous users fixing some smaller mistakes. Alessio Damato 08:31, 21 May 2007 (UTC)

[edit] Cyrillic letters

How can i write a text in cyrillic using "math" command? Is it possible? -- 82.209.211.118 15:01, 9 September 2006 (UTC)

>> According to Tobias Oetiker's "The Not So Short Introduction to LaTex2e", you need to add the the matext package before the fontenc package. Here is what might go at the top of the document:

\usepackage{mathtext}
\usepackage[T1,T2A]{fontenc}
\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it} % Italic cyrillic letters
\usepackage[koi8-ru]{inputenc}
\usepackage[english,bulgarian,russian,ukranian]{babel}

When you are in math mode, remember that to show regular text you use the {\text{}} command. I added extra braces because there are certain cases where you need them.

[edit] splitting a project into files (\includeonly)

I've been using \includeonly{} and \include{} as described under the advanced topics section of the wikibook, but am not sure the output is what it sould be: If I put a \label{marker} command in a file foo.1, and then put a \ref{marker} command in a file foo.2, then even though I use \includeonly{foo.1,foo.2} in the rootfile preamble and \include{foo.2} (and no other \include{} command) in the rootfile body, I'm told that the reference was undefined. I thought that \includeonly{} allowed one to preserve cross-references without having to process more than one wants to see. Can anyone tell me what I'm doing wrong? Thanks. -- 132.161.33.86 18:01, 31 January 2007 (UTC)

[edit] Using LaTeX on a website

Is it possible to use LaTeX on a personal website in much the same way it is used in Wikipedia, i. e. when LaTeX commands immediately appear as automatically generated picture files?

no you can't. Wikipedia stores the sources (containing LaTeX parts as well) and converts them to HTML and images before sending it to user's browser. You should use a software doing the same (or you can use WikiMedia, too), but you need to set up the server properly... Alessio Damato 16:29, 20 August 2007 (UTC)

Thank you. 86.100.3.253 19:44, 22 August 2007 (UTC)

yes, it do is possible, using the right CGI-scripts


Hi, i'm quite new to latex and there's something i'd need to do but i'm not able to, nor i could find any hint over the net. What i need is to create a multi-line document main title - it seems easy but i couldn't work it. If someone could help me i would really appreciate it.

[EDIT] Ok, i'm ever newer to wikis and i can't create a new topic. Sorry for the mess.

Thank you in advance Antonio

Can anyone please tell me what does the command ``punt does?

[edit] book-writing

~October 4, 2008 how do i write a book using latex? is there an available template?

What do you mean by 'book'? A textbook/manual? A novel? Anyway, you should start by specifying document class book and know how to start chapter. There's more about creating table of contents and index. --Derbeth talk 17:06, 8 October 2008 (UTC)

Is there a powerful way for add chemical structures in my papers using Latex? Now i've to add images created with a graphic design software, but it's a really slow way to write them. Nothing like a text definition of chemical structures in Latex with subsequent graphical output? Thank you.

[edit] address labels

I'm trying to output an address list (home addresses, telephone numbers, email addresses, etc.) in a standard address label-like format. In other words, I'd like, say, 3 labels across, and N labels down (whatever will fit on the page). I've looked at (and used) the labels package, but I don't like one aspect of its formatting. Each of the labels is centered in its "cell". This means that if one label is 3 lines long and another is 6 lines long, the tops of the address labels don't line up horizontally. This is probably considered a "feature", but what I'd like to achieve is that all the "first lines" line up while each address label having possibly different numbers of lines.

Does anyone know how to do this? I'd like output that looks like this:

Address 1/Line 1           Address 2/Line 1            Address 3/Line 1
Address 1/Line 2           Address 2/Line 2            Address 3/Line 2
Address 1/Line 3           Address 2/Line 3            Address 3/Line 3
                           Address 2/Line 4            Address 3/Line 4
                           Address 2/Line 5


Address 4/Line 1           etc.  
Address 4/Line 2
Address 4/Line 3
Address 4/Line 4

Clearly, the size of each "box" should be large enough for the label with the greatest number of lines.

If you have any suggestions, please let me know. If possible, I'd like to have each address label be defined in the same way as in the labels package -- blank lines separate addresses, but other representations would be ok too.

Thanks. 12.107.176.254 (talk) 02:35, 4 November 2008 (UTC) Eric

[edit] Section numbering in the PDF version?

Dear Contributors! The LaTeX wikibook is a really impressive and valuable piece of work, thanks a lot! Would it be possible to include [[[sub]sub]sub]section numbering in the PDF version? It would enhance its usability even further!

[edit] \renewcommand for section doesn't work

Hello! I wanted to have every section in a new page. So I thought I could renewcommand section to newpage and then section, like:

\renewcommand{section}{\newpage \section}

However, this freezes my compiler (I am using xelatex). Is it a problem of recursion? Does it not like recursive calls to the same function when renewing it?

Anyway, thinking that could be a problem of recursion, I tried an other way:

\newcommand{\oldsection}{\section}
\renewcommand{\section}{\newpage \oldsection}

This should avoid recursion, but it freezes my compiler anyway. Any idea? Thanks a lot! -- 93.97.73.141 (talk) 23:58, 8 February 2009 (UTC)

You need to take a snapshot of \section using let:
\let\oldsection\section
\renewcommand{\section}{\newpage \oldsection}
--134.169.135.176 (talk) 12:45, 1 April 2009 (UTC)

[edit] Chemistry in LaTeX?

As the question already asked above was ignored, I'll try it again. Is there an acceptable way to write chemical formulas? -84.59.3.240 (talk) 14:46, 19 March 2009 (UTC)

If you just wish to write formulas, then there is a package mentioned in the formatting section (search for chemical). If you wanted to produce graphical structures, then you could try searching for a package at the CTAN website, see the installing packages section.

If you mean chemical structures, ochem probably is what you are looking for. Here can you find it.

[edit] format arguments in newcommand

In the following newcommand, (how) can the argument be centered, *on the same line* as the labelenumi in the marginpar?

\newcommand{\answer}[1]{\leavevmode\marginpar{\labelenumi\hspace{5pt} #1}}

(Inserting the centering environment between \hspace{5pt} and the argument #1 creates a line space in the marginpar--at least in pdflatex.)

A modified box may be required, but is there a different solution? Thanks --66.31.140.209 (talk) 14:18, 17 May 2009 (UTC)

How can I write latex online & see my letter? May,30.09