PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : bestehende Guillemets ändern ersetzen



lycopus
13-03-2011, 11:06
Hallo Zusammen,

wie wandle ich Anführungs-/Endzeichen der Art " " aus einer Sammlung bestehender Dateien im Format txt, in einer späteren tex-Datei bzw. der pdf-Ausgabe in » « Anführungs-/Endzeichen um ohne den Befehl suchen und ersetzen.


Ich hab gelesen csquotes kann dies. Wie ist mir aber ein Rätsel. Denn wenn ich csquotes in der Präambel einbinde, muss ich ja im Textbereich den Befehl \enquote{} verwenden, also das Zitat in die geschweifte Klammer setzen. Aber in den txt-Dateien fehlen ja gerade diese Befehle.
Um es noch besser auszudrücken: Wenn ich txt Dateien die Endung tex gebe oder aus txt Dateien text per cpoy and paste in eine tex Datei einfüge fehlt ja dann dieser Befehl \enquote{} und müsste sehr umständlich händisch eingefügt werden.


Meine Denkweis war aber eher die, dass der LATEX-Editor egal ob in der txt Datei " " oder » « verwendet worden sind, diese Zeichen automatisch erkennt und anhand den Vorgaben in der Präambel das pdf Dokument korrekt ausgibt. Also im Falle von

\usepackage[ngerman]{babel}
\usepackage[babel,german=guillemets]{csquotes}

werden automatisch die » « erzeugt.

Rumpfdaten: Ich verwende Debian-Lenny, Texmaker oder EMACS. TeX, Version 3.141592 (Web2C 7.5.6), Texlive2010 also eigentlich alles uptodate :-)

Danke schonmal für Eure Hilfe



Minimalbeispiel:
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[babel,german=guillemets]{csquotes}
%um z.B. »« zu erzeugen oder diese schnell wieder rauszuschmeisen und durch andere zu ersetzen.

\begin{document}

1. Texteingabe über LATEX-Editor: \enquote{Zitat blahblah...} ergibt das gewünschte Ergebnis\\

2. Texteingabe per copy and paste aus bestehender txt Datei: "Zitat blahblah..." wandelt nicht in »« um.

\end{document}

mechanicus
13-03-2011, 11:17
Meine Denkweis war aber eher die, dass der LATEX-Editor egal ob in der txt Datei " " oder » « verwendet worden sind, diese Zeichen automatisch erkennt und anhand den Vorgaben in der Präambel das pdf Dokument korrekt ausgibt.
Das halte ich für nicht möglich. LaTeX weiß ja gar nicht, welches Zeichen die Öffnung bzw. die Schließung symbolisiert. Du kannst also m.M.n. nur die txt-Dateien modifizieren:


