From 407f105d695fe4f32fc5bfdd6ac959e580c298ef Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Wed, 20 Jan 2016 15:24:54 +0100 Subject: [PATCH 01/17] polishing --- lib/latex_wiki_page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/latex_wiki_page.rb b/lib/latex_wiki_page.rb index 17d3b71..5414470 100644 --- a/lib/latex_wiki_page.rb +++ b/lib/latex_wiki_page.rb @@ -27,7 +27,7 @@ def to_latex() page_txt.gsub!(fn, dsk_fn) end - # Check wiki referenzes for redirects + # Check wiki references for redirects page_txt.gsub!(/(\s|^)\[\[(.*?)(\|(.*?)|)\]\]/i) do |_| ref = $2 label = $4 From aa39e482d6d23a605c9516f3171e7731d4d6a5a8 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 08:50:49 +0100 Subject: [PATCH 02/17] put is patch in new rails --- config/routes.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 0483a3f..3d837f7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ match 'doc_pu', :controller => 'doc_pu', :action => 'index', :via => :get match 'doc_pu/new', :controller => 'doc_pu', :action => 'new', :via => [:get, :post] -match 'doc_pu/edit', :controller => 'doc_pu', :action => 'edit', :via => [:get, :post, :put] +match 'doc_pu/edit', :controller => 'doc_pu', :action => 'edit', :via => [:get, :post, :patch] match 'doc_pu/open', :controller => 'doc_pu', :action => 'open', :via => [:get, :post] match 'doc_pu/build', :controller => 'doc_pu', :action => 'build', :via => [:get, :post] match 'doc_pu/build_remote', :controller => 'doc_pu', :action => 'build_remote', :via => [:get, :post] @@ -12,7 +12,7 @@ match 'doc_pu_wiki', :controller => 'doc_pu_wiki', :action => 'index', :via => [:get] match 'doc_pu_wiki/new', :controller => 'doc_pu_wiki', :action => 'new', :via => [:get, :post] -match 'doc_pu_wiki/edit', :controller => 'doc_pu_wiki', :action => 'edit', :via => [:get, :post, :put] +match 'doc_pu_wiki/edit', :controller => 'doc_pu_wiki', :action => 'edit', :via => [:get, :post, :patch] match 'doc_pu_wiki/delete', :controller => 'doc_pu_wiki', :action => 'delete', :via => [:get, :post] match 'doc_pu_wiki/edit_order', :controller => 'doc_pu_wiki', :action => 'edit_order', :via => [:get, :post] From 23f906527ed0ab9fbd1d29a57f31ec1c565f109b Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:07:22 +0100 Subject: [PATCH 03/17] update info --- init.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.rb b/init.rb index 7574b64..dcd1085 100644 --- a/init.rb +++ b/init.rb @@ -10,7 +10,7 @@ name 'Redmine DocPu plugin' author 'Christian Raschko' description 'A wiki export and document publishing tool, sponsored by: ATV-Elektronik and modified for further use by: GIS-Fachstelle BL' - version '0.0.4' + version '2.0.0' url 'https://github.com/vvmruder/redmine_doc_pu' # Settings @@ -22,7 +22,7 @@ :partial => 'settings/doc_pu_settings' # Redmine version - requires_redmine :version_or_higher => '2.6.0' + requires_redmine :version_or_higher => '3.2.0' # Create project module project_module :doc_pu do From f885d338046b8007846c2bb4050c8cff1f9e2c78 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:16:25 +0100 Subject: [PATCH 04/17] update info and text --- config/locales/de.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/de.yml b/config/locales/de.yml index 2e767be..99caf69 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -18,6 +18,7 @@ de: field_latex_index_importance: "Wichtige Wörter indizieren" field_latex_table_border: "Rahmen für Tabellen" field_latex_image_ref: "Bilder refernzieren" + field_latex_list_of_listings: "Liste von Code-Beispielen" field_wiki_page: "Wiki Seite" field_chapter_name: "Kapitel Name" field_use_doc_flags: "Dokument Flags verwenden" @@ -74,6 +75,7 @@ de: info_latex_index_importance: "" info_latex_table_border: "Stellt Tabellenlinien dar." info_latex_image_ref: "Erzeuge Bildverzeichnis" + info_latex_list_of_listings: "Erzeugt eine Aufstellung aller Code-Beispiele. Diese wird am Anfang des Dokumentes eingefügt." button_test: "Test" field_latex_bin: "LaTeX Binärdatei (pdflatex)" field_makindex_bin: "makeindex Binärdatei" From a7e122ae028c80031556dbad068a37d7ea0f15de Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:16:41 +0100 Subject: [PATCH 05/17] add new setting --- app/views/doc_pu/_form.html.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/doc_pu/_form.html.erb b/app/views/doc_pu/_form.html.erb index 291ae14..c0af386 100644 --- a/app/views/doc_pu/_form.html.erb +++ b/app/views/doc_pu/_form.html.erb @@ -21,6 +21,9 @@

