Problem with babel and tikz using draw
up vote
33
down vote
favorite
I'm trying the next code:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
but it doesn't work. It throws the errors:
! Argument of language@active@arg> has an extra }.
! Paragraph ended before language@active@arg> was complete.<to be read again>par draw[->]
What can I do if it works right without the babel package?
tikz-pgf babel
|
show 1 more comment
up vote
33
down vote
favorite
I'm trying the next code:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
but it doesn't work. It throws the errors:
! Argument of language@active@arg> has an extra }.
! Paragraph ended before language@active@arg> was complete.<to be read again>par draw[->]
What can I do if it works right without the babel package?
tikz-pgf babel
It seems thatusepackage[english]{babel}
works, butusepackage[spanish]{babel}
does not. Also, not sure why you have[pdftex,spanish]
options fordocumentclass
- FYI, I am not that familiar withbabel
.
– Peter Grill
Mar 20 '14 at 23:08
Addshorthandoff{>}shorthandoff{<}
afterbegin{document}
. < and > are active characters in Spanish.
– Malipivo
Mar 20 '14 at 23:13
@PeterGrill using thepdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example,babel
,cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.
– Gonzalo Medina
Mar 20 '14 at 23:49
1
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44
|
show 1 more comment
up vote
33
down vote
favorite
up vote
33
down vote
favorite
I'm trying the next code:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
but it doesn't work. It throws the errors:
! Argument of language@active@arg> has an extra }.
! Paragraph ended before language@active@arg> was complete.<to be read again>par draw[->]
What can I do if it works right without the babel package?
tikz-pgf babel
I'm trying the next code:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
but it doesn't work. It throws the errors:
! Argument of language@active@arg> has an extra }.
! Paragraph ended before language@active@arg> was complete.<to be read again>par draw[->]
What can I do if it works right without the babel package?
tikz-pgf babel
tikz-pgf babel
edited Mar 21 '14 at 15:20
Martin Schröder
12.7k638120
12.7k638120
asked Mar 20 '14 at 23:04
Mario
325139
325139
It seems thatusepackage[english]{babel}
works, butusepackage[spanish]{babel}
does not. Also, not sure why you have[pdftex,spanish]
options fordocumentclass
- FYI, I am not that familiar withbabel
.
– Peter Grill
Mar 20 '14 at 23:08
Addshorthandoff{>}shorthandoff{<}
afterbegin{document}
. < and > are active characters in Spanish.
– Malipivo
Mar 20 '14 at 23:13
@PeterGrill using thepdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example,babel
,cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.
– Gonzalo Medina
Mar 20 '14 at 23:49
1
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44
|
show 1 more comment
It seems thatusepackage[english]{babel}
works, butusepackage[spanish]{babel}
does not. Also, not sure why you have[pdftex,spanish]
options fordocumentclass
- FYI, I am not that familiar withbabel
.
– Peter Grill
Mar 20 '14 at 23:08
Addshorthandoff{>}shorthandoff{<}
afterbegin{document}
. < and > are active characters in Spanish.
– Malipivo
Mar 20 '14 at 23:13
@PeterGrill using thepdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example,babel
,cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.
– Gonzalo Medina
Mar 20 '14 at 23:49
1
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44
It seems that
usepackage[english]{babel}
works, but usepackage[spanish]{babel}
does not. Also, not sure why you have [pdftex,spanish]
options for documentclass
- FYI, I am not that familiar with babel
.– Peter Grill
Mar 20 '14 at 23:08
It seems that
usepackage[english]{babel}
works, but usepackage[spanish]{babel}
does not. Also, not sure why you have [pdftex,spanish]
options for documentclass
- FYI, I am not that familiar with babel
.– Peter Grill
Mar 20 '14 at 23:08
Add
shorthandoff{>}shorthandoff{<}
after begin{document}
. < and > are active characters in Spanish.– Malipivo
Mar 20 '14 at 23:13
Add
shorthandoff{>}shorthandoff{<}
after begin{document}
. < and > are active characters in Spanish.– Malipivo
Mar 20 '14 at 23:13
@PeterGrill using the
pdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example, babel
, cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.– Gonzalo Medina
Mar 20 '14 at 23:49
@PeterGrill using the
pdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example, babel
, cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.– Gonzalo Medina
Mar 20 '14 at 23:49
1
1
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44
|
show 1 more comment
4 Answers
4
active
oldest
votes
up vote
50
down vote
accepted
The problem is that the spanish
module for babel
makes >
and <
active characters for its special management of Spanish quotations.
Update:
With PGF/TikZ version 3.0.0 there's a babel
library that solves the problems produced by changes to category codes made by some babel
modules, so it's enough to load the library:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
(Thanks to Claudio Fiandrino for pointing this out in his comment).
PGF/TikZ version 2.10
To deactivate the undesired redefinition for tikzpicture
s, but maintaining it for other parts of the document, you can use
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
for every tikzpicture
. Notice that this approach has two advantages:
No extra packages are required.
It also produces the desired result when using the command version
tikz
(see example code below).
The code:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
tikzset{
every picture/.append style={
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
}
}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
As a side note, don't use pdftex
option; modern LaTeX systems detect the driver automatically.
1
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) thebabel
modules is a great advantage.
– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
|
show 2 more comments
up vote
8
down vote
As noted by Malipivo, the spanish
option of babel
makes >
active. You can make it inactive just inside (all) the tikzpicture
environment locally, Add these in your preamble:
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
Full code:
documentclass{article}
usepackage[spanish]{babel}
usepackage{tikz}
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with theusetikzpackage{babel}
is that it will not work if thetikzpicture
is inside anifthenelse{}{}{}
block --- is there a solution for this?
– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
add a comment |
up vote
8
down vote
If you don't need to use spanish quotes
, just add es-noquoting
to babel options and TiKZ
arrows will appear again.
documentclass[pdftex,spanish]{article}
usepackage[es-noquoting]{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
If you need spanish quotes
use new babel
TiKZ 3.0 library (as Claudio suggested). Here you have an example:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0) node[right] {<<Hola>>};
end{tikzpicture}
<<Hola>>
end{document}
add a comment |
up vote
1
down vote
I do not know why, but none of the previous answers has worked for me. They showed me the right path though; adding just
deactivatequoting
on the preambled fixed the problem.
Calling babel
with english
as well as spanish
does the trick, too
usepackage[spanish,english]{babel}
4
It is quite normal that callingbabel
with theenglish
option placed after thespanish
one does the trick: it means that theenglish
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)
– Franck Pastor
Apr 7 '15 at 10:38
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
50
down vote
accepted
The problem is that the spanish
module for babel
makes >
and <
active characters for its special management of Spanish quotations.
Update:
With PGF/TikZ version 3.0.0 there's a babel
library that solves the problems produced by changes to category codes made by some babel
modules, so it's enough to load the library:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
(Thanks to Claudio Fiandrino for pointing this out in his comment).
PGF/TikZ version 2.10
To deactivate the undesired redefinition for tikzpicture
s, but maintaining it for other parts of the document, you can use
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
for every tikzpicture
. Notice that this approach has two advantages:
No extra packages are required.
It also produces the desired result when using the command version
tikz
(see example code below).
The code:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
tikzset{
every picture/.append style={
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
}
}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
As a side note, don't use pdftex
option; modern LaTeX systems detect the driver automatically.
1
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) thebabel
modules is a great advantage.
– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
|
show 2 more comments
up vote
50
down vote
accepted
The problem is that the spanish
module for babel
makes >
and <
active characters for its special management of Spanish quotations.
Update:
With PGF/TikZ version 3.0.0 there's a babel
library that solves the problems produced by changes to category codes made by some babel
modules, so it's enough to load the library:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
(Thanks to Claudio Fiandrino for pointing this out in his comment).
PGF/TikZ version 2.10
To deactivate the undesired redefinition for tikzpicture
s, but maintaining it for other parts of the document, you can use
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
for every tikzpicture
. Notice that this approach has two advantages:
No extra packages are required.
It also produces the desired result when using the command version
tikz
(see example code below).
The code:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
tikzset{
every picture/.append style={
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
}
}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
As a side note, don't use pdftex
option; modern LaTeX systems detect the driver automatically.
1
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) thebabel
modules is a great advantage.
– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
|
show 2 more comments
up vote
50
down vote
accepted
up vote
50
down vote
accepted
The problem is that the spanish
module for babel
makes >
and <
active characters for its special management of Spanish quotations.
Update:
With PGF/TikZ version 3.0.0 there's a babel
library that solves the problems produced by changes to category codes made by some babel
modules, so it's enough to load the library:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
(Thanks to Claudio Fiandrino for pointing this out in his comment).
PGF/TikZ version 2.10
To deactivate the undesired redefinition for tikzpicture
s, but maintaining it for other parts of the document, you can use
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
for every tikzpicture
. Notice that this approach has two advantages:
No extra packages are required.
It also produces the desired result when using the command version
tikz
(see example code below).
The code:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
tikzset{
every picture/.append style={
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
}
}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
As a side note, don't use pdftex
option; modern LaTeX systems detect the driver automatically.
The problem is that the spanish
module for babel
makes >
and <
active characters for its special management of Spanish quotations.
Update:
With PGF/TikZ version 3.0.0 there's a babel
library that solves the problems produced by changes to category codes made by some babel
modules, so it's enough to load the library:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
(Thanks to Claudio Fiandrino for pointing this out in his comment).
PGF/TikZ version 2.10
To deactivate the undesired redefinition for tikzpicture
s, but maintaining it for other parts of the document, you can use
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
for every tikzpicture
. Notice that this approach has two advantages:
No extra packages are required.
It also produces the desired result when using the command version
tikz
(see example code below).
The code:
documentclass[spanish]{article}
usepackage{babel}
usepackage{tikz}
tikzset{
every picture/.append style={
execute at begin picture={deactivatequoting},
execute at end picture={activatequoting}
}
}
begin{document}
Simple arrows:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
tikzdraw[->] (-1.5,0) -- (1.5,0);
end{document}
As a side note, don't use pdftex
option; modern LaTeX systems detect the driver automatically.
edited Apr 13 '17 at 12:35
Community♦
1
1
answered Mar 20 '14 at 23:24
Gonzalo Medina
391k4012841554
391k4012841554
1
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) thebabel
modules is a great advantage.
– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
|
show 2 more comments
1
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) thebabel
modules is a great advantage.
– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
1
1
With TikZ 3.0.0 there is a
babel
library on purpose: see Tikz shortandoff-on newcommand problem.– Claudio Fiandrino
Mar 21 '14 at 6:19
With TikZ 3.0.0 there is a
babel
library on purpose: see Tikz shortandoff-on newcommand problem.– Claudio Fiandrino
Mar 21 '14 at 6:19
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
@ClaudioFiandrino Ah, that's very useful information, thank you! I updated my answer accordingly.
– Gonzalo Medina
Mar 21 '14 at 12:26
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
Personally, I think it is one the major features introduced in version 3 in terms of utility (for my own purposes of course).
– Claudio Fiandrino
Mar 21 '14 at 13:51
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) the
babel
modules is a great advantage.– Gonzalo Medina
Mar 21 '14 at 19:26
@ClaudioFiandrino I agree. Not having to introduce special fixes for (some of) the
babel
modules is a great advantage.– Gonzalo Medina
Mar 21 '14 at 19:26
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
it works also for czech babel. Thanks
– jafan
Sep 26 '16 at 6:08
|
show 2 more comments
up vote
8
down vote
As noted by Malipivo, the spanish
option of babel
makes >
active. You can make it inactive just inside (all) the tikzpicture
environment locally, Add these in your preamble:
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
Full code:
documentclass{article}
usepackage[spanish]{babel}
usepackage{tikz}
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with theusetikzpackage{babel}
is that it will not work if thetikzpicture
is inside anifthenelse{}{}{}
block --- is there a solution for this?
– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
add a comment |
up vote
8
down vote
As noted by Malipivo, the spanish
option of babel
makes >
active. You can make it inactive just inside (all) the tikzpicture
environment locally, Add these in your preamble:
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
Full code:
documentclass{article}
usepackage[spanish]{babel}
usepackage{tikz}
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with theusetikzpackage{babel}
is that it will not work if thetikzpicture
is inside anifthenelse{}{}{}
block --- is there a solution for this?
– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
add a comment |
up vote
8
down vote
up vote
8
down vote
As noted by Malipivo, the spanish
option of babel
makes >
active. You can make it inactive just inside (all) the tikzpicture
environment locally, Add these in your preamble:
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
Full code:
documentclass{article}
usepackage[spanish]{babel}
usepackage{tikz}
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
As noted by Malipivo, the spanish
option of babel
makes >
active. You can make it inactive just inside (all) the tikzpicture
environment locally, Add these in your preamble:
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
Full code:
documentclass{article}
usepackage[spanish]{babel}
usepackage{tikz}
usepackage{etoolbox}
AtBeginEnvironment{tikzpicture}{shorthandoff{>}shorthandoff{<}}{}{}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
answered Mar 20 '14 at 23:23
user11232
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with theusetikzpackage{babel}
is that it will not work if thetikzpicture
is inside anifthenelse{}{}{}
block --- is there a solution for this?
– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
add a comment |
With TikZ 3.0.0 there is ababel
library on purpose: see Tikz shortandoff-on newcommand problem.
– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with theusetikzpackage{babel}
is that it will not work if thetikzpicture
is inside anifthenelse{}{}{}
block --- is there a solution for this?
– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
With TikZ 3.0.0 there is a
babel
library on purpose: see Tikz shortandoff-on newcommand problem.– Claudio Fiandrino
Mar 21 '14 at 6:20
With TikZ 3.0.0 there is a
babel
library on purpose: see Tikz shortandoff-on newcommand problem.– Claudio Fiandrino
Mar 21 '14 at 6:20
@ClaudioFiandrino --- the problem with the
usetikzpackage{babel}
is that it will not work if the tikzpicture
is inside an ifthenelse{}{}{}
block --- is there a solution for this?– Rmano
Jun 15 '16 at 12:57
@ClaudioFiandrino --- the problem with the
usetikzpackage{babel}
is that it will not work if the tikzpicture
is inside an ifthenelse{}{}{}
block --- is there a solution for this?– Rmano
Jun 15 '16 at 12:57
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
@Rmano: Actually, I don't know. It would be great if you can post a separate question for this: it will get more attention.
– Claudio Fiandrino
Jun 15 '16 at 13:02
1
1
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
@ClaudioFiandrino done, tex.stackexchange.com/questions/314884/…
– Rmano
Jun 15 '16 at 13:16
add a comment |
up vote
8
down vote
If you don't need to use spanish quotes
, just add es-noquoting
to babel options and TiKZ
arrows will appear again.
documentclass[pdftex,spanish]{article}
usepackage[es-noquoting]{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
If you need spanish quotes
use new babel
TiKZ 3.0 library (as Claudio suggested). Here you have an example:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0) node[right] {<<Hola>>};
end{tikzpicture}
<<Hola>>
end{document}
add a comment |
up vote
8
down vote
If you don't need to use spanish quotes
, just add es-noquoting
to babel options and TiKZ
arrows will appear again.
documentclass[pdftex,spanish]{article}
usepackage[es-noquoting]{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
If you need spanish quotes
use new babel
TiKZ 3.0 library (as Claudio suggested). Here you have an example:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0) node[right] {<<Hola>>};
end{tikzpicture}
<<Hola>>
end{document}
add a comment |
up vote
8
down vote
up vote
8
down vote
If you don't need to use spanish quotes
, just add es-noquoting
to babel options and TiKZ
arrows will appear again.
documentclass[pdftex,spanish]{article}
usepackage[es-noquoting]{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
If you need spanish quotes
use new babel
TiKZ 3.0 library (as Claudio suggested). Here you have an example:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0) node[right] {<<Hola>>};
end{tikzpicture}
<<Hola>>
end{document}
If you don't need to use spanish quotes
, just add es-noquoting
to babel options and TiKZ
arrows will appear again.
documentclass[pdftex,spanish]{article}
usepackage[es-noquoting]{babel}
usepackage{tikz}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0);
end{tikzpicture}
end{document}
If you need spanish quotes
use new babel
TiKZ 3.0 library (as Claudio suggested). Here you have an example:
documentclass[pdftex,spanish]{article}
usepackage{babel}
usepackage{tikz}
usetikzlibrary{babel}
begin{document}
Simple arrow:
begin{tikzpicture}
draw[->] (-1.5,0) -- (1.5,0) node[right] {<<Hola>>};
end{tikzpicture}
<<Hola>>
end{document}
edited Mar 21 '14 at 8:05
answered Mar 21 '14 at 7:57
Ignasi
89.6k4160301
89.6k4160301
add a comment |
add a comment |
up vote
1
down vote
I do not know why, but none of the previous answers has worked for me. They showed me the right path though; adding just
deactivatequoting
on the preambled fixed the problem.
Calling babel
with english
as well as spanish
does the trick, too
usepackage[spanish,english]{babel}
4
It is quite normal that callingbabel
with theenglish
option placed after thespanish
one does the trick: it means that theenglish
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)
– Franck Pastor
Apr 7 '15 at 10:38
add a comment |
up vote
1
down vote
I do not know why, but none of the previous answers has worked for me. They showed me the right path though; adding just
deactivatequoting
on the preambled fixed the problem.
Calling babel
with english
as well as spanish
does the trick, too
usepackage[spanish,english]{babel}
4
It is quite normal that callingbabel
with theenglish
option placed after thespanish
one does the trick: it means that theenglish
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)
– Franck Pastor
Apr 7 '15 at 10:38
add a comment |
up vote
1
down vote
up vote
1
down vote
I do not know why, but none of the previous answers has worked for me. They showed me the right path though; adding just
deactivatequoting
on the preambled fixed the problem.
Calling babel
with english
as well as spanish
does the trick, too
usepackage[spanish,english]{babel}
I do not know why, but none of the previous answers has worked for me. They showed me the right path though; adding just
deactivatequoting
on the preambled fixed the problem.
Calling babel
with english
as well as spanish
does the trick, too
usepackage[spanish,english]{babel}
answered Apr 7 '15 at 9:58
Vicent
111
111
4
It is quite normal that callingbabel
with theenglish
option placed after thespanish
one does the trick: it means that theenglish
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)
– Franck Pastor
Apr 7 '15 at 10:38
add a comment |
4
It is quite normal that callingbabel
with theenglish
option placed after thespanish
one does the trick: it means that theenglish
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)
– Franck Pastor
Apr 7 '15 at 10:38
4
4
It is quite normal that calling
babel
with the english
option placed after the spanish
one does the trick: it means that the english
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)– Franck Pastor
Apr 7 '15 at 10:38
It is quite normal that calling
babel
with the english
option placed after the spanish
one does the trick: it means that the english
settings of Babel apply by default, and in that case there is no bug. But most of the time, having their documents typeset with English conventions is not what people want when they write in Spanish :-)– Franck Pastor
Apr 7 '15 at 10:38
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f166772%2fproblem-with-babel-and-tikz-using-draw%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
It seems that
usepackage[english]{babel}
works, butusepackage[spanish]{babel}
does not. Also, not sure why you have[pdftex,spanish]
options fordocumentclass
- FYI, I am not that familiar withbabel
.– Peter Grill
Mar 20 '14 at 23:08
Add
shorthandoff{>}shorthandoff{<}
afterbegin{document}
. < and > are active characters in Spanish.– Malipivo
Mar 20 '14 at 23:13
@PeterGrill using the
pdftex
option is not necessary with modern LaTeX systems (the driver is automatically detected). Using the idiomatic localization (spanish
, in this case) as class option has the advantage that all language-sensitive packages (for example,babel
,cleveref
) that can eventually be loaded will pick it and produce the idiomatic localizations.– Gonzalo Medina
Mar 20 '14 at 23:49
1
@Mario I've updated my answer with new information that might be of interest for you.
– Gonzalo Medina
Mar 21 '14 at 12:27
Neatly done with babel library, thanks @GonzaloMedina.
– Mario
Mar 24 '14 at 23:44