There’s a commandline version of Espript
IIRC. That would probably work.
I also like the TeX package texshade
for rendering MSAs, if you’re prepared to get your hands dirty with TeX.
I’ll post an example when I’m at a proper computer.
Finally at a computer, so here's an example of something you can do with TeXShade. You can of course run TeX from the commandline. It would probably be sufficient to write a wrapper script to inject the file names, or to actually write the source itself for you.
\documentclass[a4paper, oneside, 11pt]{report} % Doc Setup
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm]{geometry} % Doc Geometry
\usepackage{texshade}
\usepackage{lscape}
\begin{document}
\begin{landscape}
\begin{texshade}{/path/to/your/alignment.ext}
\seqtype{P}
\setfont{numbering}{tt}{md}{sc}{small}
\setfont{names}{tt}{md}{up}{tiny}
\setfont{residues}{tt}{md}{sc}{tiny}
\setfont{ruler}{tt}{bf}{sc}{tiny}
\shadingmode[allmatchspecial]{similar}
\feature{top}{1}{25..25}{fill:$\downarrow$}{Hi, I'm an annotation}
\feature{bottom}{1}{70..76}{brace}{So am I!}
\end{texshade}
\end{landscape}
\end{document}
This creates:
It might not be a perfect solution, as you'd need to play with the sizing etc, or perhaps figure it out dynamically. I think Espript
actually runs LaTeX behind the scenes anyway.
Revisting this thread to remind myself (having just wasted the last half an hour chasing ghosts), that
texshade
will not cooperate with 'shorthand' file paths, so ensure you use the absolute path to the alignment (i.e. avoid~
).Another note to myself/others for the future, for large alignments TeX may issue a memory size error.
This can be altered with the
main_memory
parameter of thetexmf.cnf
file for your distribution (or equivalent). See here:https://tex.stackexchange.com/questions/24753/memory-settings-with-mactex-which-texmf-cnf-to-modify
I am very OK with TeXing. Looking into Espript in the meantime. Thank you!
Hey, I can't find a link to download Espript. It says in the FAQ that it's a web browser software? http://espript.ibcp.fr/ESPript/ESPript/esp_faq.php
This page suggests there's a Linux binary:
http://espript.ibcp.fr/ESPript/ESPript/esp_userguide.php
http://espript.ibcp.fr/ESPript/ESPript/download/ESPript_linux_x86-64
Yup... I guess I'm terrible at searching, but to be fair it's a bit of a stretch to have to navigate through "Online and web" to find what is offline and not web. -_-
Big thanks though!!!
Yeah, I agree, they could certainly make it more obvious.
Don't forget to upvote comments/answers that have helped, and to Accept answers that fully address your question.
That is quite beautiful! I shall keep this one... and if Espript proves troublesome I know what to do. Big thanks!!
I encourage you to read the documentation, there's a hell of a lot of customisation achievable with
TeXShade
.Hey, ESpript was interactive in the CLI so I had to resort to texshade. It's... almost working well. Wasted a few hours on that it couldn't handle special characters in the sequence IDs, amongst other things.
Anyway, now I only need to figure out how to properly center the image. Do you have any ideas? I've tried the \alignment{center} but it appears to do nothing. I tried enclosing the \texshade environment in a \begin{center} but that led to a crash...
Ahh, I didn't realise that, its been some time since I tried using it. That's a pain.
Without testing it, I would have expected
\begin{center}...
to work, it may be the landscape-ness of my example which is causing problems.Here's one option you could consider, use of the
memoir
documentclass includes the\vplace{}
environment:Combined with the
preview
package, the page can be made to dynamically fit the content. I haven't tested this with an alignment that runs over more than one line, but I think in theory at least, it should work.I get:
You are so helpful! Thank you :))
My code has the same structure as yours, but I'm getting silly results where you get nice ones. My alignments are not centered, wrap to multiple lines, and the output page is not landscape oriented. Hmm...
can you provide a link to your alignment, so I can try it with that data specifically?
Are you creating this document with
latex
or some of the other variants?I'm creating a pdf with xelatex through latexmk because I need to use special fonts that weren't available in pdflatex. Pastebin fasta: https://pastebin.com/xgNxMMRv
I then convert the pdf to jpg but that's unimportant since the pdf is unsatisfactory: https://ibb.co/LNGHG7Y
I have to leave work now but know that I really appreciate your support! There is no active help channel for texshade according to my googling so without you I'd be quite lost ^_^
The developer of the package is reasonably respondent when I've spoken to him in the past.
I can reproduce weird formatting if I typeset with
xelatex
, though I confess this is where my TeX experience starts to run thin, as I've only ever worked with 'basic'LaTeX
.The actual texshade object can just be considered a box/figure like anything else in TeX though, so it should be manipulable in most if not all of the standard ways. I did experiment with putting it inside a minipage, but it seemed tedious and not very robust so quickly gave up on that approach.
I landed upon this thread: https://tex.stackexchange.com/a/299008/60232 and tried David Carlisle's approach, but that doesn't work in base latex. According to the comments it should work with
xetex
so maybexelatex
too? Worth a try perhaps.Alternatively, you might have to experiment with making your fonts work with base
latex
instead....Testing with your data, but via
LaTeX
does still produce the desired output (the length of each line can be controlled with\linewidth
generally, and via specific options inside theTeXShade
environment too):I'll see if I can get in touch with him then!
If I change back to LaTeX I can get it working OK, actually. Too bad... I thought XeTeX and LuaTeX were supposed to build on LaTeX, not diverge from it!? :(
I tried the solution by Carlisle but get this error regardless of whether I use LaTeX or XeLaTeX: ! Dimension too large. l.25 \pdfpagewidth=\wd0
Not knowledgeable enough to understand what is means.
I think I'll have to stick with your solution and base LaTeX. Perhaps there's some font similar enough to Palatino...
Yep thats the same error I got from David's suggestion, but I assumed that might have been a base LaTeX issue. Was above my head too, and I lacked the enthusiasm to delve in to every element of that answer to see what was going on!
I think you can use the
fontspec
package in base latex to add custom fonts. Its normally just a matter of pointing a filepath at thepalatino.ttf
file.Yeah I have successfully used fontspec and eg tglpagella in a minimal Latex script, but when I use it inside the texshade environment everything goes bonkers. Do you have a fresh e-mail address to the writer of texshade? I only find old ones that cause a bounce...
Inside the TeXShade environment itself you may be limited, as the package works by measuring the
M
andg
characters to calculate how wide the lines need to be etc. They would also need to be monospaced fonts for the alignments to render properly. You may have to toggle between font sets for the rest of the doc, and for the TeX environment. Alternatively, use the above solutions to render an image, and then pull that image in separately into a doc using Xe(La)TeX.The last email I used (bearing in mind this was around 6 months ago) was:
ebeitz [at] pharmazie [dot] uni-kiel [dot] de
(Obfuscated the email so that hopefully it doesn't get picked up by bots).
Heyo, I got in touch with him. Turns out if you put e.g. \usepackage{tglpagella} in the header, that becomes the 'default' font for the TexShade env, and the default font is called with 'rm', apparently (I thought 'rm' was for roman or something):
\setfont{names}{rm}{md}{up}{tiny}
And now it works perfectly!
I cropped the resulting images with imagemagick's convert -trim. I'm a jolly fellow now.
Thanks for everything, m8!
Perfect! LaTeX never ceases to amaze.
That email worked!
Thank you and I will let you know what he says about this :-]
this doesn't work for me
Paragraph ended before \inf@@get was complete.
I'm afraid I can't diagnose the issue just based on that - I'd need to see the code you're using. It will depend on the engine you're typesetting with as well.