<%= f.check_box :latex_table_border %> <%= acronym_info_tag t(:info_latex_table_border) %>

<%= f.check_box :latex_image_ref %> <%= acronym_info_tag t(:info_latex_image_ref) %>

+ +

<%= f.check_box :latex_list_of_listings %> <%= acronym_info_tag t(:info_latex_list_of_listings) %>

+
<%= submit_tag l(:button_save) %>
From 1394403f4a0f75957b2c1a26ee2cb99db565451e Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:17:17 +0100 Subject: [PATCH 06/17] make code rails 4.2 compatible --- app/controllers/doc_pu_wiki_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/doc_pu_wiki_controller.rb b/app/controllers/doc_pu_wiki_controller.rb index 2d92d4b..451784a 100644 --- a/app/controllers/doc_pu_wiki_controller.rb +++ b/app/controllers/doc_pu_wiki_controller.rb @@ -17,7 +17,7 @@ def new if request.post? # Save object reorder_pages(@doc_pu.doc_pu_wiki_pages.all) - @doc_pu_wiki = @doc_pu.doc_pu_wiki_pages.create(checkbox_to_boolean params[:doc_pu_wiki]) + @doc_pu_wiki = @doc_pu.doc_pu_wiki_pages.create(checkbox_to_boolean params.require(:doc_pu_wiki).permit!) @doc_pu_wiki.wiki_page_order = get_new_page_order() @doc_pu_wiki.wiki_page_version = 0 if @doc_pu_wiki.save @@ -34,7 +34,7 @@ def edit @doc_pu_wiki = DocPuWikiPage.find(params[:id]) if request.put? # Update object - @doc_pu_wiki.attributes = checkbox_to_boolean(params[:doc_pu_wiki]) + @doc_pu_wiki.attributes = checkbox_to_boolean(params.require(:doc_pu_wiki).permit!) if @doc_pu_wiki.save flash[:notice] = t(:flash_page_updated) redirect_to :controller => :doc_pu, :action => :edit, :project_id => @project, :id => @doc_pu From f8532ed2e8b789f7a6fc43901a862a1a1536ae13 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:19:38 +0100 Subject: [PATCH 07/17] add new flags to be able to configure the document --- lib/latex_flags.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/latex_flags.rb b/lib/latex_flags.rb index 11961ad..9a649f3 100644 --- a/lib/latex_flags.rb +++ b/lib/latex_flags.rb @@ -10,7 +10,12 @@ module ModuleLatexFlags :latex_index_emphasis => true, :latex_index_importance => true, :latex_table_border => true, - :latex_image_ref => false + :latex_image_ref => false, + :latex_list_of_listings => false, + :latex_list_of_figures => false, + :latex_list_of_tables => false, + :latex_table_of_contents => false, + :latex_generate_index => false } From 11332655fc60e1da070c6bd2231dcec33b77e6ac Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 16:57:22 +0100 Subject: [PATCH 08/17] optimize output of latex code --- lib/textile_doc_latex.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/textile_doc_latex.rb b/lib/textile_doc_latex.rb index 8b06260..63e23f3 100644 --- a/lib/textile_doc_latex.rb +++ b/lib/textile_doc_latex.rb @@ -2,7 +2,6 @@ module RedCloth::Formatters::LATEX_EX include RedCloth::Formatters::LATEX - def td(opts) if opts[:text] if opts[:text].include? "\n" @@ -30,10 +29,12 @@ def td(opts) end def table_close(opts) - output = "\\begin{table}[H]\n" + output = "\\begin{savenotes}\n" + output << "\\begin{table}[H]\n" output << " \\centering\n" cols = 'X' * @table[0].size if not draw_table_border_latex cols = '|' + 'X|' * @table[0].size if draw_table_border_latex + output << "\\begin{minipage}{\\linewidth}\n" output << " \\begin{tabularx}{\\textwidth}{#{cols}}\n" output << " \\hline \n" if draw_table_border_latex @table.each do |row| @@ -42,7 +43,9 @@ def table_close(opts) end output << " \\end{tabularx}\n" output << " \\caption{}\n" + output << " \\end{minipage}\n" output << "\\end{table}\n" + output << "\\end{savenotes}\n" output end @@ -55,7 +58,7 @@ def image(opts) # Build latex code [ "\\begin{figure}[#{(opts[:align].nil? ? 'H' : 'htb')}]", " \\centering", - " \\includegraphics[#{styling}]{#{opts[:src]}}", + " \\lwincludegraphics[#{styling}]{#{opts[:src]}}", (" \\caption{#{escape opts[:title]}}" if opts[:title]), (" \\label{#{opts[:alt]}}" if opts[:alt]), "\\end{figure}", @@ -75,9 +78,10 @@ def latex_code(text) code = $2 lang = "{#{$1}}" end - minted_settings = %W(mathescape linenos numbersep=5pt frame=lines framesep=2mm tabsize=4 fontsize=\\footnotesize) + minted_settings = %W(mathescape linenos numbersep=5pt frame=lines framesep=2mm tabsize=4 fontsize=\\footnotesize breaklines) .join(",") - latex_code_text = "\\begin{listing}[H]\n\\begin{minted}[#{minted_settings}]#{lang}#{code}\n\\end{minted}\n\\caption{}\n\\end{listing}\n" + puts minted_settings + latex_code_text = "\\begin{code}\\begin{minted}[#{minted_settings}]#{lang}#{code}\n\\end{minted}\n\\caption{}\n\\end{code}\n\n" latex_code_text end end @@ -126,11 +130,11 @@ def latex_index_importance(text) end end - def latex_remove_macro(text) - text.gsub!(/(\s|^)\{\{(.*?)\}\}/i) do |_| + def latex_remove_macro(text) + text.gsub!(/(\s|^)\{\{(.*?)\}\}/i) do |_| '' - end - end + end + end end # Include rules From 4f877c94bfbf9dac37b4e8eccd265bf381ad7711 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 18:19:29 +0100 Subject: [PATCH 09/17] add more options for document --- app/views/doc_pu/_form.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/doc_pu/_form.html.erb b/app/views/doc_pu/_form.html.erb index c0af386..2b7c7f3 100644 --- a/app/views/doc_pu/_form.html.erb +++ b/app/views/doc_pu/_form.html.erb @@ -22,7 +22,11 @@

