LyX ⇒ Hyphen in spanish
-
- Posts: 9
- Joined: Mon Nov 29, 2010 6:00 pm
Hyphen in spanish
The thing is that with the "default installation" lyx messes up word hyphenation in spanish. After browsing all around the web, I found out that the solution is to install a package to show latex how to hyphenate spanish words.
The package is the following: texlive-lang-spanish
I´m running Windows 7 64bit. How do I install that package? And where can I find it? I found a webpage but it seemed a linux extension to me. http://packages.debian.org/sid/texlive-lang-spanish
Any help would be really appreciated.
GG
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: Hyphen in spanish: Solution --> Install a package
But that Debian package just contains standard LaTeX packages available on CTAN. What LaTeX distribution are you using? TeXlive or MikTeX?
It's been awhile since I've used LyX, but I'd be astonished if you don't already have everything you need installed, and the trick is just how to tell LyX to use it. I believe you can edit the LaTeX preamble. Can you add:
\usepackage[spanish]{babel}
?
-
- Posts: 9
- Joined: Mon Nov 29, 2010 6:00 pm
Hyphen in spanish
I already have the \usepackage [spanish] {babel} in the preamble.frabjous wrote:You cannot install Debian packages on Windows. Debian is a Linux based operating system.
But that Debian package just contains standard LaTeX packages available on CTAN. What LaTeX distribution are you using? TeXlive or MikTeX?
It's been awhile since I've used LyX, but I'd be astonished if you don't already have everything you need installed, and the trick is just how to tell LyX to use it. I believe you can edit the LaTeX preamble. Can you add:
\usepackage[spanish]{babel}
?
I am using MikTeX.
I also tried doing CTRL+A, Text options, Language--> Spanish.
This is my preamble
Code: Select all
\AtBeginDocument{%
\addto\captionsspanish{%
\renewcommand{\tablename}{Tabla}%
}}
\AtBeginDocument{%
\addto\captionsspanish{%
\renewcommand{\chaptername}{}%
}}
\AtBeginDocument{%
\addto\captionsenglish{%
\renewcommand{\figurename}{Figura}%
}}
\usepackage[small]{caption2}
\vrefwarning
\AtBeginDocument{%
\addto\captionsenglish{%
\renewcommand{\abstractname}{Resumen}%
}}
\usepackage[spanish]{babel}
\usepackage{chngcntr}
\counterwithout{table}{chapter}
-
- Posts: 9
- Joined: Mon Nov 29, 2010 6:00 pm
Hyphen in spanish
"spanish eshyph.tex" is enabled in my language.dat file?
I found the file at CTAN directory: http://www.ctan.org/tex-archive/language/hyphenation/
Is it already included in my Lyx 1.6.7 version? How do I make it work(install it)?
Hyphen in spanish
-
- Posts: 9
- Joined: Mon Nov 29, 2010 6:00 pm
Hyphen in spanish
Thanks for the link. I think I know what the problem is... unfortunately I can’t solve it.frabjous wrote:Have you tried the suggestions given here on the miktex mailing list?
When I go to mikTex Settings--> Language --> I see that Spanish is not selected. So well, I selected it. Then I went to Update Format. Everything OK so far.
I started lyx again... clicked on View PDF (pdflatex) and still hyphenation is not done correctly. Do I need to do some "refresh" in lyx or something to make the changes active? I tried with the "reconfigure" command in the tools menu, but still the same.
Could it be a possibility that this language pack just does not hyphenate correctly? Hope not. Otherwise I will be asking on how to get rid of hyphens at once. Though I read that no-hyphens is sometimes more of a problem than a solution, as lines tend to run into margins.
I read a comment from a User in this link https://bugs.launchpad.net/ubuntu/+sour ... bug/240823that says:
"Just to confirm what user vocx says. I've had the same problem and spanish hyphen was not loaded after having installed texlive-lang-spanish. After running sudo fmtutil --all works fine and loads spanish and catalan. What is surprising is that MiKTeX for Win Vista does have the same problem.
If you read that thread you'll see it seems to be a problem with many languages.
One thing that caught my attention is that in the language setting in MikTex I see the filename for Spanish named loadhyph-es.tex Meanwhile, those who say their hyphenation work have the file named xu-eshyph.tex. Could this be the problem? Should I replace the file?
PS; Should I post this in the MikTex Section of the forum, or is this a Lyx problem??
-
- Posts: 9
- Joined: Mon Nov 29, 2010 6:00 pm
Hyphen in spanish
Good Mountain wrote:Thanks for the link. I think I know what the problem is... unfortunately I can’t solve it.frabjous wrote:Have you tried the suggestions given here on the miktex mailing list?
When I go to mikTex Settings--> Language --> I see that Spanish is not selected. So well, I selected it. Then I went to Update Format. Everything OK so far.
I started lyx again... clicked on View PDF (pdflatex) and still hyphenation is not done correctly. Do I need to do some "refresh" in lyx or something to make the changes active? I tried with the "reconfigure" command in the tools menu, but still the same.
Could it be a possibility that this language pack just does not hyphenate correctly? Hope not. Otherwise I will be asking on how to get rid of hyphens at once. Though I read that no-hyphens is sometimes more of a problem than a solution, as lines tend to run into margins.
I read a comment from a User in this link https://bugs.launchpad.net/ubuntu/+sour ... bug/240823that says:
"Just to confirm what user vocx says. I've had the same problem and spanish hyphen was not loaded after having installed texlive-lang-spanish. After running sudo fmtutil --all works fine and loads spanish and catalan. What is surprising is that MiKTeX for Win Vista does have the same problem.
If you read that thread you'll see it seems to be a problem with many languages.
One thing that caught my attention is that in the language setting in MikTex I see the filename for Spanish named loadhyph-es.tex Meanwhile, those who say their hyphenation work have the file named xu-eshyph.tex. Could this be the problem? Should I replace the file?
PS; Should I post this in the MikTex Section of the forum, or is this a Lyx problem??
Could someone tell me if after installing a package in MikTex there is any "update to perform" in lyx, so that it will load the package? Because I have done everything but i do not note any change on lyx.
Re: Hyphen in spanish
Did you finally come up with a solution?
I have EXACTLY the same problem, but I'm using TeXnicCenter instead of LyX. I also use the MikTeX distribution. I think the problem is independent from the editor, it may have something to do with MikTeX. With the default configuration, there's no way to make words hyphenate correctly in Spanish. I tried changing 'language.dat', downloading 'eshyph.tex' (it didn't come originally with the distribution) and moving it to the 'hyphen' directory, changing 'loadhyph-es.tex' for 'eshyph.tex' in MikTex->Setting->Language->Spanish->Edit... but nothing. I still get the message: 'Package babel Warning: No hyphenation patterns were loaded for the language Spanish.'
I hope you found what's going wrong.
Regards,
Francisco
Hyphen in spanish
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=newlang
Re: Hyphen in spanish
Thanks for your help. I had already done what is stated on your link, but that made me try new things and I've just solved it. I'll post it here in order to be a useful reference to the people who have the same problem in the future.
I use MikTeX 2.8. The file "language.dat" is on ..\MiKTeX 2.8\tex\generic\config. Mine had a %-commented line for the lenguage "spanish". Next to it, there was another commented line as "=espanol". I removed the % character from both and saved.
Then, I downloaded "eshyph.tex" from the CTAN repositories, and moved it into ..\MiKTeX 2.8\tex\generic\hyphen.
I selected Start-->Programs-->MikTeX 2.8 --> Maintenance --> Settings. In the tab "Languages", the boxes "english", "dumlang" and "nohyphenation" has to be ticked. Then, if it isn't already marked, "spanish" must be ticked too. There's no need to have more languages ticked unless you are going to write in them. You must also change the path for the hyphenation pattern file (if it isn't already correct) for the file you've just downloaded. Click on "Apply" and "Accept".
On the "General" tab, click on "Refresh FNDB" and "Update Formats".
I thought this was enough, but in my case, word hyphenation was still wrong. So, then, I did the next two things in the following order and it worked. But I'm not sure which one of them was only needed:
- opened the file "eshyph.tex" with my LaTeX editor, and compile.
- opened a DOS command window and execute "initexmf --dump"
I wasn't completely sure what I was doing, but, after that, I get the following message every time I compile a tex file, and word hyphenation in spanish is correctly done:
"Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, spanish, loaded."
Regards,
Francisco.