mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Remove space at end of line, when superfluous.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8953 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
aa48351c52
commit
f17505a8fb
@ -1,3 +1,10 @@
|
|||||||
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* lyx_1_4.lyx (convert_comment, convert_breaks, convert_frameless_box):
|
||||||
|
(convert_names, add_begin_body, strip_end_space): use the same policy
|
||||||
|
of lyx of not using spaces as the last character in a line that starts
|
||||||
|
with a command token (\xxxxx).
|
||||||
|
|
||||||
2004-08-15 José Matos <jamatos@lyx.org>
|
2004-08-15 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
* lyx_1_4.py (normalize_papersize, denormalize_papersize):
|
* lyx_1_4.py (normalize_papersize, denormalize_papersize):
|
||||||
|
@ -194,7 +194,7 @@ def convert_comment(lines):
|
|||||||
i = find_token(lines, "\\layout", i)
|
i = find_token(lines, "\\layout", i)
|
||||||
if i == -1:
|
if i == -1:
|
||||||
i = len(lines) - 1
|
i = len(lines) - 1
|
||||||
lines[i:i] = ["\\end_inset ","",""]
|
lines[i:i] = ["\\end_inset","",""]
|
||||||
return
|
return
|
||||||
|
|
||||||
j = find_token(lines, '\\begin_deeper', old_i, i)
|
j = find_token(lines, '\\begin_deeper', old_i, i)
|
||||||
@ -211,7 +211,7 @@ def convert_comment(lines):
|
|||||||
#but if this happens deal with it greacefully adding
|
#but if this happens deal with it greacefully adding
|
||||||
#the missing \end_deeper.
|
#the missing \end_deeper.
|
||||||
i = len(lines) - 1
|
i = len(lines) - 1
|
||||||
lines[i:i] = ["\end_deeper","","","\\end_inset ","",""]
|
lines[i:i] = ["\end_deeper","","","\\end_inset","",""]
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
del lines[i]
|
del lines[i]
|
||||||
@ -225,7 +225,7 @@ def convert_comment(lines):
|
|||||||
#but if this happens deal with it greacefully adding
|
#but if this happens deal with it greacefully adding
|
||||||
#the missing \end_inset.
|
#the missing \end_inset.
|
||||||
i = len(lines) - 1
|
i = len(lines) - 1
|
||||||
lines[i:i] = ["\\end_inset ","","","\\end_inset ","",""]
|
lines[i:i] = ["\\end_inset","","","\\end_inset","",""]
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
i = i + 1
|
i = i + 1
|
||||||
@ -525,7 +525,7 @@ def convert_breaks(lines):
|
|||||||
paragraph_above.extend(['\\newpage ',''])
|
paragraph_above.extend(['\\newpage ',''])
|
||||||
|
|
||||||
if vspace_top != -1:
|
if vspace_top != -1:
|
||||||
paragraph_above.extend(['\\begin_inset VSpace ' + vspace_top_value,'\\end_inset ','',''])
|
paragraph_above.extend(['\\begin_inset VSpace ' + vspace_top_value,'\\end_inset','',''])
|
||||||
|
|
||||||
if line_top != -1:
|
if line_top != -1:
|
||||||
paragraph_above.extend(['\\lyxline ',''])
|
paragraph_above.extend(['\\lyxline ',''])
|
||||||
@ -550,7 +550,7 @@ def convert_breaks(lines):
|
|||||||
paragraph_bellow.extend(['\\lyxline ',''])
|
paragraph_bellow.extend(['\\lyxline ',''])
|
||||||
|
|
||||||
if vspace_bot != -1:
|
if vspace_bot != -1:
|
||||||
paragraph_bellow.extend(['\\begin_inset VSpace ' + vspace_bot_value,'\\end_inset ','',''])
|
paragraph_bellow.extend(['\\begin_inset VSpace ' + vspace_bot_value,'\\end_inset','',''])
|
||||||
|
|
||||||
if pb_bot != -1:
|
if pb_bot != -1:
|
||||||
paragraph_bellow.extend(['\\newpage ',''])
|
paragraph_bellow.extend(['\\newpage ',''])
|
||||||
@ -1037,7 +1037,7 @@ def convert_frameless_box(lines, opt):
|
|||||||
else:
|
else:
|
||||||
lines[i] = lines[i] + '}'
|
lines[i] = lines[i] + '}'
|
||||||
i = i + 1
|
i = i + 1
|
||||||
lines[i:i] = ['', '\\end_inset ']
|
lines[i:i] = ['', '\\end_inset']
|
||||||
i = i + 2
|
i = i + 2
|
||||||
j = find_end_of_inset(lines, i)
|
j = find_end_of_inset(lines, i)
|
||||||
if j == -1:
|
if j == -1:
|
||||||
@ -1249,7 +1249,7 @@ def convert_names(lines, opt):
|
|||||||
"%s" % firstname,
|
"%s" % firstname,
|
||||||
"\end_layout",
|
"\end_layout",
|
||||||
"",
|
"",
|
||||||
"\end_inset ",
|
"\end_inset",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"\\begin_inset CharStyle Surname",
|
"\\begin_inset CharStyle Surname",
|
||||||
@ -1260,7 +1260,7 @@ def convert_names(lines, opt):
|
|||||||
"%s" % surname,
|
"%s" % surname,
|
||||||
"\\end_layout",
|
"\\end_layout",
|
||||||
"",
|
"",
|
||||||
"\\end_inset ",
|
"\\end_inset",
|
||||||
""]
|
""]
|
||||||
|
|
||||||
|
|
||||||
@ -1419,10 +1419,10 @@ def add_begin_header(header, opt):
|
|||||||
|
|
||||||
|
|
||||||
def remove_begin_header(header, opt):
|
def remove_begin_header(header, opt):
|
||||||
i = find_token(header, "\\begin_header", 0)
|
i = find_token(header, "\\begin_document", 0)
|
||||||
if i != -1:
|
if i != -1:
|
||||||
del header[i]
|
del header[i]
|
||||||
i = find_token(header, "\\begin_document", 0)
|
i = find_token(header, "\\begin_header", 0)
|
||||||
if i != -1:
|
if i != -1:
|
||||||
del header[i]
|
del header[i]
|
||||||
|
|
||||||
@ -1432,6 +1432,7 @@ def remove_begin_header(header, opt):
|
|||||||
#
|
#
|
||||||
def add_begin_body(body, opt):
|
def add_begin_body(body, opt):
|
||||||
body.insert(0, '\\begin_body')
|
body.insert(0, '\\begin_body')
|
||||||
|
body.insert(1, '')
|
||||||
i = find_token(body, "\\end_document", 0)
|
i = find_token(body, "\\end_document", 0)
|
||||||
body.insert(i, '\\end_body')
|
body.insert(i, '\\end_body')
|
||||||
|
|
||||||
@ -1439,6 +1440,8 @@ def remove_begin_body(body, opt):
|
|||||||
i = find_token(body, "\\begin_body", 0)
|
i = find_token(body, "\\begin_body", 0)
|
||||||
if i != -1:
|
if i != -1:
|
||||||
del body[i]
|
del body[i]
|
||||||
|
if not body[i]:
|
||||||
|
del body[i]
|
||||||
i = find_token(body, "\\end_body", 0)
|
i = find_token(body, "\\end_body", 0)
|
||||||
if i != -1:
|
if i != -1:
|
||||||
del body[i]
|
del body[i]
|
||||||
@ -1470,6 +1473,15 @@ def denormalize_papersize(header):
|
|||||||
header[i] = '\\papersize Custom'
|
header[i] = '\\papersize Custom'
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# Strip spaces at end of command line
|
||||||
|
#
|
||||||
|
def strip_end_space(body):
|
||||||
|
for i in range(len(body)):
|
||||||
|
if body[i][:1] == '\\':
|
||||||
|
body[i] = strip(body[i])
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Convertion hub
|
# Convertion hub
|
||||||
#
|
#
|
||||||
@ -1556,6 +1568,7 @@ def convert(file):
|
|||||||
add_begin_header(file.header, file)
|
add_begin_header(file.header, file)
|
||||||
add_begin_body(file.body, file)
|
add_begin_body(file.body, file)
|
||||||
normalize_papersize(file.header)
|
normalize_papersize(file.header)
|
||||||
|
strip_end_space(file.body)
|
||||||
file.format = 236
|
file.format = 236
|
||||||
|
|
||||||
def revert(file):
|
def revert(file):
|
||||||
@ -1638,7 +1651,7 @@ def revert(file):
|
|||||||
revert_spaces(file.body)
|
revert_spaces(file.body)
|
||||||
revert_bibtex(file.body)
|
revert_bibtex(file.body)
|
||||||
rm_tracking_changes(file.header)
|
rm_tracking_changes(file.header)
|
||||||
rm_file.body_changes(file.body)
|
rm_body_changes(file.body)
|
||||||
file.format = 221
|
file.format = 221
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* ParagraphParameters.C (write):
|
||||||
|
* Spacing.C (writeFile):
|
||||||
|
* bufferparams.C (writeLaTeX):
|
||||||
|
* lyx_cb.C (Reconfigure):
|
||||||
|
* paragraph.C (write):
|
||||||
|
* tabular.C (write): remove unnecessary space at end of line.
|
||||||
|
|
||||||
|
|
||||||
2004-08-16 José Matos <jamatos@lyx.org>
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
* text.C (readParagraph): remove debug message.
|
* text.C (readParagraph): remove debug message.
|
||||||
|
@ -225,25 +225,27 @@ void ParagraphParameters::read(LyXLex & lex)
|
|||||||
|
|
||||||
void ParagraphParameters::write(ostream & os) const
|
void ParagraphParameters::write(ostream & os) const
|
||||||
{
|
{
|
||||||
|
ostringstream oss;
|
||||||
|
|
||||||
// Maybe the paragraph has special spacing
|
// Maybe the paragraph has special spacing
|
||||||
spacing().writeFile(os, true);
|
spacing().writeFile(oss, true);
|
||||||
|
|
||||||
// The labelwidth string used in lists.
|
// The labelwidth string used in lists.
|
||||||
if (!labelWidthString().empty())
|
if (!labelWidthString().empty())
|
||||||
os << "\\labelwidthstring "
|
oss << "\\labelwidthstring "
|
||||||
<< labelWidthString() << '\n';
|
<< labelWidthString() << '\n';
|
||||||
|
|
||||||
// Start of appendix?
|
// Start of appendix?
|
||||||
if (startOfAppendix())
|
if (startOfAppendix())
|
||||||
os << "\\start_of_appendix ";
|
oss << "\\start_of_appendix ";
|
||||||
|
|
||||||
// Noindent?
|
// Noindent?
|
||||||
if (noindent())
|
if (noindent())
|
||||||
os << "\\noindent ";
|
oss << "\\noindent ";
|
||||||
|
|
||||||
// Do we have a manual left indent?
|
// Do we have a manual left indent?
|
||||||
if (!leftIndent().zero())
|
if (!leftIndent().zero())
|
||||||
os << "\\leftindent " << leftIndent().asString()
|
oss << "\\leftindent " << leftIndent().asString()
|
||||||
<< ' ';
|
<< ' ';
|
||||||
|
|
||||||
// Alignment?
|
// Alignment?
|
||||||
@ -255,8 +257,9 @@ void ParagraphParameters::write(ostream & os) const
|
|||||||
case LYX_ALIGN_CENTER: h = 3; break;
|
case LYX_ALIGN_CENTER: h = 3; break;
|
||||||
default: h = 0; break;
|
default: h = 0; break;
|
||||||
}
|
}
|
||||||
os << "\\align " << string_align[h] << ' ';
|
oss << "\\align " << string_align[h] << ' ';
|
||||||
}
|
}
|
||||||
|
os << rtrim(oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,9 +72,9 @@ void Spacing::writeFile(ostream & os, bool para) const
|
|||||||
os.setf(ios::showpoint|ios::fixed);
|
os.setf(ios::showpoint|ios::fixed);
|
||||||
os.precision(2);
|
os.precision(2);
|
||||||
os << cmd << spacing_string[getSpace()]
|
os << cmd << spacing_string[getSpace()]
|
||||||
<< ' ' << getValue() << " \n";
|
<< ' ' << getValue() << "\n";
|
||||||
} else {
|
} else {
|
||||||
os << cmd << spacing_string[getSpace()] << " \n";
|
os << cmd << spacing_string[getSpace()] << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,7 +792,7 @@ bool Buffer::do_writeFile(ostream & ofs) const
|
|||||||
<< "\\begin_document\n";
|
<< "\\begin_document\n";
|
||||||
|
|
||||||
// now write out the buffer parameters.
|
// now write out the buffer parameters.
|
||||||
ofs << "\n\\begin_header\n";
|
ofs << "\\begin_header\n";
|
||||||
params().writeFile(ofs);
|
params().writeFile(ofs);
|
||||||
ofs << "\\end_header\n";
|
ofs << "\\end_header\n";
|
||||||
|
|
||||||
|
@ -1005,7 +1005,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
|
|||||||
"\\dvipost{osstart color push Red}\n"
|
"\\dvipost{osstart color push Red}\n"
|
||||||
"\\dvipost{osend color pop}\n"
|
"\\dvipost{osend color pop}\n"
|
||||||
"\\dvipost{cbstart color push Blue}\n"
|
"\\dvipost{cbstart color push Blue}\n"
|
||||||
"\\dvipost{cbend color pop} \n";
|
"\\dvipost{cbend color pop}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
int const nlines =
|
int const nlines =
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* PreviewLoader.C (Impl::startLoading): remove space at end of line.
|
||||||
|
|
||||||
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
|
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
|
||||||
|
|
||||||
* pch.h: new file
|
* pch.h: new file
|
||||||
|
@ -510,7 +510,7 @@ void PreviewLoader::Impl::startLoading()
|
|||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()\n"
|
lyxerr[Debug::GRAPHICS] << "PreviewLoader::startLoading()\n"
|
||||||
<< "Unable to start process \n"
|
<< "Unable to start process\n"
|
||||||
<< command << endl;
|
<< command << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* insethfill.C (write):
|
||||||
|
* insetline.C (write):
|
||||||
|
* insetnewline.C (write):
|
||||||
|
* insetpagebreak.C (write): remove space at end of line.
|
||||||
|
|
||||||
2004-08-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
2004-08-16 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
* insettabular.C (plaintext): do not use ownerPar to get the
|
* insettabular.C (plaintext): do not use ownerPar to get the
|
||||||
|
@ -77,7 +77,7 @@ int InsetHFill::docbook(Buffer const &, std::ostream & os,
|
|||||||
|
|
||||||
void InsetHFill::write(Buffer const &, ostream & os) const
|
void InsetHFill::write(Buffer const &, ostream & os) const
|
||||||
{
|
{
|
||||||
os << "\n\\hfill \n";
|
os << "\n\\hfill\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ void InsetLine::read(Buffer const &, LyXLex &)
|
|||||||
|
|
||||||
void InsetLine::write(Buffer const &, ostream & os) const
|
void InsetLine::write(Buffer const &, ostream & os) const
|
||||||
{
|
{
|
||||||
os << "\n\\lyxline \n";
|
os << "\n\\lyxline\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ void InsetNewline::read(Buffer const &, LyXLex &)
|
|||||||
|
|
||||||
void InsetNewline::write(Buffer const &, ostream & os) const
|
void InsetNewline::write(Buffer const &, ostream & os) const
|
||||||
{
|
{
|
||||||
os << "\n\\newline \n";
|
os << "\n\\newline\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ void InsetPagebreak::read(Buffer const &, LyXLex &)
|
|||||||
|
|
||||||
void InsetPagebreak::write(Buffer const &, ostream & os) const
|
void InsetPagebreak::write(Buffer const &, ostream & os) const
|
||||||
{
|
{
|
||||||
os << "\n\\newpage \n";
|
os << "\n\\newpage\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -453,6 +453,6 @@ void Reconfigure(BufferView * bv)
|
|||||||
|
|
||||||
Alert::information(_("System reconfigured"),
|
Alert::information(_("System reconfigured"),
|
||||||
_("The system has been reconfigured.\n"
|
_("The system has been reconfigured.\n"
|
||||||
"You need to restart LyX to make use of any \n"
|
"You need to restart LyX to make use of any\n"
|
||||||
"updated document class specifications."));
|
"updated document class specifications."));
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2004-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* formulamacro.C (write):
|
||||||
|
* math_macrotemplate.C (write): remove space at end of line.
|
||||||
|
|
||||||
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
|
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
|
||||||
|
|
||||||
* pch.h: new file
|
* pch.h: new file
|
||||||
|
@ -69,7 +69,7 @@ auto_ptr<InsetBase> InsetFormulaMacro::clone() const
|
|||||||
|
|
||||||
void InsetFormulaMacro::write(Buffer const &, ostream & os) const
|
void InsetFormulaMacro::write(Buffer const &, ostream & os) const
|
||||||
{
|
{
|
||||||
os << "FormulaMacro ";
|
os << "FormulaMacro\n";
|
||||||
WriteStream wi(os, false, false);
|
WriteStream wi(os, false, false);
|
||||||
tmpl()->write(wi);
|
tmpl()->write(wi);
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ void MathMacroTemplate::read(Buffer const &, LyXLex & lex)
|
|||||||
void MathMacroTemplate::write(Buffer const &, std::ostream & os) const
|
void MathMacroTemplate::write(Buffer const &, std::ostream & os) const
|
||||||
{
|
{
|
||||||
WriteStream wi(os, false, false);
|
WriteStream wi(os, false, false);
|
||||||
os << "FormulaMacro ";
|
os << "FormulaMacro\n";
|
||||||
write(wi);
|
write(wi);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,12 +180,12 @@ void MathMacroTemplate::write(Buffer const &, std::ostream & os) const
|
|||||||
void MathMacroTemplate::write(WriteStream & os) const
|
void MathMacroTemplate::write(WriteStream & os) const
|
||||||
{
|
{
|
||||||
if (type_ == "def") {
|
if (type_ == "def") {
|
||||||
os << "\n\\def\\" << name_.c_str();
|
os << "\\def\\" << name_.c_str();
|
||||||
for (int i = 1; i <= numargs_; ++i)
|
for (int i = 1; i <= numargs_; ++i)
|
||||||
os << '#' << i;
|
os << '#' << i;
|
||||||
} else {
|
} else {
|
||||||
// newcommand or renewcommand
|
// newcommand or renewcommand
|
||||||
os << "\n\\" << type_.c_str() << "{\\" << name_.c_str() << '}';
|
os << "\\" << type_.c_str() << "{\\" << name_.c_str() << '}';
|
||||||
if (numargs_ > 0)
|
if (numargs_ > 0)
|
||||||
os << '[' << numargs_ << ']';
|
os << '[' << numargs_ << ']';
|
||||||
}
|
}
|
||||||
|
@ -138,12 +138,12 @@ void Paragraph::write(Buffer const & buf, ostream & os,
|
|||||||
if (dth != params().depth()) {
|
if (dth != params().depth()) {
|
||||||
if (params().depth() > dth) {
|
if (params().depth() > dth) {
|
||||||
while (params().depth() > dth) {
|
while (params().depth() > dth) {
|
||||||
os << "\n\\begin_deeper ";
|
os << "\n\\begin_deeper";
|
||||||
++dth;
|
++dth;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while (params().depth() < dth) {
|
while (params().depth() < dth) {
|
||||||
os << "\n\\end_deeper ";
|
os << "\n\\end_deeper";
|
||||||
--dth;
|
--dth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,13 +192,13 @@ void Paragraph::write(Buffer const & buf, ostream & os,
|
|||||||
} else {
|
} else {
|
||||||
os << "\n\\begin_inset ";
|
os << "\n\\begin_inset ";
|
||||||
inset->write(buf, os);
|
inset->write(buf, os);
|
||||||
os << "\n\\end_inset \n\n";
|
os << "\n\\end_inset\n\n";
|
||||||
column = 0;
|
column = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
os << "\n\\backslash \n";
|
os << "\n\\backslash\n";
|
||||||
column = 0;
|
column = 0;
|
||||||
break;
|
break;
|
||||||
case '.':
|
case '.':
|
||||||
|
@ -1126,7 +1126,7 @@ void LyXTabular::write(Buffer const & buf, ostream & os) const
|
|||||||
<< ">\n";
|
<< ">\n";
|
||||||
os << "\\begin_inset ";
|
os << "\\begin_inset ";
|
||||||
cell_info[i][j].inset.write(buf, os);
|
cell_info[i][j].inset.write(buf, os);
|
||||||
os << "\n\\end_inset \n"
|
os << "\n\\end_inset\n"
|
||||||
<< "</cell>\n";
|
<< "</cell>\n";
|
||||||
}
|
}
|
||||||
os << "</row>\n";
|
os << "</row>\n";
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2008-08-16 José Matos <jamatos@lyx.org>
|
||||||
|
|
||||||
|
* context.C (begin_deeper, end_deeper):
|
||||||
|
* preamble.C (end_preamble):
|
||||||
|
* table.C (handle_tabular):
|
||||||
|
* text.C (end_inset, handle_ert, handle_comment):
|
||||||
|
(parse_text_attributes, parse_text): remove space at end of line.
|
||||||
|
|
||||||
2004-08-10 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
2004-08-10 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||||
|
|
||||||
* preamble.C (split_options): new, split package options into vector
|
* preamble.C (split_options): new, split package options into vector
|
||||||
|
@ -36,13 +36,13 @@ void end_layout(ostream & os)
|
|||||||
|
|
||||||
void begin_deeper(ostream & os)
|
void begin_deeper(ostream & os)
|
||||||
{
|
{
|
||||||
os << "\n\\begin_deeper \n";
|
os << "\n\\begin_deeper\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void end_deeper(ostream & os)
|
void end_deeper(ostream & os)
|
||||||
{
|
{
|
||||||
os << "\n\\end_deeper \n";
|
os << "\n\\end_deeper\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ void handle_package(string const & name, string const & opts)
|
|||||||
|
|
||||||
void end_preamble(ostream & os, LyXTextClass const & /*textclass*/)
|
void end_preamble(ostream & os, LyXTextClass const & /*textclass*/)
|
||||||
{
|
{
|
||||||
os << "#LyX file created by tex2lyx 0.1.2 \n"
|
os << "#LyX file created by tex2lyx 0.1.2\n"
|
||||||
<< "\\lyxformat 235\n"
|
<< "\\lyxformat 235\n"
|
||||||
<< "\\textclass " << h_textclass << "\n"
|
<< "\\textclass " << h_textclass << "\n"
|
||||||
<< "\\begin_preamble\n" << h_preamble.str() << "\n\\end_preamble\n";
|
<< "\\begin_preamble\n" << h_preamble.str() << "\n\\end_preamble\n";
|
||||||
|
@ -528,7 +528,7 @@ void handle_tabular(Parser & p, ostream & os,
|
|||||||
<< ">"
|
<< ">"
|
||||||
<< "\n\\begin_inset Text\n"
|
<< "\n\\begin_inset Text\n"
|
||||||
<< cell.content
|
<< cell.content
|
||||||
<< "\n\\end_inset \n"
|
<< "\n\\end_inset\n"
|
||||||
<< "</cell>\n";
|
<< "</cell>\n";
|
||||||
}
|
}
|
||||||
os << "</row>\n";
|
os << "</row>\n";
|
||||||
|
@ -331,7 +331,7 @@ void begin_inset(ostream & os, string const & name)
|
|||||||
|
|
||||||
void end_inset(ostream & os)
|
void end_inset(ostream & os)
|
||||||
{
|
{
|
||||||
os << "\n\\end_inset \n\n";
|
os << "\n\\end_inset\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -360,9 +360,9 @@ void handle_ert(ostream & os, string const & s, Context & context, bool check_la
|
|||||||
newcontext.check_layout(os);
|
newcontext.check_layout(os);
|
||||||
for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
|
for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
|
||||||
if (*it == '\\')
|
if (*it == '\\')
|
||||||
os << "\n\\backslash \n";
|
os << "\n\\backslash\n";
|
||||||
else if (*it == '\n')
|
else if (*it == '\n')
|
||||||
os << "\n\\newline \n";
|
os << "\n\\newline\n";
|
||||||
else
|
else
|
||||||
os << *it;
|
os << *it;
|
||||||
}
|
}
|
||||||
@ -380,7 +380,7 @@ void handle_comment(ostream & os, string const & s, Context & context)
|
|||||||
newcontext.check_layout(os);
|
newcontext.check_layout(os);
|
||||||
for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
|
for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) {
|
||||||
if (*it == '\\')
|
if (*it == '\\')
|
||||||
os << "\n\\backslash \n";
|
os << "\n\\backslash\n";
|
||||||
else
|
else
|
||||||
os << *it;
|
os << *it;
|
||||||
}
|
}
|
||||||
@ -840,10 +840,10 @@ void parse_text_attributes(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
string oldvalue = currentvalue;
|
string oldvalue = currentvalue;
|
||||||
currentvalue = newvalue;
|
currentvalue = newvalue;
|
||||||
os << '\n' << attribute << ' ' << newvalue << " \n";
|
os << '\n' << attribute << ' ' << newvalue << "\n";
|
||||||
parse_text_snippet(p, os, flags, outer, context);
|
parse_text_snippet(p, os, flags, outer, context);
|
||||||
currentvalue = oldvalue;
|
currentvalue = oldvalue;
|
||||||
os << '\n' << attribute << ' ' << oldvalue << " \n";
|
os << '\n' << attribute << ' ' << oldvalue << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1008,22 +1008,22 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
// s will change the size, so we must reset
|
// s will change the size, so we must reset
|
||||||
// it here
|
// it here
|
||||||
os << s << "\n\\size " << context.font.size
|
os << s << "\n\\size " << context.font.size
|
||||||
<< " \n";
|
<< "\n";
|
||||||
else if (is_known(next.cs(), known_font_families))
|
else if (is_known(next.cs(), known_font_families))
|
||||||
// s will change the font family, so we must
|
// s will change the font family, so we must
|
||||||
// reset it here
|
// reset it here
|
||||||
os << s << "\n\\family "
|
os << s << "\n\\family "
|
||||||
<< context.font.family << " \n";
|
<< context.font.family << "\n";
|
||||||
else if (is_known(next.cs(), known_font_series))
|
else if (is_known(next.cs(), known_font_series))
|
||||||
// s will change the font series, so we must
|
// s will change the font series, so we must
|
||||||
// reset it here
|
// reset it here
|
||||||
os << s << "\n\\series "
|
os << s << "\n\\series "
|
||||||
<< context.font.series << " \n";
|
<< context.font.series << "\n";
|
||||||
else if (is_known(next.cs(), known_font_shapes))
|
else if (is_known(next.cs(), known_font_shapes))
|
||||||
// s will change the font shape, so we must
|
// s will change the font shape, so we must
|
||||||
// reset it here
|
// reset it here
|
||||||
os << s << "\n\\shape "
|
os << s << "\n\\shape "
|
||||||
<< context.font.shape << " \n";
|
<< context.font.shape << "\n";
|
||||||
else if (is_known(next.cs(), known_old_font_families) ||
|
else if (is_known(next.cs(), known_old_font_families) ||
|
||||||
is_known(next.cs(), known_old_font_series) ||
|
is_known(next.cs(), known_old_font_series) ||
|
||||||
is_known(next.cs(), known_old_font_shapes))
|
is_known(next.cs(), known_old_font_shapes))
|
||||||
@ -1031,9 +1031,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
// and shape, so we must reset it here
|
// and shape, so we must reset it here
|
||||||
os << s
|
os << s
|
||||||
<< "\n\\family " << context.font.family
|
<< "\n\\family " << context.font.family
|
||||||
<< " \n\\series " << context.font.series
|
<< "\n\\series " << context.font.series
|
||||||
<< " \n\\shape " << context.font.shape
|
<< "\n\\shape " << context.font.shape
|
||||||
<< " \n";
|
<< "\n";
|
||||||
else {
|
else {
|
||||||
handle_ert(os, "{", context, false);
|
handle_ert(os, "{", context, false);
|
||||||
// s will end the current layout and begin a
|
// s will end the current layout and begin a
|
||||||
@ -1334,7 +1334,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
|
|
||||||
else if (t.cs() == "hfill") {
|
else if (t.cs() == "hfill") {
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
os << "\n\\hfill \n";
|
os << "\n\\hfill\n";
|
||||||
skip_braces(p);
|
skip_braces(p);
|
||||||
p.skip_spaces();
|
p.skip_spaces();
|
||||||
}
|
}
|
||||||
@ -1431,31 +1431,31 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
Font oldFont = context.font;
|
Font oldFont = context.font;
|
||||||
context.font.init();
|
context.font.init();
|
||||||
context.font.size = oldFont.size;
|
context.font.size = oldFont.size;
|
||||||
os << "\n\\family " << context.font.family << " \n";
|
os << "\n\\family " << context.font.family << "\n";
|
||||||
os << "\n\\series " << context.font.series << " \n";
|
os << "\n\\series " << context.font.series << "\n";
|
||||||
os << "\n\\shape " << context.font.shape << " \n";
|
os << "\n\\shape " << context.font.shape << "\n";
|
||||||
if (t.cs() == "textnormal") {
|
if (t.cs() == "textnormal") {
|
||||||
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
||||||
context.font = oldFont;
|
context.font = oldFont;
|
||||||
os << "\n\\shape " << oldFont.shape << " \n";
|
os << "\n\\shape " << oldFont.shape << "\n";
|
||||||
os << "\n\\series " << oldFont.series << " \n";
|
os << "\n\\series " << oldFont.series << "\n";
|
||||||
os << "\n\\family " << oldFont.family << " \n";
|
os << "\n\\family " << oldFont.family << "\n";
|
||||||
} else
|
} else
|
||||||
eat_whitespace(p, os, context, false);
|
eat_whitespace(p, os, context, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "underbar") {
|
else if (t.cs() == "underbar") {
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
os << "\n\\bar under \n";
|
os << "\n\\bar under\n";
|
||||||
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
||||||
os << "\n\\bar default \n";
|
os << "\n\\bar default\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (t.cs() == "emph" || t.cs() == "noun") {
|
else if (t.cs() == "emph" || t.cs() == "noun") {
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
os << "\n\\" << t.cs() << " on \n";
|
os << "\n\\" << t.cs() << " on\n";
|
||||||
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
|
||||||
os << "\n\\" << t.cs() << " default \n";
|
os << "\n\\" << t.cs() << " default\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (use_natbib &&
|
else if (use_natbib &&
|
||||||
@ -1618,9 +1618,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
context.font.size = oldsize;
|
context.font.size = oldsize;
|
||||||
context.font.family =
|
context.font.family =
|
||||||
known_coded_font_families[where - known_old_font_families];
|
known_coded_font_families[where - known_old_font_families];
|
||||||
os << "\n\\family " << context.font.family << " \n"
|
os << "\n\\family " << context.font.family << "\n"
|
||||||
<< "\\series " << context.font.series << " \n"
|
<< "\\series " << context.font.series << "\n"
|
||||||
<< "\\shape " << context.font.shape << " \n";
|
<< "\\shape " << context.font.shape << "\n";
|
||||||
eat_whitespace(p, os, context, false);
|
eat_whitespace(p, os, context, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1633,9 +1633,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
context.font.size = oldsize;
|
context.font.size = oldsize;
|
||||||
context.font.series =
|
context.font.series =
|
||||||
known_coded_font_series[where - known_old_font_series];
|
known_coded_font_series[where - known_old_font_series];
|
||||||
os << "\n\\family " << context.font.family << " \n"
|
os << "\n\\family " << context.font.family << "\n"
|
||||||
<< "\\series " << context.font.series << " \n"
|
<< "\\series " << context.font.series << "\n"
|
||||||
<< "\\shape " << context.font.shape << " \n";
|
<< "\\shape " << context.font.shape << "\n";
|
||||||
eat_whitespace(p, os, context, false);
|
eat_whitespace(p, os, context, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1648,9 +1648,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
context.font.size = oldsize;
|
context.font.size = oldsize;
|
||||||
context.font.shape =
|
context.font.shape =
|
||||||
known_coded_font_shapes[where - known_old_font_shapes];
|
known_coded_font_shapes[where - known_old_font_shapes];
|
||||||
os << "\n\\family " << context.font.family << " \n"
|
os << "\n\\family " << context.font.family << "\n"
|
||||||
<< "\\series " << context.font.series << " \n"
|
<< "\\series " << context.font.series << "\n"
|
||||||
<< "\\shape " << context.font.shape << " \n";
|
<< "\\shape " << context.font.shape << "\n";
|
||||||
eat_whitespace(p, os, context, false);
|
eat_whitespace(p, os, context, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1710,7 +1710,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
|
|
||||||
else if (t.cs() == "textbackslash") {
|
else if (t.cs() == "textbackslash") {
|
||||||
context.check_layout(os);
|
context.check_layout(os);
|
||||||
os << "\n\\backslash \n";
|
os << "\n\\backslash\n";
|
||||||
skip_braces(p);
|
skip_braces(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1783,7 +1783,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
|||||||
handle_ert(os, "\\\\*" + p.getOpt(), context);
|
handle_ert(os, "\\\\*" + p.getOpt(), context);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
os << "\n\\newline \n";
|
os << "\n\\newline\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user