<%= f.check_box :latex_image_ref %> <%= acronym_info_tag t(:info_latex_image_ref) %>

+

<%= f.check_box :latex_table_of_contents %> <%= acronym_info_tag t(:info_latex_table_of_contents) %>

+

<%= f.check_box :latex_list_of_figures %> <%= acronym_info_tag t(:info_latex_list_of_figures) %>

+

<%= f.check_box :latex_list_of_tables %> <%= acronym_info_tag t(:info_latex_list_of_tables) %>

<%= f.check_box :latex_list_of_listings %> <%= acronym_info_tag t(:info_latex_list_of_listings) %>

+

<%= f.check_box :latex_generate_index %> <%= acronym_info_tag t(:info_latex_generate_index) %>

From 16fbd3197720b4d6f297f61d128c75f81b3972a1 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Thu, 21 Jan 2016 18:19:39 +0100 Subject: [PATCH 10/17] add more options for document --- config/locales/de.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 99caf69..cc5872a 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -18,7 +18,11 @@ de: field_latex_index_importance: "Wichtige Wörter indizieren" field_latex_table_border: "Rahmen für Tabellen" field_latex_image_ref: "Bilder refernzieren" - field_latex_list_of_listings: "Liste von Code-Beispielen" + field_latex_list_of_listings: "Codeverzeichnis" + field_latex_table_of_contents: "Inhaltsverzeichnis" + field_latex_list_of_figures: "Abbildungsverzeichnis" + field_latex_list_of_tables: "Tabellenverzeichnis" + field_latex_generate_index: "Index" field_wiki_page: "Wiki Seite" field_chapter_name: "Kapitel Name" field_use_doc_flags: "Dokument Flags verwenden" @@ -75,7 +79,11 @@ de: info_latex_index_importance: "" info_latex_table_border: "Stellt Tabellenlinien dar." info_latex_image_ref: "Erzeuge Bildverzeichnis" - info_latex_list_of_listings: "Erzeugt eine Aufstellung aller Code-Beispiele. Diese wird am Anfang des Dokumentes eingefügt." + info_latex_list_of_listings: "Erzeugt ein Verzeichnis aller Code-Beispiele. Dieses wird am Anfang des Dokumentes eingefügt." + info_latex_list_of_figures: "Erzeugt eine Verzeichnis aller Abbildungen. Dieses wird am Anfang des Dokumentes eingefügt." + info_latex_list_of_tables: "Erzeugt eine Verzeichnis aller Tabellen. Dieses wird am Anfang des Dokumentes eingefügt." + info_latex_table_of_contents: "Erzeugt ein Inhaltsverzeichnis für das gesamte Dokument. Dieses wird am Anfang des Dokumentes eingefügt." + info_latex_generate_index: "Erzeugt einen Index von hervorgehobenen Wörtern (dies sind alle Wörter die mit \\*WORT\\* fett gedruckt werden). Es wird am Ende des Dokumentes eingefügt." button_test: "Test" field_latex_bin: "LaTeX Binärdatei (pdflatex)" field_makindex_bin: "makeindex Binärdatei" From bf5a6f1b9c36982c7603b6f46d8acc0885f49683 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Fri, 22 Jan 2016 16:09:37 +0100 Subject: [PATCH 11/17] make code rails 4.2 compatible --- app/controllers/doc_pu_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/doc_pu_controller.rb b/app/controllers/doc_pu_controller.rb index 09920dc..b6fefaa 100644 --- a/app/controllers/doc_pu_controller.rb +++ b/app/controllers/doc_pu_controller.rb @@ -10,19 +10,20 @@ class DocPuController < ApplicationController # Show all documents def index - @documents = DocPuDocument.find_all_by_project_id(@project) + @documents = DocPuDocument.where(project_id: @project) end # Create new document def new + @templates_list = DocPuTemplates.new(Rails.root.join(Setting.plugin_redmine_doc_pu['template_dir'])).list @doc = DocPuDocument.new @doc.project = @project @doc.user = User.current if request.post? # Save object - @doc.attributes = checkbox_to_boolean(params[:doc]) + @doc.attributes = checkbox_to_boolean(params.require(:doc).permit!) if @doc.save flash[:notice] = t(:flash_document_saved) redirect_to :action => :edit, :project_id => @project, :id => @doc @@ -34,10 +35,10 @@ def new # Edit document def edit - @doc = DocPuDocument.find(params[:id]) - if request.put? + @doc = DocPuDocument.find(params[:id]) + if request.patch? # Update document - @doc.attributes = checkbox_to_boolean(params[:doc]) + @doc.attributes = checkbox_to_boolean(params.require(:doc).permit!) flash[:notice] = t(:flash_document_updated) if @doc.save end From 6f63aa072f7c1dedd1cbb61e9d0d23ac07d4c75c Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Fri, 22 Jan 2016 16:09:52 +0100 Subject: [PATCH 12/17] make code rails 4.2 compatible --- app/models/doc_pu_document.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/doc_pu_document.rb b/app/models/doc_pu_document.rb index 0356a74..d36825b 100644 --- a/app/models/doc_pu_document.rb +++ b/app/models/doc_pu_document.rb @@ -10,7 +10,7 @@ class DocPuDocument < ActiveRecord::Base belongs_to :user belongs_to :project - has_many :doc_pu_wiki_pages, :dependent => :destroy, :order => 'wiki_page_order' + has_many :doc_pu_wiki_pages, :dependent => :destroy validates_presence_of :name, :template, :user_id, :project_id validates_uniqueness_of :name From d9e9bb296474a2471fb71f99b1d07e57cfa8d87a Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Fri, 22 Jan 2016 16:13:10 +0100 Subject: [PATCH 13/17] some polishing --- lib/latex_wiki_page.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/latex_wiki_page.rb b/lib/latex_wiki_page.rb index 5414470..513dfd5 100644 --- a/lib/latex_wiki_page.rb +++ b/lib/latex_wiki_page.rb @@ -32,7 +32,7 @@ def to_latex() ref = $2 label = $4 ref = Wiki.titleize(ref) - redir = WikiRedirect.all(:conditions => ['title = ?', ref])[0] + redir = WikiRedirect.where(title: ref) ref = redir.redirects_to unless redir.nil? " [[#{ref}|#{label}]]" end @@ -46,12 +46,11 @@ def to_latex() rules.push(:latex_index_emphasis) if self.latex_index_emphasis rules.push(:latex_index_importance) if self.latex_index_importance rules.push(:latex_remove_macro) if self.latex_remove_macro - # Convert page to latex r = TextileDocLatex.new(page_txt) r.draw_table_border_latex = self.latex_table_border page_txt = r.to_latex(*rules) - + if self.latex_add_chapter # Add chapter tag page_txt = "\n\\chapter{#{self.chapter_name}} \\label{page:#{self.wiki_page.title}}\n" + page_txt @@ -60,7 +59,7 @@ def to_latex() page_txt.sub!(/\\section\{(.+)\}/i) do |_| "\\section{#{$1}}\\label{page:#{self.wiki_page.title.gsub(' ', '_')}}" end - end + end page_txt end From 04e8b48447f86864eeb4206dd7e029a59b9364cc Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Fri, 22 Jan 2016 16:13:59 +0100 Subject: [PATCH 14/17] imlement a way to configure document related info pages --- lib/latex_doc.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/lib/latex_doc.rb b/lib/latex_doc.rb index e1e7fd9..ffa07ac 100644 --- a/lib/latex_doc.rb +++ b/lib/latex_doc.rb @@ -64,6 +64,49 @@ def to_latex self.wiki_pages.each do |page| doc_txt += page.to_latex end + intro_content = false + pre_text = "" + + if self.latex_table_of_contents + # Add table of contents to the begin of the document + with_table_of_content = "\\tableofcontents\n\n" + pre_text << with_table_of_content + intro_content = true + end + + if self.latex_list_of_figures + # Add list of figures to the begin of the document + with_list_of_figures = "\\listoffigures\n\n" + pre_text << with_list_of_figures + intro_content = true + end + + if self.latex_list_of_tables + # Add list of tables to the begin of the document + with_list_of_tables = "\\listoftables\n\n" + pre_text << with_list_of_tables + intro_content = true + end + + if self.latex_list_of_listings + # Add list of code listings to the begin of the document + with_list_of_listings = "\\listoflistings\n\n" + pre_text << with_list_of_listings + intro_content = true + end + + if intro_content + with_roman_numbers = "\n\n\\pagenumbering{roman}\n\n\\setcounter{page}{1}\n\n" + pre_text = with_roman_numbers << pre_text + pre_text << "\n\n\\cleardoublepage\\pagenumbering{arabic}\n\n\\setcounter{page}{1}\n\n" + doc_txt = pre_text << doc_txt + end + + if self.latex_generate_index + # Add list of code listings to the begin of the document + with_index = "\n\n\\printindex" + doc_txt << with_index + end doc_txt end From 3f1e7f8e148d75d601c37e23b0acbbb9f38639f4 Mon Sep 17 00:00:00 2001 From: Clemens Rudert Date: Fri, 22 Jan 2016 16:15:14 +0100 Subject: [PATCH 15/17] optimize the ways latex output is written, and include some better libraries to improve pdf generation --- templates/scrartcl_de_tcfi.tex | 36 ++++++++++++++++++---------------- templates/scrreprt_de_tcfi.tex | 36 ++++++++++++++++++---------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/templates/scrartcl_de_tcfi.tex b/templates/scrartcl_de_tcfi.tex index 4432174..611f082 100644 --- a/templates/scrartcl_de_tcfi.tex +++ b/templates/scrartcl_de_tcfi.tex @@ -15,8 +15,8 @@ \usepackage[utf8]{inputenc} % textile required packages -\usepackage{minted} -\usepackage{tabularx} +\usepackage{newfloat} +\usepackage[newfloat=true]{minted} \usepackage{caption} \usepackage[normalem]{ulem} \usepackage{graphicx} @@ -24,6 +24,23 @@ \usepackage{multirow} \usepackage{makeidx} \usepackage{hyperref} +\usepackage{tabularx} +\usepackage{footnote} +\usepackage{scrhack} +\makesavenoteenv{tabularx} + +\SetupFloatingEnvironment{listing}{name=Code-Beispiel} +\SetupFloatingEnvironment{listing}{listname=Code-Verzeichnis} + +\newenvironment{code}{\captionsetup{type=listing,belowskip=12pt,aboveskip=4pt}}{} + +\newcommand{\lwincludegraphics}[2][]{% + \sbox{0}{\includegraphics[#1]{#2}}% + \ifdim\wd0>\linewidth + \resizebox{\linewidth}{!}{\box0 }% + \else + \leavevmode\box0 + \fi} \hypersetup{ colorlinks=true, % false: boxed links; true: colored links @@ -48,22 +65,7 @@ % title on the first page \maketitle - % table of contents - \tableofcontents - - % list of figures - \listoffigures - - % list of tables - \listoftables - - % list of listings - \listoflistings - % input \input{document.tex} - - % print index - \printindex \end{document} diff --git a/templates/scrreprt_de_tcfi.tex b/templates/scrreprt_de_tcfi.tex index 3ee6764..dd8cdb8 100644 --- a/templates/scrreprt_de_tcfi.tex +++ b/templates/scrreprt_de_tcfi.tex @@ -15,8 +15,8 @@ \usepackage[utf8]{inputenc} % textile required packages -\usepackage{minted} -\usepackage{tabularx} +\usepackage{newfloat} +\usepackage[newfloat=true]{minted} \usepackage{caption} \usepackage[normalem]{ulem} \usepackage{graphicx} @@ -24,6 +24,23 @@ \usepackage{multirow} \usepackage{makeidx} \usepackage{hyperref} +\usepackage{tabularx} +\usepackage{footnote} +\usepackage{scrhack} +\makesavenoteenv{tabularx} + +\SetupFloatingEnvironment{listing}{name=Code-Beispiel} +\SetupFloatingEnvironment{listing}{listname=Code-Verzeichnis} + +\newenvironment{code}{\captionsetup{type=listing,belowskip=12pt,aboveskip=4pt}}{} + +\newcommand{\lwincludegraphics}[2][]{% + \sbox{0}{\includegraphics[#1]{#2}}% + \ifdim\wd0>\linewidth + \resizebox{\linewidth}{!}{\box0 }% + \else + \leavevmode\box0 + \fi} \hypersetup{ colorlinks=true, % false: boxed links; true: colored links @@ -48,22 +65,7 @@ % title on the first page \maketitle - % table of contents - \tableofcontents - - % list of figures - \listoffigures - - % list of tables - \listoftables - - % list of listings - \listoflistings - % input \input{document.tex} - - % print index - \printindex \end{document} From cbaa28962221e70431ad6aa411215f998ba67b6c Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 22 Jan 2016 17:15:17 +0100 Subject: [PATCH 16/17] Update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e018f54..017fb18 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ DocPu, Document publishing plugin This plugin enables PDF export and generation for Redmine wiki pages using the LaTeX typesetting system. But it is even more than an simple PDF exporter since it uses the LaTeX text and figure layout engine. Originally this redmine plugin was created by Christian Raschko (sponsored by [ATV-Elektronik](http://atv-elektronik.co.at/)). It was intended to be used for 1.1.x verisions of redmine and below. -Since this plugin creates eye catching documents and of cause can be extended a little more I decided to adopt the code and make it valid for use in __redmine 2.6.x__ versions. +Since this plugin creates eye catching documents and of cause can be extended a little more I decided to adopt the code and make it valid for use in __redmine 3.2.x__ versions. Mainly all features as described below should work. You may find formatting in Redmine's wiki-syntax which isn't covered yet. If so-feel free to contact me. @@ -30,6 +30,11 @@ Dependencies DocPu uses and extends the [RedCloth4](http://redcloth.org/) LaTeX export module, which is a converter for the Textile markup language. The system which hosts redmine should also have an working installation of LaTeX. Since the code highlighting is done by pygments, this python package should be installed too. This version of the plugin is made to work with __redmine 2.6.x__. This indicate a dependency to [rails 3.2](http://guides.rubyonrails.org/v3.2.21/3_2_release_notes.html) as you can see [here](http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Ruby-interpreter). For older redmines you can refer to this [version](http://www.redmine.org/plugins/redmine_doc_pu) of the plugin. +List of Dependencies in a quick view: +* redmine 3.2.0 (tested with ruby 2.0, rails 4.2.5, RedCloth 4.2.9) +* Tex (tested with pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014)) + * Packeges which are important due to creation process of the PDF inside the plugin (newfloat, minted, caption, ulem, graphicx, float, multirow, makeidx, hyperref, tabularx, footnote, scrhack) + Installing RedCloth4 -------------------- @@ -47,6 +52,7 @@ On Windows machines you can download and install the [MikTex](http://miktex.org/ DocPu Requires the following LaTeX packages, be sure you have them installed as well: +* newfloat * tabularx * listings * ulem @@ -57,6 +63,8 @@ DocPu Requires the following LaTeX packages, be sure you have them installed as * hyperref * minted * caption +* footnote +* scrhack ### Testing LaTeX @@ -162,3 +170,11 @@ DocPu supports the Redmine/Textile table syntax with table span and heading. # Template handling The templates in the plugins template directory are simply LeTeX-Templates. Please refer to [this](https://en.wikibooks.org/wiki/LaTeX) guide to learn more about LaTeX and how to use it. + +It is really important, that you have a look at the templates which are included in this plugin. There you can have a look how a template must be written to match the criteria set by this plugin. We designed around this pattern several special looking templates, which are working well. You should be able to do so as well. But keep in mind to NOT DELETE/EDIT ANY CONTENT/PACKAGES which is given in this templates. You can copy one of them (keeping all stuff which is in it) and use the copy to add your own styling. Again: If you delete/edit any thing of the given parameters it will probably not work. But you have enough options to build a nice looking template on top of the existing pattern. + +# Known Problems + +* Footnotes in tables are placed directly under the table and not to the end of the page (this is due to LaTeX-dependet problems => you may google for it). +* Sometimes the index will not be created well (it helps to build the document 2-3 times again => the number of warnings should decrease) +* to get rid of the warnings and sometimes the errors it can be helpful to rebuild the document 2-3 times before having a look on the templates (also use the clean function in the build view to delete all generated files if you are facing any problems) From e8d371cf4a7409af47ca02ceda9579b79bf583c3 Mon Sep 17 00:00:00 2001 From: Kalle Date: Fri, 22 Jan 2016 17:22:22 +0100 Subject: [PATCH 17/17] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 017fb18..34090ff 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Features Dependencies ============ -DocPu uses and extends the [RedCloth4](http://redcloth.org/) LaTeX export module, which is a converter for the Textile markup language. The system which hosts redmine should also have an working installation of LaTeX. Since the code highlighting is done by pygments, this python package should be installed too. This version of the plugin is made to work with __redmine 2.6.x__. This indicate a dependency to [rails 3.2](http://guides.rubyonrails.org/v3.2.21/3_2_release_notes.html) as you can see [here](http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Ruby-interpreter). For older redmines you can refer to this [version](http://www.redmine.org/plugins/redmine_doc_pu) of the plugin. +DocPu uses and extends the [RedCloth4](http://redcloth.org/) LaTeX export module, which is a converter for the Textile markup language. The system which hosts redmine should also have an working installation of LaTeX. Since the code highlighting is done by pygments, this python package should be installed too. This version of the plugin is made to work with __redmine 3.2.x__. This indicate a dependency to [rails 4.2.5](http://guides.rubyonrails.org/4_2_release_notes.html) as you can see [here](http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Ruby-interpreter). For older redmines you can refer to this [version](http://www.redmine.org/plugins/redmine_doc_pu) of the plugin. List of Dependencies in a quick view: * redmine 3.2.0 (tested with ruby 2.0, rails 4.2.5, RedCloth 4.2.9) @@ -40,7 +40,7 @@ Installing RedCloth4 Currently Redmine uses RedCloth3, so you have to additionally install RedCloth4. The simplest solution is by typing gem install RedCloth, but this only works if you have a compiler set-up, since some parts are written in C code. -For windows users a pre compiled gem package can be downloaded from the repository. Download it first and install it via eg. gem install RedCloth-4.2.2-x86-mswin32-60.gem +For windows users a pre compiled gem package can be downloaded from the repository. LaTeX ----- @@ -162,6 +162,8 @@ The image position can be fixed or floated. Fixed images occur at the text posit Normally you have the standard LaTeX [image types](https://en.wikibooks.org/wiki/LaTeX/Importing_Graphics#Supported_image_formats) available for use. +Note that all images are scaled to fit in the text width space with keeping the spect ratio if they are to large for the page. + ## Tables DocPu supports the Redmine/Textile table syntax with table span and heading.