>> See section 1.10 of babel's manual, on page 12 under
>> "TROUBLESHOOTING". There cannot be
>> a closing curly brace after a shorthand, and in babel-spanish ">" is a
>> shorthand.
>>
You are right 
(https://ctan.javinator9889.com/macros/latex/required/babel/base/babel.pdf). 
The particular options and macros for Spanish are in the package 
"babel-spanish", whose manual is here 
(https://ctan.javinator9889.com/macros/latex/contrib/babel-contrib/spanish/spanish.pdf).
 It is in Spanish, but there is a resume in English at the end.


> Oh  wait, I did not notice that LyX adds the line
>
> \addto\shorthandsspanish{\spanishdeactivate{~<>}}
>
> to the preamble. but for some reason the shorthand does not get
> deactivated... even the category code is wrong.
>
Oddly, the LaTeX instruction SHOULD work: it deactivates the three characters 
as shorthands, permanently; as clearly stated in the manual of babel-spanish 
(beginning of page 8).

I believe the problem is in the document class, not the language package, as 
this does not happen with other document classes.
Download the two TeX files (variants of the letter document) attached and 
process them with pdflatex (pdflatex name-of-file.tex). No errors arose in my 
system (LinuxMint 21.2 with TeXLive).
  - One has some environments after the body of the letter commented out.
  - The other, has replaced the problematic character > for " (added the latter 
to \spanishdeactivate). This should yield the very same problem, but does not.

Altogether hints the problem is in some particular environments of this class. 
Unfortunately, I do not know LaTeX that much to dive into the document class 
definition to figure out the source of the problem.


>> Attached is a manual workaround for this particular document, but it
>> should be fixed somehow.
>> maybe we should keep a list of shorthands for each language and check
>> if there is a closing curley
>> brace after a shorthand?
>>
I provide a better workaround for this problem: custom command to set the 
language in Document > Settings... > Language.
The command is
     \usepackage[spanish,es-noquoting]{babel}
which sets the document's language to Spanish and disables the shorthands < and 
>; and for some reason seems to work ^^'.



Daniel.
--
Enviat amb Tutanota.
%% LyX 2.4.0~RC1.devel created this file.  For more info, see https://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[spanish]{letter}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}

\address{<Nombre del remitente>\\
<Calle del remitente>\\
<Localidad/ciudad/pueblo del remitente>}

\letter{<Nombre del destinatario>\\
<Calle del destinatario>\\
<Localidad/ciudad/pueblo del destinatario>}


\signature{<Tu firma>}

\opening{<Estimado/a ...>}

<El texto del cuerpo de la carta va aquí. Sustituir todos los textos rodeados por
los caracteres «<» y «>» (ambos incluidos) por el texto real de la carta.

%\closing{<Atentamente,>}

%\cc{<con copia a...>}

%\encl{<contenido adjunto>}

%\thispagestyle{firstpage}\telephone{<Número>}

\thispagestyle{firstpage}\location{<Ubicación>}
\end{document}

Attachment: Letter__28Standard_Class_29.lyx
Description: application/lyx

%% LyX 2.4.0"RC1.devel created this file.  For more info, see https://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[spanish]{letter}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{"~<>}}

\begin{document}

\address{<Nombre del remitente"\\
<Calle del remitente"\\
<Localidad/ciudad/pueblo del remitente"}

\letter{<Nombre del destinatario"\\
<Calle del destinatario"\\
<Localidad/ciudad/pueblo del destinatario"}


\signature{<Tu firma"}

\opening{<Estimado/a ..."}

<El texto del cuerpo de la carta va aquí. Sustituir todos los textos rodeados por
los caracteres «<» y «"» (ambos incluidos) por el texto real de la carta.

\closing{<Atentamente,"}

\cc{<con copia a..."}

\encl{<contenido adjunto"}

\thispagestyle{firstpage}\telephone{<Número"}

\thispagestyle{firstpage}\location{<Ubicación"}
\end{document}
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to