you can try to define formatting command in \DeclareBibliographyExtras section in lbx file.
so in magyar.lbx
\protected\def\nameprint#1#2{#1\space#2}
and in english.lbx
\protected\def\nameprint#1#2{#2\addcomma\space#1}
and in bbx define name format:
\DeclareNameFormat{default}{%
\nameprint{#1}{#3}
..call macro for punctation
..call macro for and others
}
Edit:
I was in hurry yesterday, so didn't post complete example.
DeclareNameFormat is command, which accepts 8 parameters. they are:
- #1 The last names. If a name consists of a single part only (for example,
‘Aristotle’), this part will be
treated as the last name.
- #2 The last names, given as initials.
- #3 The first names. This argument also includes all middle names.
- #4 The first names, given as initials.
- #5 The name prefixes, for example von, van, of, da, de, del, della,
etc. Note that name prefixes are
referred to as the ‘von part’ of the
name in the BibTeX documentation.
- #6 The name prefixes, given as initials.
- #7 The name aYxes, for example ‘junior’, ‘senior’, ‘der Jüngere’,
‘der Ältere’, etc. Note that name
aYxes are referred to as the ‘junior
part’ of the name in the BibTeX
documentation.
- #8 The name aYxes, given as initials.
This command is called on every name in list, if number of authors is smaller than \value{maxnames}. If you have 8 authors and maxnames is set to 5, it will print only authors up to \value{minnames}, I have this value set to 3.
We call command \nameprint with full last and first name. If you need other parts of name use some parameter from list above.
Then we have to print punctuation after every author. I do that with folowning macro:
\newbibmacro{names:separator}{%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\addsemicolon\addspace}%
{}%
}
This macro prints semicolon and space after every author except last one. If you want other punctuation than semicolon, you can replace it with some other punctuation command. Their list is on the page 155 of biblatex manual. Or you can directly print char with \printtext command.
My andothers macro look like this:
\newbibmacro*{names:andothers}{%
\ifboolexpr{%
test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
and%
test \ifmorenames%
}{\bibsstring{andothers}}%
{}%
}
We don't have to add punctuation after andothers, because it is printed automatically with next \newunit command in your \DeclareBibliographyDriver.
So my \DeclareNameFormat now looks this way:
\DeclareNameFormat{default}{%
\nameprint{#1}{#3}
\usebibmacro{names:separator}%
\usebibmacro{names:andothers}%
}
Now I see, that my first version of \nameprint was incorrect. Magyar version should probably be:
\protected\def\nameprint#1#2{#2\space#1}
And English:
\protected\def\nameprint#1#2{#1\addcomma\space#2}
You have to define this macro for every language you use in your bibliography, otherwise you will get error message about undefined command.
Another edit based on comments below this post:
you must create bbx and cbx file. For example:
huglain.bbx
\ProvidesFile{hugplain.bbx}
\DeclareLanguageMapping{magyar}{magyar}
\RequireBibliographyStyle{authoryear}
\renewcommand*{\finalnamedelim}{%
\ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
\addspace\bibsstring{and}\space}
\newbibmacro{names:separator}{%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\addcomma\addspace}%
{}%
}
\newbibmacro{names:separator2}{%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\addspace}%
{}%
}
\newbibmacro*{names:andothers}{%
\ifboolexpr{%
test {\ifnumequal{\value{listcount}}{\value{liststop}}}%
and%
test \ifmorenames%
}{\bibsstring{andothers}\addcomma}%
{}%
}
%\DeclareNameFormat{default}{%
% \nameprint{#1}{#3}
% \usebibmacro{names:separator}%
% \usebibmacro{names:andothers}%
% }
\DeclareNameFormat{sortname}{%
\nameprint{#1}{#3}
\usebibmacro{names:separator}%
\usebibmacro{names:andothers}%
}
\endinput
notice line
\DeclareLanguageMapping{magyar}{magyar}
this is loading of your magyar.lbx file. In your current version, this file is not used at all, so in your citation there is "and" before last name instead of "és"
hugplain.cbx is rather simple
\ProvidesFile{hugplain.cbx}
\RequireCitationStyle{authoryear}
\endinput
In your tex file delete all biblatex macros and call babel with \usepackage[english,magyar]{babel}. Last language is the main language of document.
at top of file magyar.lbx, right below line \PorvidesFile... add lines
\InheritBibliographyExtras{english}
\InheritBibliographyStrings{english}
and you have error in bibliography strings, replace
bibliography = {{Felhasznált\addspaceirodalom}{Felhasznált\addspaceirodalom}},
with
bibliography = {{Felhasznált\addspace{}irodalom}{Felhasznált\addspace{}irodalom}},
and finally, you should add hyphenation fields even to english publications in your bib files, unless you want to have citation like Berk, Kriegler, és Ylvisaker
As egreg warned, the following will probably break many things. But it works in simple situations. [code edited following egreg's advice]
[update: at the bottom of this answer I edit the answer to be compatible with \label
and \ref
]
\documentclass{article}
\newtheorem{theorem}{Theorem}
\catcode1=12
\catcode2=12
\mathcode1=\the\mathcode`\(
\delcode1=\the\delcode`\(
\mathcode2=\the\mathcode`\)
\delcode2=\the\delcode`\)
\catcode`\(=\active
\catcode`\)=\active
\everymath\expandafter{\the\everymath\let(^^A\let)^^B}
\everydisplay\expandafter{\the\everydisplay\let(^^A\let)^^B}
%%\def({\begingroup\upshape\char`\(\endgroup}
%%\def){\begingroup\upshape\char`\)\endgroup}
\def({\textup{\char`\(}}
\def){\textup{\char`\)}}
\begin{document}
\begin{theorem}
I want parenthesis (around this text) to be upright. Of course, parentheses in
math mode are already upright: $\Bigg((E = mc^2)\Bigg)$, and we don't want to
fiddle with them.
\end{theorem}
\[ \Bigg((E = mc^2)\Bigg) \]
I want parenthesis (around this text) to be upright.
\emph{I want parenthesis (around this text) to be upright. }
\end{document}
with egreg's suggestion the spacing appears to be better:
Code for (hopefully...) compatibility with \label
and \ref
(with or without hyperref
used in the document):
\documentclass{article}
\usepackage{hyperref}
\newtheorem{theorem}{Theorem}
\def\makeparenletter{\catcode`\(=11 \catcode`\)=11 }
\def\makeparenother{\catcode`\(=12 \catcode`\)=12 }
\def\makeparenactive{\catcode`\(=\active\catcode`\)=\active}
\catcode1=12
\catcode2=12
\mathcode1=\the\mathcode`\(
\delcode1=\the\delcode`\(
\mathcode2=\the\mathcode`\)
\delcode2=\the\delcode`\)
\makeparenactive
\everymath\expandafter{\the\everymath\let(^^A\let)^^B}
\everydisplay\expandafter{\the\everydisplay\let(^^A\let)^^B}
\def({\textup{\char`\(}}
\def){\textup{\char`\)}}
\makeparenother
\AtBeginDocument{% this is at begin document as it must be done
% after hyperref does its things
\makeparenactive
\let\zzzlabel\label
\let\zzzref\ref
\let\zzznewlabel\newlabel
\def\label{\makeparenletter\wwwlabel}
\def\ref{\makeparenletter\wwwref}
\def\newlabel{\makeparenletter\wwwnewlabel}
\def\wwwlabel#1{\makeparenactive\zzzlabel{#1}}
\def\wwwref#1{\makeparenactive\zzzref{#1}}
\def\wwwnewlabel#1{\makeparenactive\zzznewlabel{#1}}}
\begin{document}\thispagestyle{empty}
\begin{theorem}\label{(thm:1)}
I want parenthesis (around this text) to be upright. Of course, parentheses in
math mode are already upright: $\Bigg((E = mc^2)\Bigg)$, and we don't want to
fiddle with them.
\end{theorem}
\[ \Bigg((E = mc^2)\Bigg) \]
I want parenthesis (around this text) to be upright.
\emph{I want parenthesis (around this text) to be upright. \textbf{I want parenthesis (around this text) to be upright. }}
Theorem \ref{(thm:1)}
\end{document}
Best Answer
By dafault,
spanish
changes to a comma as decimal separator; to change to a dot, you can use\decimalpoint
:This gives the possibility to revert at any moment to a comma, using
\decimalcomma
or even to select a different symbol with\spanishdecimal{<symbol>}
The package option
es-nodecimaldot
disbales completely this decimal separator mechanism and uses a dot,leaving without effect\spanishdecimal{<symbol>}
, and\decimalcomma
: