Longitude of Titles set in 50 chars and more issues on LaTeX pdf export

22 views
Skip to first unread message

Offray Luna

unread,
Jun 5, 2012, 12:19:49 AM6/5/12
to nested...@googlegroups.com
Hi,

I'm making my workflow on Nested and now I write a simple document on
Nested, export it to html and LaTeX, make some changes on the LaTeX
output and run manually pdflatex to get the wanted results. The problem
with a direct export from Nested to pdf is that I don't get the proper
control with figures yet. For the moment this will be the workflow, but
I would like to propose some changes on the markup in order to get
better results with LaTeX.

In the previous mail I proposed some syntax like this:

%!code-block
```latex
<latex code>
```

After that I thought that this code would be a better variant:

%!code-block
: latex
```
<latex code>
```

or may be something like:

%!code-block: : latex
%%%
<latex code>
%%%

or

%latex%
%%%
<latex code>
%%%


Or some variation that preserves the idea that, when you have large
portions of target code, you don't have to mark every line with %target%
individually. Ideally should be nice to have more control on txt2tags
source code for variations of the source doc that give you more control
on the output (scale or arranges of images, table borders) without
making the markup extremely complex. Thats the real issue here:
preserving the easy and flexible spirit of txt2tags while giving
professional output support for the most used targets (xhtml, LaTeX, pdf
and, who knows eventually Libre Office).

One final thing: the max length of titles in Nested is 50 characters.
This is kind of arbitrary and strange for a professional typing system.

Cheers,

Offray

Carlos Jenkins

unread,
Jun 5, 2012, 12:33:22 AM6/5/12
to nested...@googlegroups.com


2012/6/4 Offray Luna <offra...@mutabit.com>
Or some variation that preserves the idea that, when you have large portions of target code, you don't have to mark every line with %target% individually. Ideally should be nice to have more control on txt2tags source code for variations of the source doc that give you more control on the output (scale or arranges of images, table borders) without making the markup extremely complex. Thats the real issue here: preserving the easy and flexible spirit of txt2tags while giving professional output support for the most used targets (xhtml, LaTeX, pdf and, who knows eventually Libre Office).
Yes, that's exactly the problem. As discussed in the other thread, there is no easy solution for that, and with that kind of requirements there is no other solution than to fork txt2tags, and really don't want to that. In the case, for example, the table borders, that is a presentation feature, so this should not be included in markup, this should be in the theme in case of HTML, or in the header in case of LaTeX. 
For now, I do:

%tex% '''
%tex% \begin{figure}
%tex% '''
[250-sample_figure.png]
%tex% '''
%tex%     \caption{Simulation Results}
%tex%     \label{simulationfigure}
%tex% \end{figure}
%tex% '''

Or for example, for two columns:

%xhtmls% ''<table style="margin: 0 auto 0 auto; width: 80%;" border="0"><tbody><tr><td>''
%tex% ''\begin{multicols}{2}''

- Actionscript (FlexUnit)
- Ada (AUnit)
- C (CUnit)
- C# (NUnit)
- C++ (CPPUnit)
- Fortran (fUnit)
- Delphi (DUnit)
- Free Pascal (FPCUnit)


%xhtmls% ''</td><td>''

- JavaScript (JSUnit)
- Objective-C (OCUnit)
- Perl (Test::Class y Test::Unit)
- PHP (PHPUnit)
- Python (PyUnit)
- R (RUnit)
- Haskell (HUnit)
- Qt (QTestLib)


%xhtmls% ''</td></tr></tbody></table>''
%tex% ''\end{multicols}''
%tex% ''\newpage''

But yes, you have to repeat %target% every time. Suggestions are welcome, the problem is always interacting with txt2tags, because right now %target% is just a default preproc, just that.

One final thing: the max length of titles in Nested is 50 characters. This is kind of arbitrary and strange for a professional typing system.
Yes, absolutely arbitrary. How much do you need? I haven't a criteria for choosing a maximum length. In any case, this is a GUI restriction, that can be changed in file gui.glade in the source directory, line 3808:

                      <object class="GtkEntry" id="title_entry">
                        <property name="width_request">300</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="max_length">50</property>

Thanks again for this kind of feedback, it helps Nested a lot to become better.

Kind regards

--
Carlos Jenkins
http://carlos.jenkins.co.cr/

Carlos Jenkins

unread,
Jun 5, 2012, 1:11:04 AM6/5/12
to nested...@googlegroups.com
BTW centering of LaTeX images if I remember is not working, and fixing it is quite tricky. For now I have to do:

%tex% '''
%tex% \begin{figure}[H]
%tex% \begin{center}
%tex% '''
[400-nunit_loc.png]
%tex% '''
%tex%     \caption{Evolución de la cantidad de líneas de código y su distribución.}
%tex%     \label{nunit_loc}
%tex% \end{center}
%tex% \end{figure}
%tex% '''

The [H] lets put the image in the same place as in your source code, but you need to add:

\usepackage{float} % To fix images position

To the LaTeX header.

Offray Luna

unread,
Jun 5, 2012, 1:47:14 AM6/5/12
to nested...@googlegroups.com
On 04/06/12 23:33, Carlos Jenkins wrote:
>
> 2012/6/4 Offray Luna<offra...@mutabit.com<mailto:offra...@mutabit.com>>
>
>
> One final thing: the max length of titles in Nested is 50 characters. This
> is kind of arbitrary and strange for a professional typing system.
>
> Yes, absolutely arbitrary. How much do you need? I haven't a criteria for
> choosing a maximum length. In any case, this is a GUI restriction, that can be
> changed in file gui.glade in the source directory, line 3808:

