将标题或标题与图像对齐?(Align Title or Caption with Image?)
我在Ubuntu 13.04上使用DockBook 4.5和Apache FOP 1.1。 Docbook翻译由Ubuntu提供,FOP直接从Apache下载。
第一个问题:有人请告诉我如何确保图像的标题或标题与图像对齐? 例如:
Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
我知道我可以将
imagedata
与以下内容对齐:<figure id="figure-xxx"> <title>YYYYY</title> <mediaobject> <imageobject> <imagedata align="center" fileref="xxx.png" scale="75"/> </imageobject> <caption>XXX/caption> </mediaobject> </figure>
但是,
align="center"
会产生类似于:Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
并且
align="right"
使情况变得更糟:Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
当我尝试将
align
标记添加到figure
,title
,imageobject
,imageobject
或caption
,我得到类似于以下的错误:element figure: validity error : No declaration for attribute align of element figure
和:
element mediaobject: validity error : No declaration for attribute align of element mediaobject
也许我又做错了。 尝试在图像周围流动文本( 块图像右侧和文本周围的文本? )并将标题与图像对齐(这个问题)后,我想知道DocBook是否可以在现实生活中使用图像。
所以我的第二个问题是:有人知道DocBook是否支持现实生活中的图像?
编辑:对于第二个问题的答案,问题是Apache FOP而不是DocBook。
I'm working with DockBook 4.5 and Apache FOP 1.1 on Ubuntu 13.04. The Docbook translation are provided by Ubuntu and FOP was downloaded directly from Apache.
First question: would someone please tell me how to ensure the title or caption of a image is aligned with the image? For example:
Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
I know I can align the
imagedata
with the following:<figure id="figure-xxx"> <title>YYYYY</title> <mediaobject> <imageobject> <imagedata align="center" fileref="xxx.png" scale="75"/> </imageobject> <caption>XXX/caption> </mediaobject> </figure>
However,
align="center"
produces something like:Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
And
align="right"
makes it worse:Figure X: YYYYYY +---------------+ | | | Image | | | +---------------+
When I attempt to add the
align
tag to thefigure
,title
,mediaobject
,imageobject
, orcaption
, I get an errors similar to:element figure: validity error : No declaration for attribute align of element figure
and:
element mediaobject: validity error : No declaration for attribute align of element mediaobject
Perhaps I'm doing something wrong again. After trying to flow text around an image (Block Image Right and Flow Text Around It?) and align the caption to the image (this question), I'm left wondering if DocBook can work with images in real life.
So my second question: does anyone know if DocBook supports images in real life?
EDIT: for the answer to the second question, the problem is with Apache FOP and not DocBook.
原文:https://stackoverflow.com/questions/19773563
最满意答案
这可能是偏执狂模块中的一个错误(实际上它将在Mongoid的下一个主要版本中消失: http ://mongoid.org/en/mongoid/docs/extras.html#paranoia)。 如果您需要“复活”用户帐户,您可能需要添加自己的布尔字段,例如“已启用”,您可以将其设置为false以禁用帐户。
This may be a bug in the paranoia module (which is actually going to disappear in the next major version of Mongoid: http://mongoid.org/en/mongoid/docs/extras.html#paranoia). If you need user account to be "resurrected", you may want to add your own boolean field such as "enabled" which you can set to false to disable an account.
相关问答
更多-
以下是如何获取关联元数据。 Mongoid :: Relations :: Reflections#reflect_on_all_associations - 请参阅http://rdoc.info/github/mongoid/mongoid/Mongoid/Relations/Reflections 请注意,如果要提供多个宏作为当前写入的reflect_on_all_associations的参数,则宏必须是args。 如果要提供数组,则必须进行绘制,例如*宏,如下面的测试所示。 以下是“旧API”,因 ...
-
这可能是偏执狂模块中的一个错误(实际上它将在Mongoid的下一个主要版本中消失: http ://mongoid.org/en/mongoid/docs/extras.html#paranoia)。 如果您需要“复活”用户帐户,您可能需要添加自己的布尔字段,例如“已启用”,您可以将其设置为false以禁用帐户。 This may be a bug in the paranoia module (which is actually going to disappear in the next major v ...
-
那么它非常简单但棘手... 当你删除标签时,你需要重新加载父对象。 码 model.tags.delete_all model.reload model.tags.each do |tag| tag.delete end model.reload model.tags.destroy_all model.reload 这是您的模型重新加载的方式,您将获得正确的对象 Well Its very simple but tricky ... When you delete the tags , Y ...
-
如何使用太阳黑子SOLR搜索嵌入式mongoid文档?(How to search embedded mongoid documents with sunspot SOLR?)[2022-10-26]
刚试了一下。 这是一个黑客,但它适用于搜索嵌入的文档,并返回持有它的父文档。 那是你要的吗? 如果是这样,那么就这样做。 定义方法,返回所需的嵌入字段作为数组,然后索引该数组。 假设你有班级公司,有嵌入式部门 searchable do # Your regular index # ... text :company_departments end def company_departments departments.map(&:name).join(" ") end 重新索引并尝试搜 ... -
如果目标是找到柏林航点地址的所有优惠,那么您有几个选择。 移动要嵌入要约内的航点。 执行两个查询,如下所示: 码: waypoints = Waypoint.where(:address => "Berlin").only(:offer_id).all offer_ids = waypoints.map(&:offer_id) offers = Offer.any_in(:_id => offer_ids).all If the goal is to find all Offers with a wayp ...
-
3中删除了复合键支持,因为您现在可以轻松覆盖默认的_id字段并使用lambda设置默认值。 尝试以下方法: class Host include Mongoid::Document field :_id, type: String, default: -> { ip + ":" + port } ... end 然后,您可以验证此_id字段的唯一性。 有关详细信息,请参阅Mongoid 文档 。 Composite key support was removed in 3, since you ...
-
你必须定义模型嵌入一个office对象,反之亦然,解释如下: http : //mongoid.org/en/mongoid/docs/relations.html 。 我猜你需要一个1-N关系,以便专业人士可以嵌入几个办公室? 在这种情况下,这样的事情应该有效。 专业模特 class Professional include Mongoid::Document field :first_name, type: String field :last_name, type: String fi ...
-
如果为remote_id字段添加唯一索引,MongoDB将关注此字段的唯一性 index({ remote_id: 1 }, { unique: true }) 不要忘记运行create_indexes: rake db:mongoid:create_indexes 之后,您可以自由使用Article.collection.insert(batch) 。 If you add a unique indexing for remote_id field, MongoDB will take care the ...
-
这似乎是Mongoid上的一个急切的负载问题..你可以去https://github.com/mongoid/mongoid/issues/new并打开一个新的问题,所以我们可以在发布之前解决它最终的4.0.0版本。 谢谢 That looks like to be a eager load issue on Mongoid.. Can you go to https://github.com/mongoid/mongoid/issues/new and open a new issue, so we ca ...
-
你有两种方法可以做到这一点,一种是通过Mongoid,它是AFAIK,它会给所有物体充气。 就像是: Person.only("albums.photos").where(id: '1').albums.map(&:photos).flatten 或者您可以在Moped(驱动程序)中执行此操作,该操作仅返回一系列照片。 Person.collection.find(id: "1").select("albums.photos" => 1). first["albums"].map { |a| a["pho ...