DocBook 5.x: bibliography citation with extra text, or completely custom text? - bibliography

I have a book with bibliography like
<bibliography>
<biblioentry>
<abbrev>A</abbrev>
<title>This is the book title</title>
</biblioentry>
<!-- ... -->
</bibliography>
and can cite individual works with <citation>A</citation>, which will output something like [A] in the resulting HTML.
Now, the citation often includes precise location within the work (such as volume/chapter/page/paragraph number, or their range). I currently have this part in the following text (like <citation>A</citation><phrase>, XX–XXI</phrase>) so I get [A], XX-XXI in the resulting text, but the XX–XXI part is semantically not related to the citation.
How can I make either a citation with text affixed to the reference abbreviation (something like <citation>A<loc>XX–XXI</loc></citation> → [A, XX–XXI]), or citation with completely custom text (but hyperlink resolved to the bibliography entry)?
I've been browsing DocBook 5.2: The Definitive Guide, grepping through xslTNG stylesheets and unit tests, and still unsure what to do. Perhaps <link ...> with some xref pointing to bibliography or something similar? Pointers appreciated.

Related

How to make a Pandoc table wider than textwidth?

I'm adding a table to a document and discovered that the columns are too narrow, making it a bit difficult to read. Therefore I'd like to make the entire table (and thus also the individual columns relative sizes) wider while keeping the textwidth of the rest of the document unchanged. Is it possible to do this using the Pandoc multi-line tables? Or do I need to use pure LaTeX for this table?
This is what the Pandoc markdown for my table looks like:
--------------------------------------------------------------------------------------------------------------------------------------------------------
DSR Activity Description In this thesis
-------------------------------------- --------------------------------------------- -------------------------------------------------------------------
1. Problem Identification & Motivation The specific research problem is defined, The research problem was initially defined by Simon Hacks
and the value of a solution is justified. and Robert Lagerström in a thesis proposal. The value of
the solution is that the produced artifact will establish
a foundation for further work in EAD detection and analysis.
2. Defining Objectives for a Solution The objectives of the solution are infered In order to determine the objectives of the solution the problem
from the problem definition and knowledge definition is examined.
about what is possible and feasible. This
might e.g. be a description of how the
artifact is expected to support solutions
to problems which have not yet been
addressed.
--------------------------------------------------------------------------------------------------------------------------------------------------------
And the resulting PDF (compiled simply using pandoc myfile.md -o myfile.pdf), where you can see that the table is only as wide as the textwidth:
In case it matters, I'm using
\usepackage{fancyhdr}
\pagestyle{fancy}
A crude but effective method is to widen the \columwidth just for the table. You'll probably want to change the \LTleft table margin, like so:
```{=latex}
\newlength{\extraspace}
\setlength\extraspace{4cm}
\setlength\columnwidth{\columnwidth + \extraspace}
\setlength\LTleft{-0.5\extraspace + \tabcolsep}
```
Table goes here
```{=latex}
% restore old columnwidth, table placement
\setlength\columnwidth{\linewidth - 4cm}
\LTleft=\fill
```
Result:
I ended up using this solution:
\usepackage[textwidth=12.1cm,textheight=22cm]{geometry}
...
\newgeometry{textwidth=18cm,textheight=22cm}
<!-- my table here -->
\restoregeometry

Semantically correct way to add a copyright notice into a svg file?

I want to add a copyright notice in my svg files and it should be only "hidden" text and no watermark.
This is no real protection, because if you open a svg file with a text editor you can edit everything and delete the copyright. But I think this would be a simple and great way to show, who has made the file and a possible chance to find unlicensed graphics if there is some hidden information and if you are looking for it you can easily find it.
My main question is: how should the copyright text be put into the file?
<title> element is for accessibility purposes, some user agents display the title element as a tooltip.
<desc> element generally improves accessibility and you should describe what a user would see.
ugly way: a text element with inline CSS to hide it. Don't even think about this! :)
<!--Copyright info here--> could be also a simple solution.
<metadata>: this would the best way but I did not find a detailed definition and which child elements could live inside. Also https://developer.mozilla.org/en-US/DOM/SVGMetadataElement gives a 404.
Under https://www.w3.org/TR/SVG/struct.html#MetadataElement we can find more details. But is RDF really necessary?
I think a <metadata> element is the right place, but which child elements should be used and is just RDF the way to go?
I think the metadata element is the correct choice here. It has to contain XML, but it doesn’t have to be a RDF serialization (e.g., RDF/XML).
But I think it makes sense to use RDF here, because that’s exactly RDF’s job (providing metadata about resources, like SVG documents), and there is probably no other XML-based metadata language that has greater reach / better support.
A simple RDF statement (in RDF/XML) could look like this:
<metadata>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/">
<rdf:Description rdf:about="http://example.com/my-svg-file.svg">
<schema:license rdf:resource="https://creativecommons.org/licenses/by-sa/4.0/"/>
</rdf:Description>
</rdf:RDF>
</metadata>
The about attribute takes an IRI as value; for a stand-alone SVG document, you could provide an empty value (= the base IRI of the document).
In this example I use the license property from Schema.org:
A license document that applies to this content, typically indicated by URL.
(The vocabulary Schema.org is supported by several big search engines.)