Well I don't know. May be 200. Can't be this just as long as is needed?
and make the interface scroll the letter in the box in case you reach
the limit?

Hopefully a longer limit will be put in the next svn version. About the
LaTeX code I would like to show the code I need to put on the LaTeX file
manually to see if this can be integrated in the txt2tags source code. I
will post them in some pastebin space.

Cheers,

Offray

Carlos Jenkins

unread,
Jun 5, 2012, 2:03:29 AM6/5/12
to nested...@googlegroups.com


2012/6/4 Offray Luna <offra...@mutabit.com>

Well I don't know. May be 200. Can't be this just as long as is needed? and make the interface scroll the letter in the box in case you reach the limit?
Well, yes... I removed the limit, please report any LaTeX failure when compiling the document with a large or particular title (if any). I made a commit the lastest changes:


Kind regards

Offray Luna

unread,
Jun 5, 2012, 11:47:45 AM6/5/12
to nested...@googlegroups.com
Hi,

On 05/06/12 01:03, Carlos Jenkins wrote:
>
> 2012/6/4 Offray Luna<offra...@mutabit.com<mailto:offra...@mutabit.com>>
>
> Well I don't know. May be 200. Can't be this just as long as is needed? and
> make the interface scroll the letter in the box in case you reach the limit?
>
> Well, yes... I removed the limit, please report any LaTeX failure when compiling
> the document with a large or particular title (if any). I made a commit the
> lastest changes:
>
> http://sourceforge.net/p/nestededitor/code/242/

I've updated to the 242 revisión of the code and is working fine for
long titles. There is a problem with LaTeX export that is not related
with the longitude of titles but with the use of special document
classes. For example, this is what I have in the preamble of a LaTeX text:

```
%%% Preamble
\documentclass[paper=a4, fontsize=11pt]{scrartcl} % Article class of
KOMA-script with 11pt font and a4 format
\usepackage[T1]{fontenc}
\usepackage{fourier}


\usepackage[protrusion=true,expansion=true]{microtype} %
Better typography
\usepackage{amsmath,amsfonts,amsthm}
% Math packages
\usepackage{graphicx} % images and graphics
\usepackage{paralist} % needed for compact lists
\usepackage[normalem]{ulem} % needed by strike
\usepackage{listings} % required for code blocks
\usepackage[urlcolor=blue,colorlinks=true,hyperfootnotes=false]{hyperref} %
links
\usepackage[utf8]{inputenc} % char encoding
\usepackage[spanish]{babel}
\usepackage[bottom]{footmisc} % footnotes
\usepackage{caption}
\usepackage{subcaption}


%%% Custom sectioning (sectsty package)
\usepackage{sectsty} %
Custom sectioning (see below)
\allsectionsfont{\centering \normalfont\scshape} % Change font of al
section commands


%%% Custom headers/footers (fancyhdr package)
\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhead{} % No
page header
\fancyfoot[L]{\small \url{http://kazak.com.co}} % You may
remove/edit this line
\fancyfoot[C]{} % Empty
\fancyfoot[R]{\thepage} % Pagenumbering
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt}
\renewcommand{\thefigure}{\arabic{figure}} % Changing the way figures
are numbered

%%% Equation and float numbering
\numberwithin{equation}{section} % Equationnumbering: section.eq#
%\numberwithin{figure}{section} % Figurenumbering: section.fig#
\numberwithin{table}{section} % Tablenumbering: section.tab#


%%% Maketitle metadata
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Horizontal rule

\title{
%\vspace{-1in}
\usefont{OT1}{bch}{b}{n}
\normalfont \normalsize \textsc{.:| Labs Consortium |:.} \\ [25pt]
\horrule{0.5pt} \\[0.4cm]
\huge This is the title of the template report \\
\horrule{2pt} \\[0.5cm]
}
\author{
\normalfont \normalsize
Kazak Ltda\\[-3pt] \normalsize
\today
}
\date{}
```

as you can see the preamble define a document class different of the
options given in the document properties window (Article, Book, Paper,
Report) and this can be a frequent condition of LaTeX final doc tunning,
so, in this case I think that Nested could have an extra option in the
Document Class menu and is "As defined in header". In fact the
particular markup that Nested puts before the \begindocument LaTeX
command should be put _between_ the used defined header and the
\begindocument command, so we could get a consistent behavior between
user options that can change the whole document and Nested automatically
added options for supporting links, internal refs and so on.

For the moment I'm using subfigure code to create figure arrangements in
LaTeX/pdf outputs and tables in html outputs and works fine, but now my
LaTeX and nested sources have diverged, because when I try to use %tex%
trying to set the options for image arrangements the LaTeX preamble gets
overwritten and I want to preserve it for getting the proper pdf output.
So, for me, the most important feature that Nested introduce as a
superset of txt2tags are content blocks that are treated differently.
This is want you get with "%%%", "{{{", "}}}" and "<<<", ">>>" blocks,
which are not part of the txt2tags set. The idea would be to introduce
some kind of markup that treat that content blocks in a special way if
they are processed from Nested superset and outputs to default content
in the txt2tags subset. Thats why I'm proposing something like:

%!code-block
<language>
```
<content>
```
or

%!img: <options>
[my-image.png]

I don't know how to support this features without breaking txt2tags
standard of if is possible to play with this options in a more modular
way, extending the standard without breaking it. But having a divergence
between Nested source and intended targets is not a nice option either.
For the moment I will use Leo to break LaTeX and Nested inputs and remix
them as I need to get the proper output, but I will try to help as much
as I can to get Nested as a viable option for writing structured light docs.

Cheers,

Offray
Reply all
Reply to author
Forward
0 new messages