Commit Graph

48 Commits

Author SHA1 Message Date
Georg Baum
6bf6c8453d add pure ASCII encoding for LaTeX export
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17224 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-16 18:29:48 +00:00
Abdelrazak Younes
500a5f959f The caption inset patch by Georg, Martin and myself.
* buffer.C: increase LyX format to 257.

* lyxtextclass.C: increase FORMAT format to 3.

* buffer_funcs.C: 
  - setCaptionLabels(): new recursive function
  - setCaptions(): new function
  - updateLabels(): call setCaptions() for each paragraph.

* InsetCaption:
  - add a virtual destructor
  - overload InsetText' getStatus() and wide().
  - setLabel(): only set the new private member label_.
  - metrics(): don't set label here and correct for title metrics.
  - draw(): don't set label here
  - latex(): fix optional argument.
  - plaintext(): implement!

* InsetText:
  - add a virtual destructor
  - add virtual to getStatus() and wide().

*  output_latex.[Ch]: move latexOptArgInsets() out of anon namespace.

* text3.C: enable LFUN_CAPTION_INSERT


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16948 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-30 13:23:21 +00:00
Georg Baum
439582ec6d Fix regression to 1.4.x: Additional vertical space if inputenc == auto
* src/output_latex.C
	(TeXOnePar): Postpone the output of newlines after the call of
	switchEncoding(), since we may get additional whitespace otherwise.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16740 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 22:01:08 +00:00
Georg Baum
7202474476 whitespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16739 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 21:25:17 +00:00
Georg Baum
c727c6db7f * src/insets/insetbase.h
(forceDefaultParagraphs): Fix comment: Not all text classes have a
	"Standard" layout. What was meant here is the default layout of the
	text class.

	* src/paragraph.C
	(Paragraph::simpleTeXOnePar): ditto

	* src/output_latex.C
	(latexParagraphs): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16738 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 21:22:19 +00:00
Georg Baum
a8739b8b91 * src/output_latex.C
(TeXOnePar): Remove dead code


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16736 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-17 20:41:22 +00:00
Georg Baum
0ddb4d5f30 Change lyx2lyx conversion and LaTeX export of documents with
\inputencoding default

	* src/paragraph_pimpl.C
	(isEncoding): Explain why bparams.inputenc == "default" is ignored

	* src/bufferparams.C
	(BufferParams::encoding): Determine the encoding from the language
	for inputenc == "default"

	* src/buffer.h
	(writeLaTeXSource): Mention inputenc == "default" in documentation

	* src/bufferparams.h
	(inputenc): Update documentation of "default"

	* src/output_latex.C
	(switchEncoding): Switch the encoding also for inputenc == "default",
	but don't output \inputencoding commands in that case

	* lib/lyx2lyx/LyX.py
	(get_encoding): Determine the encoding from the language for
	inputencoding == "default"

	* lib/lyx2lyx/lyx_1_5.py
	(convert_multiencoding): ditto

	* development/FORMAT: Update documentation of \inputencoding default


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16667 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-13 14:36:54 +00:00
Georg Baum
bcb1654b15 Make the output of \inputencoding commands (and the change of output
encodings) more fine grained: From paragraph level to individual character
level. The inputenc package supports that since at least 2000.

	* src/insets/insetbase.h
	(latex): Document the differences between output to a string stream
	and a file stream

	* src/buffer.h
	(writeLaTeXSource): ditto

	* src/output_latex.h
	(latexParagraphs): ditto
	(switchEncoding): new function to change the encoding of a stream
	(and output \inputencoding commands)

	* src/paragraph_pimpl.C
	(Paragraph::Pimpl::simpleTeXSpecialC): Adjust to latexWriteEndChanges
	changes

	* src/support/docstream.[Ch]
	(setEncoding, operator<<): New stream modifier that changes the
	encoding of file streams

	* src/lyxfont.[Ch]
	(LyXFont::latexWriteStartChanges): Change stream encoding if needed
	(LyXFont::latexWriteEndChanges): Change stream encoding if needed

	* src/lyxfont.h
	(public:):

	* src/paragraph.C
	(Paragraph::simpleTeXOnePar): Adjust to latexWriteStartChanges and latexWriteEndChanges changes
	(bool Paragraph::simpleTeXOnePar):
	(bool Paragraph::simpleTeXOnePar):
	(bool Paragraph::simpleTeXOnePar):
	(bool Paragraph::simpleTeXOnePar):
	(bool Paragraph::simpleTeXOnePar):

	* src/output_latex.C
	(TeXOnePar): Remove the ugly hack to for wencoding changes and use
	switchEncoding instead. A nice side effect is that the old hack would
	not work if the main language encoding is latin1 and a character
	would be mapped to a cedilla in the "fake ucs4" encoding, because
	iconv refuses to convert such a character to latin1, although it
	exists in latin1 (it wants to attach it to a base character).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16633 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-09 19:25:40 +00:00
