[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Provide style file for babel support for Brazilian
From: |
Arash Esbati |
Subject: |
Re: Provide style file for babel support for Brazilian |
Date: |
Fri, 18 Jun 2021 00:39:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 |
Hi Gustavo,
Gustavo Barros <gusbrs.2016@gmail.com> writes:
> "brazilian.el" and "portuguese.el" add symbols for four convenience
> macros which are defined by `babel' in `portuges.ldf', namely `\ord',
> `\orda', `\ro' and `\ra'. While I had correctly reported they do not
> receive arguments, I started playing with them now (the style files made
> me remember they exist), and they do however gobble the following space.
> Hence they should be inserted with trailing empty braces, or `nil'
> argument in `TeX-add-symbols'.
This is not the general approach in AUCTeX. If you want to have braces
after (certain) macros, please use the variables `TeX-insert-braces' or
`TeX-insert-braces-alist':
User Option: TeX-insert-braces
If non-nil, append a empty pair of braces after inserting a
macro with no arguments.
User Option: TeX-insert-braces-alist
Control the insertion of a pair of braces after a macro on a per
macro basis.
This variable is an alist. Each element is a cons cell, whose
car is the macro name, and the cdr is non-nil or nil, depending
on whether a pair of braces should be, respectively, appended or
not to the macro.
If a macro has an element in this variable, TeX-parse-macro will
use its value to decide what to do, whatever the value of the
variable TeX-insert-braces
> A comment on this though. I'm not sure how important this is, or if
> these commands should be simply considered as outdated, since these
> macros are defined as:
>
> #+begin_src latex
> \def\ord{$^{\rm o}$}
> \def\orda{$^{\rm a}$}
> \let\ro\ord\let\ra\orda
> #+end_src
I think they should be defined as:
\def\ord{\textsuperscript{o}}
\def\orda{\textsuperscript{o}}
Consider this example:
\documentclass{article}
\usepackage[brazil]{babel}
\begin{document}
\noindent 1\ord\ e 2\orda \\
{\sffamily 1\ord\ e 2\orda} \\
{\ttfamily 1\ord\ e 2\orda}
\def\ord{\textsuperscript{o}}
\def\orda{\textsuperscript{o}}
\noindent 1\ord\ e 2\orda \\
{\sffamily 1\ord\ e 2\orda} \\
{\ttfamily 1\ord\ e 2\orda}
\end{document}
With the current definitions, the macros don't respect any font families
around them when used; I think this is a misbehaviour.
> Koma-script literally does not let me use it, throwing me a "Class
> scrbook Error: undefined old font command `\rm'." (short of
> `enabledeprecatedfontcommands', which these macros are not worth, of
> course). If it had let me, I'd still get a due warning from `nag'.
>
> In light of this, do you think these macros should be even kept in the
> style files?
I don't think that AUCTeX styles should judge what is supported and what
not. We just cater for things a package provides, and if Koma throws an
error on \rm, bad for Koma users, but not all users rely on Koma.
I think the best solution is to contact the babel-brazilian developers
and talk with them about a proper solution. Do you want to take this?
I see this already[1]
Best, Arash
Footnotes:
[1] https://github.com/latex3/babel/issues/137