10 ms·
Pwning coworkers thanks to LaTeX
- chj 10y agoshell-escape really should be turned off by default.
- exDM69 10y agoIt is, or at least had been on every distro I've used. I had to explicitly enable it to use gnuplottex. The article shows a default config file where it is enabled for a handful of commands.
- lucb1e 10y ago> Writing reports in LaTeX is painful. No it's not. I like being able to use my favorite editor to write markup a lot better than being forced into a particular WYSIWYG editor. > In short, run `pdflatex` in a VM. Yeah with a premature prankster you might have to.
- philtar 10y ago>No it's not. Yes, it is. That's like saying I prefer bash because it's the same on all platform as opposed to windows proprietary UI. Is latex powerful? Yes. Is it easy? Not for the average user.
- itazula 10y agoThe "average" user isn't aware of the alternative that is LaTeX. Watching a few tutorials is an easy way to start. For example, see https://www.sharelatex.com/blog/latex-guides/beginners-tutorial.html https://www.sharelatex.com/blog/latex-guides/beginners-tutor... and go from there.
- adimitrov 10y ago> Is latex powerful? Yes. Is it easy? Not for the average user. Have you tried writing technical reports in Word? It's a nightmare. Word's numbering and reference functionality, not to mention its citation functions are way worse than what you can achieve with TeX. Cooperating on writing the same document with many people? Yeah, forget about it. One guy has Mac OS with one Word version and then you have three others with different combinations of Windows/Word, and the whole thing implodes in a cascade of formatting glitches. Also, I'd say that if you can't write your technical report in LaTeX because LaTeX is too hard, let's go shopping (in the Microsoft App Store), then maybe you shouldn't be writing a technical report. Not to mention that nobody has to write an ounce of LaTeX since the advent of pandoc.
- wallacoloo 10y agoSaying that the alternatives are hard does not do anything to prove that LaTeX is easy. When you make a syntax error (missing closing brace, forgot to escape that underscore, etc), what's the probability that the latex error message will be at all relevant to the source of the error? It's pretty damn low. In my experience, debugging LaTeX is anything but easy.
- adimitrov 10y agoYes, typesetting documents isn't easy, and it takes skill. Yes, LaTeX's error reporting is a bloody mess straight out of the 80s. Word may make it easier to half-ass something. But its error reporting is way worse than LaTeX's — it doesn't have any. If something's fucked up, it's fucked up, and good luck finding out what you did wrong. Writing a consistently styled, readable and good looking document in Word is anything but easy. So we're back to square one: typesetting a document is hard, and there is no software solution that makes it easy (for simple stuff, pandoc comes close.) You'll have to learn to do it.
- IshKebab 10y agoHave you tried writing technical reports in LyX? It's not a nightmare and you can see what it looks like.
- raesene6 10y agoTo provide a counterpoint, I've been writing Technical reports in word for about 15 years, using it for about 20, works fine for most things I've seen. Like any complex program there are things to learn and quirks to get used to, but it can be a very powerful platform once you get past that.
- deleted 10y ago[deleted]
- adrianN 10y agoFor an average document that doesn't do anything special, Latex is extremely simple. It only gets complicated if you want to deviate from the design that your document class uses by default. The average user of course doesn't even know what the difference between a text editor and MS Word is but I'd argue that it's not much harder to learn using something like LyX than learning Word. Word only wins because of peer pressure. Almost all offices use MS Office, so you're expected to use that, even for documents where simple Markdown would be completely sufficient.
- TeMPOraL 10y ago> It only gets complicated if you want to deviate from the design that your document class uses by default. Which is always, because defaults are ugly as hell. Might work for math papers, but not much else. My only real issue with LaTeX though is its error reporting, which is less readable than C++ template metaprogramming fails, and the fact you have to compile the same file $magic times in a row to get a stable render.
- railorsi 10y ago> Which is always, because defaults are ugly as hell. Might work for math papers, but not much else. There are shittons of templates.
- scatty 10y ago> My only real issue with LaTeX though is its error reporting, which is less readable than C++ template metaprogramming fails Oh, that's so true. I've spend far to many hours trying to help debug LaTeX code from friends and coworkers. I'd give Office users that MS Office is easier to use if you want to write one page of plain text without anything else but above that Office is just a huge pain in the a... But the biggest problem I have with Office isn't whether it's hard to use or not but that the text it produces is simply ugly. Especially so if you have to work between different versions of MS Office and maybe even an OO user within the loop. (That would than probably be me...) The text layout MS Office produces is simply hideous.
- adrianN 10y ago
- iveqy 10y agoI would say it's a huge difference between easy to use and easy to learn. LaTeX is easy to use, but not easy to learn.
- pqs 10y agoMaybe LaTeX is not easy, but writing a scientific PhD dissertation in LaTeX is easier than doing so in Word. I did it in LaTeX. I had no problems. My wife did it in Word, and we both spend hours trying to solve tons of stupid Word related problems. edits: typos.
- dagw 10y agoWriting a dissertation in word is fine. Preparing for a dissertation for print in word is a pain in the ass. The 'correct' way to do it is to write in Word, do citations in Endnote, and then lay the whole thing out in InDesign.
- CmdrSprinkles 10y agoAnd for actual publications and the like, latex is indeed awesome and there is a strong argument for superiority. But the ``problem'' is people who insist on using it for everything. Have a memo? Better set up a repo. Writing a report for a manger? Latex! With the simpler things where you won't be cross referencing constantly and any figures that you have you want absolute control over placement, Word is the way to go. And pretty much the moment you are done your dissertation, that is the majority of what you'll write. Even in academia you'll likely spend more time writing grants and memos than papers. And, with at least the former, what matters most is having the figure easily seen and fitting the format requirements (specifically page count). Use the best tool for any given job.
- sidarape 10y agoI agree. The other day, I had to write a 1-page project proposal for a PhD scholarship and they were giving the font to use and its size, and the margins. I had almost no mathematical symbol to use. One of the professors said that it looks unprofessional to not use Latex. I mean, I could have use Latex and I would have looked like exactly the same given the requirements. I just did it in LibreOffice because that was really the simplest I could have done.
- ssivark 10y ago
- wietze 10y agoLet me be the guy that brings this article in: http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0115069 http://journals.plos.org/plosone/article?id=10.1371/journal.... "LaTeX users were slower than Word users, wrote less text, made more typesetting, grammatical, and formatting errors"
- MereInterest 10y agoAlso, the usual rebuttal to that article. http://tex.stackexchange.com/a/219581 http://tex.stackexchange.com/a/219581. Anything that did not perfectly reproduce the typesetting of a reference document, they counted as a typesetting error. Any word placement at the end of one line as opposed to the start of the next, for example. The sort of thing that LaTeX handles automatically, and better than humans.
- nekopa 10y agoMurphy's law in action, there was a correction made to the paper you quote, so I clicked through to see what was corrected: Notice of Republication This article was republished on March 30, 2015, to correct the sizing and placement of the figures; none of the article content was changed. The publisher apologizes for the original layout errors. Please download this article again to view the corrected version. The originally published, uncorrected article and the republished, corrected article are provided here for reference.
- thanatropism 10y ago> made more typesetting Agh, I keep on making the mistake of doing homework directly to LaTeX. It seems that you're able to think directly from the page but it ultimately slows you down. I know way too much about mathematical typesetting as it is -- before I start making up rules about how Expectation should be \mathsf{E} and writing huge custom command files. This one exam I started doing all the exercises in the book into LaTeX. As an aspiring mathematician, I need to learn to better appreciate pencil and paper.
- ryandrake 10y agoI agree. I consider myself a fairly technical guy. Given the breathless praise for it anytime it's mentioned, I've tried to get into LaTeX off and on throughout the years, but it's just a massive learning cliff. I still haven't figured out how to change formatting or fonts, so every document I write in it has that standard "PhD dissertation" look. I can pick up a new programming language in a weekend, but I still don't "get" TeX.
- fdgdasfadsf 10y agoSearch online for "xelatex". It's latex for the 21st century.
- titanix2 10y agoMaybe it's not when writing plain English, but as soon as you want to include tricky Unicode characters it's not anymore. I spend hours trying to fix bugs for my master dissertation and gave up with two unfixed problems: (1) missing line breaking in references containing accentuated characters and (2) including some non BMP code-point character. And some package can mess up with some other packages so coming with a solution can sometime break another thing.
- adimitrov 10y agoOn the other hand, running latex in a docker container is actually quite reasonable, since you can share the exact package/processing setup, and even set up a CI that builds PDF-artifacts. But that's an advanced use case :-)
- JorgeGT 10y ago> No it's not. Not to speak about collaborating. Oh the fun of sharing a Word doc between 10 people, each one with a slight different version that messes the formats so badly (like that one guy who uses OpenOffice) and constantly making phone calls to ask others to close the document to not overwrite it. Meanwhile with LaTeX you have plain text source files so you can have nice version control with git or oven github, each person working in their local repo or even branch, with the document having a nice history of commits, blames, merges, etc. Maybe not to the average office worker, but for anyone with experience in coding / version control is a godsend.
- vostok 10y ago> Oh the fun of sharing a Word doc between 10 people, each one with a slight different version that messes the formats so badly (like that one guy who uses OpenOffice) and constantly making phone calls to ask others to close the document to not overwrite it. You can setup git (or your preferred VCS) hooks to make this relatively manageable.
- JorgeGT 10y agoNow Dropbox tells you when others have the document open and so on, so it is easier. But still orders of magnitude worse than working with plain text files.
- johnm1019 10y agoTry Google Docs while working with 3 people at the same time. It will blow your mind.
- daenney 10y ago> > In short, run `pdflatex` in a VM. > Yeah with a premature prankster you might have to. Anything that runs on untrusted input should be run in an isolated environment. When it's your own stuff do as you please. When it's a thing you got from somewhere and just blindly run it on your machine, might want to think twice. That advise doesn't just go for LaTeX. Just because you consider it immature doesn't mean it's not genuinely exploitable and someone couldn't use it against you. If anything, taking the approach of "only immature pranksters do this" probably makes it easier for someone to sneak it past you.
- bench_soup 10y agoWell, the article implies 'pwning coworkers' which is indeed quite immature. Do you do all your development in closed/isolated environment because of your coworkers posing threats? That sounds a bit paranoid.
- daenney 10y ago> Do you do all your development in closed/isolated environment because of your coworkers posing threats? That sounds a bit paranoid. Not because of my coworkers posing threats. And this wouldn't have to come from a coworker. Though that's what the author suggests the issue isn't limited to that which unfortunately seems to have taken the upper hand in the discussions around this. But I do most of my development in isolated environments. Not because I don't trust my coworkers but because people can fuck up, things sneak in and can break my system or leave it vulnerable.
- 50CNT 10y agoOn the other hand, isn't pwning coworkers the basis of sound security awareness training?
- lucb1e 10y ago> Anything that runs on untrusted input should be run in an isolated environment. If a colleague sends me something to review, I trust that he doesn't want to hack me. Someone can always use physical access to capture my keystrokes in some way. > doesn't mean it's not genuinely exploitable Agreed, so the message should be "don't run random LaTeX files from the internet or classmates or something", not "oh hey look at me annoying colleagues at work".
- wodenokoto 10y agoI haven't found an editor, let alone my favourite editor that knows what sections exist in my latex report and can give suggestions for (any of the) ref commands, that knows what citation I have in my bib file and can do autosuggestions for the cite command. Most editors I've tried that can do some auto-completion don't know which libraries I have loaded and will suggest the same commands regardless of whether they are actually available in the given document. I find the "favourite editor" a moot point, when it is unclear if there even is an editor that works with latex. Setting up a pipeline that can give you a PDF is also difficult beyond reason. And then we haven't even mentioned the code. Latex is not mark-up, it is code and it is one of the most horrible programming languages I have ever had the displeasure of using. Writing latex is painful to say the least.
- 0xmohit 10y ago> Writing latex is painful to say the least. One feels that the pain was worth it when their existing .doc files render differently using another Word version.
- terminalcommand 10y agoAs a law student and an avid emacs user, I write my papers in org-mode and then just export it to latex and then to pdf. I don't know how to write a single line of latex, but I can write a beautiful paper, full with footnotes, links, italics, quotations etc. thanks to emacs. On the other hand, on some larger papers with heavy footnotes, sometimes tex doesn't compile. Then, I find the error through trial-and-error by editing the tex file.
- nathan_f77 10y ago> Yeah with a premature prankster you might have to. There are actually some online services that have web-based latex editors, and they may use this tool to generate PDFs. I just sent one of them an email to make sure they know about it.
- cranklin 10y agoLaTeX = this generation's ANSI?
- cpach 10y agoGet off my lawn ;-)
- 0xmohit 10y agoIn short, run pdflatex in a VM. Shouldn't it rather say that pdflatex shouldn't be run on arbitrary inputs? I suppose that funny things can happen upon opening arbitrary PDF files as well, or opening arbitrary image formats, or executing arbitrary code.
- vesinisa 10y agoIt's 2016 and someone only now realised LaTeX documents can execute arbitrary code?
- jimhefferon 10y agoThere are a number of articles about that, for example in the TeX User's Group's magazine and on the TeX StackExchange. And the developers have been aware of, and taken steps about it, many years ago. For example, TeX Live ships with write18 disabled.
- gus_massa 10y agoI'm using MikTeX, and it has also write18 disabled. I thought it was the default configuration for most distributions.
- jimhefferon 10y agoAt this point there are really only the two distributions, TeX Live (the basis for the distribution for many other platforms, including the Mac) and MikTeX on Windows.
- CJefferson 10y agoI don't usually link to xkcd cartoons, but this seems like a perfect case. Every day I have new students learning Latex, sharing documents with each other. No guide to latex ever says "hey, don't trust documents people send you, they can p0wn you" https://xkcd.com/1053/
- amq 10y agoNext episode: Pwning coworkers thanks to Makefile
- 0xmohit 10y agoOr maybe: Pwning coworkers thanks to arbitrary code.
- more_original 10y agoIt's a Turing-complete language that can do file-I/O, so it's a given that he can "pwn" his coworkers.
- jimhefferon 10y agoFWIW, MetaPost draws technical graphics. For instance, it is what Knuth uses for the graphics in his books. (Most LaTeX users these days seem to me to instead use TikZ, or sometimes Asymptote.) The purpose of its --tex option is to allow you to format the labels to fit the document, using whatever TeX engine you use for your document. For instance, if you use XeTeX so you can access system fonts then you probably want the graphics to have labels using those fonts also, so you want MetaPost to use XeTeX also. There has been a lot of work lately on MetaPost; I don't know whether this is a recently-introduced bug, but I suspect it is. Anyway, such reports are useful, as for any software project. So if someone here has a similar one please forward it to the developers list. If you go to TUG's page http://www.tug.org http://www.tug.org and click on "mailing lists" you'll see a great number of options. In a pinch you could start with the "tex-live" one and you will for sure get some attention.
- vsipuli 10y agoAnd this is why you want to run any third-party software in a sandbox or container. Doing this just needs to be done as painless as possible.
- omouse 10y agoImpressed that someone is using LaTeX to write reports! Wish I could get my coworkers to do that ;p
- 0xmohit 10y agoIt might also be worthwhile to try ConTeXt [0], especially if your reports contain floats. [0] http://wiki.contextgarden.net/What_is_ConTeXt http://wiki.contextgarden.net/What_is_ConTeXt
- wolfgang42 10y agoDoes anyone know what the history of that --wolfgang switch is? The bibtex8 man page just says "set really huge BibTeX capacity for Wolfgang". It sounds like it was made for me but I assume there was some other Wolfgang for whom it was intended.
- eridius 10y agohttp://www.ctan.org/tex-archive/biblio/bibtex/8-bit/ http://www.ctan.org/tex-archive/biblio/bibtex/8-bit/ specifically says it's for Wolfgang's PhD thesis. I still can't figure out what Wolfgang this was intended for, but it is kind of impressive that this person got a whole flag for their one document.
- wolfgang42 10y agoSo I did some more digging through the MiKTeX source code[1]. There's a couple of different Wolfgangs mentioned in comments scattered around the source, but I'm not sure which of them (if any) prompted this flag. I did find the following comment: Revision 3.6 1995/10/21 22:20:42 kempson Fixed numerous bugs, improved error reporting and added the --wolfgang option. So apparently it was a PhD from around 1995 or so. What's even more impressive is that their name got turned into a magic incantation: while looking at forum posts about this I found that a lot of people just said "always pass --wolfgang, it makes things better"! [1]: https://github.com/MiKTeX/miktex/search?utf8=%E2%9C%93&q=wolfgang https://github.com/MiKTeX/miktex/search?utf8=%E2%9C%93&q=wol...
- bandrami 10y agoI mean, you can pwn coworkers with Python, too. I'm not quite getting this. Are people who use LaTeX not aware that the interpreter is... well... an interpreter?
- TheGorramBatman 10y agoCheckoway et al. wrote a paper "Don’t take LaTeX files from strangers" in Usenix ;login: a few years ago; People forget that LaTeX isn't just a text file -- it is basically a programming language for typesetting. https://www.usenix.org/system/files/login/articles/73506-checkoway.pdf https://www.usenix.org/system/files/login/articles/73506-che...
- hughw 10y agoPwn Overleaf is more like it.
- microcolonel 10y agoPeople compile LaTeX outside of chroot?