}
-int Tabular::TeXTopHLine(odocstream & os, row_type row) const
+int Tabular::TeXTopHLine(odocstream & os, row_type row, string const lang) const
{
// we only output complete row lines and the 1st row here, the rest
// is done in Tabular::TeXBottomHLine(...)
} else if (row == 0) {
for (col_type c = 0; c < ncols; ++c) {
if (topline[c]) {
- os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 << '-';
+ //babel makes the "-" character an active one, so we have to suppress this here
+ //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
+ if (lang == "slovak" || lang == "czech")
+ os << (use_booktabs ? "\\expandafter\\cmidrule\\expandafter{\\expandafter" :
+ "\\expandafter\\cline\\expandafter{\\expandafter")
+ << c + 1 << "\\string-";
+ else
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 << '-';
// get to last column of line span
while (c < ncols && topline[c])
++c;
}
-int Tabular::TeXBottomHLine(odocstream & os, row_type row) const
+int Tabular::TeXBottomHLine(odocstream & os, row_type row, string const lang) const
{
// we output bottomlines of row r and the toplines of row r+1
// if the latter do not span the whole tabular
} else {
for (col_type c = 0; c < ncols; ++c) {
if (bottomline[c]) {
- os << (use_booktabs ? "\\cmidrule{" : "\\cline{")
- << c + 1 << '-';
+ //babel makes the "-" character an active one, so we have to suppress this here
+ //see http://groups.google.com/group/comp.text.tex/browse_thread/thread/af769424a4a0f289#
+ if (lang == "slovak" || lang == "czech")
+ os << (use_booktabs ? "\\expandafter\\cmidrule\\expandafter{\\expandafter" :
+ "\\expandafter\\cline\\expandafter{\\expandafter")
+ << c + 1 << "\\string-";
+ else
+ os << (use_booktabs ? "\\cmidrule{" : "\\cline{") << c + 1 << '-';
// get to last column of line span
while (c < ncols && bottomline[c])
++c;
OutputParams const & runparams) const
{
idx_type cell = cellIndex(i, 0);
- int ret = TeXTopHLine(os, i);
+ shared_ptr<InsetTableCell> inset = cellInset(cell);
+ Paragraph const & par = inset->paragraphs().front();
+ string const lang = par.getParLanguage(buffer().params())->lang();
+
+ //output the top line
+ int ret = TeXTopHLine(os, i, lang);
+
if (row_info[i].top_space_default) {
if (use_booktabs)
os << "\\addlinespace\n";
}
os << '\n';
++ret;
- ret += TeXBottomHLine(os, i);
+
+ //output the bottom line
+ ret += TeXBottomHLine(os, i, lang);
+
if (row_info[i].interline_space_default) {
if (use_booktabs)
os << "\\addlinespace\n";
///
// helper function for Latex returns number of newlines
///
- int TeXTopHLine(odocstream &, row_type row) const;
+ int TeXTopHLine(odocstream &, row_type row, std::string const lang) const;
///
- int TeXBottomHLine(odocstream &, row_type row) const;
+ int TeXBottomHLine(odocstream &, row_type row, std::string const lang) const;
///
int TeXCellPreamble(odocstream &, idx_type cell, bool & ismulticol) const;
///