GeneralUnknown command

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
patrikb
Posts: 7
Joined: Wed Dec 15, 2010 2:18 pm

Unknown command

Post by patrikb »

Hi, First of all I'm totally new to latex so my knowledge is very limited.

I use the editor TexmakerX and have the Miktex distribution which both should be the latest versions.

The problem is when I want to use the this setup of commands (simplified):
\usepackage[danish,english]{babel}
%and then later after \begin{document} I use
\selectlanguage{danish}
%and it is the selectlanguage command which is unknown which is confusing since I have seen it being used several times in introductions to latex
I have also tried using a preamble which should work:
\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[danish,english]{babel}
\usepackage{graphicx}
\usepackage{amsmath, amssymb}
\usepackage{url}
%giver mulighed for at henvise til en hjemmeside med f.eks. \url{www.psi.nbi.dk}

\begin{document}
\selectlanguage{danish}
%Udkommenter (tilføj et %-tegn i starten af linien) ovenstående, hvis du skriver på engelsk.

Hello world!

\end{document}
But an explanation on what this command does would be nice too. My first guess would be it changes the dictionary used or? Because I can write danish only symbols without a problem.(also have a dictionary problem but I guess that is editor related and should be in that forum)

Have a screenshot also.
http://imageshack.us/photo/my-images/14 ... known.jpg/

EDIT: solved dictionary problem I also had :D
Last edited by patrikb on Sat Feb 19, 2011 3:12 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Unknown command

Post by frabjous »

Are you having problems compiling the document, or are you just getting this tooltip?

Compiling this document:

Code: Select all

\listfiles
\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[danish,english]{babel}
\usepackage{graphicx}
\usepackage{amsmath, amssymb}
\usepackage{url}

\begin{document}
\selectlanguage{danish}

Hello world!

\end{document}
does not generate any errors for me. Does it for you? If so, can you post the .log file that is generated when you try, here?

I'm not that familiar with TeXmakerX, but are you sure that tooltip isn't just a harmless one having to do with syntax highlighting: \selectlanguage is a command, but not a specially recognized one that gets treated in an unusual way?
patrikb
Posts: 7
Joined: Wed Dec 15, 2010 2:18 pm

Re: Unknown command

Post by patrikb »

I have no problems compiling and getting a pdf file and there are no errors. And I'm also new to LaTeX so I don't know how TexMakerX would treat the command.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Unknown command

Post by frabjous »

The commands are processed by LaTeX, not TeXmakerX. Apart from determining syntax highlighting (the coloring you see for different kinds of commands and their arguments), TeXmakerX itself doesn't have to process any commands.
patrikb
Posts: 7
Joined: Wed Dec 15, 2010 2:18 pm

Re: Unknown command

Post by patrikb »

ok, then the only thing I would like to know now is if there is a definition of what the \selectlanguage{} command does since I can't find/figure out, but otherwise thx for help.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Unknown command

Post by frabjous »

The command is from the babel package (see its documentation for more info) -- but the most important thing it does is change the rules for hyphenating words at the ends of lines to match the patterns for one language as opposed to another. It is really only necessary for documents written in more than one language; otherwise, you'd just specify the desired language as the option to the babel package when you load it. (Notice that you load two languages there, so it's necessary to select one of them below; though I think if you leave this out, it's whatever is listed last that is otherwise used.)
patrikb
Posts: 7
Joined: Wed Dec 15, 2010 2:18 pm

Re: Unknown command

Post by patrikb »

thank you. That clarified a lot.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Unknown command

Post by localghost »

patrikb wrote:[…] That clarified a lot.
If that solves the problem, then please mark the topic (not the last post) accordingly as written in the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply