New hot document: Tips & Tricks

In txt2tags, you ever wondered how to:

  • Make strike, subscript or superscript text?
  • Insert the ALT text for images?
  • Create a custom DIV or SPAN?
  • Make a line break <BR>?
  • Load extra LaTeX packages?
  • Make colored code snippets?

Fear don’t. Txt2tags Tips & Tricks!

Leave a comment to share your own tip or suggest a new!

Advertisements

13 responses to “New hot document: Tips & Tricks

  1. very useful! :-)

    typo found: section “8. Config Overview” you wrote “thier” meaning “tier”… ;-)

  2. Hi Aurélio,

    I prefer to use pgf to incude pictures in my latex documents, so these q&d achieve the conversion :
    %!postproc(tex): ‘(\usepackage{amsfonts,graphicx,url})’ ‘\1\n\usepackage{pgf}’
    %!postproc(tex): ‘includegraphics{(.*).png}’ ‘pgfimage[width=\linewidth]{\1}’

    PS: I don’t forgot you, I will soonly publish my ktxt2tags app. But I’m a bit busy currently :-)

  3. Hi bobuse,

    The first postproc you can change by a single:

    %!style(tex): pgf

    Ok, tell me any news on the K world :)

  4. Thank you for this tip ;-)

  5. I have been trying very hard to do something like

    %!preproc: ‘DEF(.*)DEF’ [\1 http://www.google.com/search?q=define:\1]

    But it just doesn’t work and I don’t know why.
    Could you explain why? It break the web or don’t add the \1 on the link (I tried many things).
    Why I can do on preproc ?

    Finally I got success on this way:
    %!postproc(html): ‘–([^ ].*?)–‘ <a HREF=”http://www.google.com/search?q=define:1″ rel=”nofollow”>\1</a>

    So –css– is converted to a link to google define css
    I think is useful.

    Cumprimentos.

  6. Hello Ruben,

    The problem is that the “:” char is not recognized by txt2tags as valid for URLs, inside the form data (after the “?”). If you just change from PreProc to PostProc on your first rule, it will work:

    %!postproc(html): 'DEF(.*?)DEF' '<a href="\1">\1</a>'

    But your second filter is fine.

  7. Hello Aurelio !
    no need for new translation ?

    I suggest a tip for html generation pages.
    I worked in iso8859-1 (in use in France) for my website.
    Now installing Debian Etch : all is in UTF8. This is fully incompatible for my website.
    People working with 2 different codes depending of their OS
    So now I generate ´ ù aso with a translation table :
    a line for each character :
    %!preproc(html) : “è” “&egrave”
    I already need another command
    %!postproc(html) : “&” “&”
    because I got &egrave; without it.
    And I put these commands in the RC file.

    Seems to work

    Bye
    Claude

  8. Hello Claude!

    In this case, you must use the %!encoding setting on every document, reflecting the source file encoding (ISO or UTF).

    Nice to see you here

  9. G. Grothendieck

    Remove latex title and title page.

    –no-header removes the title but then its not a valid self
    contained latex file any more. Leaving the first line of your
    input file blank and putting this on the second line does it:

    %!postproc(tex): \\maketitle %\maketitle

    Given the minimalist philosophy of txt2tags I think this should
    be easier to do, e.g. maybe: txt2tags –no-title -t tex input.t2t

  10. How to add images in a list?

    ——— I do this
    + Blah Blah Blah Blah Blah
    [pic.png]
    + Blah Blah Blah Blah
    ————————

    Problem (above): If you just add the image it gets mixed with other elements in the list.

    Solution:

    ——————————————–
    + Blah Blah Blah Blah Blah
    @@
    [pic.png]
    + Blah Blah Blah Blah
    ——————————————– Being @@ the trick for newline in html.

    ——————————————– Another option
    + Blah Blah Blah Blah Blah

    [pic.png]
    + Blah Blah Blah Blah
    ——————————————–

  11. Suggestion For A New Tip:-
    To prevent a url breaking at first non alph character, place the whole url between pairs of double quotes; like this “” … “”
    Example:-
    Link to my [Christmas parcel “”http://track.bpost.be/btr/web/#/search?itemCode=CE123456789BE&lang=en””]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s