2

I am writing a letter with package newlfm and babel[spanish], and some construction from spanish do not work commands from newlfm. Here is a minimal working example:

\documentclass[12pt,a4paper,busletter,spanish]{newlfm}
\usepackage[utf8]{inputenc}    % Should not be used with LuaTeX  
\usepackage[T1]{fontenc}   

\usepackage{babel}   

\namefrom{%
          Dr. N. N.   \\
          N"o pasaporte: 1234556789 \\  %%% do not work...
          }
\addrfrom{Ciudad}
\addrto{%
        Señora: \\
        M. Sc. M. M.  \\
        Universidad de la Ciudad
        }
\dateset{8 de marzo de 2016}
\greetto{}
\closeline{Sin otro particular, le saluda atentamente,}  
\PhrRegard{Ref.}
\regarding{Aceptación invitación}  

\begin{document}
\begin{newlfm}

En referencia a nota N"o 12344321 %%% This works
acepto la invitación a ...

\end{newlfm}
\end{document}

It is the construction : N"o which construct V with an o in upper index position, from the spanish option to babel, which do work as expected when used in the letter body, but do not work when used inside the argument to \namefrom{}.

What is the problem, and how to resolve it?

  • 1
    never apply \protect to a { that will make all kinds of strange things happen. (\protect does not take an argument so that only applies to { not to the whole group) – David Carlisle Mar 8 '16 at 17:17
  • Will remove \protect then, it works the same bad without protect! – kjetil b halvorsen Mar 8 '16 at 17:17
  • It's not a specific newlfm problem; " becomes a shorthand only after \begin{document}. So just move up \begin{document}. – egreg Mar 8 '16 at 17:18
  • That did the trick! – kjetil b halvorsen Mar 8 '16 at 17:23
3

babel shortcuts only work after \begin{document}

\documentclass[12pt,a4paper,busletter,spanish]{newlfm}
\usepackage[utf8]{inputenc}    % Should not be used with LuaTeX  
\usepackage[T1]{fontenc}   

\usepackage{babel}   

\begin{document}
\namefrom{%
          Dr. N. N.   \\
          N"o pasaporte: 1234556789 \\  %%% do not work...
          }
\addrfrom{Ciudad}
\addrto{%
        Señora: \\
        M. Sc. M. M.  \\
        Universidad de la Ciudad
        }
\dateset{8 de marzo de 2016}
\greetto{}
\closeline{Sin otro particular, le saluda atentamente,}  
\PhrRegard{Ref.}
\regarding{Aceptación invitación}  


\begin{newlfm}

En referencia a nota N"o 12344321 %%% This works
acepto la invitación a ...

\end{newlfm}
\end{document}

Or simpler, as you are using utf8 encoding you could just enter the character directly.

  • Thanks! For entering the glyphs directly, do not know how to do that ... Any pointer to website about input methods? – kjetil b halvorsen Mar 8 '16 at 17:25
  • @kjetilbhalvorsen I assumed that if you were typing the language you'd have keyboard with them on:-) It's Unicode U+00BA so in emacs C-x8 ret ba will work, but other systems will have other ways or just cut and paste this: N.º :-) – David Carlisle Mar 8 '16 at 17:29
  • Thanks, I am writing spanish on a norwegian keyboard ... – kjetil b halvorsen Mar 8 '16 at 17:31

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.