Georg Baum
03f56201d8 Don't calculate outerfont twice
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16587 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 19:06:48 +00:00
Georg Baum
24bb8d72f3 avoid unneeded stream flushes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16586 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 18:53:59 +00:00
Georg Baum
16b2b8e6bc fix typos
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16580 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-07 17:54:26 +00:00
Georg Baum
244b2c1fab Add some more LaTeX encodings, fix thailatex and display all available
encodings in the preferences dialog

	* src/LaTeXFeatures.C: special treatment for tis620-0 encoding
	* src/bufferparams.C: ditto
	* src/output_latex.C: ditto

	* src/encoding.[Ch]: Add the possibility to iterate over all encodings

	* src/paragraph_pimpl.C: Add latin10 and cp858 to Euro treatment

	* src/buffer.C: Update format number

	* src/frontends/qt4/QDocumentDialog.C: Don't hardcode available
	encodings

	* lib/lyx2lyx/LyX.py,
	  lib/lyx2lyx/lyx_1_5.py: implement conversion from 256 to 255

	* lib/encodings: Add some encodings, fix all "unknown" entries

	* development/FORMAT: Document file format change


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16418 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-28 18:15:25 +00:00
Peter Kümmel
969f292119 add comment about ugly construct
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15606 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-29 16:43:18 +00:00
Georg Baum
1440f02a84 Add comment explaining the encoding change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15603 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-29 16:08:07 +00:00
Peter Kümmel
2dae7cce1a don't trigger the copy ctor because it's private on msvc
CCMAIL:lyx-devel@lists.lyx.org



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15579 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-27 13:10:06 +00:00
Georg Baum
0a48dce7ac Compile fix for older gcc's.
I accidentally used data() which is not yet in the standard.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15565 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 15:38:53 +00:00
Georg Baum
fa1856440c Restore inputenc support
* src/encoding.h
	(encoding_table): remove, this is no longer needed with unicode
	(iconvName_): new member: name of the encoding in iconv syntax

	* src/exporter.C
	(Exporter::Export): Use return value of Buffer::makeLaTeXFile

	* src/buffer.[Ch]
	(Buffer::makeLaTeXFile): return whether the file has been created
	successfully

	* src/buffer.C
	(Buffer::makeLaTeXFile): Use a docstream that converts to the correct
	encoding
	Display an error dialog is something went wrong

	* src/bufferparams.C
	(BufferParams::writeLaTeX): Undo the utf8 inputenc hack

	* src/frontends/qt4/QDocumentDialog.C: Add some FIXMEs

	* src/support/unicode.[Ch]
	(eightbit_to_ucs4): New conversion function
	(ucs4_to_eightbit): New conversion function

	* src/support/docstream.[Ch]
	(utf8_codecvt_facet_exception): Move to header and rename to
	iconv_codecvt_facet_exception
	(odocfstream): Take the encoding as argument

	* src/support/docstream.C
	(utf8_codecvt_facet): Generalize to other encodings than utf8 and
	rename to iconv_codecvt_facet

	* src/encoding.C: Remove obsolete tables

	* src/output_latex.C
	(TeXOnePar): Convert the paragraph to different encoding if needed

	* lib/encodings: Remove obsolete tables


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15564 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-26 15:01:45 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
Lars Gullik Bjønnes
b27bb5cb53 Change (and fix) the bullets in itemize to be more unicode friendly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15416 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 19:26:23 +00:00
Asger Ottar Alstrup
8e17851d87 - UTF-8 works on Windows as well
- We even spit out the right usepackage chant



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15385 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 19:28:27 +00:00
Georg Baum
8b67659646 Use UTF8 for LaTeX export.
Known problems:
- No space is output after a \hfill. I probably broke this with the
  InsetCommand patch. I'll have a look later.
- Although the encoding is now UTF8 the arguments of the inputenc package
  are still the old ones, so LaTeX will not run.
- Labels and references with non-ASCII characters are broken. This needs to
  be fixed in lyx::support::escape(), but this is a file format change.
- Something seems to be wrong with index entries, but this is probably also
  due to the InsetCommand changes.

