7

I'm trying to understand if LaTeX is a good choice for my use case(s). I don't know LaTeX and am having a hard time finding if these things are all possible, or maybe it is more a compiler question?

  • I'm trying to create a document for a software product that gets rebranded depending on the customer we sell it to.
  • Need a text based documentation so multiple developers can update it and it can get merged together without issue in version control.
  • The document needs to support themes - different colors and styles (look and feel)
  • The document needs to be able to use variables that can be replaced when converted. e.g. {customer name} -> compile to PDF -> Walmart
  • The document should support either conditionals, or someway to have a "customer style" that can be attached at compile time. Like: compile latex --customer:walmart.style
  • Needs to output PDF, optionally also output HTML.

In searching the internet, I keep coming back to LaTeX, but I'm having a hard time differentiating what is the documentation language providing vs the compiler.

So, can this be done with LaTeX? If so, do I need a particular compiler? If not, any suggestion on a product that might provide something like this?

EDIT 1

Wow, this is a very active and helpful community, thanks for all the responses!

Here is an example today of what is used, but it is not meeting the needs:

  1. Developers/Humans write the document using markdown

    <snip>
    that help your institution function more effectively.
    
    ![](md_images/media/image2.png){ width=90% }
    
    
    # Hardware Requirements
    
    1.  Single Tier system (windows + CIE + SQL) - recommended for low-medium volume sites:
    
        **BASE**  (supports up to 4 Channels high volume):
    <snip>
    

    This is then run through pandoc with MiKTeX and a .css style to produce a .doc, HTML, and PDF. However, it can't handle variables or conditionals very well, and the look and feel needs to be done all in CSS which can add alot of overhead, especially trying to go across the output file types.

    This will produce an output like:

    enter image description here

  2. Would like to have some type of system that works similar to this (which does not work today, it's just photoshopped):

    # Hardware Requirements for {customer}
    

    would output something like:

    enter image description here

EDIT 2:

Trying to address the hold question:

  • Does LaTeX support branding? For example, look & feel, replaceable variables and conditional text.
  • Can LaTeX be outputted to PDF, HTML and .docx using a single base document + a branding style sheet?
Werner
  • 603,163
John S.
  • 173
  • 5
  • yes,
  • yes,
  • yes,
  • gut feeling says "yes",
  • see 4.,
  • yes. see https://tex.stackexchange.com/questions/39309/convert-latex-to-html
  • – naphaneal Mar 19 '18 at 17:18
  • 2
    do you have an example of data and required output style? – michal.h21 Mar 19 '18 at 18:19
  • 1
    Have you seen Sphinx? – cmhughes Mar 19 '18 at 20:07
  • 1
    LaTeX is great for human-authored documents, e.g. it has code for implementing things that would be cumbersome for a human (automatic section numbering, sorted bibliography, easily updated references to other sections, consistent typesetting, …). But for things that aren't human-authored, I would recommend not using LaTeX directly, except for the typesetting (to get a PDF). Make your own system that collects the data and processes the conditionals etc., and have it populate either a HTML template (to generate the HTML file) or (La)TeX template (to generate the PDF file). – ShreevatsaR Mar 19 '18 at 21:24
  • @ShreevatsaR I assume the developers who need to be able to edit it are human beings, so I take it you're suggesting that the actual documentation part not be LaTeX either, though I'm not clear why as this seems just the kind of case where it is better for developers to write e.g. \section{This bit} rather than 5. This bit or whatever. But I fear I have misunderstood? – cfr Mar 19 '18 at 23:20
  • I would think handling the core of the documentation as LaTeX, but doing the wrapping with other tools, as @ShreevatsaR suggests, would probably be the most straightforward approach. While you could (almost) certainly cook-up something for the whole thing in LaTeX, I can't see any good reason to do it this way and would expect it to be less flexible and harder to maintain and use than a combo solution. This is unless you'd be prepared to accept a different workflow than the one you specify. If you could use a different workflow, then the answer would likely be different. – cfr Mar 19 '18 at 23:25
  • If you wanted to try an all-LaTeX approach, I'd work with LaTeX rather than trying to fit LaTeX into a non-LaTeX-shaped hole. For example, you might use a thin wrapper file for each different customer, which would then pull in the common configuration and the documentation itself. However, then you'd be saying compiler weaver-street.tex or compiler woolworths.tex rather than compiling the same .tex file with different arguments. But weaver-street.tex and woolworths.tex would include only the Weaver Street- and Woolworths-specific stuff - the rest would all be in another file(s). – cfr Mar 19 '18 at 23:29
  • @cfr I meant things like: • For export to other formats, I'd have to implement generating e.g. "5. This bit". Might as well use that in the TeX document, for consistency just in case. • If characters like &$%\~ appear in content, it would be cleaner to have the export-to-TeX code handle “escaping” them, than to type \textasciitilde (etc.) into the original data. • Conditionals are easier for developers to handle in their preferred languages. • I may want to reorder or vary data with different “themes”, etc. This can get messy inside TeX; is cleaner in templating systems designed for this. – ShreevatsaR Mar 20 '18 at 01:26
  • @cfr I think in practice what you're recommending and what I'm thinking of would end up being the same. :-) – ShreevatsaR Mar 20 '18 at 01:27