Quantcast
Channel: Question and Answer » babel
Viewing all 75 articles
Browse latest View live

Brazil Language problem in the TikZ diagram

$
0
0

I have a problem with TikZ diagram, I don’t get to make the diagram with babel under the brazil language.
I used the code with french and everything is OK!

documentclass[a4paper,12pt, brazil]{article}

usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{lmodern}
usepackage[body={16.5cm,24cm}]{geometry}
usepackage{amsthm, amssymb}
usepackage{babel}
usepackage{comment} 
usepackage{amsmath}
usepackage{color}
usepackage{graphicx}
usepackage{tikz-cd}

begin{document}

begin{defi}

[begin{tikzcd}[column sep=small]
Y_1 ar[dr, "pi_1"'] ar[rr, "f"]& & ar[ld, "pi_2"] Y_2 \
& X &
end{tikzcd}]

end{defi}

end{document}

bad Itemize environment with babel and StandardItemLabels

$
0
0

Using the StandardItemLabels options of babel, itemize bullets are in the margins. How is it possible to set up properly bullet item and right spacing ?

documentclass[french]{article}

usepackage{babel}
frenchbsetup{StandardItemLabels=true}

usepackage{lipsum}

begin{document}


lipsum[2]
begin{itemize}
    item une
    item liste
    item de 
    item mots
end{itemize}
lipsum[2]

begin{enumerate}
    item et un
    item et deux
    item et trois
end{enumerate}

begin{description}
    item[obj] def
    item[obj] def
    item[obj] def
end{description}

end{document}

with StandardItemLabels option
without StandardItemLabels options

I would like only change the bullet not the position.

makefirstuc from glossaries clashes with foreignlanguage from babel

$
0
0

I write a document, whose primary language is English. But I have some glossary entries whose names (aka label) are in German, but the description, etc. is in English again. I use the packages glossaries and babel.

So, some of my glossary definitions look like this:

newglossaryentry{foo}{%
    name={foreignlanguage{ngerman}{Foo}},%
    description={(ger.) German word for Bar.}%
}

Additionally, I want every entry in the glossary to start with a capital letter. Hence, I redefined

renewcommand*{glsnamefont}[1]{makefirstuc{#1}}

in the preamble. This results into a compilation error.

! Illegal parameter number in definition of languagename

Instead, if I protected the argument with an addition {}, i.e.

renewcommand*{glsnamefont}[1]{makefirstuc{{#1}}}

the compilation is successful, but then the whole entry is capitalized not only the first letter. But that’s not what I want.

fmtcount problems with french & newcommand

$
0
0

I built & used a complex command qd this spring who requires datetime package and therefore fmtcount. I start again to use my command these days, but occurred some changes. I suspect updates of fmtcount package. Problems :

  1. Though I put frenchb option in babel package, results of numberstringnum& ordinalnum commands are in english…
  2. Now, I can’t use this form for my command : numberstringnum{{#1}0}, & it’s very troublesome.

I put here a minimal exemple :

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = arara
documentclass{scrbook}
usepackage[frenchb]{babel} 
usepackage[quiet]{fontspec}                    
usepackage[automark,headsepline]{scrpage2}         
usepackage[babel,french=guillemets*]{csquotes}
usepackage[dayofweek]{datetime}

setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}
addtokomafont{disposition}{normalfont}
newcommand{qd}[1]{années~numberstringnum{{#1}0}}

begin{document}
numberstringnum{300}, ordinalnum{3}[m], formatdate{1}{1}{2000}…
%qd{8}.
end{document}
% arara: xelatex

And the result :s

enter image description here

I put above the second problem in grey (%qd{8}.), but if I active the qd command, error messages in the console are :

! Missing number
…
! Missing = inserted for ifnum
…
! Package fmtcount error: Out of range

I have the 3.00 version of fmtcount package manual. Thank you for your help.

Non-English letter input/output problem [duplicate]

Spanish.ldf error

$
0
0

I just installed MiKTeX 2.9 x64 on my windows 8.1 laptop. I use Texmaker as a TeX editor.

I’m trying to compile a document with these packages:

usepackage[utf8]{inputenc}

usepackage[spanish]{babel}

usepackage[spanish]{layout}

when the compiler is running, it appears the MiKTeX Package Manager’s message saying that the file spanish.ldf is missing and it will install the babel-spanish package. So, I click yes, then the package is installed, but I get the following error: (and hundred more)

! Undefined control sequence.
l.117 StartBabelCommands

on line 117 but my file only has 67 lines!.

On the other hand, if I compile the file clicking on “no” to the package manager, the file compile normally.

How can I install the babel-spanish in order to compile normally my files?

I tried to install this package from differents repositories and I still get the error.

How to fix this interaction bug between pgfplots and babel-french module?

$
0
0

Here is an example of a minimum non-working case which is generating the bug:

documentclass{standalone}
usepackage{luatextra}
usepackage[frenchb]{babel}

usepackage{pgfplots}

begin{document}

begin{tikzpicture}
    begin{axis}
        legend{a};
    end{axis}
end{tikzpicture}

end{document}

I get this:

error: /usr/share/texmf-dist/tex/generic/babel-french/frenchb.lua:62: attempt to index a nil value
.
endpgfpicture ...globally endgroup hss egroup
                                                  pgf@restore@layerlist@fro...
l.36 end{tikzpicture} 

If I remove the legend away, this is working well. But well, the legend is usually kind of a required piece of information in a graph.

EDIT:

I just installed the latest TL version (net install): the bug is still there!

Bibliography string 'by' undefined in Canadian

$
0
0

I use babel with the canadian language, and biblatex-chicago. If I use a @inbook reference with a bookauthor field, I get the following error:

Bibliography string 'by' undefined at entry 'smith' on input line 104.

And by is shown in bold case as in this other thread.

I have tried using

DefineBibliographyStrings{canadian}{
  by = {by}
}

as suggested but it returns the following error:

Package keyval Error: by undefined.

If I simply switch to english in babel, the problem does not occur.


Package babel Error: Unknown option `francais'

$
0
0

I recently updated my Operating system from Ubuntu 13.04 to Ubuntu 13.10.

Since then, I am facing difficulties compiling my tex code in which the french babel package is called. Please note that all my codes were working very fine before the system upgrade.

However, now, given the following header :

  usepackage[francais]{babel}

I receive the following error :

! Package babel Error: Unknown option `francais'. Either you misspelled it

What should I do ? Please note that if I remove this part of code (usepackage[francais]{babel}), everything is compiling good. I also tried it with french, and I receive the same result.

Thank you in advance for your help.


MINIMUM WORKING EXAMPLE :

documentclass[11pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[francais]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}

begin{document}
This is a MINIMUM WORKING EXAMPLE.
end{document}
! Package babel Error: Unknow option `francais'. Either you misspelled it

pdfLaTeX problems with figures in Arabi package (Farsi)

$
0
0

I have searched the site with different keywords regarding the aforementioned problem and it seems that I am the first guy with this problem.
I am new to Arabi package. I will use it to typeset Farsi texts, if I could solve this problem.

I use pdfLaTeX to compile my latex files and interestingly, I have no problem if the selected language is English instead of Farsi. In such a case, my figure caption starts with an English phrase “Figure 1:” for example, however in Farsi text I should have some Farsi phrase instead. If I switch to choose Farsi (as usual my texts are in Farsi) I will encounter with this problem:

Edit: replaced included image by a rule of the same size, to produce reproducible example.

(/usr/local/texlive/2014/texmf-dist/tex/latex/base/ifthen.sty) [1

pdfTeX warning: pdflatex: pdfrestore: missing pdfsave
{/usr/local/texlive/2014/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
!pdfTeX error: pdflatex: 1 unmatched pdfsave after page shipout
 ==> Fatal error occurred, no output PDF file produced!

Any help would be appreciated heartily.

My code sample is as follows:

documentclass[10pt]{article} 

usepackage{graphics} 
usepackage[utf8]{inputenc}
usepackage[LAE,LFE]{fontenc} 
usepackage[english,farsi]{babel}
usepackage[free]{frfonts}

title{عنوان فارسی}

begin{document} 

selectlanguage{farsi}

section{بخش اول}

begin{figure}  
centering
    resizebox{.7textwidth}{!}{rule{532.99126bp}{414.54875bp}}
    caption{نتایج شبیه‌سازی روش حداکثر نسبت سیگنال به تداخل بعلاوه نویز}
    label{fig:SINRBF} 
end{figure}

end{document}

Possible bug in babel-greek, TexLive 2014

$
0
0

Apologies for bug reporting here, but thought I might as well. My current banner is:

$ pdflatex -version | grep 'TeX Live'
pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)

The problem seems to be described in Printing sentence in ancient Greek – comp.text.tex, and in my case stems from here: Getting Texlive version in pdflatex?; regardless of which example I try, say:

documentclass{article}

defgettexliveversion#1(#2 #3 #4#5#6#7#8)#9relax{#4#5#6#7}
edeftexliveversion{expandaftergettexliveversionpdftexbannerrelax}
% usepackage{unravel}

% [Printing sentence in ancient Greek - Google Groups](https://groups.google.com/forum/?_escaped_fragment_=topic/comp.text.tex/ajGFiDqpvW0#!topic/comp.text.tex/ajGFiDqpvW0)
% fail at step 16200 (16190)
% unravel{
usepackage[greek,english]{babel}
usepackage[utf8]{inputenc}
ifnumtexliveversion<2013
  usepackage[LGRx,T1]{fontenc}
else
  usepackage[T1]{fontenc}
fi
% }

listfiles

begin{document}

The starting verse of the Iliad is
begin{quotation}greektext
Μῆνιν ἄειδε, θεά, Πηληιάδεω Ἀχιλῆος
end{quotation}
and it's really great.

end{document}

… it fails with:

Package babel Warning: No hyphenation patterns were preloaded for
(babel)                the language `greek' into the format.
(babel)                Please, configure your TeX system to add them and
(babel)                rebuild the format. Now I will use the patterns
(babel)                preloaded for english instead on input line 44.

! Undefined control sequence.
l.50 ...bbl@monogreek bbl@monogreek=l@monogreek

If I keep on pressing ENTER at each error, eventually it compiles a PDF, and the listfiles output is:

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
   babel.sty    2014/09/25 3.9l The Babel package
   greek.ldf    2014/09/18 v1.9b Greek support for the babel system
  lgrenc.def    2013/12/02 v0.11.2 LGR Greek font encoding definitions
greek-fontenc.def    2013/11/28 v0.11 Common Greek font encoding definitions
 english.ldf    2012/08/20 v3.3p English support from the babel system
inputenc.sty    2014/04/30 v1.2b Input encoding file
    utf8.def    2008/04/05 v1.1m UTF-8 support for inputenc
   t1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  ot1enc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  omsenc.dfu    2008/04/05 v1.1m UTF-8 support for inputenc
  lgrenc.dfu    2014/09/14 1.5 UTF-8 support for Greek
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
  lgrcmr.fd    2013/09/01 v1.0 Greek European Computer Regular
 ***********

The comp.text.tex thread actually mentions:

Actually, to get this far I edited
/usr/share/texlive/texmf-local/texmf-compat/tex/latex/greek.ldf
replacing

ifxl@monogreek@undefined
  adddialect@monogreek 0fi
ifxl@ancientgreek@undefined
  adddialect@ancientgreek 0fi

by

ifxl@monogreek@undefined
  adddialectl@monogreek 0fi
ifxl@ancientgreek@undefined
  adddialectl@ancientgreek 0fi

The second version has l@monogreek in the second line (for @monogreek),
and a similar change in the fourth line.

After the change my problems go away.

For me, that snippet is in /media/texlive/2014/texmf-dist/tex/generic/babel-greek/greek.ldf, and contains:

...
ProvidesLanguage{greek}
        [2014/09/18 v1.9b Greek support for the babel system]
%% File `babel-greek.dtx'
...
ifxl@greek@undefined
  @nopatterns{greek}
  adddialectl@greek 0fi
ifxl@monogreek@undefined
  adddialect@monogreek 0fi
ifxl@ancientgreek@undefined
  adddialect@ancientgreek 0fi

Clearly, it should be adddialectl@monogreek, not adddialect@monogreek as it is; and indeed, when I make that change as well, the document compiles just fine.


The thing is this: I installed TexLive from scratch (install-tl), tried to compile the given MWE, it fails with given error – had to hack babel-greek/greek.ldf as described to get it to compile. So, there’s either faulty code in greek.ldf and it’s a bug — or I miss some package, and Latex cannot tell me which with the usual “file not found” message. Since no one else can reproduce this error, it is probably not a bug – but how do I find what I am missing, then?

Problems with acro package and greek babel?

$
0
0

Well, I need to create an acronym list in my thesis, I was using the acronympackage before for that. Since I updated several package and my old preamble had too much error, I decided to create another main.tex file and build there again the preamble. Has been hard to do and order the packages for avoid errors. All was fine until yesterday when I added greek polytonic for few notes that I compose like sidenotes with the snotez package, and then started the problems.

At first the errors were related to babel and greek, bunt now that works fine. My problem now are the acronyms that yesterday were fine.

My MWE:

documentclass[paper=letter,headings=big,bibliography=totoc,DIV=9]{scrbook}
KOMAoptions{headsepline=true,fontsize=10pt,draft=false}
usepackage{typearea}
usepackage[greek.polutoniko,spanish.mexico]{babel}
usepackage[utf8]{inputenc}
usepackage[LGR,T1]{fontenc}
usepackage{snotez}
%%%%%%%%%%%%%%%%%%%%%%%% Acronyms
usepackage[single=false,macros=false,xspace=false]{acro}
DeclareAcronym{lbd}{
 short = LBD , 
 long = Lipoproteinas de baja densidad ,
 foreign = Low-Density Lipoprotein
}
DeclareAcronym{vop}{
 short = VOP , 
 long = Velocidad de onda de pulso ,
 foreign = Pulse Wave Velocity
}
DeclareAcronym{ifs}{
 short = IFS , 
 long = Interacción fluido-sólido ,
 foreign = Fluid-Solid/Structure Interaction
}

DeclareAcronym{hgo}{
 short = HGO , 
 long = modelo de Holzapfel-Gasser-Ogden
}

DeclareAcronym{aha}{
 short = AHA , 
 long = Asociación Americana del Corazón ,
 foreign = American Heart Asociation
}
DeclareAcronym{wss}{
 short = WSS , 
 long = Esfuerzo cortante de pared ,
 foreign = Wall Shear Stress
}    

DeclareAcronym{adina}{
 short = ADINA ,
 long  =  Automatic Dynamic Incremental Nonlinear Analysis ,
 class = software
}    

begin{document}

minisec{Arteriosclerosis}

Es un término genéricosidenote{Del griego {selectlanguage{greek} textgreek{'arthr'ia}} emph{arteria} y {selectlanguage{greek} textgreek{skl'hrwsic}} emph{cicatriz, rigidez}.} que fue creado por Jean Georges Chrétien Frédéric Martin Lobstein.

Este capítulo tiene como objetivo proporcionar una descripción de las ecuaciones matemáticas que rigen y el algoritmo desarrollado para la modelación computacional ac{ifs} del flujo sanguíneo y las geometrías del modelo utilizadas en el estudio.

La ac{dfc} descompone la geometría en pequeñas celdas y por tanto tiene como objetivo resolver las ecuaciones que rigen para cada celda.

En la actualidad, varios paquetes de software como ac{adina} proporcionan esta capacidad. Todos estos programas emplean el método de elementos finitos para resolver las ecuaciones de flujo. Este es el método preferido para resolver simulaciones ac{ifs} de problemas estructurales, ya que es uno de los mejores métodos disponibles. 

printacronyms[exclude-classes=software]
printacronyms[include-classes=software, name={Software}]    
end{document}

When I try to compile I get few errors, one of them says:

! Improper alphabetic constant.
<to be read again>
global
l.186 cnltx@tmpa
A one-character control sequence belongs after a ` mark.
So I'm essentially inserting  here.
! Missing number, treated as zero.
<to be read again>

another:

! Undefined control sequence.
<argument> 2
9/9/17 v1.1 Trim spaces around a token list
l.6 Trim spaces around a token list]
The control sequence at the end of the top line
of your error message was never def'ed. If you have
misspelled it (e.g., `hobx'), type `I' and the correct
spelling (e.g., `Ihbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

In the first case I understand that the error is because the cnltx package wasn’t load before or something else. I don’t use it, and I want to believe that one of the several packages I’ve got should load it.

If you want to see the original log file is here, and the real preamble is this.

Localize fields in biblatex

$
0
0

I’m trying to write a document using a .bib as a database of entries, and then formatting them. However, I need to have some entries in multiple languages.

So, is there an easy way to localize fields in a .bib entry, such that I can extend the model.

For example, now I’m using a really straightforward way to change between languages of each entry

documentclass{article}

usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{filecontents}

begin{filecontents}{jobname.dbx}
DeclareDatamodelEntrytypes{localized}

DeclareDatamodelFields[type=field,datatype=literal]{
  description-english,
  description-spanish,
}

DeclareDatamodelEntryfields[localized]{
  description-english,
  description-spanish,
}
end{filecontents}

begin{filecontents}{jobname.bib}
@localized{entry1,
  description-english = {this is english},
  description-spanish = {esto es español}
}
end{filecontents}

usepackage[datamodel=jobname]{biblatex}
DeclareFieldFormat{description-spanish}{#1}
DeclareFieldFormat{description-english}{#1}
newbibmacro*{langfield}[1]{%
  expandafteriffieldundefexpandafter{#1-languagename}{}{expandafterprintfieldexpandafter{#1-languagename}}%
}
DeclareBibliographyDriver{localized}{%
  usebibmacro{langfield}{description}
}

addbibresource{jobname.bib}

nocite{*}
begin{document}
printbibliography
end{document}

However, this becomes really hard to manage if I have several entries that should be in multiple languages, as I need to declare each in the data model. Also, it does not support some spelling changes. For example, if I want to put a university field, in Spanish it is spelled “Universidad X” while in English it should be “X University”, or in some cases “University X”.

Thus, having a way to default some fields or macros would be useful. Is there something that I can use to achieve such behavior from biblatex?

Vietnamese babel: font consistency

$
0
0

I am writing a document in English, but want my name written in Vietnamese. I am using babel and mathpazo. The problem is that when I switch font to Vietnamese as in this minimal example:

documentclass{article}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[vietnamese,german,english]{babel}
usepackage[osf,sc]{mathpazo}
usepackage{mathrsfs} 
begin{document}
{Large Vietnam}

begin{otherlanguage}{vietnamese}
{Large Việt Nam}
end{otherlanguage}
end{document}

the font is also switched from Palatino to… something else, see the output below.

Font switch in changing languages

Is there anyway to keep the Palatino font also for Vietnamese language? I am very grateful to your comments.

Error when using Greek babel, mparhack and pagenumbering{roman}

$
0
0

Using:

This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)

… I compile the following MWE:

documentclass[10pt,twoside,openright]{book}
%usepackage[english]{babel}
usepackage[greek,english]{babel} %% A
usepackage{mparhack}             %% B
usepackage{lipsum}

begin{document}
pagenumbering{roman}             %% C
Testing

lipsum[1]
end{document}

… which triggers the following error upon pdflatex test.tex:

! Use of \@lipsum doesn't match its definition.
text@command #1->def reserved@a {
                                    #1}ifx reserved@a @empty let check@...
l.12 end{document}

? 
! Unbalanced write command.
<write> string mph@setcol {ii:thepage }{
                                           string mph@nr }
l.12 end{document}

? X

Interestingly, this error appears only when all three: A, B, and C are present; it doesn’t occur if we replace, say, A with usepackage[danish,english]{babel} (if you delete the old .aux file first before recompiling). (Note: in my original doc, I actually got ! Incomplete iffalse; all text was ignored after line ... appearing at mph@outputpage@hook which is from mparhack; but similarly, that error appeared first only after adding greek to babel)

So this seems to be a specific error occuring when Greek babel, mparhack and pagenumbering{roman} interact. How do I get rid of it?


2 Arabic words just using Babel Arabic and Roman letters

$
0
0

I need to put the Arabic words for deaf and restoration into an English language book review. I know what these should look from the book under review, but I can’t find a guide for the Roman letters to use for transliteration in Babel.

For instance, AR{ASm} is close for deaf (should be أصم), but there’s an extra dot and the leftmost symbol might be off. (Embarrassingly, I know nothing about Arabic, as you can probably tell.) The sense of restoration is described as resetting broken bones; it is the word that led to “algebra.”

I realize this is a much more basic question than many previous ones about putting documents in Arabic, and is really asking about a particular transliteration system that is old-school now. But there are people out there who still use COBOL; anyone up on this?

TeX code:

documentclass{article}
usepackage[arabic,greek,english]{babel}
begin{document}
The Arabic word for deaf is close to AR{ASm}, which has a strange connection 
to the mathematical term surd.
end{document}

Package babel Error: Unknown option `francais'

$
0
0

I recently updated my Operating system from Ubuntu 13.04 to Ubuntu 13.10.

Since then, I am facing difficulties compiling my tex code in which the french babel package is called. Please note that all my codes were working very fine before the system upgrade.

However, now, given the following header :

  usepackage[francais]{babel}

I receive the following error :

! Package babel Error: Unknown option `francais'. Either you misspelled it

What should I do ? Please note that if I remove this part of code (usepackage[francais]{babel}), everything is compiling good. I also tried it with french, and I receive the same result.

Thank you in advance for your help.


MINIMUM WORKING EXAMPLE :

documentclass[11pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[francais]{babel}
usepackage[T1]{fontenc}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}

begin{document}
This is a MINIMUM WORKING EXAMPLE.
end{document}
! Package babel Error: Unknow option `francais'. Either you misspelled it

Custom thebibliography with alphabetic numbering for scrltt2 not working in presence of babel

$
0
0

I want to use an alphabetically numbered bibliography in a letter class that does not provide bibliographies (scrlttr in my case, but the example provided below works with letter, too). Based on this answer I came up with a short piece of code that works very satisfyingly — until I load the babel package, which I also need.

My investigations show that babel seems to provide its own definition of @citex, and it is substantially different from plain LaTeX. Specifically, org@@citex seems to be the place where I would have to turn a number stored in the macro csname b@@citeb endcsname into an alphabetic digit using @Alph:

> @citex=macro:
[#1]#2->@safe@activestrue 
        edef @tempa {#2}@safe@activesfalse org@@citex [#1]{@tempa }.

and

> org@@citex=macro:
[#1]#2->leavevmode let @citea @empty 
        @cite {@for @citeb :=#2do {%
        @citea def @citea {,penalty @m  }%
        edef @citeb {expandafter @firstofone @citeb @empty }%
        if@filesw immediate write @auxout {string citation {@citeb }}fi
        @ifundefined {b@@citeb }%
          {hbox {reset@font bfseries ?}G@refundefinedtrue @latex@warning {Citation `@citeb ' on page thepage space undefined}}%
          {@cite@ofmt {csname b@@citeb endcsname }}%  <--- this is what I would like to modify, I think
        }}{#1}.

However, in contrast to plain LaTeX in the babel version this command does not just store a number, but it is preceeded by @safe@activesfalse and I do not understand how to get rid of that. For example, csname b@test1 endcsname contains:

> b@test1=macro:
->@safe@activesfalse 1.

For my purposes it should only contain 1.

I would like to know how to fix this, but also I’d appreciate input on how to make such a code more robust against the many things that other packages could do to it.

A minimal example is available through this gist and here:

documentclass{scrlttr2}

%% These two lines will break everything:
% usepackage[english,german]{babel}
% selectlanguage{english}

%% Some of the following taken from
%% http://tex.stackexchange.com/questions/18033/using-bibtex-with-letter-class
makeatletter
newenvironment{thebibliography}[1]
{list{@biblabel{@Alphc@enumiv}}%  LATIN LETTERS AS REFERENCES
  {settowidthlabelwidth{@biblabel{#1}}%
    leftmarginlabelwidth
    advanceleftmarginlabelsep
    usecounter{enumiv}%
    letp@enumiv@empty
    renewcommandtheenumiv{@Alphc@enumiv}}% SAME HERE
  sloppy
  clubpenalty4000
  @clubpenalty clubpenalty
  widowpenalty4000%
  sfcode`.@m}
{def@noitemerr
  {@latex@warning{Empty `thebibliography' environment}}%
  endlist}
newcommandnewblock{hskip .11em@plus.33em@minus.07em}
letbibsectionrelax
defsection*#1{relax}
def@citex[#1]#2{leavevmode 
  let @citea @empty @cite {%
    @for @citeb :=#2do {%
      @citea def @citea {,penalty @m  }%
      edef @citeb {expandafter @firstofone @citeb @empty }%
      if@filesw immediate write @auxout {string citation {@citeb }}fi%
      @ifundefined {b@@citeb }%
      {hbox {reset@font bfseries ?}G@refundefinedtrue @latex@warning {Citation `@citeb ' on page thepage space undefined}}%
      {@cite@ofmt {expandafter@Alphcsname b@@citeb endcsname }}%
    }%
  }%
  {#1}%
}
makeatother

bibliographystyle{unsrt}
begin{document}
begin{letter}{TeX.SE}

  opening{Hello,}

  When writing scientific reports I like to refer to the references in
  the main document using the citation style that has been used
  there. Sometimes I need to mention additional references, and for
  those I like to use capital latin characters to number them. Of
  course I rely on BibTeX when writing reports. 

  Thus, I like to cite cite{test1} and cite{test2} separately, but
  also cite{test1,test2}. This all works just fine, as long as I do
  not include the babel package.

  How can I make commands defined above more robust?

  vspace{2cm}
  noindent References:

  begin{thebibliography}{A}
  bibitem{test1} First reference.
  bibitem{test2} Second reference.
  end{thebibliography}

end{letter}
end{document}

Set hyphenation with polyglossia

$
0
0

If babel doesn’t know how to hyphenate a word, I can inform it of good line breaks with babelhyphenation:

documentclass{article}
usepackage[nynorsk]{babel}
    babelhyphenation[nynorsk]{fram-halds-skulen}
begin{document}
framhaldsskulen
end{document}

But how do I do this with polyglossia? The documentation doesn’t say anything about it. babelhyphenation obviously doesn’t work:

documentclass{article}
usepackage{polyglossia}
    setdefaultlanguage{nynorsk}
    babelhyphenation[nynorsk]{fram-halds-skulen}
begin{document}
framhaldsskulen
end{document}

! Undefined control sequence.
l.4 ^^Ibabelhyphenation
                        [nynorsk]{fram-halds-skulen}
? 

problems finding correct language.dat

$
0
0

I have installed the portable version of miktex 2.9 on a pc without administrator rights. I try to use the package dutch babel, but it gives the common error of

Package babel Warning: No hyphenation patterns were loaded for (label) the language 'Dutch' (babel) I will use the patterns loaded for language=0 instead.

MWE:

documentclass{article}
usepackage[dutch]{babel}
begin{document}
Doesn't work with or without text.
end{document}

I searched for all language.dat files on my external hard drive AND my pc and placed the line ‘dutch nehyph.tex’, ‘dutch nehyph2.tex’ (found that in another language.dat file) in it, but it keeps giving the error.

If I try to check the box for the language via the MiKTeX options, it says:

This language is not yet available
Viewing all 75 articles
Browse latest View live