Have fun!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15378 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-19 16:51:30 +00:00
Martin Vermeer
21316375fe Support for optional arguments for environments. No material format change.
* src/buffer.C
	(BufferList bufferlist;): bump version

	* src/output_latex.C
	TexEnvironment: add optarg for environments

	* lib/lyx2lyx/lyx_1_5.py: add converters

	* development/FORMAT: document



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15315 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-12 20:21:14 +00:00
Georg Baum
34b7650cbb Introduce wide streams. This fixes the remaining problems of plain text
export (e.g. the ToC) and the navigate menu.

	* src/insets/insetbase.h
	(InsetBase::plaintext): output to a docstream
	(InsetBase::textString): ditto

	* src/mathed/TextPainter.h
	(TextPainter::show): ditto

	* src/support/docstream.[Ch] New file and string streams for
	docstring. The file streams convert to UTF8 on the fly.

	* many more files: Adjust to the changes above


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15301 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 19:40:50 +00:00
Bo Peng
eb485caa96 view-source feature, from Bo Peng <ben.bob@gmail.com>
* src/buffer.h buffer.C - getSourceCode()
	* src/lyxfunc.C -  open view-source dialog
	* src/text3.C - change LFUN_MOUSE_RELEASE
	* src/output_linuxdoc.C, src/output_docbook.C, src/output_latex.C 
		- intercept output
	* src/outputparams.h, outputparams.C - add par_begin, par_end, dryrun
	* src/insets/insetgraphics.C  - add dryrun mode of file conversion
	* lib/ui/stdmenus.ui - add view-source menu item under view
	* Add view-source dialog, add 
	    src/frontends/qt2/QViewSourceDialog.h, QViewSource.C, QViewSource.h, QViewSourceDialog.C
	    src/frontends/qt2/ui/QViewSourceDialogBase.ui
	    src/frontends/controllers/ControlViewSource.h ControlViewSource.C
	  modify
	    src/frontends/qt2/Makefile.dialogs, Makefile.am, Dialogs.C,
	    src/frontends/controllers/Makefile.am, po.POTFILES.in


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13610 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 02:48:54 +00:00
Lars Gullik Bjønnes
cf4293824f * Change several freestanding and class methods with first letter
capitalized to have first letter lowercased.
* Adjust all affected files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13605 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 00:26:19 +00:00
Lars Gullik Bjønnes
3b9338a3a8 Whitespace cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13565 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-05 23:56:29 +00:00
Lars Gullik Bjønnes
9d6cad3fe6 * output_latex.h:
* buffer.h:
        * CutAndPaste.h:
        * pariterator.h:
        * paragraph_funcs.h:
        * output_linuxdoc.h:
        * output_docbook.h:
        * insets/insettext.h: get forward declaration of ParagraphList

        * output_plaintext.C:
        * bufferlist.C:
        * undo.C:
        * lyxtext.h:
        * undo.h:
        * buffer_funcs.C:
        * insets/insetbibitem.C: get proper ParagraphList decls

        * output_linuxdoc.C (linuxdocParagraphs):
        * output_latex.C (TeXOnePar):
        * insets/insettext.C (appendParagraphs):
        * insets/insetcharstyle.C (docbook): use std::distance

        * CutAndPaste.C (pasteSelectionHelper, copySelectionHelper):
        * paragraph_funcs.C (breakParagraph,
        breakParagraphConservative, mergeParagraph):
        * text.C (acceptChange, rejectChange):
        * text2.C (deleteEmptyParagraphMechanism): use boost::next

        * output_docbook.C (several places): use boost::next and
        std::distance

        * ParagraphList_fwd.h: modify to provid a forward declaratoin
        of the new ParagraphList.

        * RandomAccessList.h: New container for Paragraphs from
        Abdelrazak Younes

        * ParagraphList.h: new file, setup user of RandomAccessList

        * paragraph.C: remove ParagraphList constructor from this file



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13467 a592a061-630c-0410-9148-cb99ea01b6c8
2006-03-23 20:11:06 +00:00
Lars Gullik Bjønnes
6719871884 avoid deref of past the end iter
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10203 a592a061-630c-0410-9148-cb99ea01b6c8
2005-07-15 11:14:08 +00:00
Angus Leeming
19a1d8bc10 Add the bibitemWidest declaration to insetbibitem.h.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9532 a592a061-630c-0410-9148-cb99ea01b6c8
2005-01-23 16:36:36 +00:00
Angus Leeming
7b0a35adf0 Prevent crash when outputting latex file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9506 a592a061-630c-0410-9148-cb99ea01b6c8
2005-01-20 11:44:20 +00:00
Angus Leeming
68b0cca2e7 Whitespace, only whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9314 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-26 14:52:54 +00:00
Jean-Marc Lasgouttes
6ae4dc23f4 allow more than one optional inset
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9272 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-19 16:17:52 +00:00
Jean-Marc Lasgouttes
3d9f2089dd propagate the need_protect property to optional insets (bug 1739)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9249 a592a061-630c-0410-9148-cb99ea01b6c8
2004-11-15 13:39:06 +00:00
Angus Leeming
e978fa42e3 Whitespace, only whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9044 a592a061-630c-0410-9148-cb99ea01b6c8
2004-10-05 10:11:42 +00:00
Jean-Marc Lasgouttes
21f14a3a3e make sure language commands are the outermost ones when typesetting a paragraph (bug 1404)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9020 a592a061-630c-0410-9148-cb99ea01b6c8
2004-09-28 13:29:19 +00:00
Georg Baum
db707dab04 remove now unnecessary const casts
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8757 a592a061-630c-0410-9148-cb99ea01b6c8
2004-05-17 11:28:31 +00:00
Jean-Marc Lasgouttes
de3c8e5b80 fix arabtex-related problems (bug 1225 and bug 1404)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8692 a592a061-630c-0410-9148-cb99ea01b6c8
2004-04-22 13:59:39 +00:00
André Pönitz
2bdaf96dfb the Paragraph::inInset() changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8632 a592a061-630c-0410-9148-cb99ea01b6c8
2004-04-08 15:03:33 +00:00
André Pönitz
0d43ba149a the stuff from the sneak preview:
For one, it still contains a few things that are already in CVS (the
'brown paperbag' changes).