How to refer to an equation in a different page with Mathjax

I have several html pages with a lot of equations rendered by Mathjax. I would like to refer to several equations not especially in the same page.
The problem is that "\eqref" is only working if the equation is in the same page.
One solution would be to use "\tag{}" for all equations and use simple html links.
For example,
\label{myequation} \tag{4.1}
and the link would be
" 4.1 "
The problem with that solution is that I need to have personal tag for all equations.
Does anyone has a solution for referring to equations in different pages by producing tags automatically ?
See the documentation for automatic equation numbering. This allows you to have your equations numbered automatically rather than requiring \tag. Note that any numbered or tagged equation automatically gets an ID that can be used in a link, so there is no requirement to use \label (though it helps if you are adding and removing equations during editing). If an equation is numbered 5, then the id is mjx-eqn-5. There are functions that you can override in order to change the format of the equation numbers. See the equationNumbers section of the TeX configuration parameters documentation.
Edit: Now that I understand your request, I can tell you that to do what you ask for would require MathJax to know the label-to-tag mapping for the other pages in your site (not just the page currently being viewed). MathJax doesn't have that data available to it. The only way to do it would be to create data files for the other pages that includes that data so that MathJax could load it and have it available. While technically possible, it would be a bit cumbersome to do that, especially since JavaScript (normally) can't write files for you.
On the other hand, the only place the label-to-tag mapping is needed is for the text that acts as the link itself (that is, if eq:sum refers to equation 4.1, then you would want "4.1" to be the text that links to that equation. Note that the link itself will be to myotherpage#eq:sum, so the only thing that needs the number is the link text itself. If you were willing to use something like "[sum]" as the link text for eq:sum (e.g., "In equation [sum] we see..."), then you would not need the label-to-tag mapping, and \eqref could be modified to handle that. But if you really want the equation number as the link, you would need a lot more infrastructure to make that happen.

Reading DTDs as Reference Texts

Is it a correct, quick starting point to read the actual plaintexts that DTDs contain like the following, for a human-readable reference of all valid tags and properties for each specific DOCTYPE?
DTD for XHTML 1.0 Transitional
It seems to me that it becomes sort of a down-to-earth reference by doing so, but does it tell me "at run time" everything that is valid for a DOCTYPE, and as well to the browser program?
After that, what is a better reference? Where are the actual DOCTYPE standards, or are they the same as the general HTML standards? DOM level standards? W3Schools? Some other manual like "The HTML Reference Library 4.0" but for "newer" DOCTYPEs/HTML?
The DTD just describes the lexical structure of each DOCTYPE, it doesn't explain the semantics of anything, e.g. it doesn't say what <table> does. For that, you should go to the HTML specifications. The HTML 4.0 spec is at http://www.w3.org/TR/html4, HTML5 is http://www.w3.org/TR/html5/.

Markdown to HTML conversion

I'm still in the middle of coding my final year project at university, and I have come across an issue where I need to either convert from HTML to Markdown or visa versa. Now I have no experience whatsoever of Perl, Python, etc. so I'm in need of an easy-to-implement solution, I only have about 6 weeks left to complete this now. I'm writing the data from a WMD text box to SQL Server, and I can either upload it as Markdown or HTML but if that data needs editing it cannot be in HTML as this would be too confusing for the end user who is perceived to have zero/very little computing "know how".
What should I do?
Karmastan's answer is probably the best here. Keeping the raw Markdown in the database is a really good solution as it allows users to upkeep the content in a form with which they're familiar.
However, if you have a bunch of HTML which is already converted, you might want to look at something like Markdownify: The HTML to Markdown converter for PHP.
Edit: based on what you've said below, there are a few things you should keep in mind:
Make sure that the following is set in wmd.js:
wmd_options = {"output": "Markdown"};
This ensures that you're storing Markdown in the database.
Source: How do you store the markdown using WMD in ASP.NET?
When outputting the Markdown to the web, you need to transform it to HTML. To do this, you'll need a library which does Markdown -> HTML conversion. Here are two examples:
Announcing Markdown.NET
Revisied Markdown.NET Library
I'm not a .NET developer, so I can't really help with how these libraries should be used, but hopefully the documentation will make that clear.
If you look at the web site for Markdown, you'll find a Perl script that converts Markdown-syntax documents to HTML. Keep Markdown text in your database and invoke the script whenever you need to display the text. No Perl knowledge required!

Resources