The required the introduction of the new converter token $$e, that holds
the iconv name of the latex file encoding.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35772
a592a061-630c-0410-9148-
cb99ea01b6c8
rc_entry = [r'''\converter literate latex "%%" ""
\converter literate pdflatex "%%" ""'''])
#
rc_entry = [r'''\converter literate latex "%%" ""
\converter literate pdflatex "%%" ""'''])
#
- checkProg('a Sweave -> LaTeX converter', ['Rscript --vanilla $$s/scripts/lyxsweave.R $$i'],
+ checkProg('a Sweave -> LaTeX converter', ['Rscript --vanilla $$s/scripts/lyxsweave.R $$i $$e'],
rc_entry = [r'''\converter sweave latex "%%" ""
\converter sweave pdflatex "%%" ""'''])
#
rc_entry = [r'''\converter sweave latex "%%" ""
\converter sweave pdflatex "%%" ""'''])
#
\papercolumns 1
\papersides 2
\paperpagestyle headings
\papercolumns 1
\papersides 2
\paperpagestyle headings
\output_changes false
\html_math_output 0
\html_be_strict true
\output_changes false
\html_math_output 0
\html_be_strict true
+\author 1 "Jean-Marc Lasgouttes"
\end_inset
The path to the original input file (this is different from $$p when a
\end_inset
The path to the original input file (this is different from $$p when a
- chain of converters is called).
+ chain of converters is called)
+\change_deleted 1 1287732759
+.
+\change_inserted 1 1287732721
+
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+
+\change_inserted 1 1287732753
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 1 1287732729
+$$e
+\end_layout
+
+\end_inset
+
+ The iconv name for the encoding of the document.
\end_layout
\begin_layout Standard
\end_layout
\begin_layout Standard
# Wrapper around Sweave that sets up some things for LyX
# argument 1 is the file name
# Wrapper around Sweave that sets up some things for LyX
# argument 1 is the file name
+# argument 2 is the iconv name for the encoding of the file
-args <- commandArgs(trailingOnly=T)
+ls.args <- commandArgs(trailingOnly=T)
# check whether Sweave.sty is seen by LaTeX
# check whether Sweave.sty is seen by LaTeX
-sweavesty <- system("kpsewhich Sweave.sty", intern=T, ignore.stderr=T)
-sp <- (length(sweavesty) == 0)
+ls.sweavesty <- system("kpsewhich Sweave.sty", intern=T, ignore.stderr=T)
+ls.sp <- (length(ls.sweavesty) == 0)
-Sweave(args[1], stylepath=sp)
+# set default encoding to the one of the file
+options(encoding=ls.args[2])
+
+#run sweave
+Sweave(ls.args[1], stylepath=ls.sp)
-#include "ConverterCache.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "BufferParams.h"
+#include "ConverterCache.h"
+#include "Encoding.h"
#include "ErrorList.h"
#include "Format.h"
#include "Language.h"
#include "ErrorList.h"
#include "Format.h"
#include "Language.h"
string const token_to("$$o");
string const token_path("$$p");
string const token_orig_path("$$r");
string const token_to("$$o");
string const token_path("$$p");
string const token_orig_path("$$r");
+string const token_encoding("$$e");
string const add_options(string const & command, string const & options)
string const add_options(string const & command, string const & options)
// used anyway.
OutputParams runparams(buffer ? &buffer->params().encoding() : 0);
runparams.flavor = getFlavor(edgepath);
// used anyway.
OutputParams runparams(buffer ? &buffer->params().encoding() : 0);
runparams.flavor = getFlavor(edgepath);
if (buffer) {
runparams.use_japanese = buffer->bufferFormat() == "platex";
runparams.use_indices = buffer->params().use_indices;
if (buffer) {
runparams.use_japanese = buffer->bufferFormat() == "platex";
runparams.use_indices = buffer->params().use_indices;
to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
to_utf8(makeRelPath(from_utf8(infile.absFileName()), from_utf8(path)));
- string const outfile2 =
+ string const outfile2 =
to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
string command = conv.command;
to_utf8(makeRelPath(from_utf8(outfile.absFileName()), from_utf8(path)));
string command = conv.command;
command = subst(command, token_to, quoteName(outfile2));
command = subst(command, token_path, quoteName(infile.onlyPath().absFileName()));
command = subst(command, token_orig_path, quoteName(orig_from.onlyPath().absFileName()));
command = subst(command, token_to, quoteName(outfile2));
command = subst(command, token_path, quoteName(infile.onlyPath().absFileName()));
command = subst(command, token_orig_path, quoteName(orig_from.onlyPath().absFileName()));
+ command = subst(command, token_encoding, buffer ? buffer->params().encoding().iconvName() : string());
command = libScriptSearch(command);
if (!conv.parselog.empty())
command = libScriptSearch(command);
if (!conv.parselog.empty())