Revision: 1897 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1897&view=re... Author: frlan Date: 2011-01-30 15:30:21 +0000 (Sun, 30 Jan 2011)
Log Message: ----------- GeanyLaTeX: Remove convert to table function again as it has been moved to Tableconvert plugin of Geany-Plugins
Modified Paths: -------------- trunk/geanylatex/ChangeLog trunk/geanylatex/doc/geanylatex.tex trunk/geanylatex/src/geanylatex.c trunk/geanylatex/src/latexkeybindings.c trunk/geanylatex/src/latexkeybindings.h trunk/geanylatex/src/latexutils.c trunk/geanylatex/src/latexutils.h
Modified: trunk/geanylatex/ChangeLog =================================================================== --- trunk/geanylatex/ChangeLog 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/ChangeLog 2011-01-30 15:30:21 UTC (rev 1897) @@ -1,3 +1,8 @@ +2011-01-30 Frank Lanitz <frank(at)frank(dot)uvena(dot)de> + + * Move convert to table function to new Tableconvert plugin of Geany-Plugins. + + 2011-01-29 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
* Backport update from convert to table function from HTMLTable-plugin
Modified: trunk/geanylatex/doc/geanylatex.tex =================================================================== --- trunk/geanylatex/doc/geanylatex.tex 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/doc/geanylatex.tex 2011-01-30 15:30:21 UTC (rev 1897) @@ -97,13 +97,12 @@ \subsection{Upcoming Geany\LaTeX{} 0.6} \begin{itemize} \item Moved \LaTeX{} menu to a separate menu inside Geany main menu - \item Added a feature to autocapetlise letters on typing on begin of + \item Added a feature to autocapetlise letters on typing on begin of a sentence \item Added a way to put a icon for \LaTeX{}-wizard into Geany's main toolbar \item Added a dialog for inserting BibTeX references based on available *.bib-files - \item Convert a tab separated block into \LaTeX{}-table \item Upgrade plugin API to version 199 \end{itemize}
@@ -426,7 +425,7 @@ Geany\LaTeX{} is searching here for *.bib-files inside the directory of current active file. Its filtering for all references inside these files and putting it sorted and cleared from duplicated -entries into the pulldown of the dialog. +entries into the pulldown of the dialog.
\begin{figure}[h!] \centering{\includegraphics[height=2.5cm]{img/bibtex_reference.png}} @@ -548,7 +547,7 @@ \pageref {sec:hidden_pref_autocompletion_context}.
This feature is by default file type depending, so it will only work -on \TeX{}-like file types as well its turned on by default. +on \TeX{}-like file types as well its turned on by default.
\subsection{Inserting \textbackslash{}usepackage{}-entry to header} @@ -568,28 +567,7 @@ \caption{Dialog for inserting \textbackslash{}usepackage{}} \end{figure}
-\subsection{Convert selected block to \LaTeX{}-table}
-This feature allows to convert a tabular formated block into \LaTeX{}-compatible -table. In detail the feature replaces all occurrences of tabulator with & -surrounded by some spaces as well as adding \textbackslash{}\textbackslash{} -at the end of each line. Nevertheless it also adds \texttt{tabular} environments -around the selected passage. - -It will enclose your selection with an \texttt{tabular} environment. -\begin{figure}[h!] -\begin{lstlisting} -\begin{tabular} - % selection converted to table -\end{tabular} -\end{lstlisting} -\end{figure} - -After this has been done you will need to add the missing paramters -for \texttt{tabular} like position and columns definitions as -tabular environment is defined as to be used with -\texttt{\textbackslash{}begin{tabular}[pos]{table spec}}. - \section{Configuration}
GeanyLaTeX{} can be configured in three major ways: @@ -626,13 +604,13 @@
\subsubsection{Capitalize letters on sentence begin}
-If this option is enabled, Geany\LaTeX{} will look for \textsc{.}, -\textsc{!} or \textsc{?} followed by a space. The next letter will -be inserted in capital letters. Currenty this is not working for -multichar letters as German Umlauts as well as the overwriting is -not supported very well at this point. In case of you don't want to -have the capital version of a letter in a particular case, just hit -undo (Ctrl + z in most cases). +If this option is enabled, Geany\LaTeX{} will look for \textsc{.}, +\textsc{!} or \textsc{?} followed by a space. The next letter will +be inserted in capital letters. Currenty this is not working for +multichar letters as German Umlauts as well as the overwriting is +not supported very well at this point. In case of you don't want to +have the capital version of a letter in a particular case, just hit +undo (Ctrl + z in most cases).
\subsubsection{Add a wizard icon to Geany's main toolbar} This adds an icon for Geany\LaTeX{} wizard to Geany's main toolbar @@ -1071,6 +1049,19 @@ another tab in Geany's message widget.\ \textbf{Homepage:} \url{http://plugins.geany.org/addons/%7D
+ +\subsubsection{Tableconvert to convert a tabulator separated list into a table} + +Its an quiet annyoing problem which happens from time to time: There +is a list of values e.g. from some experiment which needs to be +included into your document. The \LaTeX{}-export filter of your +spreadsheet tool is not very adavanced and you just want to insert a +couple of lines and have to do it manually. + +Tableconvert is offering to convert a tabular separated list into an +table. The plugin is also offering to convert such a list into a +\LaTeX{}-like table and therefor is maybe useful on daily work. + \section{License} Geany\LaTeX{} and all its parts is distributed under the terms of the GNU General Public License as published by the Free Software
Modified: trunk/geanylatex/src/geanylatex.c =================================================================== --- trunk/geanylatex/src/geanylatex.c 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/src/geanylatex.c 2011-01-30 15:30:21 UTC (rev 1897) @@ -1967,9 +1967,6 @@ keybindings_set_item(key_group, KB_LATEX_INSERT_CITE, glatex_kb_insert_bibtex_cite, 0, 0, "insert_cite_dialog", _("Insert BibTeX reference dialog"), menu_latex_insert_bibtex_cite); - keybindings_set_item(key_group, KB_LATEX_CONVERT_TO_TABLE, - glatex_kb_convert_to_table, 0, 0, "convert_to_table", - _("Convert selection to table"), NULL); }
Modified: trunk/geanylatex/src/latexkeybindings.c =================================================================== --- trunk/geanylatex/src/latexkeybindings.c 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/src/latexkeybindings.c 2011-01-30 15:30:21 UTC (rev 1897) @@ -163,9 +163,3 @@ g_return_if_fail(document_get_current() != NULL); on_insert_bibtex_dialog_activate(NULL, NULL); } - -void glatex_kb_convert_to_table(G_GNUC_UNUSED guint key_id) -{ - g_return_if_fail(document_get_current() != NULL); - glatex_convert_to_table(FALSE); -}
Modified: trunk/geanylatex/src/latexkeybindings.h =================================================================== --- trunk/geanylatex/src/latexkeybindings.h 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/src/latexkeybindings.h 2011-01-30 15:30:21 UTC (rev 1897) @@ -49,7 +49,6 @@ KB_LATEX_USEPACKAGE_DIALOG, KB_LATEX_INSERT_COMMAND, KB_LATEX_INSERT_CITE, - KB_LATEX_CONVERT_TO_TABLE, COUNT_KB };
@@ -75,6 +74,5 @@ void glatex_kb_usepackage_dialog(G_GNUC_UNUSED guint key_id); void glatex_kb_insert_command_dialog(G_GNUC_UNUSED guint key_id); void glatex_kb_insert_bibtex_cite(G_GNUC_UNUSED guint key_id); -void glatex_kb_convert_to_table(G_GNUC_UNUSED guint key_id);
#endif
Modified: trunk/geanylatex/src/latexutils.c =================================================================== --- trunk/geanylatex/src/latexutils.c 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/src/latexutils.c 2011-01-30 15:30:21 UTC (rev 1897) @@ -161,81 +161,3 @@ g_free(new); } } - - -/* Based on reimplementation at HTMLTable plugin of Geany-Plugins package - * originally in GPL2+ */ -/* gboolean header is not yet used but to don't break API later its already - * defined */ -void glatex_convert_to_table(G_GNUC_UNUSED gboolean header) -{ - GeanyDocument *doc = NULL; - doc = document_get_current(); - - g_return_if_fail(doc != NULL); - if (sci_has_selection(doc->editor->sci)) - { - gchar *selection = NULL; - gchar **rows = NULL; - GString *replacement_str = NULL; - gchar *replacement = NULL; - - /* Actually grabbing selection and splitting it into single - * lines we will work on later */ - selection = sci_get_selection_contents(doc->editor->sci); - rows = g_strsplit_set(selection, "\r\n", -1); - g_free(selection); - - /* Checking whether we do have something we can work on - Returning if not */ - if (rows != NULL) - { - /* Adding header to replacement */ - guint i; - guint j; - - replacement_str = g_string_new("\begin{tabular}{}\n"); - - /* Iteration onto rows and building up lines of table for - * replacement */ - for (i = 0; rows[i] != NULL ; i++) - { - gchar **columns = NULL; - columns = g_strsplit_set(rows[i], "\t", -1); - - for (j = 0; columns[j] != NULL; j++) - { - if (j > 0) - { - g_string_append(replacement_str, " & "); - } - g_string_append(replacement_str, columns[j]); - } - - g_string_append(replacement_str, "\\\n"); - - g_free(columns); - } - } - - /* Adding the footer of table */ - - g_string_append(replacement_str, "\end{tabular}\n"); - - /* Replacing selection with new table */ - replacement = g_string_free(replacement_str, FALSE); - sci_replace_sel(doc->editor->sci, replacement); - - g_free(rows); - g_free(replacement); - } - else - { - /* OK. Something went not as expected. - * We did have a selection but cannot parse it into rows. - * Aborting */ - g_warning(_("Something went went wrong on parsing selection. Aborting")); - return; - } /* Selection was given -- end - * in case of there was no selection we are just doing nothing */ - return; -}
Modified: trunk/geanylatex/src/latexutils.h =================================================================== --- trunk/geanylatex/src/latexutils.h 2011-01-30 15:30:05 UTC (rev 1896) +++ trunk/geanylatex/src/latexutils.h 2011-01-30 15:30:21 UTC (rev 1897) @@ -28,6 +28,5 @@ void glatex_enter_key_pressed_in_entry(G_GNUC_UNUSED GtkWidget *widget, gpointer dialog); void glatex_insert_string(const gchar *string, gboolean reset_position); void glatex_replace_special_character(void); -void glatex_convert_to_table(G_GNUC_UNUSED gboolean header);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org