1

I'm very new to LaTeX and run into some problems. I'm using Texmaker for windows with pdflatex btw.

When I use special characters and arrows etc. I would like to write it like this.

\wedge

But I have to write it like this

$\wedge$

Why is this ?

Now I would like to write [ and ] in my document. But neither of these examples work.

[
\[
$\[$

How can I write [ and ] in my document?

EDIT:

Here are some parts from my document.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{colortbl}
\usepackage{graphicx}
...
\begin{document}
\begin{tabular}{ll}
 [  &  this is a square bracket \\
\end{tabular}
\end{document}

Maybe the problem is the table ? When I just write [ I get following error:

! Paragraph ended before \@argarraycr was complete.

EDIT 2: Here is a test document. This one I can not compile.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{colortbl}
\usepackage{graphicx}


\begin{document}
\begin{tabular}{ll}
\{ / \}  &  test \\
[\{ / ]\}  &  test \\
\end{tabular}
\end{document}
  • I've tried to answer the main question here: it is usually best to stick to one issue per question. The TeXmaker part would be better as a separate question. – Joseph Wright Apr 28 '11 at 11:27
  • Your example works fine for me. – Joseph Wright Apr 28 '11 at 11:57
  • @joseph: Strange. But with {[} it worked for me to. Problem solved :D – mjspier Apr 28 '11 at 12:01
5

\wedge is a math mode character, as it's usually intended to show mathematical meaning. That's why you need to use math mode ($ ... $) to display it: this lets TeX sort out spacing in cases such as

$ A \wedge B $

You can use UTF-8 input directly with XeLaTeX to type in special characters. However, for mathematical characters, getting good font coverage can be hard. So it is often easier for these to stick to using math mode even with XeLaTeX.


One reason that you might not see [ is if it is used in a place where LaTeX looks for an optional argument. You can prevent LaTeX getting 'confused' by inserting an empty group ({}) or the 'do nothing' \relax primitive. A classic case is \item:

\item{} [
\item\relax [
  • thanks Joseph. I'm still not able to write [ though. I posted some snippets of the document. – mjspier Apr 28 '11 at 11:47
1

Ok I found the problem. It was the \tabular

When you want to write a square bracket inside of a table, you have to use

{[}
  • Not in general, no. Please post the exact code you used to get the error, so we can see what is going on! – Joseph Wright Apr 28 '11 at 12:25
  • @joseph: thanks for the effort. I posted another test document which I can not compile. – mjspier Apr 28 '11 at 12:42
  • 1
    Ah ha: LaTeX looks for an optional argument after \\ , and it is misunderstanding what you have. This is a 'known issue'! – Joseph Wright Apr 28 '11 at 13:08
  • @joseph: mistery solved then. Thanks for your effort and clearing things up. Didn't know about this issue. – mjspier Apr 28 '11 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.