%Minimalbeispiel:
\documentclass[11pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[babel,german=guillemets]{csquotes}
\defineshorthand{"`}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}


%um z.B. »« zu erzeugen oder diese schnell wieder rauszuschmeisen und durch andere zu ersetzen.

\begin{document}

1. Texteingabe über LATEX-Editor: \enquote{Zitat blahblah...} ergibt das gewünschte Ergebnis\\

2. Texteingabe per copy and paste aus bestehender txt Datei: "`Zitat blahblah..."' wandelt nicht in »« um.

\end{document}

Siehe hierzu csquotes-Doku S.28.

Gruß
Marco

lycopus
13-03-2011, 13:30
Das halte ich für nicht möglich. LaTeX weiß ja gar nicht, welches Zeichen die Öffnung bzw. die Schließung symbolisiert. Du kannst also m.M.n. nur die txt-Dateien modifizieren:

Latex nicht, aber möglicherweise ein Editor wie EMACS.
Vielleicht muss ich mich mal ergänzend an ein EMACS-Forum wenden. Ich bin da noch nicht so fit.

Mit dem Minimalbeispiel und

\defineshorthand{"`}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}

komme ich leider nicht weiter. Wirft Fehler aus....



This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdflatex 2011.1.3) 13 MAR 2011 14:13
entering extended mode
%&-line parsing enabled.
**test11.tex
(./test11.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, croatian, ukrainian, russian, bulgarian, czech, slovak, danish, dut
ch, finnish, basque, french, german, ngerman, ibycus, greek, monogreek, ancient
greek, hungarian, italian, latin, mongolian, norsk, icelandic, interlingua, tur
kish, coptic, romanian, welsh, serbian, slovenian, estonian, esperanto, upperso
rbian, indonesian, polish, portuguese, spanish, catalan, galician, swedish, loa
ded.
(/usr/share/texmf-texlive/tex/latex/base/report.cls
Document Class: report 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size11.clo
File: size11.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-texlive/tex/latex/base/inputenc.sty
Package: inputenc 2006/05/05 v1.1b Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15

(/usr/share/texmf-texlive/tex/latex/base/utf8.def
File: utf8.def 2006/03/30 v1.1i UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encodingT1

(/usr/share/texmf-texlive/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
.......ing Unicode char U+2031 (decimal 8241)
defining Unicode char U+2039 (decimal 8249)
defining Unicode char U+203A (decimal 8250)
defining Unicode char U+2423 (decimal 9251)
)
Now handling font encoding OT1 ...
... processing UTF-8 mapping file for font encodingOT1

(/usr/share/texmf-texlive/tex/latex/base/ot1enc.dfu
File: ot1enc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
defining Unicode char U+00A1 (decimal 161)
defining Unicode char U+00A3 (decimal 163)
defining Unicode char U+00B8 (decimal 184)
defining Unicode char U+00BF (decimal 191)
defining Unicode char U+00C5 (decimal 197)
defining Unicode char U+00C6 (decimal 198)
defining Unicode char U+00D8 (decimal 216)
defining Unicode char U+00DF (decimal 223)
defining Unicode char U+00E6 (decimal 230)
defining Unicode char U+00EC (decimal 236)
defining Unicode char U+00ED (decimal 237)
defining Unicode char U+00EE (decimal 238)
defining Unicode char U+00EF (decimal 239)
defining Unicode char U+00F8 (decimal 248)
defining Unicode char U+0131 (decimal 305)
defining Unicode char U+0141 (decimal 321)
defining Unicode char U+0142 (decimal 322)
defining Unicode char U+0152 (decimal 338)
defining Unicode char U+0153 (decimal 339)
defining Unicode char U+2013 (decimal 8211)
defining Unicode char U+2014 (decimal 8212)
defining Unicode char U+2018 (decimal 8216)
defining Unicode char U+2019 (decimal 8217)
defining Unicode char U+201C (decimal 8220)
defining Unicode char U+201D (decimal 8221)
)
Now handling font encoding OMS ...
... processing UTF-8 mapping file for font encodingOMS

(/usr/share/texmf-texlive/tex/latex/base/omsenc.dfu
File: omsenc.dfu 2006/03/30 v1.1i UTF-8 support for inputenc
defining Unicode char U+00A7 (decimal 167)
defining Unicode char U+00B6 (decimal 182)
defining Unicode char U+00B7 (decimal 183)
defining Unicode char U+2020 (decimal 8224)
defining Unicode char U+2021 (decimal 8225)
defining Unicode char U+2022 (decimal 8226)
)
Now handling font encoding OMX ...
... no UTF-8 mapping file for font encoding OMX
Now handling font encoding U ...
... no UTF-8 mapping file for font encoding U
defining Unicode char U+00A9 (decimal 169)
defining Unicode char U+00AA (decimal 170)
defining Unicode char U+00AE (decimal 174)
defining Unicode char U+00BA (decimal 186)
defining Unicode char U+02C6 (decimal 710)
defining Unicode char U+02DC (decimal 732)
defining Unicode char U+200C (decimal 8204)
defining Unicode char U+2026 (decimal 8230)
defining Unicode char U+2122 (decimal 8482)
defining Unicode char U+2423 (decimal 9251)
))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package

(/usr/share/texmf-texlive/tex/latex/base/t1enc.def
File: t1enc.def 2005/09/27 v1.99g Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 43.
))
(/usr/share/texmf-texlive/tex/generic/babel/babel.sty
Package: babel 2005/11/23 v3.8h The Babel package

(/usr/share/texmf-texlive/tex/generic/babel/ngermanb.ldf
Language: ngermanb 2004/02/20 v2.6m new German support from the babel system

(/usr/share/texmf-texlive/tex/generic/babel/babel.def
File: babel.def 2005/11/23 v3.8h Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
)
\l@naustrian = a dialect from \language\l@ngerman
Package babel Info: Making " an active character on input line 92.
))
(/usr/share/texmf-texlive/tex/latex/csquotes/csquotes.sty
Package: csquotes 2006/11/09 v3.6 Quotation facilities

(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks16
)
\csq@gtype=\count89
\csq@glevel=\count90
\csq@qlevel=\count91
\csq@lastsf=\count92
\csq@tshold=\count93
\csq@ltxeverypar=\toks17
Package csquotes Info: Trying to load configuration file `csquotes.cfg'...
Package csquotes Info: ... configuration file loaded successfully.

(/usr/share/texmf-texlive/tex/latex/csquotes/csquotes.cfg
File: csquotes.cfg 2006/11/09 v3.6 Quotation configuration
)
Package csquotes Info: Enabling multilingual support.
Package csquotes Info: Redefining alias `german' -> `german/guillemets'.
) (./test11.aux)
\openout1 = `test11.aux'.

LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.

Underfull \hbox (badness 10000) in paragraph at lines 15--16

[]

! Undefined control sequence.
\user@sh@"@`@ ->\openautoquote

l.17 ...py and paste aus bestehender txt Datei: "`
Zitat blahblah..."' wandel...
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., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\user@sh@"@'@ ->\closeautoquote

l.17 ...stehender txt Datei: "`Zitat blahblah..."'
wandelt nicht in »« um.
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., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

[1

{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./test11.aux) )
Here is how much of TeX's memory you used:
1476 strings out of 94101
17326 string characters out of 1165811
72958 words of memory out of 1500000
4797 multiletter control sequences out of 10000+50000
4709 words of font info for 16 fonts, out of 1200000 for 2000
637 hyphenation exceptions out of 8191
24i,4n,25p,208b,127s stack positions out of 5000i,500n,6000p,200000b,5000s
</home/ka
rlheinz/.texmf-var/fonts/pk/ljfour/jknappen/ec/ecrm1095.600pk>
Output written on test11.pdf (1 page, 13124 bytes).
PDF statistics:
45 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 131072)
1 words of extra memory for PDF output out of 10000 (max. 10000000)

rais
13-03-2011, 18:53
Moin moin,


Mit dem Minimalbeispiel und

\defineshorthand{"`}{\openautoquote}
\defineshorthand{"'}{\closeautoquote}

komme ich leider nicht weiter. Wirft Fehler aus....

das sieht ja ziemlich alt aus:p


*File List*
report.cls 2007/10/19 v1.4h Standard LaTeX document class
size11.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
inputenc.sty 2008/03/30 v1.1d 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
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
babel.sty 2008/07/06 v3.8l The Babel package
ngermanb.ldf 2008/07/06 v2.6n new German support from the babel system
csquotes.sty 2011/01/20 v5.1b context-sensitive quotations
etoolbox.sty 2011/01/03 v2.1 e-TeX tools for LaTeX
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
csquotes.def 2011/01/20 v5.1b csquotes generic definitions
csquotes.cfg
***********

(so eine File List bekommst Du in Deiner .log-Datei mit \listfiles z. B. vor \documentclass)

MfG