Secondly, this changes the ParagraphList to a std::vector but does not
yet take full advantage of it except removing LyXText::parOffset() and
similar.

I had an extensive talk with my profiler and we are happy nevertheless.

This also moves almost all Cut&Paste specific stuff from text.C to
CutAndPaste.C. Much smaller interface now... Namespace CutAndPaste is
now  lyx::cap::. Was inconsistent with the rest....

Make ParagraphList a proper class. We'll need this later for a
specialized erase/insert.

Remove some unneeded prototypes and function declarations

Use ParameterStruct directly instead of ShareContainer<ParameterStruct>

Inline a few accesses to CursorSlice members as suggested by the profiler.

Fix commandline conversion crash reported by Kayvan.

Replace PosIterator by DocumentIterator. The latter can also iterate
through math and nested text in math...

Remove math specific hack from Documentiterator

Derive InsetCollapsable from InsetText instead of using an InsetText
member. This give us the opportunity to get rid of the InsetOld::owner_
backpointer.

Cosmetics in CutAndPaste.C and cursor.C. Fix nasty crash (popping slices
off an empty selection anchor). Add a few asserts.

Remove all 'manual' update calls. We do now one per user interaction which
is completely sufficient.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8527 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-25 09:16:36 +00:00
André Pönitz
5198e1d9a3 The Buffer::LyXText -> Buffer::InsetText patch
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8498 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-18 12:53:43 +00:00
André Pönitz
ec4ab8ce18 revert Buffer LyxText->InsetText commit
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8489 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-11 17:16:38 +00:00
André Pönitz
1b3f5ee46f the Buffer::text -> inset change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8488 a592a061-630c-0410-9148-cb99ea01b6c8
2004-03-11 16:09:42 +00:00
André Pönitz
2a5bc90633 bug + spped fixes + small stuff
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8421 a592a061-630c-0410-9148-cb99ea01b6c8
2004-02-11 14:45:44 +00:00
André Pönitz
1eaa3eb913 more IU
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8371 a592a061-630c-0410-9148-cb99ea01b6c8
2004-01-26 10:13:15 +00:00
André Pönitz
8fa8cfb4a3 remove Inset::getParagraphs()
cache 'outermost' inset font


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8192 a592a061-630c-0410-9148-cb99ea01b6c8
2003-12-03 18:17:20 +00:00
André Pönitz
7de76711b1 move space above/below from Paragraph into a separate vspace inset.
Gui interaction mailer stuff by Angus...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8149 a592a061-630c-0410-9148-cb99ea01b6c8
2003-11-28 15:53:34 +00:00
Martin Vermeer
af37f0d23e Introducing a number of tags parametrizing various
XML formats that we may want to support


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8137 a592a061-630c-0410-9148-cb99ea01b6c8
2003-11-25 17:23:36 +00:00
José Matox
cd424d7853 Rename ascii to plaintext and LatexRunParams to OutputParams.
Create new files for each output format.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8046 a592a061-630c-0410-9148-cb99ea01b6c8
2003-11-05 12:06:20 +00:00